In the previous units, we covered how primary keys uniquely identify records and foreign keys create links between tables, forming different types of relationships.
Now, let's practice applying these concepts to different database scenarios.
Engagement Message
Ready to become a key master?
Type
Sort Into Boxes
Practice Question
Consider an Orders
table with the columns order_id
, customer_id
, order_date
, and product_id
. Sort these columns into the correct key type for this table.
Labels
- First Box Label: Primary Key
- Second Box Label: Foreign Key
First Box Items
- order_id
Second Box Items
- customer_id
- product_id
Type
Multiple Choice
Practice Question
Which of the following is a true statement about a foreign key?
A. It must be unique within its table. B. It cannot contain duplicate values. C. It must refer to a primary key value in another table. D. It cannot be NULL.
Suggested Answers
- A
- B
- C - Correct
- D
