240 likes | 351 Views
Database Design Concepts IMAT1408. Lecture 4 Worked Example of ER Modelling. We will use another simple scenario and identify: The entities The relationships between the entities The multiplicity of each relationship We will see that ER modelling is an iterative process. Objectives.
E N D
Database Design ConceptsIMAT1408 Lecture 4 Worked Example of ER Modelling
We will use another simple scenario and identify: The entities The relationships between the entities The multiplicity of each relationship We will see that ER modelling is an iterative process. Objectives
You would use the results of your fact finding to identify the entities (as we discussed last week) In this case we will use a scenario Identify the entities from the scenario on the next slide………. To create an ER Model
A small cinema club runs a number of cinemas throughout the region. The cinemas show films. A film is shown several times over a week or more in a series of showings. Members book for a particular showing. Identify the entities. The Scenario
A small cinema club runs a number of cinemasthroughout the region. The cinemas show films. A film is shown several times over a week or more in a series of showings.Members book for a particular showing.
A small cinema club runs a number of cinemas throughout the region. The cinemasshowfilms A filmis shown several times over a week or more ina series of showings Membersbook for a particular showing. Refer back to the scenario and identify relationships
cinemasshowfilms. You could draw that like this: Cinema Film A possible relationship shows
filmis shown…in…showings. Film Showing Showing Film Another possible relationship screens OR…… screened is at
Cinema Film Showing Always draw a joined-up diagram(draw each entity once) shows screened is at
Membersbook for a……showing Cinema Member Film Showing Now add this relationship shows screened is at books for
We have used the verbs in the scenario to get us started We may find later that these are not the best relationships to put in our diagram ER modelling is iterative: sometimes we draw many versions before we are satisfied Carry on for now……….. This is a first attempt – expect changes later!
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? Identify the multiplicity of each relationship: cinema-shows-film
How many cinemas can a film be shown at? Many How many films can a cinema show? Many So the relationship is many to many Does a cinema have to show a film in order to be on our database as a cinema? Let’s say“No”, it’s non-obligatory (We are making an assumption here) Does a film have to be shown at a cinema in order to be on our database? Let’s say“Yes”, it’s obligatory
Cinema Member Film Showing shows M M screened is at books for
A showing screens how many films? A film can have how many showings? Must a film have a showing to be on the database? Must a showing have a film to be on the database? Identify the multiplicity of each relationship: is-screened-at
A showing screens how many films? 1 A film can have how many showings? Many Must a film have a showing to be on the database? Yes - obligatory Must a showing have a film to be on the database? Yes – obligatory.
Cinema Member Film Showing shows M M 1 screened is at M books for
How many showings can a member book for? How many members can book for a showing? Must every showing have a member booked for it? Must every member have booked for a showing? Identify the multiplicity of each relationship: books-for
How many showings can a member book for?Many How many members can book for a showing? Many Must every showing have a member booked for it? No, non-obligatory Must every member have booked for a showing? No, non-obligatory.
Cinema Member Film Showing shows M M 1 screened is at M books for M M
We will see in week 6 that this is only a first attempt at a system design for the cinema club There are problems with this diagram and we can do better Don’t forget that ER modelling is an iterative process………… We have not finished!
We have: Identified entities and relationships between the entities Drawn an ER diagram to show the entities and relationships Recorded the multiplicity of each relationship Used the Chen notation which is standard on this module. Summary
Data Analysis for Database Design By D R Howe Reference