Files
Tirsvad 1d06a2c892 Add notebook, step screenshots, README screenshots and three-language wiki
Closes #18
Closes #19
Closes #20
Closes #21
Closes #22
Closes #23
Closes #24
Refs #25

Task: MIL-003#1
2026-11-12 08:45:20 +08:00

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?

Step 7: Themes, primary keys and foreign keys

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