BrainTok
ENESIT

Databases: Why NULL Is Not Equal to NULL

How databases store, find and protect data: the relational model, SQL's surprises, normalization, indexes, query plans, transactions and NoSQL trade-offs.

Databases · 50 questions

Try 3 questions

1. In the relational model, what does the word 'relation' actually mean?

  1. A table of rows and columns
  2. A link joining two tables
  3. A rule pairing two values
Show the answer

Answer: A table of rows and columns

Codd borrowed the mathematical term: a relation is a set of tuples, which we draw as a table. Links between tables are separate.

2. Since a relation is a mathematical set, what does relational theory say about the order of its rows?

  1. Rows keep their insertion order
  2. Rows have no inherent order
  3. Rows are sorted by primary key
Show the answer

Answer: Rows have no inherent order

That's why SQL only guarantees order when you write ORDER BY; otherwise the database may return rows in any order.

3. What must always be true of a table's primary key?

  1. Always the first column of the table
  2. Unique and never null for every row
  3. Always a number that counts upward
Show the answer

Answer: Unique and never null for every row

A primary key identifies each row; it may be text or several columns, but it can't repeat or be missing.

The whole quiz comes before your apps

BrainTok asks a few questions like these before the apps you choose open, so your screen time turns into learning. For iPhone.

Join the beta