Week 13 • Thursday

Block 127: Database Design Basics

Design normalized relational database schemas.

Concepts

Code Examples

See exercise below.

Exercise

Design a schema for: students, courses, and enrollments. Write the CREATE TABLE SQL for all 3. Insert sample data and write a JOIN query to list students with their courses.

Homework

What is the N+1 query problem in databases? How do JOINs solve it?