All 131 questions

  1. What is database normalization, and can you give a practical example?

    Asked in 12 of 612 interviews · last asked Oct 7 · Concept · Junior

    Show answer

    Database normalization organizes tables to reduce repeated data and prevent problems when inserting, updating, or deleting rows. For example, store customer details once in a Customers table instead of repeating them in every order. Each order links to its customer through a foreign key.

    • 1NF: Each field holds one value, with no repeating groups of columns.
    • 2NF: Meets 1NF; non-key columns depend on the whole candidate key, not just part of it.
    • 3NF: Meets 2NF; non-key columns do not depend indirectly on keys through other non-key columns.
    • Normalization makes updates safer, but reading related data may require more joins.
    Code
    Before:
    Orders(order_id PK, customer_id, customer_name)
    
    After:
    Customers(customer_id PK, customer_name)
    Orders(order_id PK, customer_id FK → Customers.customer_id)
    
    A customer name change now updates one row, not every order.

    What the interviewer checks: The interviewer checks whether you understand how table design reduces repeated data and prevents inconsistent updates.

    Other ways it was asked
    • “What is database normalization?”
    • “What is database normalization, and when would you use it?”
    • “What is normalization?”
  2. What is the difference between a primary key and a unique constraint?

    Asked in 9 of 612 interviews · last asked Oct 16 · Concept · Junior

    Show answer

    A primary key identifies each row, enforces uniqueness, and normally forbids NULL. A unique constraint prevents duplicate values but may allow NULL, depending on the database. A table can have only one primary key, but it can have several unique constraints. Both can cover one column or a group of columns.

    • A primary key enforces uniqueness and normally forbids NULL.
    • A table has at most one primary key and can have several unique constraints.
    • For a multi-column key or constraint, the combination must be unique.
    • NULL handling in unique constraints differs between databases.

    What the interviewer checks: The interviewer is checking whether you understand row identity, uniqueness, NULL rules, and multi-column keys.

    Other ways it was asked
    • “What is the difference between a primary key and a unique key?”
    • “What is the difference between a unique key and a primary key?”
    • “What are the differences between a unique key and a primary key?”
  3. What is the difference between a primary key and a foreign key?

    Asked in 7 of 612 interviews · last asked Oct 8 · Concept · Junior

    Other ways it was asked
    • “What are a primary key and a foreign key?”
    • “Can you explain the difference between a primary key and a foreign key in databases?”
    • “What is a primary key and what is a foreign key?”
  4. How would you design and create a database schema for a new application?

    Asked in 6 of 612 interviews · last asked Oct 12 · Scenario · Mid-level

    Other ways it was asked
    • “How would you design a database schema for an application, including its tables and choice of database tools?”
    • “How would you design a database schema and manage the database for an application?”
    • “What factors do you consider when designing a database and its tables, and how do you create them?”
  5. What is a primary key?

    Asked in 5 of 612 interviews · last asked Sep 9 · Concept · Junior

    Other ways it was asked
    • “What is a primary key, and why is it important?”
  6. Can you explain the first three normal forms in database normalization?

    Asked in 3 of 612 interviews · last asked Sep 8 · Concept · Mid-level

    Other ways it was asked
    • “What are the first three normal forms in database normalization?”
    • “Can you tell me more about specific normal forms, such as first normal form and third normal form, and their importance?”
  7. What types of relationships can exist between database tables?

    Asked in 3 of 612 interviews · last asked Oct 7 · Concept · Junior

    Other ways it was asked
    • “What other types of relationships can exist between database tables?”
  8. What is BCNF?

    Asked in 3 of 612 interviews · last asked Sep 9 · Concept · Junior

    Other ways it was asked
    • “Can you define BCNF and explain what it stands for?”
    • “Why is BCNF needed?”
  9. What is a foreign key?

    Asked in 3 of 612 interviews · last asked Sep 9 · Concept · Junior

  10. How many NULL values are allowed in a unique-key column?

    Asked in 2 of 612 interviews · last asked Oct 16 · Concept · Mid-level

    Other ways it was asked
    • “How many NULL values can a SQL UNIQUE constraint allow?”
  11. When modeling a new table in PostgreSQL, how do you decide between a natural key and a surrogate key, such as BIGSERIAL or UUID, and what performance or operational trade-offs drive that choice?

    Asked in 2 of 612 interviews · last asked Jul 27 · Concept · Senior

    Other ways it was asked
    • “When you are designing tables in PostgreSQL, what factors make you choose a UUID primary key versus a big serial or identity key?”
  12. How would you design users, roles, and matching at the database level?

    Asked in 2 of 612 interviews · last asked Jul 22 · Design · Mid-level

  13. In what real world scenarios would you intentionally denormalize a database?

    Asked in 2 of 612 interviews · last asked Sep 5 · Concept · Mid-level

    Other ways it was asked
    • “When would you intentionally denormalize a data model?”
  14. What are database constraints, and how do they help enforce data integrity?

    Asked in 2 of 612 interviews · last asked Jul 20 · Concept · Junior

    Other ways it was asked
    • “What are database constraints, and what types of constraints are there?”
  15. How can you implement a one-to-one relationship between two database tables?

    Asked in 2 of 612 interviews · last asked Jul 16 · Concept · Mid-level

    Other ways it was asked
    • “Can you give an example of a one-to-one relationship between database tables?”
  16. What is a one-to-many relationship between database tables?

    Asked in 2 of 612 interviews · last asked Oct 10 · Concept · Junior

    Other ways it was asked
    • “What is a one-to-one relationship between database tables?”
    • “What is a many-to-many relationship between database tables?”
    • “What does a one-to-many relationship between two tables mean?”
  17. What is an ER diagram?

    Asked in 2 of 612 interviews · last asked Jul 19 · Concept · Junior

  18. What is data integrity?

    Asked in 2 of 612 interviews · last asked Jul 19 · Concept · Junior

  19. What is a composite key?

    Asked in 2 of 612 interviews · last asked Jul 29 · Concept · Junior

  20. What is a schema?

    Asked in 2 of 612 interviews · last asked Sep 8 · Concept · Junior

    Other ways it was asked
    • “What is schema?”
  21. How would you approach designing and building a transactional platform for a fintech business?

    Asked once · last asked Apr 11 · Design · Mid-level

    Other ways it was asked
    • “How would you estimate the cost of building a transactional platform for a fintech business?”
  22. In a multi-tenant application, would you store listings in one table and distinguish tenants by tenant ID, or use separate tables?

    Asked once · last asked Aug 20 · Design · Senior

    Other ways it was asked
    • “In a multi-tenant application, would you store listings in one table or use separate tables for each company?”
    • “In a multi-tenant application, how would you structure the database if you did not want to store all listings in one table?”
  23. How would you model projects, team members, and tasks in a relational database?

    Asked once · last asked Sep 30 · Concept · Mid-level

    Other ways it was asked
    • “How would you model the relationships among projects, team members, and tasks in a relational database?”
    • “What is the relationship between projects and team members in a relational database?”
    • “What is the relationship between tasks and projects in a relational database?”
  24. How would you design a database schema for a user with a first name, last name, password, login email, and phone number? How many tables would you create?

    Asked once · last asked Feb 23 · Design · Mid-level

  25. How would you change a user database schema to support an additional contact phone number after the system has launched?

    Asked once · last asked Feb 23 · Scenario · Mid-level

  26. How would you model multiple phone numbers for a user, such as personal, contact, and relative's numbers?

    Asked once · last asked Feb 23 · Design · Mid-level

  27. How would you design a phone-number schema to support additional numbers and international phone numbers?

    Asked once · last asked Feb 23 · Design · Mid-level

  28. In a one-to-many relationship between profiles and phone numbers, which table should contain the foreign key?

    Asked once · last asked Feb 23 · Concept · Junior

  29. What fields would you include in a phone-number table?

    Asked once · last asked Feb 23 · Design · Mid-level

    Other ways it was asked
    • “Besides the phone number and foreign key, what other fields would you include in a phone-number table?”
  30. How would you prevent the same phone number from being assigned to multiple user profiles?

    Asked once · last asked Feb 23 · Scenario · Mid-level

  31. Why might you use Redis INCR to generate IDs instead of relying on a database primary key?

    Asked once · last asked Mar 19 · Concept · Mid-level

    Other ways it was asked
    • “When using Redis INCR to generate an ID, should you generate the ID before saving the record to the database?”
  32. How would you approach database schema design and performance tuning?

    Asked once · last asked Apr 9 · Concept · Mid-level

    Other ways it was asked
    • “Can you tell me more about your schema design and any performance tuning you've done with your databases?”
  33. You need to store each customer's product price history for 1–20 years. Which type of database would you choose, and why?

    Asked once · last asked Apr 15 · Scenario · Mid-level

  34. What is third normal form (3NF)?

    Asked once · last asked Apr 23 · Concept · Mid-level

  35. What is an alternate key in a CRM system, and when would you use one?

    Asked once · last asked Apr 24 · Concept · Mid-level

  36. What do primary and foreign keys guarantee, and why are they useful if tables can be joined without them?

    Asked once · last asked Apr 27 · Concept · Mid-level

  37. If an entity has a unique attribute, such as a passport number, should you still create a separate primary key?

    Asked once · last asked Apr 27 · Concept · Mid-level

  38. Where would you persist the idempotency key and associated response in the Laravel schema, and what unique constraint would you add to prevent duplicates?

    Asked once · last asked May 5 · Design · Senior

  39. How do you apply normalization when designing a relational data model?

    Asked once · last asked May 16 · Concept · Junior

  40. How would you design database schema changes for notification storage to support future features like notification categories or per-user preferences without frequent migrations?

    Asked once · last asked May 23 · Design · Senior

  41. What are the differences among 1NF, 2NF, and 3NF?

    Asked once · last asked May 28 · Concept · Junior

  42. Can a key column contain NULL values?

    Asked once · last asked Jun 17 · Concept · Junior

  43. Can a database key consist of one column or multiple columns?

    Asked once · last asked Jun 17 · Concept · Junior

  44. If a manager or team gives you a task but you do not know which tables contain the needed data, or the query is unclear, what would you do?

    Asked once · last asked Jun 17 · Scenario · Mid-level

  45. How would you design SQL tables for a gym management system?

    Asked once · last asked Jun 19 · Write code · Junior

  46. How would you model users, products, inventory, and orders in a relational database, and what relationships would you define?

    Asked once · last asked Jun 20 · Design · Junior

  47. What are the different normalization forms, and can you give an example?

    Asked once · last asked Jun 20 · Concept · Mid-level

  48. How do you design database schemas and data models for downstream use, and what do you consider when choosing tables or entities?

    Asked once · last asked Jun 24 · Design · Mid-level

  49. What's the difference between ADD CONSTRAINT NOT VALID and VALIDATE CONSTRAINT in terms of which rows get checked and when enforcement begins?

    Asked once · last asked Jul 16 · Concept · Senior

  50. How would you design a database schema for a feature that needs to represent multiple links between records?

    Asked once · last asked Jul 17 · Design · Mid-level

  51. Is storing multiple related IDs in an array really the best way to model a many-to-many relationship?

    Asked once · last asked Jul 17 · Concept · Mid-level

    Other ways it was asked
    • “What is a better database design for representing many-to-many relationships than storing related IDs in an array?”
    • “What alternative to storing multiple related IDs in an array would you use to model these relationships?”
  52. When a medical record can be linked to multiple thesaurus entries, how should you model those relationships?

    Asked once · last asked Jul 17 · Design · Mid-level

  53. Why can storing related IDs in an array cause problems when modeling relationships between medical records and thesaurus entries?

    Asked once · last asked Jul 17 · Concept · Mid-level

  54. When related IDs are stored in an array, what are the implications for saving data and handling cascading deletes?

    Asked once · last asked Jul 17 · Scenario · Mid-level

  55. What is a join table, and when would you use one?

    Asked once · last asked Jul 17 · Concept · Junior

  56. How would a join table represent links between two medical records and two thesaurus entries?

    Asked once · last asked Jul 17 · Scenario · Mid-level

    Other ways it was asked
    • “If two medical records are linked to two thesaurus entries, what would the corresponding join-table rows contain?”
  57. How would you represent partial and complete dates when your database schema has only one date column?

    Asked once · last asked Jul 17 · Design · Mid-level

  58. What risks or problems can arise when using join tables to represent relationships between records?

    Asked once · last asked Jul 17 · Scenario · Mid-level

    Other ways it was asked
    • “What risks or problems can arise when using join tables to represent these relationships?”
  59. Why might you associate reviews with a transaction rather than directly with a user?

    Asked once · last asked Jul 22 · Concept · Mid-level

  60. How are Odoo Many2one fields stored in the database?

    Asked once · last asked Jul 23 · Concept · Mid-level

  61. How do you handle very large JSON columns in a frequently read table? When do you keep JSON inline versus moving fields into typed columns or a side table, and why?

    Asked once · last asked Jul 27 · Design · Senior

  62. What are some caveats of denormalizing tables?

    Asked once · last asked Jul 27 · Concept · Mid-level

  63. How would denormalization impact write performance?

    Asked once · last asked Jul 27 · Concept · Mid-level

  64. Can you design a task management system where users can create, update, and track tasks with subtasks across multiple workspaces, user roles, and task histories, considering scalability and consistency?

    Asked once · last asked Jul 29 · Design · Senior

    Other ways it was asked
    • “Can you design a task management system like Tracked, where users can create, update, and track tasks with subtasks across multiple workspaces, user roles, and task histories, considering scalability and consistency?”
  65. How would you approach setting up a server and structuring a database when defining an application's initial architecture?

    Asked once · last asked Jul 31 · Scenario · Mid-level

  66. How would you validate and enforce referential integrity between a fact table and a dimension table, such as orders and customers, while keeping the process auditable?

    Asked once · last asked Aug 5 · Scenario · Senior

  67. How would you structure the key entities and relationships in an event ticket booking system, including events, seats, and bookings?

    Asked once · last asked Aug 5 · Design · Mid-level

  68. Walk me through your process for designing a MySQL database schema for a new web application. What metrics do you monitor for performance?

    Asked once · last asked Aug 10 · Design · Senior

  69. For a star schema, would you store data in Delta tables or an external database such as PostgreSQL, and why?

    Asked once · last asked Aug 14 · Scenario · Mid-level

  70. What problems can occur if two bank records have the same account number and their data is duplicated?

    Asked once · last asked Aug 14 · Scenario · Junior

  71. What are alternative ways to isolate tenant data within a shared database?

    Asked once · last asked Aug 20 · Concept · Senior

  72. How would you choose between separate servers, databases, or schemas for isolating tenants in a multi-tenant system?

    Asked once · last asked Aug 20 · Design · Senior

  73. Surrogate keys vs natural keys: when would you choose each?

    Asked once · last asked Aug 23 · Concept · Mid-level

  74. How is `sale_order_line` related to `sale_order` in Odoo?

    Asked once · last asked Aug 28 · Concept · Junior

  75. How do many-to-many, one-to-many, and many-to-one relationships differ at the database level?

    Asked once · last asked Aug 28 · Concept · Junior

  76. What are the common data modeling relationship types and cardinalities?

    Asked once · last asked Sep 2 · Concept · Mid-level

  77. How do you design and handle a database schema for an application requiring multi-currency financial ledger entries with 100% auditability?

    Asked once · last asked Sep 5 · Design · Senior

  78. What is the difference between third normal form and Boyce-Codd normal form?

    Asked once · last asked Sep 5 · Concept · Mid-level

  79. How would you design a database schema for a doctor appointment booking system?

    Asked once · last asked Sep 10 · Design · Mid-level

  80. How would you design a ledger data model, including its keys and transaction invariants?

    Asked once · last asked Sep 11 · Design · Senior

  81. What is the difference between an API constraint and an SQL constraint in Odoo?

    Asked once · last asked Sep 14 · Concept · Mid-level

  82. How would you handle an audit log requirement when the same order gets updated over time?

    Asked once · last asked Sep 18 · Scenario · Mid-level

  83. How would you maintain relationships in a length-of-stay data mart?

    Asked once · last asked Sep 19 · Design · Mid-level

  84. In PostgreSQL specifically, how do nulls behave under a unique constraint, and what implication does that have for modeling optional fields that should be unique when present?

    Asked once · last asked Sep 21 · Concept · Mid-level

  85. How would you write a partial unique index in PostgreSQL to enforce unique email only when email IS NOT NULL?

    Asked once · last asked Sep 21 · Write code · Mid-level

  86. How would you design or optimize a database schema for an application, and what trade-offs would you consider?

    Asked once · last asked Sep 23 · Behavioral · Mid-level

    Other ways it was asked
    • “Can you share an example of how you've designed or optimized a database schema for a particular application? What trade-offs did you consider?”
  87. Why do you validate constraints using test cases instead of enforcing them at table creation time?

    Asked once · last asked Sep 24 · Concept · Mid-level

  88. What are primary keys and foreign keys, and how are they used in a relational database?

    Asked once · last asked Sep 25 · Concept · Junior

  89. What is the difference between soft delete and hard delete?

    Asked once · last asked Sep 28 · Concept · Junior

  90. How do you identify a table's primary key, and how does that affect indexing decisions?

    Asked once · last asked Sep 28 · Concept · Mid-level

  91. How would you implement a many-to-many relationship in PostgreSQL?

    Asked once · last asked Sep 30 · Concept · Mid-level

  92. How do you define primary and foreign keys in a Spring Boot entity?

    Asked once · last asked Sep 30 · Tooling · Junior

  93. Can you design a database schema for a question-and-answer website with users, questions, answers, topics, comments, upvotes, and downloads?

    Asked once · last asked Oct 1 · Design · Mid-level

  94. How do you ensure the data integrity of an order object so the total price always matches the sum of its items?

    Asked once · last asked Oct 6 · Scenario · Mid-level

  95. How would you approach working with claim, member, and provider tables?

    Asked once · last asked Oct 13 · Scenario · Mid-level

  96. How do you implement database relationships in SQL?

    Asked once · last asked Oct 15 · Concept · Junior

  97. What challenges arise when a data table has no primary key, and how would you handle them?

    Asked once · last asked Oct 18 · Scenario · Mid-level

  98. How can you prevent duplicate records in SQL?

    Asked once · last asked Oct 19 · Concept · Junior

  99. Why would you use a one-to-many relationship to model a contract's details and installments?

    Asked once · last asked Oct 21 · Concept · Mid-level

    Other ways it was asked
    • “Why did you use a One-to-Many relationship for the contract details and installments?”
  100. What is a one-to-many relationship in Laravel?

    Asked once · last asked Apr 1 · Concept · Junior

  101. What is a practical use case for a many-to-many relationship in a CRM system?

    Asked once · last asked Apr 16 · Concept · Mid-level

  102. What are the different normal forms in database normalization?

    Asked once · last asked Apr 23 · Concept · Junior

    Other ways it was asked
    • “Does database normalization have different types?”
  103. What are primary key, foreign key, and composite key constraints?

    Asked once · last asked May 26 · Concept · Junior

  104. How would you write SQL to create a database table?

    Asked once · last asked Jun 17 · Write code · Junior

  105. What is a key in a database table?

    Asked once · last asked Jun 17 · Concept · Junior

  106. How do database keys help prevent duplicate rows?

    Asked once · last asked Jun 17 · Concept · Junior

  107. What properties can a database key have?

    Asked once · last asked Jun 17 · Concept · Junior

    Other ways it was asked
    • “What other properties can a database key have?”
  108. Can a database table have multiple foreign keys?

    Asked once · last asked Jul 16 · Concept · Junior

  109. How would you prevent data-integrity problems when using join tables?

    Asked once · last asked Jul 17 · Scenario · Mid-level

  110. What is an entity in a database?

    Asked once · last asked Jul 19 · Concept · Junior

  111. Explain one-to-one, one-to-many, and many-to-many relationships.

    Asked once · last asked Jul 19 · Concept · Junior

  112. Can you create a unique key without a primary key?

    Asked once · last asked Jul 20 · Concept · Junior

  113. Which constraints can you apply when creating a table?

    Asked once · last asked Jul 26 · Concept · Junior

  114. How would you approach understanding the design of a database whose internals you are unfamiliar with?

    Asked once · last asked Aug 21 · Scenario · Mid-level

  115. What does a relationship represent in a DBMS?

    Asked once · last asked Aug 26 · Concept · Junior

  116. What options do you have for designing a relational schema?

    Asked once · last asked Sep 3 · Concept · Mid-level

  117. How do you design a database schema?

    Asked once · last asked Sep 4 · Scenario · Junior

  118. Can a foreign key be NULL?

    Asked once · last asked Sep 4 · Concept · Junior

  119. What is a surrogate key?

    Asked once · last asked Sep 4 · Concept · Junior

  120. Can you explain what primary and foreign keys are in SQL?

    Asked once · last asked Sep 8 · Concept · Junior

  121. What is database design?

    Asked once · last asked Sep 9 · Concept · Junior

    Other ways it was asked
    • “What is a database design?”
  122. What are the constraints available in SQL?

    Asked once · last asked Sep 10 · Concept · Junior

  123. What is a primary key in a relational database, and what purpose does it serve?

    Asked once · last asked Sep 27 · Concept · Junior

  124. How would you associate topics with questions in a question-and-answer website database?

    Asked once · last asked Oct 1 · Concept · Mid-level

  125. If a question has 50 associated tags and its title changes, how would you update the question and its related records?

    Asked once · last asked Oct 1 · Scenario · Mid-level

  126. How would you design and create a database table to store data submitted through a form?

    Asked once · last asked Oct 9 · Scenario · Mid-level

  127. How do you determine the structure of database tables for a software application?

    Asked once · last asked Oct 10 · Scenario · Mid-level

  128. What exactly is functional dependency?

    Asked once · last asked Oct 10 · Concept · Junior

  129. What role do keys play in functional dependencies?

    Asked once · last asked Oct 10 · Concept · Junior

  130. Which SQL constraint or key can allow multiple NULL values?

    Asked once · last asked Oct 16 · Concept · Mid-level

  131. Could you explain SQL keys?

    Asked once · last asked Jan 25 · Concept · Junior

More SQL interview questions

How this list is made

Every question here was asked by a real interviewer in a real job interview that a candidate ran MeetAssist in. After the call, the interviewer's questions are pulled from the transcript. Practice sessions, tests, exams and anything that was not a job interview are dropped.

Questions are rewritten so they make sense on their own: names of people, employers and clients are removed, and speech-to-text mistakes are fixed. Small talk, logistics and questions about one candidate's own résumé are left out. Rephrasings of the same question are merged, and the count is the number of different interviews it came up in.

The interviews come from candidates who use MeetAssist, so they lean towards software, data and AI roles: the shares describe these interviews, not every SQL interview. Answers to the most asked questions are written and checked by an editor; a "common mistake" is shown only when reviews of real answers in these interviews show it, with the count.

612 interviews, 357 candidates, Nov 2025 to Oct 2026. Updated every month with new interviews.