Bird
0
0

What is the main purpose of a foreign key in a database?

easy📝 Conceptual Q11 of 15
SQL - Table Relationships
What is the main purpose of a foreign key in a database?
ATo link one table to another and ensure data consistency
BTo store large amounts of text data
CTo speed up database queries
DTo create a backup of the database
Step-by-Step Solution
Solution:
  1. Step 1: Understand the role of foreign keys

    A foreign key connects one table to another by referencing a primary key in the related table.
  2. Step 2: Identify the purpose of this connection

    This connection helps keep data consistent and organized by preventing invalid data entries.
  3. Final Answer:

    To link one table to another and ensure data consistency -> Option A
  4. Quick Check:

    Foreign key = link tables + data consistency [OK]
Quick Trick: Foreign keys link tables to keep data correct [OK]
Common Mistakes:
MISTAKES
  • Thinking foreign keys store data themselves
  • Confusing foreign keys with indexes
  • Believing foreign keys speed up queries directly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes