Database design concepts imat1408
Download
1 / 24

Database Design Concepts IMAT1408 - PowerPoint PPT Presentation


  • 96 Views
  • Uploaded on

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.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Database Design Concepts IMAT1408' - jean


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Database design concepts imat1408

Database Design ConceptsIMAT1408

Lecture 4

Worked Example of ER Modelling


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.

Objectives


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

To create an ER Model


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.

The Scenario


A small cinema club runs a number of 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.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.


Draw a box for each entity
Draw a Box for each Entity 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.


Refer back to the scenario and identify relationships

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


A possible relationship

cinemas region. The showfilms.

You could draw that like this:

Cinema

Film

A possible relationship

shows


Another possible relationship

film region. The is shown…in…showings.

Film

Showing

Showing

Film

Another possible relationship

screens

OR……

screened

is

at


Always draw a joined up diagram draw each entity once

Cinema region. The

Film

Showing

Always draw a joined-up diagram(draw each entity once)

shows

screened

is

at


Now add this relationship

Members region. The book for a……showing

Cinema

Member

Film

Showing

Now add this relationship

shows

screened

is

at

books

for


This is a first attempt expect changes later

We have used the verbs in the scenario to get us started region. The

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!


Identify the multiplicity of each relationship cinema shows film

How many region. The 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? region. The 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 region. The

Member

Film

Showing

shows

M

M

screened

is

at

books

for


A region. The 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? region. The 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 region. The

Member

Film

Showing

shows

M

M

1

screened

is

at

M

books

for


Identify the multiplicity of each relationship books for

How many region. The 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? region. The 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 region. The

Member

Film

Showing

shows

M

M

1

screened

is

at

M

books

for

M

M


We have not finished

We will see in week region. The 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!


Summary

We have: region. The

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


Reference

Data Analysis for Database Design region. The

By D R Howe

Reference


ad