ER Models ISSUES and Examples CS263 Lecture 9

Slides:



Advertisements
Similar presentations
Banking Business Scenario
Advertisements

ER Model For a college DB
Chapter 2.2 V3.0 Napier University Dr Gordon Russell
Exercise 1 Consider the ER diagram below. Assume that an employee may work in up to two departments or may not be assigned to any department. Assume that.
DB Review Session. ER Diagrams 1 Where does the salary attribute belong? Actor id name address birthday Acted In Movie title type year salary.
E NTITY R ELATIONSHIP D IAGRAMS Joe Meehean 1. E NTITY R ELATIONSHIP M ODEL Entity type an object (noun) e.g., student attributes (e.g., last name) Relationship.
Entity-Relationship Models
Database Design (Data Modeling) DCO11310 Database Systems and Design By Rose Chang.
Lecture Eleven Entity-Relationship Modelling
Data modelling uses two main techniques Entity relationship (E-R) modelling: a top- down approach Normalisation: a bottom-up approach.
1 Data Modelling Which data to include in the database.
Case study Lisa’s Bookstore IST210.
Electronic Library Management System (ELiMS). Content Overview on ELiMS Key Fact on National Library Board Entities, Key Attributes Entities – Relationship.
Entity Relationship Model Chapter 6. Basic Elements of E-R Model Entity Object of the real world that stores data. Eg. Customer, State, Project, Supplier,
Ch5: ER Diagrams - Part 2 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
Advanced Entity Relationship Concepts. Advanced Concepts UIDs Intersection Entities Recursive Relationships Roles Subtypes Exclusivity Historical Fan.
CSE 441: Systems Analysis & Design
Practice of ER modeling
Instructor :Huda Al-Omair
Conceptual Design Lecture - 2 Database Development.
Data Modelling – ERD Entity Relationship Diagram’s Entity Relationship Diagrams and how to create them. 1.
Switch off your Mobiles Phones or Change Profile to Silent Mode.
Practice of ER modeling - Answer Yong Choi School of Business CSUB.
L4-S1 ER Diagrams 2003 SJSU -- CmpE Database Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of Engineering San José.
Dr Gordon Russell, Napier University Data Analysis 2 - V2.0 1 Data Analysis 2 Unit 2.2.
Database Design Principles – Lecture 3
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
1. Objectives At the end of this chapter you should be able to:  Discuss the use and features of a data model  Define the terms entity and attribute.
Database Design – Lecture 3 Conceptual Database Design.
Entity-Relationship (ER) Modelling ER modelling - Identify entities - Identify relationships - Construct ER diagram - Collect attributes for entities &
IT 21103/41103 System Analysis & Design. Chapter 04 Data Modeling.
An Entity Relationship (ER) Diagram is a graphic that shows the interrelationship between entities in a database.
Use Case Diagrams.
Data Flow Diagrams CP1 Computing.
Practice of ER modeling Yong Choi School of Business CSUB.
Introduction to Database Systems
Systems Analysis & Design
Chapter 8 Entity-Relationship Modeling Pearson Education © 2009.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 340 Introduction to Database Systems.
Free Delivery No Fines or Fees 60 Day Loans + 2 Renewals Up to 50 Items.
ENTITY RELATIONSHIP DIAGRAM. Objectives Define terms related to entity relationship modeling, including entity, entity instances, attribute, relationship.
Year 12 > 13 Applied GCE ICT Unit 7 Using Database Software.
ENTITY-RELATIONSHIP MODELLING. Objectives: How to use Entity–Relationship (ER) modelling in database design. Basic concepts associated with ER model.
1 OOA3 Stellman – Preface and Intro u Key Ideas? u Assumptions by Stellman/Greene 540/3 f07 OOA3 aug28.
Week 03 – ER Diagram INFOSYS 222.
Entity-Relationship Model
Chapter # 3 Data Modeling Using the Entity-Relationship (ER) Model
Conceptual Design & ERD Modelling
E-R Diagram (Cont.) Draw ER Diagram for the following scenario:
Database EER.
Start at 17th March 2012 end at 31th March 2012
ER MODEL Lecture 3.
Figure Specialization Hierarchy
Entity-Relationship Model and Diagrams (continued)
Order Database – ER Diagram
Practice of ER modeling
ERD Exercises.
Entity-Relationship Modeling
Entity – Relationship Model
Chapter Entity-Relationship Modeling & Enhanced Entity- Relationship Modeling.
LIS 384K.11 Database-Management Principles and Applications
Data Modeling for Database Design 2
Databases.
To view, Enable Editing, select Slide Show, select From Beginning
Chapter Entity-Relationship Modeling & Enhanced Entity- Relationship Modeling.
Database Design Dr. M.E. Fayad, Professor
Entity Relationship Model
Database Design More entity-relationship modelling
Data Analysis 2 Unit 2.2 Dr Gordon Russell, Napier University
Presentation transcript:

