Bird
0
0

Which of the following best describes the role of a FOREIGN KEY constraint in a database?

easy📝 Conceptual Q2 of 15
SQL - Table Constraints
Which of the following best describes the role of a FOREIGN KEY constraint in a database?
AIt speeds up queries by indexing columns.
BIt automatically deletes all records in a table.
CIt ensures data in one table matches data in another table.
DIt encrypts data stored in the table.
Step-by-Step Solution
Solution:
  1. Step 1: Define foreign key purpose

    A foreign key links a column in one table to a primary key in another, ensuring data consistency.
  2. Step 2: Eliminate unrelated options

    Speeding queries, deleting records, and encrypting data are unrelated to foreign keys.
  3. Final Answer:

    It ensures data in one table matches data in another table. -> Option C
  4. Quick Check:

    Foreign key = data consistency between tables [OK]
Quick Trick: Foreign keys link tables by matching data values [OK]
Common Mistakes:
MISTAKES
  • Confusing foreign keys with indexes
  • Thinking foreign keys delete data automatically
  • Assuming foreign keys encrypt data

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes