You've mastered creating individual tables with PRIMARY KEY
s and linking them with FOREIGN KEY
s. Now, let's practice designing small, interconnected database schemas that model real-world scenarios.
Engagement Message
Ready to put all the pieces together?
Type
Fill In The Blanks
Markdown With Blanks
Fill in the blanks to create two related tables: authors
and books
. Every book must be linked to a valid author.
Suggested Answers
- PRIMARY KEY
- FOREIGN KEY
Type
Sort Into Boxes
Practice Question
Sort these columns into the correct box based on whether they would typically be a Primary Key or a Foreign Key in a database schema.
Labels
- First Box Label: Primary Key
- Second Box Label: Foreign Key
First Box Items
- customer_id in customers table
- order_id in orders table
- product_id in products table
- category_id in categories table
Second Box Items
