--:--









Quiz for Primary Key vs Foreign Key

Course: SQL | Subject: SQL | Topic: Database Design Concepts



Logo

Q1: Which key uniquely identifies a row in a table?

Logo

Q2: What is the purpose of a primary key in a table?

Logo

Q3: What is the purpose of a Primary Key in a database?

Logo

Q4: Which of the following can have NULL values?

Logo

Q5: Can a table have more than one Foreign Key?

Logo

Q6: Which key creates a relationship between two tables?

Logo

Q7: Which key must contain unique and non-null values?

Logo

Q8: Which of the following is FALSE about Primary Key?

Logo

Q9: What happens when you delete a referenced Primary Key record?

Logo

Q10: Can a Foreign Key reference a non-primary key column?

Logo

Q11: What is the main role of a Foreign Key?

Logo

Q12: Which combination is valid in a table?

Logo

Q13: Can a Foreign Key be part of a composite Primary Key?

Logo

Q14: Which type of key helps avoid redundancy across tables?

Logo

Q15: What is required before adding a Foreign Key?

Logo

Q16: Which constraint is automatically indexed?

Logo

Q17: Can a table have both Primary Key and Foreign Key?

Logo

Q18: What does referential integrity ensure?

Logo

Q19: Which one helps maintain relationships between entities?

Logo

Q20: Is it possible for a Foreign Key to reference another Foreign Key?

Logo

Q21: Which action is not allowed on a Primary Key column?

Logo

Q22: What is the default behavior when a referenced Primary Key is deleted and no ON DELETE clause is set?

Are you ready to start test? Set your time limit