Databases: Relational model and relational algebra · Relations, Keys and Integrity
How the relational model organizes data into relations, and how keys and integrity constraints keep that data consistent.
Try 3 questions
1. In the relational model, what exactly is a "relation"?
- A set of tuples sharing the same attributes
- A file storing a table on disk
- A link connecting two separate tables
Show the answer
Answer: A set of tuples sharing the same attributes
A relation is the mathematical name for what we draw as a table: a set of tuples (rows) over a fixed list of attributes (columns).
2. Today, no two customers in the table happen to share a surname. Does that make surname a key?
- Yes, current uniqueness is enough
- Yes, if the surnames are also sorted
- No, a key must hold for all valid data
Show the answer
Answer: No, a key must hold for all valid data
A key is a constraint on every legal instance of the schema, not an accident of today's rows; the next customer could share a surname.
3. Codd paired the model with relational algebra. What does every relational algebra operation produce?
- A new relation
- A list of row positions
- A single number
Show the answer
Answer: A new relation
Relational algebra is closed: operations take relations and return relations, so their results can be fed into further operations and nested freely.
The rest of the quiz, a few questions at a time
BrainTok asks a few questions from quizzes like these before the apps you choose open, so your screen time turns into learning. For iPhone.
Join the betaMore Computer Science quizzes
- Databases: Why NULL Is Not Equal to NULL
- Artificial Intelligence: Intelligent agents and environments · Agents, Percepts and Rationality
- Artificial Intelligence: Why Chess Was Easier Than Laundry
- Computer Architecture: Data representation and binary arithmetic · Binary and Hexadecimal Numbers
- Computer Architecture: Why Your Processor Guesses the Future
- Computer Networks: Layered models: OSI and TCP/IP · The Seven Layers of the OSI Model