ER Models ISSUES and Examples CS263 Lecture 9

ER Issues - Fan Trap Where a model represents a relationship between entity types, but the pathway between certain entity occurrences is ambiguous. works for operates Staff Division Branch reports to has Q. At which branch does employee Fred Bloggs (001) work? Staff Division Branch 001 B03 D1 002 B02 D2 003 B04 A. Fred Bloggs (001) works at Branch B03, or is it B02?

ER Issues - Fan Trap Resolution We resolve the Fan Trap by restructuring the original ER model to represent the correct association between the entities concerned. operates has Division Branch Staff reports to work for Q. At which branch does employee Fred Bloggs (001) work? Staff 002 001 003 Division D1 D2 Branch B03 B02 B04 A. Fred Bloggs (001) works at Branch B02

Developing an ER Diagram Step 1 Identify Entities Step 2 Work out relationships Step 3 Identify Attributes Step 4 Identify optionality Step 5 Identify KEY attributes (Resolve any assumptions)

Example Problem 1 A college library holds books for its members to borrow. Each book may be written by more than one author. Any one author may have written several books. If no copies of a wanted book are currently in stock, a member may make a reservation for the title until it is available. If books are not returned on time a fine is imposed and if the fine is not paid the member is barred from loaning any other books until the fine is paid.

Example Problem 1 A college library holds books for its members to borrow. Each book may be written by more than one author. Any one author may have written several books. If no copies of a wanted book are currently in stock, a member may make a reservation for the title until it is available. If books are not returned on time a fine is imposed and if the fine is not paid the member is barred from loaning any other books until the fine is paid.

Example Problem 1 A college library holds books for its members to borrow. Each book may be written by more than one author. Any one author may have written several books. If no copies of a wanted book are currently in stock, a member may make a reservation for the title until it is available. If books are not returned on time a fine is imposed and if the fine is not paid the member is barred from loaning any other books until the fine is paid.

Example Problem 1 A college library holds books for its members to borrow. Each book may be written by more than one author. Any one author may have written several books. If no copies of a wanted book are currently in stock, a member may make a reservation for the title until it is available. If books are not returned on time a fine is imposed and if the fine is not paid the member is barred from loaning any other books until the fine is paid.

Example Problem 1 A college library holds books for its members to borrow. Each book may be written by more than one author. Any one author may have written several books. If no copies of a wanted book are currently in stock, a member may make a reservation for the title until it is available. If books are not returned on time a fine is imposed and if the fine is not paid the member is barred from loaning any other books until the fine is paid.

Example Problem 1 A college library holds books for its members to borrow. Each book may be written by more than one author. Any one author may have written several books. If no copies of a wanted book are currently in stock, a member may make a reservation for the title until it is available. If books are not returned on time a fine is imposed and if the fine is not paid the member is barred from loaning any other books until the fine is paid.

