Closes #18 Closes #19 Closes #20 Closes #21 Closes #22 Closes #23 Closes #24 Refs #25 Task: MIL-003#1
1.1 KiB
1.1 KiB
English · Dansk · Bahasa Malaysia
Step 7: Themes, primary keys and foreign keys
Question: Which theme names belong to the theme ids, and how are the tables linked?
What the code does
sets.csv holds theme_id (a foreign key); themes.csv holds the unique id (the primary key) and the theme name. find_theme_ids(themes, "Star Wars") finds four ids (18, 158, 209, 261) and sets_for_theme_ids lists the matching sets, for example the Star Wars Advent Calendars that share one theme.
What you gained
- A relational database is split into tables linked by keys.
- A primary key is unique in its own table; a foreign key points to it from another table.
- One name (Star Wars) can belong to several ids.
Previous: Step-6-Parts-per-Set · Next: Step-8-Merge
