Part 3 — ER Modeling & ER Diagram

CLO3 · 11 marks. Parts 3 & 4 share the same university schema — learn it once. Rectangle = entity, double rectangle = weak entity, diamond = relationship, underline = key.

The schema

student (student-id, name, program)
course (courseno, title, syllabus, credits)
course-offering (courseno, secno, year, semester, time, room)
instructor (instructor-id, name, dept, designation, salary)
enrolls (student-id, courseno, secno, semester, year, grade)
teaches (courseno, secno, semester, year, instructor-id)
requires (maincourse, prerequisite)
Q5(a)For each relation, identify: keys (primary/foreign), attribute types, entity vs relationship, and weak vs strong. (5)

Attribute types you must be able to name

TypeER symbolExample
Simple (atomic)plain ovalsalary, gender
Compositeoval with sub-ovalsname → (first, middle, last)
Single-valuedplain ovaldate_of_birth
Multi-valueddouble ovalphone_numbers
Deriveddashed ovalage (from DOB)
Keyunderlinedstudent-id

Keys — the nesting hierarchy

Super keyany attr set that identifies a rowCandidate keyminimal super key (no extra attrs)Primary key — the chosen candidateForeign keya value that mustappear as a PK inanother relationdept → department
Q5(b)bigDraw the detailed ER diagram (attributes, keys, relationships, cardinality, correct notation). (6)

Cardinality — the four shapes

1 : 1AB11Person–Passport1 : NAB1NDept–EmployeeN : 1ABN1Student–AdvisorN : NABMNStudent–Course
Weak entity essentials
  • Double rectangle for the entity.
  • Double diamond for its identifying relationship.
  • Dashed underline for the discriminator (partial key).
  • PK = owner's PK + discriminator.
Participation

Total (double line): every entity must participate — every student must have an advisor.

Partial (single line): may not participate — some instructors advise nobody.