Bird
0
0

In a one-to-one relationship between two tables, what is the best way to enforce uniqueness on the related table?

easy📝 Conceptual Q1 of 15
SQL - Table Relationships
In a one-to-one relationship between two tables, what is the best way to enforce uniqueness on the related table?
AUse a NOT NULL constraint on the foreign key column
BUse a CHECK constraint on the foreign key column
CUse a UNIQUE constraint on the foreign key column
DUse a DEFAULT constraint on the foreign key column
Step-by-Step Solution
Solution:
  1. Step 1: Understand uniqueness enforcement in one-to-one relationships

    One-to-one relationships require that each foreign key value appears only once in the related table.
  2. Step 2: Identify the correct constraint for uniqueness

    A UNIQUE constraint ensures that no duplicate values exist in the foreign key column, enforcing one-to-one mapping.
  3. Final Answer:

    Use a UNIQUE constraint on the foreign key column -> Option C
  4. Quick Check:

    Uniqueness enforcement = UNIQUE constraint [OK]
Quick Trick: Use UNIQUE constraint on foreign key for one-to-one [OK]
Common Mistakes:
MISTAKES
  • Confusing CHECK with UNIQUE constraint
  • Using NOT NULL alone without uniqueness
  • Assuming DEFAULT enforces uniqueness

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes