Diagramium
🏫 Narrated diagram

School database, explained

Students, teachers, classes, enrollments and grades — a classic relational design, narrated table by table.

5 steps1 min readNarrated with a studio voice
School database, explainedteachesenrollsfillsearnsA table: name, then “--” and rows. Prefix a row with PK, FK or UK for keys.studentsPK idnamebirth_dateyear_groupA table: name, then “--” and rows. Prefix a row with PK, FK or UK for keys.teachersPK idnamedepartmentA table: name, then “--” and rows. Prefix a row with PK, FK or UK for keys.classesPK idsubjectroomFK teacher_idA table: name, then “--” and rows. Prefix a row with PK, FK or UK for keys.enrollmentsPK idFK student_idFK class_idtermA table: name, then “--” and rows. Prefix a row with PK, FK or UK for keys.gradesPK idFK enrollment_idassignmentscore
School database, explained — the complete diagram. Press Present to watch it build itself.
Step 1 of 5

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.

Step 2 of 5

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.

Step 3 of 5

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.

Step 4 of 5

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.

Step 5 of 5

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.