School database, explained
Students, teachers, classes, enrollments and grades — a classic relational design, narrated table by table.
students PK id name birth_date year_group
Every school system starts with the students table. One row per student, with a primary key that never changes even when a name does.
teachers PK id name department
Teachers get their own table. Notice what is NOT here — no list of classes. Relationships live in the lines, not in columns.
classes PK id subject room FK teacher_id
A class is a subject, a room, and exactly one teacher — that is the foreign key. One teacher can run many classes.
enrollments PK id FK student_id FK class_id term
Enrollments are the clever part. A student takes many classes and a class holds many students — that many-to-many is broken into two one-to-many links through this junction table.
grades PK id FK enrollment_id assignment score
Grades attach to an enrollment, not to a student — because a grade only means something for a particular student IN a particular class.
Watch it explain itself
Every step above is narrated aloud. Play it, or open it in the editor and make it yours — no account needed.