Questions: Database Schema Design

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

A developer argues that validating email uniqueness only in application code is sufficient — no UNIQUE constraint needed in the schema. What is the critical flaw in this reasoning?

ANothing — application-layer validation is more flexible and equally reliable
BApplication code cannot enforce uniqueness as efficiently as the database engine
CTwo concurrent transactions can both pass the application check before either inserts, creating a duplicate the code never detects
DDatabase constraints are only needed for NoSQL systems, not relational ones
Question 2 Multiple Choice

A system has Students and Courses where each student can enroll in many courses and each course can have many students. How should this relationship be represented?

AAdd a courses column (comma-separated list) to the Students table
BAdd a students column (as an array) to the Courses table
CCreate a junction table (e.g., Enrollments) with foreign keys referencing both Students and Courses
DAdd a student_id foreign key directly to the Courses table
Question 3 True / False

A fully normalized schema minimizes redundancy but may require expensive joins for common queries, making deliberate denormalization a valid design tradeoff in practice.

TTrue
FFalse
Question 4 True / False

Because schemas can usually be altered later with ALTER TABLE, it is safe to defer schema design decisions until after the application reaches production.

TTrue
FFalse
Question 5 Short Answer

Explain why enforcing data integrity at the schema level is preferable to relying solely on application code, and give one concrete example.

Think about your answer, then reveal below.