From text to diagram: design choices
After this lesson you will turn a requirements text into an ER diagram the way the exercise sessions do — five passes, written assumptions — and defend every choice: entity or attribute, which element an attribute belongs to, when a relationship must become an entity, when a subclass earns its place.
Late in its role-playing-game exercise, the ER exercise session prints a table (p. 1318). A character called Axel has dealt killing blows to goblins with three different multipliers, and the slide just before it (p. 1317) draws the diagram meant to hold the rows: a relationship Killing Blow between Character and Monster, carrying KB Amount and KB Multiplier.
| Character Name | Monster Name | KB Amount | KB Multiplier |
|---|---|---|---|
| Axel | Goblin | 15 | 1.2 |
| Axel | Goblin | 10 | 1.5 |
| Axel | Goblin | 8 | 1.0 circled: "Standard Kill" |
Three rows, one pair of participants: Axel and the Goblin. That diagram can keep only one of the three. The rule that forbids the other two is printed in the lecture, in a sentence about an employee who works in the same department twice. Spot it on the way; in the last section you move the multiplier yourself and watch the missing rows come back.
Entity or attribute: two tests
Page 73 lists the "Crucial design choices" of conceptual design as three questions: "Should a concept be modeled as an entity or an attribute? Should a concept be modeled as an entity or a relationship? Identifying relationships: Binary or ternary? Aggregation?" The first two decide most of a diagram, and the lecture answers each with one example.
Take an employee and her address (p. 74). If every employee has one address and you only ever print it on an envelope, an attribute of Employee is enough. The slide names the two situations in which it is not:
- "If we have several addresses per employee, address must be an entity (since attributes cannot be set-valued)."
- "If the structure (city, street, etc.) is important, e.g., we want to retrieve employees in a given city, address must be modeled as an entity (since attribute values are atomic)."
Two tests: several values for one owner, or a structure you need to look inside — either one makes the concept an entity, linked to its owner by a relationship.
The car-rental exercise of the session applies both tests without naming them. The inspecting company is one name with nothing inside: the attribute Company Name (p. 1296). The licence's "list of vehicles they are allowed to drive" is several values, but a short fixed list of yes-or-no facts: the composite attribute Drives, one component per category — Truck, Cars, Bus, … (p. 1295).
"Structure forces an entity, so the museum's location (address and city) must be an entity." Not in the session's notation. The lecture's dialect (pp. 68–76) knows only atomic, single-valued attributes; the session adds the composite attribute, made of named parts, and draws exactly that location as one (p. 1306). Asked "attribute or entity?" at the exam, give the slide's two tests and say which one decides.
The same tests, on a relationship
The tests bite harder on the attributes of a relationship (p. 75). Say Joe worked in the toy department from 2015 to 2016 and came back in 2019. Work_In4 links Employee and Department and carries from and to. The slide's verdict: "Works_In4 does not allow an employee to work in a department for two or more periods (a relationship is identified by participating entities)."
A relationship instance is the pair (Joe, Toys) and nothing more; from and to only describe it. A second period would need a second instance with the same pair — which is the same instance. The fix repeats the address case: "We want to record several values of the descriptive attributes for each instance of this relationship. Accomplished by introducing new entity set, Duration." Duration is identified by from and to together, Work_In4 becomes a ternary relationship among Employee, Department and Duration, and (Joe, Toys, 2015–2016) and (Joe, Toys, 2019–…) are two instances: the "Binary or ternary?" of p. 73, answered once.
Before: the period hangs on the pair
After: the period is an entity, part of the identity
Hold on to that sentence — "a relationship is identified by participating entities". It is the rule the dungeon table of the warm-up breaks.
Where an attribute lives
Page 76, "Entity vs. Relationship", asks the second question through a budget. Each manager receives a discretionary budget, dbudget, and the first diagram hangs it on the relationship Manages2, next to since. The slide approves that drawing for one reading only: "First ER diagram OK if a manager gets a separate discretionary budget for each dept."
Change one fact — "What if a manager gets a discretionary budget that covers all managed depts?" — and the same drawing goes wrong twice:
- "Redundancy: dbudget stored for each dept managed by manager." A manager of three departments carries the same number in three Manages2 instances; update one, forget two, and the database contradicts itself.
- "Misleading: Suggests dbudget associated with department-mgr combination." The diagram claims the budget depends on the pair, when it depends on the manager alone.
The fix, in the slide's box "This fixes the problem!", is a subclass: Manager ISA Employee carries dbudget, and Manages2 now links Manager and Department and keeps only since, which really does depend on the pair.
Before: dbudget on the relationship
After: dbudget on the subclass Manager
An attribute lives on the element whose instance alone determines its value; anywhere else it is copied, and misread.
Two remarks. The subclass has both "Reasons for using ISA" of p. 72 (lesson 6): "To add descriptive attributes specific to a subclass" — dbudget — and "To identify entities that participate in a relationship" — only managers manage. And the same question — where is this value determined? — is what moves the dungeon's multiplier in the last section.
A whole schema, and three ways to build one
Page 77, "E-R Example", is a complete schema in the course's own notation: the training company of the textbook the slides are taken from (Atzeni and colleagues — background, not on the slide). Nine entities, ten relationships, and every (min,max) pair sits next to the entity it counts: in how many instances of the relationship one instance of that entity takes part (lesson 6). Reading it aloud, relationship by relationship, is the drill every exam diagram needs.
| Relationship and its two pairs | In words |
|---|---|
| CURRENT EMPLOYMENT (StartDate) EMPLOYER (0,N) · EMPLOYEE (1,1) | An employer employs any number of employees now, possibly none; each employee has exactly one current employer. |
| PAST EMPLOYMENT (StartDate, EndDate) EMPLOYER (0,N) · TRAINEE (0,N) | Any number in both directions. |
| EMPLOYMENT DATA TRAINEE (0,1) · EMPLOYEE (1,1) | A trainee has at most one employment record; each record belongs to exactly one trainee, which also identifies it. |
| PROFESSIONAL DATA TRAINEE (0,1) · PROFESSIONAL (1,1) | The same pattern for the professional record. |
| ATTENDANCE (Marks (0,1)) TRAINEE (0,N) · COURSE EDITION (1,N) | A trainee attends any number of editions; every edition has at least one trainee; a mark may be missing. |
| COMPOSITION CLASS (1,1) · COURSE EDITION (1,N) | Every class belongs to exactly one edition; every edition has at least one class. |
| TYPE COURSE EDITION (1,1) · COURSE (0,N) | Each edition is an edition of exactly one course; a course may have no edition yet. |
| TEACHING COURSE EDITION (1,1) · INSTRUCTOR (0,N) | One instructor per edition; an instructor may teach none or many. |
| QUALIFICATION COURSE (1,N) · INSTRUCTOR (1,N) | Every course has at least one qualified instructor; every instructor is qualified for at least one course. |
| HOLDER TELEPHONE (1,1) · INSTRUCTOR (1,N) | Each number belongs to exactly one instructor; each instructor has at least one number. |
TELEPHONE is p. 74's first test in action: several numbers per instructor, so an entity and the relationship HOLDER. Four symbols of p. 77 come from the textbook, unexplained on the slides: a black dot is an identifier (Code of TRAINEE); an arc with one dot across Time, Room and Date of CLASS is a composite identifier — one room at one time on one date is one class; a dot on a bar across the line of EMPLOYMENT DATA is an external identifier — an EMPLOYEE record is identified through its trainee; a (0,1) on an attribute's stem makes it optional, like Marks. The exam papers list the attributes under the diagram and underline the keys; only the paper of 30 Jan 2026 draws them on the diagram, a filled dot for each key.
Three strategies
How does a designer get from a text to such a schema? Pages 78–83, "ER Design Methodology", answer with three pictures, two tables and no prose; the explanations below are the textbook's.
- Top-down (p. 79): one abstract schema of the whole specification, the "Initial schema", refined through "Intermediate schema"s into the "Final schema"; each refinement applies a top-down primitive (p. 80).
- Bottom-up (p. 81): the "Specifications" split into components and sub-components, a small schema for each, then the "Integration of schemas" into the "Final schema"; its primitives (p. 82) create concepts from nothing or from loose pieces.
- Inside-out (p. 83): start from the most important concept — EMPLOYEE in the slide's example — and grow outward like an oil stain, each ring adding what is directly connected: PARTICIPATION and PROJECT, then MEMBERSHIP, MANAGEMENT and DEPARTMENT, then COMPOSITION and BRANCH.
| Top-down primitives (p. 80) | Bottom-up primitives (p. 82) |
|---|---|
| T1 From one entity to two entities and a relationship between them | T1 Generation of an entity |
| T2 From one entity to a generalization | T2 Generation of a relationship |
| T3 From one relationship to multiple relationships | T3 Generation of a generalization |
| T4 From one relationship to an entity with relationships | T4 Aggregation of attributes on an entity |
| T5 Adding attributes to an entity | T5 Aggregation of attributes on a relationship |
| T6 Adding attributes to a relationship | — |
Top-down T2, "From one entity to a generalization", is what Manager did to Employee. Top-down T4, "From one relationship to an entity with relationships", replaces a relationship by an entity of its own: the dungeon will need it in the last section. Duration was a different cure for the same illness: p. 75 keeps Work_In4 and adds a third participant.
On a text the size of the session's exercises, inside-out keeps you oriented: start from the entity the first sentence is about, then follow the verbs outward.
What a diagram cannot say
Page 73 ends with a warning: "A lot of data semantics can (and should) be captured. But some constraints cannot be captured in ER diagrams." The exam papers write such constraints in a line under the diagram that starts with N.B. The restaurant paper (6 Sept 2024) draws Table 1:N — Serve — 1:N Waiter and adds "Tables are served by more Waiters overall, but only one at a time": the pairs count every instance the relationship ever holds, and no pair can say "at a time". The Netflix paper (21 Jan 2025) adds "Only the original digital content can be dubbed", a condition on an attribute value, not a count. The Formula 1 paper (11 Feb 2025) writes "Each Team Member might have worked for different Teams in different periods of time" — Joe's problem again.
From text to diagram: the car rental
Exercise 1 of the session (p. 1293) is a one-paragraph requirements text: "Design an ER Model for a car rental system that manages the customers, the cars and their related elements." Customers show an ID card, a driving licence and a credit card, cars are inspected, rentals produce invoices. Read the solution slides in order (pp. 1294–1298) and a method shows through; this notebook splits it into five passes over the text, each leaving its own mark:
- Nouns. Things with an identity of their own — with facts to keep or, like the customer, with links to everything else — become entities; p. 1294 prints them in capitals and colour.
- Attributes. The facts in parentheses, or after "described by", become attributes of the entity they describe.
- Keys and assumptions. Underline what identifies each entity; where the text gives nothing, invent an identifier and write the assumption next to it.
- Verbs and quantity words. A verb between two entities becomes a relationship; "each", "their", "the list of all" become (min,max) pairs.
- The process out. What the system does is not what it stores: drop the steps, keep only their data footprint.
| Entity | Attributes · origin of the identifier |
|---|---|
| Customer ID Card | ID, Name, Surname, Birth Date, Address, Release Date, Expiration Date the text: "9-digit ID" |
| Driving License | Drive License Number, Name, Surname, Birth Date, Release Date, Expiration Date, Drives (Truck, Cars, Bus, …) the text: "10-digit drive license number" |
| Credit Card | Identifier Number, CVC, Expiration Date the text: "16 digit number" |
| Car | License Plate, Brand, Price per Day, Maximum Speed, Fuel Consumption added: a car's natural identifier, not in the text |
| Car Inspection | Inspection ID, Date, Company Name invented: a date and a company need not be unique |
| Operation | Operation ID, Description invented, like the description |
| Rental Invoice | Rental Invoice ID, Rental Date, Rental Period, Final Price, Status invented; Status is the footprint of "closed" |
| Customer | E-mail "Assumption: Customer is identified through an E-Mail" |
Five identifiers out of eight are the designer's. The customer is the extreme case: the text gives the customer no attribute at all — every personal datum sits on the ID card — so the assistants invent one, circle it in red and write "Assumption: Customer is identified through an E-Mail" (p. 1297). Copy the habit. An invented key, or your reading of an ambiguous sentence, goes on the paper as "Assumption: …": a choice that is written down can be accepted, a silent one can only be wrong.
Page 1298 draws the customer half of the diagram. Read each pair from its own side: Credit Card (1,1) — Owns — (1,N) Customer gives each card exactly one owner and each customer one or more cards; the two other Owns, (1,1) on both legs, give every customer exactly one ID card and one licence. The other half exists only as a link (p. 1309), so the dashed part of the widget is one possible completion, not the assistants'. Its open choice is Operation: a kind of work that recurs across inspections gives Car Inspection (1,N) — Includes — (1,N) Operation; a line of a single inspection takes (1,1). Say which you mean.
And then: tables
The exercise closes with "N.B. ER models will be then mapped on tables that will contain data." and two tables (p. 1299):
| License Plate | Fuel Consumption | Max Speed | Price Per Day | Brand |
|---|---|---|---|---|
| AF012CG | 20 Km/l | 135 Km/h | 50€ | Citroen |
| DG186HF | 10 Km/l | 320 Km/h | 2’000€ | Ferrari |
| Inspection ID | Date | Company Name | License Plate |
|---|---|---|---|
| 1 | 01/05/2021 | Tires & Co. | AF012CG |
| 2 | 01/08/2021 | Ferrari | DG186HF |
The plate appears twice: as the key of a car, and inside each inspection row. That is the relational form of Car (0,N) — Undergoes — (1,1) Car Inspection: every inspection concerns exactly one car, so the car's key travels into the inspection's row, never the other way. Which key travels where is the recipe of lesson 8. Notice also what is missing: the "3 months" of the text — the check is a query over Date.
Museums and dungeons: derive, specialise, collapse
The second text of the session (p. 1302) is the Dutch Museum Association: museums, halls, artworks, artists, visitors, tickets and a shop. One deck prints it again under the assistant's red pen (p. 1328): boxed nouns, underlined identifiers, a small composite-attribute sketch beside "location", "only one artist" boxed as a cardinality hint. One placement repeats the rule of section 2: "Visitors state the time when they would visit the museum when they buy tickets", so Visiting Time hangs on Buy, the purchase that fixes it (p. 1306).
Two hierarchies, each with a reason
Extra II (p. 1305) grows the shop: "now museums will include three different kinds of shops: restaurant, sweets shop, and gadgets shop. While the first two shops sell food, the latter sells gadgets. Sweet shops only sell sweets. Food is described by the same attributes as gadgets, plus an expiry date."
Each hierarchy has a reason. Product exists because food and gadgets share attributes: the shared ones go up, Expiry Date stays on Food — the first reason for ISA on p. 72, "To add descriptive attributes specific to a subclass". The kinds of shop exist because each sells a different kind of product through its own Sell — the second reason. Sweet has no attribute of its own; it exists to be the far end of the sweets shop's Sell.
"The slide draws the hierarchies without a pair, so the pair is optional." None of the three hierarchies of p. 1306 carries one, but the exam diagrams print a (T/P, E/O) pair on nearly every hierarchy (the restaurant paper of 6 Sept 2024 is the exception). Write yours, as a reading of the text: every shop is one of the three kinds, (T,E); every product is food or a gadget, (T,E); only some food is sweet, (P,E).
Keep it or derive it?
The dungeon text (pp. 1310–1311) describes players, characters, items, weapons and monsters; its solution opens with two red remarks (p. 1312). "Not all the data is useful": the password and e-mail confirmations check a form, they are not facts to store. "Do not forget the “Gold” attribute": the text only says gold "is provided to the player" when a monster is defeated, yet an amount that accumulates must live somewhere — the solution puts it on Character.
Then the session asks whether some attributes should be stored at all. Strength Score is "derived from the strength of the items equipped", and the slide's chain reads "It can be derived from “Weapons”" → "Redundancy" (p. 1314). A value you can compute from stored data is a derived attribute: storing it keeps two copies of one fact that can drift apart. The slide's next question, "What if the “Strength Score” would depend also on the “Experience Points”?", changes nothing: Experience Points are stored too. Page 1315 pushes on — "Can we remove “Gold” and “Experience Points” based on the same statement we made before?" — and prints both answers, each with its assumption:
| Attribute | Recomputable from stored data? | Decision |
|---|---|---|
| Strength Score | yes: from the strength of the equipped weapons (and the stored Experience Points, if it depends on them) | derive: "Redundancy" |
| Experience Points | yes, if they only grow: the experience provided by the monsters slain, which the model records | "Yes, they can be derived." — "Assumption: “Experience Points” are only earned." |
| Gold | no, if it also shrinks: what a character spends is not recorded | "No, they should be kept." — "Assumption: “Gold” can be spent." |
Derivable means computable from what is recorded, and what is recorded depends on how you read the text — so the slide writes the assumption next to each verdict. Do the same.
When a subclass earns its place
In Extra III a bug lets players "equip weapons regardless of the class of their character, but they can only equip one weapon", and a "Weapon Efficiency Score" gives each weapon a multiplier against misuse (p. 1319). Page 1320 draws one Wield for everybody, Character (1,1) — Wield — (0,N) Weapon, makes the score a composite attribute of Weapon with one component per class, circles both hierarchies and asks "Is it still necessary to keep the ISA Hierarchies?" — "They can be transformed into attributes". With their wielding rules gone, the classes have nothing of their own: they collapse into an attribute Class of Character, the weapon kinds into an attribute of Weapon.
Extra IV runs the argument backwards. Developers start to play; they "have the same attributes of players, although they have a special tag named “DEV” associated with their account" (p. 1321), so the slide draws a Developer subclass, "OR" a Developer attribute — both work, and the attribute is simpler. Then "allowing players to add developers to their friends is not a good practice" (p. 1322): one kind of player now has a relationship the other must not have.
Before (p. 1321): developer as an attribute
After (p. 1322): the subclass has a relationship of its own
A subclass earns its place with an attribute or a relationship of its own; without one, it is an attribute of the parent.
The structural fix has a price: Befriend now exists only among basic players, so developers cannot befriend each other either — more than the text asked. If that matters, it is exactly the kind of constraint that goes into an N.B. line.
Two more cases go through the same test. Boss Monster (p. 1313) fails it — no attribute or relationship of its own, only larger values — yet the slide keeps the subclass, (P,E); a Yes/No attribute would do as well. The museum's Extra III (p. 1307) passes it: "painters only befriend other painters and sculptors only befriend other sculptors". No solution is printed, but the device of p. 1322 gives one: Painter and Sculptor under Artist, (P,E) if other artists exist and nobody is both (state it), each with its own recursive Befriend.
Monster or fight? When a relationship must become an entity
Back to the warm-up. Extra I (p. 1316) introduces the "Killing Blow", which "awards the player that kills the monster with extra experience points, based on a “Monster Killing Blow Multiplier” score (between 1.2 and 1.5)". That multiplier belongs to the kind of monster, so the solution puts KB Multiplier on Monster, and a relationship Slay, (0,N) on both sides, counts Slain Amount and KB Amount for each pair.
Extra II (p. 1317) rebalances the game: the multiplier is now "between 0.5 and 1.5" and "assigned depending on how well the player fought the monster". Its value is fixed by the fight, so — the rule of p. 76 — it leaves Monster and joins KB Amount on a second relationship, Killing Blow. The slide asks "Should I keep them both?" and p. 1318 prints two answers: "Yes - From a data perspective, we can only keep “Killing Blow” even though the name of the relationship would change drastically. Therefore, we could assume we keep slay and add a simple “Slay Modifier”." and "No - We should keep them both for clarity of their meaning and for text coherence." Read each label by its text: "Yes" argues for one relationship, "No" for two. Both are printed, so argue yours: an ordinary kill is a killing blow with multiplier 1.0, the row circled "Standard Kill".
That answers the warm-up: the sentence was p. 75's "a relationship is identified by participating entities". The cure is top-down primitive T4, "From one relationship to an entity with relationships": as an entity, three killing blows are three instances that may share a character and a monster. Turning a relationship into an entity is called reification (the textbooks' word, not the slides'); Work_In4 took the other cure, a third participant — both give each repetition an identity of its own. The museum's Extra I (p. 1304) needs the same if one artwork can be lent to the same museum twice: "keep track of the period each artwork spends in each museum" — one loan, one entity.
The exam papers keep their relationships binary and state such situations in words, like the Formula 1 "N.B." of section 3: spot them before you design the graph or the documents of the later exercises.
Exam-style questions
Theory questions in the form of the written exam — open answers of a few sentences, closed ones where a wrong answer may carry a penalty — and two exercises on ER fragments of past papers. In the nine past papers no exercise asks you to draw an ER diagram: every practical exercise starts from a given one, and its N.B. lines are where the design trouble hides.
Explain how you decide whether a concept should be modelled as an attribute or as an entity in an ER diagram. Use the address of an employee as the example.
Show model answer
It depends on how the information is used and on the semantics of the data. An attribute holds one atomic value for its owner. If an employee can have several addresses, address must be an entity connected to Employee by a relationship, because attributes cannot be set-valued. If the structure of the address matters — for example, we want to retrieve the employees who live in a given city — address must also be modelled as an entity, because attribute values are atomic. If neither holds (one address, always used as a whole), an attribute is enough. The same reasoning applies to attributes of relationships: since a relationship instance is identified by its participating entities, several values for the same pair (two working periods of one employee in one department) require a new entity, such as Duration.
A complete answer gives the two tests with their reasons — "set-valued" and "atomic" are the slide's words — and the decision for each case. The last sentence shows that you see the same rule behind p. 75.
True or false: in an ER diagram, a relationship Works_In between Employee and Department with the attributes from and to can record that the same employee worked in the same department in two different periods.
Show model answer
False. A relationship instance is identified by its participating entities, so there is at most one instance for a given employee and department, with one value of from and to. Several periods require a new entity (Duration) and a ternary relationship.
A true/false with a possible penalty: the trap is that attributes look like they could repeat. They cannot — they hang on the pair.
Describe the top-down, bottom-up and inside-out strategies of conceptual design, and give one primitive of each of the first two.
Show model answer
Top-down: start from a single, abstract schema that covers the whole specification and refine it step by step — initial schema, intermediate schemas, final schema — each step replacing a concept with a more detailed structure; a primitive is "from one entity to two entities and a relationship between them" (others: to a generalization, from one relationship to multiple relationships or to an entity with relationships, adding attributes). Bottom-up: split the specification into components and sub-components, design a schema for each, then integrate the schemas into the final one; a primitive is "generation of an entity" (others: of a relationship, of a generalization, aggregation of attributes on an entity or a relationship). Inside-out: start from the most important concept and grow the schema outward, adding at each step the concepts directly connected to those already present, like an oil stain.
The slides give these strategies as pictures only (pp. 79–83), so explain the mechanism in your own words: refinement, integration, growth from a core. Remember that the bottom-up table is printed under the title "Top-down primitives".
Which of the following are primitives of the bottom-up strategy? Select all that apply.
Show model answer
Generation of a relationship, aggregation of attributes on an entity, generation of a generalization. The other two refine an existing concept and belong to the top-down strategy.
Rule of thumb: "generation" and "aggregation" build up (bottom-up); "from one … to …" refines (top-down). The bottom-up rows are printed under the title "Top-down primitives" (p. 82): know the printed title, and classify by the verbs.
In the role-playing-game exercise, a Character has Gold, Experience Points and a Strength Score derived from the strength of the equipped items. Which of these attributes would you keep in the ER model, and why?
Show model answer
An attribute whose value can be computed from data already stored is a derived attribute: storing it is redundant and can become inconsistent. Strength Score can be computed from the strength of the weapons the character wields, so it can be removed; it stays derivable even if it also depends on the Experience Points, since those are stored too. Experience Points can be derived under the assumption that they are only earned: they are then the sum of the experience provided by the monsters the character has defeated, which the model records. Gold must be kept under the assumption that it can be spent: spending is not recorded, so the current amount cannot be recomputed. The decision depends on these assumptions, which must be stated.
Three marks: the definition (derived = computable from stored data, hence redundant), one verdict per attribute, and the assumptions — the slides print both "Yes, they can be derived" and "No, they should be kept", each with its assumption.
On the ER diagram of the exam of 11 Feb 2025 (Formula 1 races). Consider this fragment of the diagram: Team Member 1:N — Include — 1:N Team, where Include has the attributes Hiring_Date and Resignation_Date, and the note "N.B. Each Team Member might have worked for different Teams in different periods of time." (a) State the two cardinalities in words. (b) Can the diagram record a mechanic who worked for the same team twice, in two different periods? (c) If not, change the conceptual design so that it can, and give the resulting entities, relationships and cardinalities.
Show model answer
(a) Each team member is included in at least one team and possibly many; each team includes at least one team member and possibly many.
(b) No. A relationship instance is identified by its participating entities, so Include contains at most one instance for the pair (mechanic, team), with one Hiring_Date and one Resignation_Date.
(c) Turn Include into an entity, Employment (Employment_ID, Hiring_Date, Resignation_Date), with Team Member (1,N) — Hold — (1,1) Employment and Employment (1,1) — In — (1,N) Team. Each period is now its own Employment instance, so the same member and team can appear in several periods. Equivalently, add a Period entity identified by Hiring_Date and Resignation_Date and make Include ternary, as the lecture does with Duration.
Part (b) is the point of the N.B.: the diagram alone cannot hold the situation the note describes. In (c), check that the new entity is (1,1) towards both old ones — every employment belongs to one member and one team. The paper itself does not ask (c); its MongoDB exercise asks for a documental representation of Team and of the team members, and that is where the N.B. bites: an array of periods inside each member can list the same team twice (lesson 13).
On the ER diagram of the exam of 6 Sept 2024 (restaurant). The diagram contains Table 1:N — Serve — 1:N Waiter, and the paper adds: "N.B. Tables are served by more Waiters overall, but only one at a time." Explain what the cardinalities express and why the paper needs the N.B. line.
Show model answer
Table 1:N means that each table is served by at least one waiter and possibly many; Waiter 1:N, that each waiter serves at least one table and possibly many. Cardinalities count all the instances of the relationship, whenever they hold, so they cannot say that at any given moment a table has only one waiter: that is a constraint over time. A lot of data semantics can be captured in an ER diagram, but some constraints cannot; they are stated in text, as in this N.B. line, and must be enforced by the database or by the application.
Two things make the answer complete: each pair read from its own side, and the link to p. 73, "some constraints cannot be captured in ER diagrams".
Check yourself
An instructor can have several telephone numbers, and each number belongs to one instructor. How does the schema of p. 77 model them?
Museum text: "Visitors state the time when they would visit the museum when they buy tickets." Ticket takes part in Buy with 1:1, Visitor with 1:N (p. 1306). Where can Visiting Time go without losing or repeating anything? Select all that apply.
The (1,1) side can absorb a relationship's attributes — the same fact that, in lesson 8, lets a key travel into that table.
A manager's discretionary budget covers all the departments they manage. What is wrong with keeping dbudget on Manages2 (p. 76)?
Car-rental text. Which fragments leave no trace in the ER model? Select all that apply.
You begin with the entity the whole project is about and, round after round, add the concepts directly connected to what you already have. Which strategy is this?
Developers are players with a "DEV" tag (p. 1321). When does a Developer subclass become necessary instead of an attribute?
In Extra II the Killing Blow multiplier depends on how well the player fought. Why does the slide move it off Monster?
Key take-aways
- Entity or attribute: several values for one owner, or a structure you need to look inside, make a concept an entity (p. 74); a short fixed list or a set of named parts can stay a composite attribute in the session's notation.
- A relationship instance is identified by its participants: when the same pair must carry several values — two working periods, three killing blows — each repetition needs an identity of its own, through a third participant (Duration, p. 75) or by turning the relationship into an entity (a Killing Blow entity: top-down primitive T4, reification).
- An attribute lives on the element whose instance alone determines its value; anywhere else it is redundant and misleading (dbudget moves to Manager, p. 76; the KB Multiplier sits on Monster in Extra I and on the fight in Extra II).
- Designers work top-down (refinement, primitives T1–T6), bottom-up (components, schemas, integration; T1–T5 on the slide mistitled "Top-down primitives") or inside-out (an oil stain from the central concept); constraints a diagram cannot express go into N.B. lines.
- From text to diagram: nouns, attributes, keys with written assumptions, verbs and quantity words, then drop the process and keep its footprint. Derived attributes go when they can be recomputed under a stated assumption; a subclass stays only with an attribute or a relationship of its own.
What to watch and read
-
Database Lesson #4 of 8 — Data Modeling and the ER Model
Dr. Daniel Soper58 min
A slow, drawn lecture on entities, identifiers, relationships and minimum/maximum cardinality — every rule drawn before it is stated. It uses crow's-foot symbols, not the exam's (min,max) pairs: keep the ideas, not the notation.
-
The Entity-Relationship Model (chapter 2 slides)
Raghu Ramakrishnan and Johannes Gehrke18 slides
The source of pp. 73–76. It keeps what the course copy dropped: weak entities, aggregation, and a "binary vs. ternary" pair that shows when a ternary relationship is the right answer — the question p. 73 raises and Duration settles.
-
Database Systems: Concepts, Languages and Architectures
Atzeni, Ceri, Paraboschi, Torlone — free PDF from the authors
The textbook behind pp. 77–83 and the session's (min,max) notation. Its chapters on design explain the strategies the slides only draw, and the training company of p. 77 comes from there.
-
Solutions to the exercises of the book
Atzeni, Ceri, Paraboschi, Torlone
Worked ER-design exercises in the course's own notation, with solutions — useful because the past papers come without. Do one text a day with the five passes, then compare.