Database Design Interview Questions for SQL
24 Database Design questions with answers for sql roles — 7 easy, 11 medium, 6 hard.
About Database Design
Design reliable schemas with primary, foreign, unique and composite keys, constraints and normalisation from 1NF to BCNF. Understand denormalisation, OLTP versus OLAP, star and snowflake schemas, surrogate keys and slowly changing dimensions. Practise designing schemas for real applications such as food delivery and e-commerce.
What is the difference between a primary key and a unique key?
Show answer
What is normalisation and why is it needed?
Show answer
Explain 1NF, 2NF and 3NF with simple examples.
Show answer
Design tables for students, courses and enrolments.
Show answer
What is a composite key?
Show answer
How do you document a database you designed so others can use it?
Show answer
What are constraints in SQL?
Show answer
What is denormalisation and when is it used?
Show answer
What is the difference between OLTP and OLAP databases?
Show answer
What is a star schema and a snowflake schema?
Show answer
What are surrogate keys and natural keys?
Show answer
What are referential actions such as ON DELETE CASCADE?
Show answer
Add a foreign key and a check constraint to an existing table.
Show answer
A table stores phone numbers as 'ph1, ph2, ph3' in one column. What is wrong and how do you fix it?
Show answer
How would you design a database for an online food delivery app at a high level?
Show answer
A reporting team wants to query the production OLTP database directly. What are the risks and alternatives?
Show answer
Tell me about a database design decision you made and its outcome.
Show answer
What are slowly changing dimensions in data warehousing?
Show answer
What is BCNF and how is it different from 3NF?
Show answer
Product prices change often, but old orders must keep the price at the time of purchase. How do you design it?
Show answer
Your team debates using UUIDs or auto-increment integers as primary keys. What do you advise?
Show answer
How do you handle disagreement with developers about schema changes?
Show answer
An e-commerce app needs products with very different attributes, such as phones and shirts. How do you model them?
Show answer
Frequently asked questions
How important is Database Design in SQL interviews?
Design reliable schemas with primary, foreign, unique and composite keys, constraints and normalisation from 1NF to BCNF. Understand denormalisation, OLTP versus OLAP, star and snowflake schemas, surrogate keys and slowly changing dimensions. Practise designing schemas for real applications such as food delivery and e-commerce.
How should I use the Database Design sheet?
Go top to bottom — easy to hard. Answer before opening each answer, tick what you solved and save misses to Last-Minute Revision.