ER Diagram & EER

Lecture 3 · the diagram notation put together, a worked university ER diagram, and the enhanced concepts (specialization, generalization, aggregation).

Notation summary

ShapeMeans
RectangleEntity set
Double rectangleWeak entity set
DiamondRelationship set
Double diamondIdentifying relationship (for a weak entity)
OvalAttribute (underline = key)
Double oval · dashed ovalMultivalued · derived attribute
Directed line (→) / undirected line (—)“one” / “many” side of the relationship
Double line to an entityTotal participation (single line = partial)
Triangle labelled ISASpecialization / generalization

Worked example — university ER diagram

The same schema used in the midterm. Double rectangle = weak entity, double diamond = identifying relationship, underline = key, dashed underline = discriminator.

advisorenrollsteachessec ofrequiresmainprereqgradestudentstudent-idnameprogramcoursecoursenotitlecredits · syllabusinstructorinstructor-idname · deptdesignationsalarycourse-offeringsecnosemesteryeartime · roomN1MN1M1M
EntityWeak entityRelationshipIdentifyingKey (underline)Discriminator (dashed)Total participation1 / M / N cardinality
Weak entity course-offering borrows courseno from course through the identifying sec of relationship (double line = its total participation). requires is recursive on course with roles main & prereq.

Need the full solved version with the key/attribute classification table? Midterm Part 3 →

Enhanced ER (EER) concepts

ConceptDirectionIdea
SpecializationTop-downSplit an entity set into sub-groups (person → student, employee) via an ISA triangle. Sub-classes inherit the super-class's attributes.
GeneralizationBottom-upCombine entity sets that share features into a higher-level set. It's the inverse of specialization — drawn the same way.
AggregationTreat a relationship as an abstract entity so it can participate in another relationship (e.g. an eval_for on top of proj_guide).
Constraints on generalization: disjoint vs overlapping (can an entity be in more than one sub-class?), and total vs partial (must it be in at least one?).