1 / 24

Database Design Concepts IMAT1408

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.

Télécharger la présentation

Database Design Concepts IMAT1408

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Database Design ConceptsIMAT1408 Lecture 4 Worked Example of ER Modelling

  2. 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

  3. 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

  4. 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

  5. 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.

  6. Draw a Box for each Entity

  7. 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

  8. cinemasshowfilms. You could draw that like this: Cinema Film A possible relationship shows

  9. filmis shown…in…showings. Film Showing Showing Film Another possible relationship screens OR…… screened is at

  10. Cinema Film Showing Always draw a joined-up diagram(draw each entity once) shows screened is at

  11. Membersbook for a……showing Cinema Member Film Showing Now add this relationship shows screened is at books for

  12. 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!

  13. 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

  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. Cinema Member Film Showing shows M M screened is at books for

  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. 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. Cinema Member Film Showing shows M M 1 screened is at M books for

  19. 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

  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. Cinema Member Film Showing shows M M 1 screened is at M books for M M

  22. 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!

  23. 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

  24. Data Analysis for Database Design By D R Howe Reference

More Related