NivaarExam PrepOfficial exam papers ↗

25-Comp-B3 Data Bases and File Systems · May 2015

Question 3 of 8

Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)

Notes on this paper

98-Comp-B3, Data Bases & File Systems — National Exams, May 2015. 3 hours, closed book (calculators permitted). Candidates were instructed to answer five questions: one of Questions 1/2, one of Questions 3/4, and three of Questions 5–8 — only those five are marked. All 8 questions are answered below for completeness (this is a study resource covering the full syllabus).

Reference texts: Silberschatz, Korth & Sudarshan, Database System Concepts (7th ed.) — ER modelling, normal forms, and transactions/serializability; Ramakrishnan & Gehrke, Database Management Systems (3rd ed.) — B+-tree indexing, SQL, and relational algebra.

Question 3 (20 marks)

Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.

Given. Four entity classes described in prose — musicians (SIN, name, address, phone), instruments (ID, name, musical key), albums (ID, title, copyright date, format), songs (title, author) — plus five business rules connecting them (plays, one-album-per-song, performs, exactly-one-producer, and the address/phone sharing rule).

Find. A complete Chen-notation ER diagram: entities with keys, relationships with cardinalities and participation, and any constraint the diagram cannot express.

Approach. Read each bullet as either an entity attribute or a relationship cardinality; the two trickiest bullets ("no address has more than one phone" and "no song may appear on more than one album") get special attention because one is a plain 1:N/weak-entity cardinality (expressible) and the other is a cross-attribute functional dependency (NOT expressible in a basic ER diagram).

Musician (SIN key, Name, Address, Phone) — SIN is the natural key since names are not guaranteed unique. Instrument (ID key, Name, MusicalKey). Album (AlbumID key, Title, CopyrightDate, Format) — the source text lists both "a unique identification number" and "an album identifier" for Album; these read as the same key attribute named twice, so only one key attribute is modelled (flagged below). Song is a weak entity (Title, Author, no attribute of its own is globally unique) identified by its owning Album via the identifying relationship Includes, with a partial key of Title — this matches the rule "no song may appear on more than one album" exactly, since a weak entity can only ever be linked to ONE owner.

Four relationships complete the model: Plays (Musician M:N Instrument, "a musician may play several instruments, and a given instrument may be played by several musicians" — no participation constraint stated, so partial on both sides); Includes (Album 1:N Song, identifying, total participation of Song — every song belongs to exactly one album); Performs (Song M:N Musician, total participation on the Song side because "each song is performed by one or more musicians" requires at least one); Produces (Album N:1 Musician, total participation on the Album side because "each album has exactly one musician who acts as its producer" is mandatory, partial on the Musician side since not every musician need produce).

INSTRUMENTALBUMMUSICIANSONGPlaysProducesIncludesPerformsNMN11NNM
Question 3 — Downtown Records ER diagram (Chen notation; double border/line = weak entity & total participation)
Check — assumption
Album's "unique identification number" and "album identifier" are treated as the same key attribute (a likely duplicated description in the source rather than two distinct attributes); if a grader intended two separate identifiers, add a second candidate-key attribute to Album with no change to the rest of the diagram.

Constraint the ER diagram cannot capture. The rule "poorly paid musicians often share the same address, and no address has more than one phone" is a functional dependency between two ATTRIBUTES of the same entity (Address → Phone): every Musician tuple with a given Address value must carry the same Phone value. Chen-notation ER diagrams (and the cardinality/participation constraints they express) only constrain relationships BETWEEN entities, or the uniqueness of a whole key; they have no notation for "attribute X of an entity determines attribute Y of the same entity." Capturing this rule structurally would require pulling Address out into its own entity (with Phone as ITS attribute, and a relationship from Musician to Address) — a NORMALIZATION step that changes the schema rather than something expressible by decorating the diagram above. By contrast, "no song may appear on more than one album" IS fully captured, simply by making Song a weak entity with Album as its one identifying owner.

Final results — Question 3
ItemValue
EntitiesMusician, Instrument, Album, Song (weak)
RelationshipsPlays (M:N), Includes (1:N, identifying), Performs (M:N, total on Song), Produces (N:1, total on Album)
Constraint NOT expressibleAddress → Phone functional dependency (intra-entity FD; needs normalization, not ER notation)