Foreign Key Purpose
Multiple Choice Easy
Question
What is the purpose of a foreign key?
Hint
Foreign keys create relationships between tables.
Explanation
A foreign key ensures that a column's value must reference an existing primary key in another table. This enforces referential integrity — you cannot create orphan records.
Related Resources
Related Lessons
- Relationships
Learn about foreign keys.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.