juniorT-SQL
What is FOREIGN KEY?
Updated May 17, 2026
Short answer
Creates relationship between tables.
Deep explanation
Ensures referential integrity between parent and child tables.
Real-world example
Linking orders to employees.
Common mistakes
- Violating referential integrity.
Follow-up questions
- Can FK be null?
- What happens on delete?