Database design concepts info1408 Lecture 8 Worked example of E:R Modelling.
-
date post
20-Dec-2015 -
Category
Documents
-
view
216 -
download
1
Transcript of Database design concepts info1408 Lecture 8 Worked example of E:R Modelling.
![Page 1: Database design concepts info1408 Lecture 8 Worked example of E:R Modelling.](https://reader035.fdocuments.in/reader035/viewer/2022062714/56649d4b5503460f94a2959e/html5/thumbnails/1.jpg)
Database design conceptsinfo1408
Lecture 8
Worked example of E:R Modelling
![Page 2: Database design concepts info1408 Lecture 8 Worked example of E:R Modelling.](https://reader035.fdocuments.in/reader035/viewer/2022062714/56649d4b5503460f94a2959e/html5/thumbnails/2.jpg)
Objectives
We will use a simple scenarioWe will identify the entitiesIdentify the relationships between the entities ( if any)For each relationship the multiplicity ( or degree) and optionality will be determined
![Page 3: Database design concepts info1408 Lecture 8 Worked example of E:R Modelling.](https://reader035.fdocuments.in/reader035/viewer/2022062714/56649d4b5503460f94a2959e/html5/thumbnails/3.jpg)
To create an E:R Model
You would use the results of your fact finding to identify the entities ( as we did last week)In this case we will use a scenario
Identify the entities from the scenario
![Page 4: Database design concepts info1408 Lecture 8 Worked example of E:R Modelling.](https://reader035.fdocuments.in/reader035/viewer/2022062714/56649d4b5503460f94a2959e/html5/thumbnails/4.jpg)
The Scenario
A small Cinema club runs a number of cinemas throughout the region. The cinema shows films. A film is shown several times over a week ( or more) known as a showing. Each film can have several showings. Members book tickets for a particular showingIdentify the entities
![Page 5: Database design concepts info1408 Lecture 8 Worked example of E:R Modelling.](https://reader035.fdocuments.in/reader035/viewer/2022062714/56649d4b5503460f94a2959e/html5/thumbnails/5.jpg)
A small Cinema club runs a number of cinemas throughout the region. The cinema show films. A film is shown several times over a week ( or more) known as a showing Each film can have several showings. Members book tickets for a particular showing.
![Page 6: Database design concepts info1408 Lecture 8 Worked example of E:R Modelling.](https://reader035.fdocuments.in/reader035/viewer/2022062714/56649d4b5503460f94a2959e/html5/thumbnails/6.jpg)
Each entity is represented as a Box
![Page 7: Database design concepts info1408 Lecture 8 Worked example of E:R Modelling.](https://reader035.fdocuments.in/reader035/viewer/2022062714/56649d4b5503460f94a2959e/html5/thumbnails/7.jpg)
Refer back to the scenario and identify the relationships
The cinema show films.
Therefore there is a relationship between cinema and film Shown by a line- named shown at
![Page 8: Database design concepts info1408 Lecture 8 Worked example of E:R Modelling.](https://reader035.fdocuments.in/reader035/viewer/2022062714/56649d4b5503460f94a2959e/html5/thumbnails/8.jpg)
Identify the properties of the relationship
How many cinemas can a film be shown at? How many films can a cinema show?
Does a cinema have to show a film in order to be on our database as a cinema?Does a film have to be shown at a cinema in order to be on our database?
![Page 9: Database design concepts info1408 Lecture 8 Worked example of E:R Modelling.](https://reader035.fdocuments.in/reader035/viewer/2022062714/56649d4b5503460f94a2959e/html5/thumbnails/9.jpg)
How many cinemas can a film be shown at? Many How many films can a cinema show? ManySo the relationship is many to manyDoes a cinema have to show a film in order to be on our database as a cinema? No- optionalDoes a film have to be shown at a cinema in order to be on our database? Yes- mandatory
![Page 10: Database design concepts info1408 Lecture 8 Worked example of E:R Modelling.](https://reader035.fdocuments.in/reader035/viewer/2022062714/56649d4b5503460f94a2959e/html5/thumbnails/10.jpg)
![Page 11: Database design concepts info1408 Lecture 8 Worked example of E:R Modelling.](https://reader035.fdocuments.in/reader035/viewer/2022062714/56649d4b5503460f94a2959e/html5/thumbnails/11.jpg)
A film is shown several times over a week ( or more) and in several of the clubs cinemas. Each film can have several showings.
![Page 12: Database design concepts info1408 Lecture 8 Worked example of E:R Modelling.](https://reader035.fdocuments.in/reader035/viewer/2022062714/56649d4b5503460f94a2959e/html5/thumbnails/12.jpg)
Showing and filmRelationship name-screens
A showing shows how many films?A film can have how many a showings?
A film must have a showing to be on database?A showing must have a film to show to be on the database?
![Page 13: Database design concepts info1408 Lecture 8 Worked example of E:R Modelling.](https://reader035.fdocuments.in/reader035/viewer/2022062714/56649d4b5503460f94a2959e/html5/thumbnails/13.jpg)
A showing shows how many films? 1A film can have how many a showings?Many
A film must have a showing to be on database? Yes-mandatoryA showing must have a film to show to be on the database? Yes -Mandatory
![Page 14: Database design concepts info1408 Lecture 8 Worked example of E:R Modelling.](https://reader035.fdocuments.in/reader035/viewer/2022062714/56649d4b5503460f94a2959e/html5/thumbnails/14.jpg)
![Page 15: Database design concepts info1408 Lecture 8 Worked example of E:R Modelling.](https://reader035.fdocuments.in/reader035/viewer/2022062714/56649d4b5503460f94a2959e/html5/thumbnails/15.jpg)
Add to existing diagram
![Page 16: Database design concepts info1408 Lecture 8 Worked example of E:R Modelling.](https://reader035.fdocuments.in/reader035/viewer/2022062714/56649d4b5503460f94a2959e/html5/thumbnails/16.jpg)
Members book tickets for a particular showing
How many bookings can a member make for a showing?A Showing has bookings made by how many members?
A showing must have a booking ?A member must have made a booking?
![Page 17: Database design concepts info1408 Lecture 8 Worked example of E:R Modelling.](https://reader035.fdocuments.in/reader035/viewer/2022062714/56649d4b5503460f94a2959e/html5/thumbnails/17.jpg)
How many bookings can a member make for a showing? manyA Showing has bookings made by how many members? many
A showing must have a booking ? No- OptionalA member must have made a booking? No -optional
![Page 18: Database design concepts info1408 Lecture 8 Worked example of E:R Modelling.](https://reader035.fdocuments.in/reader035/viewer/2022062714/56649d4b5503460f94a2959e/html5/thumbnails/18.jpg)
Add to diagram
![Page 19: Database design concepts info1408 Lecture 8 Worked example of E:R Modelling.](https://reader035.fdocuments.in/reader035/viewer/2022062714/56649d4b5503460f94a2959e/html5/thumbnails/19.jpg)
Summary
The many to many relationships are not appropriate to the final design- we will look at what to do with them next week.We have taken entities and identified the relationships between the entities.Relationships have been described and recorded using the prescribed notation.
![Page 20: Database design concepts info1408 Lecture 8 Worked example of E:R Modelling.](https://reader035.fdocuments.in/reader035/viewer/2022062714/56649d4b5503460f94a2959e/html5/thumbnails/20.jpg)
References
Data Analysis for database Design By D R Howe