Bird
0
0

Which of the following is a good practice when naming a foreign key constraint?

easy📝 Conceptual Q2 of 15
SQL - Table Constraints
Which of the following is a good practice when naming a foreign key constraint?
AUse only numbers to name the constraint
BStart with FK, then table name, then referenced table name
CName it after the database server
DUse random letters without meaning
Step-by-Step Solution
Solution:
  1. Step 1: Identify standard foreign key naming pattern

    Foreign key constraints usually start with 'FK' followed by the table and referenced table names.
  2. Step 2: Evaluate options for clarity and meaning

    Only Start with FK, then table name, then referenced table name follows a meaningful, clear pattern that helps identify the constraint.
  3. Final Answer:

    Start with FK, then table name, then referenced table name -> Option B
  4. Quick Check:

    Foreign key naming pattern = A [OK]
Quick Trick: FK prefix + tables = clear foreign key name [OK]
Common Mistakes:
MISTAKES
  • Using meaningless or random names
  • Using only numbers
  • Ignoring referenced table in name

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes