DBMS slides 📂 Introduction · 6 of 11 39 min read

Designing an ER Diagram for a University Research Database

A 17-slide case study that turns a messy university research-office brief into a precise ER diagram. It identifies four entities, five relationships (including a ternary Supervises and a Works_In relationship attribute), handles a surrogate key, and assembles the complete diagram — with animated Chen-notation diagrams and the final SQL schema.

🎓

Designing an ER Diagram for a University Research Database

A full case study — turning a messy research-office brief into a precise ER diagram: four entities, five relationships, a ternary, a relationship attribute, and a surrogate key.
Parse the Brief 5 Relationships Ternary Full ER Diagram

Press Next → or use ← → arrow keys

Section 01

The Story — A Brief Lands on Your Desk

Notes, not tables
A university research office hands you loose notes about professors, projects, graduate students and departments — no tables, no keys, no structure. Your job is to turn that prose into a precise ER diagram. The trick is grammar: nouns become entities, verbs become relationships, describing words become attributes.
SymbolMeansSymbolMeans
▭ RectangleEntity◇ DiamondRelationship
⬭ EllipseAttribute— Single linePartial participation
UnderlinedKey attribute═ Double lineTotal participation
1 / N / M labelsCardinality on the edges
Section 02 · Step 1

Find the Entities & Their Attributes

PROFESSORProf_ID 🔑 (surrogate) Name · Age · Rank · Specialty PROJECTPno 🔑 Sponsor · Dates · Budget GRADUATEUID 🔑 Name · Age · Deg_Prog DEPARTMENTDno 🔑 Dname · Main_Office Four core entities
🔑
Critical Design Decision — a Surrogate Key

PROFESSOR has no naturally unique attribute (names and ranks repeat). So we introduce a surrogate key Prof_ID — without an underlined key, the entity simply cannot be identified.

Section 03 · Step 2

Turn the Verbs Into Relationships

Brief says…RelationshipEntitiesCardinality
Each project has one principal investigatorManagesProfessor–Project1:N
Projects have multiple co-investigatorsWorks_OnProfessor–ProjectM:N
Grads work on projects under supervisionSupervisesProfessor–Graduate–ProjectTernary
Each department has a chairmanRunsProfessor–Department1:1
Professors work in departments (with time %)Works_InProfessor–DepartmentM:N
🎭
Two Relationships Can Share the Same Entity Pair

Professor and Project are joined by two separate diamondsManages (the PI) and Works_On (co-investigators) — because they are distinct roles with different cardinalities.

Section 04

Manages — One Principal Investigator (1:N)

PROFESSOR 1N Manages PROJECT total participation (double line)
👤
Exactly One PI per Project

Each project is managed by exactly one professor; one professor may manage many projects. The project side has total participation — every project must have a principal investigator.

Section 05

Works_On — Many Co-Investigators (M:N)

PROFESSOR MN Works_On PROJECT total participation (needs co-investigators)
👥
Same Pair, Different Role

A project is worked on by one or more professors, and professors work on many projects — pure M:N. This is the second diamond between the same pair: Works_On (co-investigators) sits alongside Manages (the PI), because collapsing them would erase the principal-investigator rule.

Section 06

Supervises — The Ternary Relationship

Supervises PROFESSOR GRADUATE PROJECT (Graduate, Project) → exactly one supervising professor
🔺
Why Not Two Binaries?

"A grad works on Robotics under Prof. Rao, and on AI under Prof. Mehta." Supervision depends on the combination of student and project. Splitting it into two binary relationships would lose which project the professor supervises the student on — so it must be a single ternary diamond.

Section 07

Runs — Department Chairman (1:1)

PROFESSOR 11 Runs DEPARTMENT partial — most profs don't chair total — every dept has a chairman
🪑
Asymmetric Participation

Each department has exactly one chairman, and a professor chairs at most one department — 1:1. But participation differs: department is total (every dept must have a chairman), professor is partial (most professors chair nothing).

Section 08

Works_In — M:N With a Relationship Attribute

PROFESSOR MN Works_In DEPARTMENT Time_Pct total — every prof works in ≥1 dept
⏱️
Time_Pct Belongs on the Relationship

A professor split across two departments has a different time percentage in each — it varies per professor–department pairing. So Time_Pct hangs off the diamond, never off PROFESSOR or DEPARTMENT alone.

Section 09

The Complete ER Diagram

PROFESSORProf_ID 🔑 PROJECTPno 🔑 DEPARTMENTDno 🔑 GRADUATEUID 🔑 Manages1:N Works_OnM:N Runs1:1 Works_InM:N Time_Pct Supervises PROFESSOR sits at the centre · green double lines = total participation · purple = ternary
🗺️
Everything Assembled

Four entities, five relationships. PROFESSOR connects to all others; PROJECT and DEPARTMENT are the leaf nodes. Manages and Works_On run in parallel to PROJECT; Runs and Works_In in parallel to DEPARTMENT; and the purple ternary Supervises ties Professor, Graduate and Project together.

Section 10

Key & Participation Constraints

RelationshipDegreeCardinalityTotal onKey constraint
ManagesBinary1:NPROJECTeach project → 1 professor
Works_OnBinaryM:NPROJECT
SupervisesTernaryTernaryPROJECT(Graduate, Project) → 1 professor
RunsBinary1:1DEPARTMENTeach dept → 1 chairman
Works_InBinaryM:NPROFESSORattribute: Time_Pct
Prof_IDPROFESSOR key
PnoPROJECT key
UIDGRADUATE key
DnoDEPARTMENT key
Section 11

Design Decisions & Assumptions

🔑
Surrogate key
No unique attribute for a professor → introduce Prof_ID to satisfy identification.
🔺
Ternary over binaries
Supervision is one ternary, not two binaries, to preserve all three-way dependencies.
⏱️
Time_Pct placement
On the relationship, not either entity — it varies per professor–department pairing.
🎭
Separate diamonds
Manages and Works_On stay distinct — PI and co-investigator are different roles with different cardinalities.
Participation
Double lines added wherever the brief said "each," "must," or "one or more."
🧭
Professor at centre
It participates in every relationship, so it anchors the diagram; PROJECT and DEPARTMENT are leaves.
Section 12

Three Common Mistakes to Avoid

🎭
Merging Manages & Works_On
Collapsing the two diamonds loses the principal-investigator rule entirely — same entities, but different meaning and cardinality.
⏱️
Time_Pct on an entity
Placing it on PROFESSOR implies one fixed percentage per professor — but the brief says it varies per department.
🔑
Forgetting the key
Drawing PROFESSOR with only its four given attributes fails — with no underlined key, the entity can't be identified.
🧭
The Common Thread

Every mistake here comes from ignoring what a fact depends on — a role, a pairing, or an identity. Model the dependency, not just the words.

Bonus · ER → Tables

The Resulting Relational Schema

Applying the mapping rules: entities → tables, 1:N → FK, M:N & ternary → junction tables.

-- Entities
PROFESSOR  (Prof_ID PK, Name, Age, Rank, Specialty)
PROJECT    (Pno PK, Sponsor, Start_Date, End_Date, Budget, PI_Prof_ID FK)  -- Manages 1:N
GRADUATE   (UID PK, Name, Age, Deg_Prog)
DEPARTMENT (Dno PK, Dname, Main_Office, Chair_Prof_ID FK UNIQUE) -- Runs 1:1

-- Relationship tables
WORKS_ON   (Prof_ID FK, Pno FK)                    -- M:N · PK=(Prof_ID,Pno)
WORKS_IN   (Prof_ID FK, Dno FK, Time_Pct)          -- M:N + attribute
SUPERVISES (Prof_ID FK, UID FK, Pno FK)            -- ternary · PK=(UID,Pno)
🔗
Notice the Key Constraints

SUPERVISES uses (UID, Pno) as its primary key — encoding the rule that each (graduate, project) pair has exactly one supervising professor. The 1:N and 1:1 links needed no new table, just a foreign key.

Section 13 · Part 1

Golden Rules for Designing From a Brief — 1 to 3

🏆 NON-NEGOTIABLE RULES · 1–3
1
Parse by grammar. Nouns → entities, verbs → relationships, adjectives → attributes. Read the brief as sentences and translate shape by shape.
2
Every strong entity needs one underlined key. If the brief gives none, introduce a surrogate — like Prof_ID.
3
Three-entity rule. If a fact depends on three things at once, use a ternary relationship — never split it into binaries.
Section 13 · Part 2

Golden Rules for Designing From a Brief — 4 to 6

🏆 NON-NEGOTIABLE RULES · 4–6
4
An attribute that depends on a pairing belongs on the relationship — never on either entity. Time_Pct sits on Works_In.
5
Participation signals. Words like "each," "must," and "one or more" mean total participation — draw double lines.
6
Keep distinct roles as distinct relationships. Principal investigator and co-investigator are different verbs, so they get different diamonds.
🧵
The Thread

Good ER design is disciplined reading. Find the nouns, name the verbs, ask what each fact depends on, and mark what's mandatory — the diagram falls out of the brief.

FINAL

From Brief to Blueprint

4Entities
5Relationships
1Ternary
1Surrogate key
1Relationship attribute
🎯
The Foundation Is Set

You've taken an unstructured brief all the way to a precise ER diagram — with a surrogate key, a ternary relationship, two roles between the same pair, and a relationship attribute — then converted it to tables. This is exactly the workflow real database design follows.

🧠
One Sentence to Remember

Nouns are entities, verbs are relationships, adjectives are attributes — and always ask what a fact depends on before deciding where it lives.

🎓 End of tutorial · Press to review, or click Restart