Example Problem 1 A college library holds books for its members to borrow. Each book may be written by more than one author. Any one author may have written several books. If no copies of a wanted book are currently in stock, a member may make a reservation for the title until it is available. If books are not returned on time a fine is imposed and if the fine is not paid the member is barred from loaning any other books until the fine is paid.

Example Problem 1 A college library holds books for its members to borrow. Each book may be written by more than one author. Any one author may have written several books. If no copies of a wanted book are currently in stock, a member may make a reservation for the title until it is available. If books are not returned on time a fine is imposed and if the fine is not paid the member is barred from loaning any other books until the fine is paid.

Example Problem 1 A college library holds books for its members to borrow. Each book may be written by more than one author. Any one author may have written several books. If no copies of a wanted book are currently in stock, a member may make a reservation for the title until it is available. If books are not returned on time a fine is imposed and if the fine is not paid the member is barred from loaning any other books until the fine is paid.

Example Problem 1 A college library holds books for its members to borrow. Each book may be written by more than one author. Any one author may have written several books. If no copies of a wanted book are currently in stock, a member may make a reservation for the title until it is available. If books are not returned on time a fine is imposed and if the fine is not paid the member is barred from loaning any other books until the fine is paid.

Example Problem 1 A college library holds books for its members to borrow. Each book may be written by more than one author. Any one author may have written several books. If no copies of a wanted book are currently in stock, a member may make a reservation for the title until it is available. If books are not returned on time a fine is imposed and if the fine is not paid the member is barred from loaning any other books until the fine is paid.

Example Problem 1 A college library holds books for its members to borrow. Each book may be written by more than one author. Any one author may have written several books. If no copies of a wanted book are currently in stock, a member may make a reservation for the title until it is available. If books are not returned on time a fine is imposed and if the fine is not paid the member is barred from loaning any other books until the fine is paid.

Example Problem 1 A college library holds books for its members to borrow. Each book may be written by more than one author. Any one author may have written several books. If no copies of a wanted book are currently in stock, a member may make a reservation for the title until it is available. If books are not returned on time a fine is imposed and if the fine is not paid the member is barred from loaning any other books until the fine is paid.

Member Book Author

Title Member Book Author

Title Member Book Author Serial Number. Condition. Date Purchased.

Title EACH Written by Writes Member Borrows Book Author On loan

Title Book Author RESERVES Member BARRED FINE Written by Writes Borrows Book Author On loan BARRED FINE

Title Book Author Fine Member Written Reserves by Reserved By Writes Borrows Book Author On loan MUST MAY Fine

Title Book Author Fine ER Diagram One Member Written Reserves by Reserved By Has Has Writes Member Borrows Book Author On loan Has For Results in Imposed on Fine

ER Diagram Two Title T_A Reserve Member Book Author M_B Fine

Title Author Book Fine Identify Keys T_A Member M_B T# A# M# B# F# Reserve Member M# A# Book Author B# M_B F# Fine

Title Author Book Fine Foreign Keys ER Diagram Two T_A Member T# A# M# Reserve M#,T# Member M# A# Book Author M#,B# B# Borrow T# F# Fine M#,B#

Example Problem 2 A global enterprise has three companies, and each company has between two and six departments. Each department employs one or more employees (although certain company employees may not currently be attached to a department), who, as well as possibly having a number of dependants, may well have an associated set of employment history notes. State any assumptions you make.

Company Department Employee Employment Note Dependent Belongs to Operates Department Employee Employment Note Employs Has Works for Belongs to Belongs to Has Dependent

Example Problem 3 A local authority wishes to keep a database of all its schools and the school children that are attending each school. The system should also be able to record teachers available to be employed at a school and be able to show which teachers teach which children. Each school has one head teacher who’s responsibility it is to manage their individual school, this should also be modelled. State any assumptions you make.

School Teacher Child Employed by Employs Attended by Attends Managed by Manages Teacher Child Teaches Taught by