Opening the shared document…
Diagram playground
Write a diagram as text and it renders here as you type. Canvas editing for six of ten notations. Nothing leaves your browser. Syntax reference ·
1
archlab 1.0 er
2
title "Course catalogue"
3
description "A join table whose key is entirely foreign, a course that requires another course, and enrolments that outlive a term."
4
5
@er
6
entity student "Student" [PostgreSQL]
7
desc "Anyone who has ever enrolled, including alumni."
8
attr id uuid pk
9
attr email string uk
10
attr full_name string
11
entity course "Course"
12
attr id uuid pk
13
attr code string uk
14
desc "The printed code, e.g. CS101 — unique, but never the primary key, because codes get reused across faculties."
15
attr title string
16
attr prerequisite_id uuid fk
17
entity term "Term"
18
attr id uuid pk
19
attr name string
20
attr starts_on date
21
entity enrolment "Enrolment"
22
desc "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."
23
attr student_id uuid pk fk
24
attr course_id uuid pk fk
25
attr term_id uuid pk fk
26
attr grade string
27
28
student ||--o{ enrolment : takes
29
course ||--o{ enrolment : "is taken as"
30
term ||--o{ enrolment : "runs in"
31
course |o--o{ course : requires
Tab indents · Esc then Tab leaves the editor · worked examples
Read-only