Interview Question

What is a super key?

A superkey uniquely identifies rows; a candidate key is minimal.

💡 Concept ✅ Quick Revision 🗃️ SQL

Answer

A superkey is any set of attributes that uniquely identifies a row. • It may contain unnecessary extra attributes. • A candidate key is a minimal superkey. • Database constraints should enforce the real keys used by the design.

💡 SQL Example

SELECT user_id, email FROM users;

Result

user_id alone and user_id plus email can both be superkeys

⚡ Quick Revision

A superkey uniquely identifies rows; a candidate key is minimal.