What are the different Types of Keys in Relational Model?

SQL
Medium
Flipkart
68.9K views

Tests knowledge of Primary, Foreign, Candidate, Super, and Alternate keys.

Why Interviewers Ask This

Keys define relationships and constraints. Interviewers assess your ability to design schemas that enforce referential integrity and uniqueness.

How to Answer This Question

List and define each key type. Explain how Primary Keys uniquely identify rows. Describe Foreign Keys linking tables. Mention Candidate Keys as potential primary keys. Use examples to illustrate relationships between entities.

Key Points to Cover

  • Primary Key definition
  • Foreign Key relationships
  • Candidate vs Super keys
  • Integrity enforcement

Sample Answer

In relational databases, keys include Primary Keys for unique identification, Foreign Keys for linking tables, and Candidate Keys as potential primary keys. Super Keys are any sets of attributes that uniquely identify a row, while Alternate Keys are candidate keys not chosen as primary. These ensure data integrity and efficient querying.

Common Mistakes to Avoid

  • Confusing primary and foreign keys
  • Omitting alternate keys
  • Failing to explain uniqueness

Practice This Question with AI

Answer this question orally or via text and get instant AI-powered feedback on your response quality, structure, and delivery.

Start Practicing

Related Interview Questions

Browse all 19 SQL questionsBrowse all 52 Flipkart questions