Back to Topic 3.2 — Database design
3.2.4Computer Science SL5 flashcards

Building tables

Practice Flashcards

Flip to reveal answers
Card 1 of 53.2.4
3.2.4
Question

How do you turn an ERD into tables?

Click to reveal answer

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.

Card 1process

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.

Card 2concept

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.

Card 3comparison

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.

Card 4definition

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.

Card 5concept

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.

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
IB Computer Science Building tables Flashcards | 3.2.4 | Aimnova