Skip to content
arch-lab

Course catalogue

A join table whose key is entirely foreign, a course that requires another course, and enrolments that outlive a term.

Open in the playground

takesis taken asruns inrequiresStudent — Anyone who has ever enrolled, including alumni.StudentPostgreSQLidPKuuidemailUKstringfull_namestringCourseidPKuuidcode — The printed code, e.g. CS101 — unique, but never the primary key, because codes get reused across faculties.codeUKstringtitlestringprerequisite_idFKuuidTermidPKuuidnamestringstarts_ondateEnrolment — A join table: its primary key is the three foreign keys together, so a student can take a course once per term and no more.Enrolmentstudent_idPK FKuuidcourse_idPK FKuuidterm_idPK FKuuidgradestring