Presentation is loading. Please wait.

Presentation is loading. Please wait.

HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design.

Similar presentations


Presentation on theme: "HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design."— Presentation transcript:

1 HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design Concepts Database Design Concepts IMAT1408 Lecture 4 Worked Example of ER Modelling

2 HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design Concepts 2 Objectives 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.

3 HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design Concepts 3 To create an ER Model 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……….

4 HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design Concepts 4 The Scenario 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.

5 HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design Concepts 5 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.

6 HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design Concepts 6 Draw a Box for each Entity

7 HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design Concepts 7 Refer back to the scenario and identify relationships 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.

8 HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design Concepts 8 A possible relationship cinemas show films. You could draw that like this: shows Cinema Film

9 HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design Concepts 9 Another possible relationship film is shown … in … showings. Film screens Showing screened Film OR …… is at

10 HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design Concepts 10 Always draw a joined-up diagram (draw each entity once) Cinema Film screened Showing shows is at

11 HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design Concepts 11 Now add this relationship Members book for a ……showing Cinema Film screened Showing shows Member books for is at

12 HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design Concepts 12 This is a first attempt – expect changes later! 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………..

13 HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design Concepts 13 Identify the multiplicity of each relationship: cinema-shows-film 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?

14 HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design Concepts 14 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

15 HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design Concepts 15 M M Cinema Film screened Showing shows Member books for is at

16 HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design Concepts 16 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

17 HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design Concepts 17 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.

18 HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design Concepts 18 M M Cinema Film screened Showing shows Member books for is at M 1

19 HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design Concepts 19 Identify the multiplicity of each relationship: 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?

20 HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design Concepts 20 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.

21 HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design Concepts 21 M M Cinema Film screened Showing shows Member books for is at M 1 MM

22 HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design Concepts 22 We have not finished! 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…………

23 HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design Concepts 23 Summary 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.

24 HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design Concepts 24 Reference Data Analysis for Database Design By D R Howe


Download ppt "HNDComputing – DeMontfort University  DeMontfort University 2011 Entity Relationship Modelling (continued) wk4 Database Design ConceptsDatabase Design."

Similar presentations


Ads by Google