Presentation is loading. Please wait.

Presentation is loading. Please wait.

IS6145 Database Analysis and Design Lecture 4: Fine-Granular Design-Specific ER Modelling Rob Gleasure R.Gleasure@ucc.ie www.robgleasure.com.

Similar presentations


Presentation on theme: "IS6145 Database Analysis and Design Lecture 4: Fine-Granular Design-Specific ER Modelling Rob Gleasure R.Gleasure@ucc.ie www.robgleasure.com."— Presentation transcript:

1 IS6145 Database Analysis and Design Lecture 4: Fine-Granular Design-Specific ER Modelling
Rob Gleasure

2 IS6145 Today’s session The Fine-Granular Design-Specific ER Model
Some exercises

3 The Fine-Granular Design-Specific ER Model
The development of the coarse-granular design-specific ER model from the Presentation Layer ER model allows greater detail in data modelling. However it may still contain constructs that may not be mapped directly to the database

4 The Fine-Granular Design-Specific ER Model
This involves the following tasks The ER constructs that are not compatible for logical model mapping are decomposed, namely Multi-valued attributes m:n cardinality constraints Additional attribute characteristics are mapped to the ER diagram

5 Resolving Multi-Valued Attributes
This can be done in two ways Including the attribute as part of the unique identifier for the entity Image from Data Modeling and Database Design, By Narayan Umanath, Richard Scamell

6 Resolving Multi-Valued Attributes
Which looks as follows in terms of actual database tables Image from Data Modeling and Database Design, By Narayan Umanath, Richard Scamell

7 Resolving Multi-Valued Attributes
Transform the multi-valued attribute into a new weak entity type (this is usually a last resort) Image from Data Modeling and Database Design, By Narayan Umanath, Richard Scamell

8 Resolving Multi-Valued Attributes
Which looks as follows in terms of actual database tables Image from Data Modeling and Database Design, By Narayan Umanath, Richard Scamell

9 Resolving m:n Cardinality Constraints
This requires the addition of a weak entity type with two identifying parents, sometimes called a ‘Gerund’ entity type, more often referred to as an associative entity E.g. imagine we added the following relationship to our ERD for Mary’s Playschool Has favourite Teacher Assistant (1, m) (1, n)

10 Resolving m:n Cardinality Constraints
This could be replaced by Teacher Assistant (1, m) (1, m) Favours Favours Favoured pairing (1, 1) (1,1)

11 Adding Additional Data Characteristics to the ERD
Next we want to include the data type and size into the ERD directly. We do this using a two-part notation. The first part uses the following letters to indicate type A – Alphabetic N – Numeric X – Alphanumeric Dt - Date The second part indicates size with a n1.n2 notation n1 indicates the number of characters before a decimal point n2 (optional) indicates the number of places after

12 Adding Additional Data Characteristics to the ERD
For example Image from Data Modeling and Database Design, By Narayan Umanath, Richard Scamell

13 Semantic Integrity Constraints
The remaining constraints at this level typically specify a range using the keyword ‘IN’ or ‘NOT’ e.g. > Constraint Experience IN (‘1’,’2’,’3’) > Constraint Teacher.Age NOT > 67 Others may relate to interdependencies between entities using ‘COUNT’ e.g. > Constraint Teacher COUNT (NOT > 2) Or more complex interdependencies between entities using ‘related_how’ e.g. >Constraint related_how IN (‘Experience’,’1’,’2’) NOT (‘Capacity’>’20’)

14 Example narrative: Mary’s Playschool
A parent registers their child or children at the school with a special registration form, which records the parent, the child, a contact phone number, and any special needs, allergies, etc. the child has. A parent submits one registration form for each child but they may have more than one child at the school. Each room in the school is assigned an age group. Children under 4 years of age go in different rooms from children over 4. A child is assigned to a room based on their age and the capacity of the room. This capacity depends on the room’s size and the experience of the teacher (which may be low, intermediate, or high) but total room capacity capped at 30. A room may be assigned one or more teachers but a teacher must only be assigned to one room. The school also employs assistants to help the teachers (they tend to have favourites they pair up with repeatedly), who must also be assigned to exactly one room. At all times, each room must have an assistant and/or a teacher associated with it. Some part-time teachers also act as assistants on free days.

15 Example narrative: Mary’s Playschool
Draw a Fine-granular design-specific ERD Jot down any semantic integrity constraints you can think of (don’t worry too much about these though)

16 Example narrative: BigArt Galleries
Galleries keep information about artists, their name (which is unique), birthplace, age, and one or more styles of art. For each piece of artwork, the artist, the year it was made, its unique title, its type of art (e.g., painting, lithograph, sculpture, photograph), and its price must be stored. Pieces of artwork are also classified into groups of various kinds, for example, portraits, still lifes, etc., and assigned a curator. A given piece may belong to more than one group. Each group is identified by a name (like those just given) that describes the group. Finally, galleries keep information about customers. For each customer, galleries keep that person’s unique name, address, total amount of dollars spent in the gallery (very important!), and the artists and groups of art that the customer tends to like.

17 Example narrative: BigArt Galleries
Draw a Fine-granular design-specific ERD Jot down any semantic integrity constraints you can think of (again, don’t worry too much about these)


Download ppt "IS6145 Database Analysis and Design Lecture 4: Fine-Granular Design-Specific ER Modelling Rob Gleasure R.Gleasure@ucc.ie www.robgleasure.com."

Similar presentations


Ads by Google