Practice Flashcards
Flip to reveal answersHow do you turn an ERD into tables?
Track your progress — Sign up free to save your progress and get smart review reminders based on spaced repetition.
All 5 Flashcards — Building tables
Sign up free to track progress and get spaced-repetition review schedules.
Question
How do you turn an ERD into tables?
Answer
Each entity becomes a table and each relationship becomes a foreign key. In a one-to-many the foreign key goes in the many table; a many-to-many needs a linking table holding both foreign keys.
Question
Why does the foreign key go in the many table?
Answer
Because a column holds one value. A Class row holds one TeacherID easily, whereas a Teacher row would need an unknown number of columns to hold every class they take.
Question
What is the difference between a composite key and a concatenated key?
Answer
A composite key uses two or more columns together as the primary key, keeping them separate and queryable. A concatenated key glues values into a single column, such as 2026-S1, which then has to be pulled apart to filter on either part.
Question
What are entity, referential and domain integrity?
Answer
Entity integrity: a primary key is never empty or duplicated. Referential integrity: a foreign key must match an existing row. Domain integrity: a value must fit its column's data type.
Question
Why enforce rules in the database rather than in the program?
Answer
Rules enforced by the database apply to every program that touches the data, including ones written years later. Rules enforced in a program apply only to that program.
Read the notes
Full study notes for Building tables
Topic 3.2 hub
Database design
More from Topic 3.2
All flashcards in this topic
Computer Science exam skills
Paper structures & tips
Track your progress with spaced repetition
Sign up free — Aimnova tells you exactly which cards to review and when, so you remember everything before your IB exam.
Start Free