CSE2DBF – CSE4DBF E-R Model Examples 06/03/2017

Slides:



Advertisements
Similar presentations
Banking Business Scenario
Advertisements

ER Modeling Case Studies
Chapter 6: Entity-Relationship Model (part I)
ER Modeling Case Studies
Announcements Reading for Friday Homework 2 - Due 9/24
Copyright © 2004 Pearson Education, Inc.. Chapter 4 Enhanced Entity- Relationship and UML Modeling.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
CSE 1561 Designing Relational Databases Stephen Scott.
ER Modeling Case Studies
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,
Data Modeling Using the Entity-Relationship Model
1 Advanced Computer Programming Databases. Overview What is a database? Database Basics Database Components Data Models Normalization Database Design.
CHAPTER 2. FUNDAMENTAL OF ENTITY RELATIONSHIP (ER)
Database. Basic Definitions Database: A collection of related data. Database Management System (DBMS): A software package/ system to facilitate the creation.
Module Title? Data Base Design 30/6/2007 Entity Relationship Diagrams (ERDs)
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Introduction to Database Systems Mapping ER Models to Relational Schemas Irvanizam Zamanhuri, M.Sc Informatics (Computer Science) Study Program Syiah Kuala.
Entity-Relationship (ER) Modelling ER modelling - Identify entities - Identify relationships - Construct ER diagram - Collect attributes for entities &
Chapter 1 1 Lecture # 1 & 2 Chapter # 1 Databases and Database Users Muhammad Emran Database Systems.
Lecture 4 Conceptual Data Modeling. Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship,
Entity – Relationship Model (E-R Model)
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
ERD ( Conceptual data model From the statement of data requirements a conceptual data model is produced. This describes.
ENTITY RELATIONSHIP MODELLING
EntityRelationshipDiagrams. Entity Relationship Models The E-R (entity-relationship) data model views the real world as a set of basic objects (entities)
Data Base Design Steps 1.Define Entity Classes (Relations/Tables) and Keys. 2.Define Relationships between Entity Classes. Normalization Steps Eliminate.
Entity-Relationship Data Model
Contents Design Process Modeling Constraints E-R Diagram Design Issues
Database Design Chapters 17 and 18.
Chapter 17 Property Management
Data Modeling Using the ERD
Let try to identify the conectivity of these entity relationship
Data Modeling and the Entity-Relationship Model
Assignements.
Entity- Relationship (ER) Model
Chapter # 3 Data Modeling Using the Entity-Relationship (ER) Model
COP Introduction to Database Structures
Entity-Relationship Model
Entity Relationship Model
Databases Chapter 16.
Entity-Relationship Model
Chapter -3- Data Modeling Using the Entity-Relationship Model
Chapter -3- Data Modeling Using the Entity-Relationship Model
Dept. of Computer & Information Sciences
CSCI-100 Introduction to Computing
ER MODEL Lecture 3.
ER Modeling Case Studies
Continuum of Care Program (CoC) Training Requirements Related to Housing Assistance Rent Reasonableness, Fair Market Rent (FMR) and Housing Quality Standards.
Data Modelling Introduction
Data Modeling with Entity Relationship Diagrams (Cont.)
Relational Database Design (Top Down)
CSE2DBF – CSE4DBF EER Example 14/03/2017
Database Modeling using Entity Relationship Model (E-R Model)
Review of Week 1 Database DBMS File systems vs. database systems
ER Modeling Case Studies
ER Modeling Case Studies
Relational Database Design Examples
Chapter 7: Entity-Relationship Model
Entity-Relationship Diagram (ERD)
IT 244 Database Management System
E.R. Examples.
Relational Database Design
Entity Relation Model Tingting Zhang.
Conceptual modeling of databases
Database Management system
Database Management system
Entity-Relationship Data Model
Relational Database Design Relational Database Design
Date: ____________________ Receipt #: _______________
Presentation transcript:

CSE2DBF – CSE4DBF E-R Model Examples 06/03/2017 Reading: Elmasri and Navathe, “Fundamentals of Database Systems, Chapters 3 & 5”, Pearson, 2017.

E-R Diagram Case (Real-Estate Agency) Properties are rented by tenants. Each tenant is assigned a unique number by the agency. Data held about each tenant includes family name, first name, contact address, phone number and property rented. A tenant may rent more than one property at any given time. Properties are owned by owners. Each property is assigned a unique building number. The agency only encourages a single owner for any of the properties it handles. The owner, address and value are recorded for each property. In addition, the lease period and bond, are recorded for each property rented. An owner may own several properties. Regular property maintenance is also recorded. The property, date, type of maintenance and cost are stored. Maintenance costs are charged to the property owner. Tenants pay accounts to the agency for each property they rent. These consists of date of payment, tenant, property, type of account (rental, Bond or damage) and the amount.

E-R Diagram Case (Real- Estate Agency) Owner# OwnerName OwnerAddress OWNER Maintenance# Date Type Cost 1 (1, N) own Building# Address Value N (1, 1) (1, 1) incur (0, N) MAINTENANCE PROPERTY 1 N LeasePeriod Bond (0, N) 1 N (0,N) for rent (1, 1) Tenant# FamilyName Address FirstName Phone# ACCOUNT N ACReceipt# DateofPayment TypeOfAccount AmountPaid N (1, 1) M (1, N) pay TENANT (1, N) 1

E-R Diagram Case (Car Factory) Extracted from a past test A car manufacturer makes many models of cars. Each model is made up from many parts and each part may be used in the manufacture of more than one model. Each model of car is produced at just one of the firm’s factories, which are located in London, Birmingham, Bristol, Wolverhampton and Manchester – one in each city. A factory produces many models of car and many types of part although each type of part is produced at one particular factory only. Which of the following ER diagrams correctly represents the above problem statement? (Note that for simplicity, participations have been omitted from the diagrams).  

E-R Diagram Case (Car Factory) Incorrect: we cannot get the FACTORY which produces the parts. Incorrect: FACTORY produces models and parts independently/separately, not a ternary relationship. Incorrect: there is only one car manufacturer – we do not need an entity for it, also factory does not connect to model. CORRECT

E-R Diagram Case (Food Plan Database) Extracted from a past exam A database on food plan is to be maintained that can store any number of plans. Each plan is given a unique food plan id. The plan-designer and plan-creation-date are stored for each food plan. Each plan may be made up of any number of servings, each of which is given a unique serving-name. A time-of-serving attribute is stored for each serving within a food plan. A serving-description is stored for each serving.   Each serving is made up of any amount of any number of food elements. For example, one particular serving may be made up of 10g of beef, 20g potatoes, 5g of tomatoes, and 3g of peas. A food-id is used for each element, and a field food-description is stored for each food element.

E-R Diagram Case (Food Plan Database) To allow the nutritional value of each diet to be computed, nutrient values are associated with each food element, as follows: A set of nutrients (eg. VitA, VitB, etc.) is stored with their unit-of measure (eg. IU [International Unit] for VitA, mg [milligrams] for VitB, etc.). A nutrient-id and a nutrient-description are also stored. The nutrient-content for each nutrient that applies to a particular food is stored for a standard-amount of that food. A patient is assigned a food plan on each day of his or her stay. Only one food plan applies to one patient on the one day, but patient may have different food plans on different days. A patient-id and patient-details are stored for each patient.   Develop an ER model for the above problem definition. The ER should contain necessary information such as entities, attributes, primary keys, relationships, cardinalities, and participation. Any assumptions should also be stated.

E-R Diagram Case (Food Plan Database) ServingName consists_of FOODPLAN M (1, N) (1, N) N SERVING ServDesc FPlanID Designer TimeOfServing M (1, N) M (1, N) CreationDate includes applies_to Amount Date N (1, N) N (1, N) PatientID PATIENT FOODELEMENT ElementID Name ElementDesc Address M (1, N) DOB contains StandardAmount N (0, N) NutritionContent NUTRIENT NutrientID NutrientDesc UnitMeasurement

Relational Database Design Next Lecture Relational Database Design Reading: Elmasri and Navathe, “Fundamentals of Database Systems, Chapter 9”, Pearson, 2017