Conceptual Modeling with ER Diagrams Peter Chen introduced ER Diagrams.

Slides:



Advertisements
Similar presentations
More Diagramming & Practice with Relationship Modeling
Advertisements

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.
BUSINESS DRIVEN TECHNOLOGY Plug-In T4 Designing Database Applications.
Chapter 31 Chapter 3 Data Modeling Using the Entity-Relationship Model.
Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Systems Development Life Cycle
Chapter 4 Conceptual Modeling of Databases with Entity-Relationship Diagrams and the Unified Modeling Language.
Mapping an ERD to a Relational Database To map an ERD to a relational database, five rules are defined to govern how tables are constructed. 1)Rule for.
Conceptual Models Agenda - Steps in the design of a DB - Need for conceptual models - The Entity-Relationship Model (ER-Model)
Modeling Data The Entity Relationship Model (ER) For Database Design.
Entity-Relationship Model and Diagrams (continued)
Data Modeling Yong Choi School of Business CSUB. Part # 2 2 Database Collection of data in electronic format – A digital library of organization Managed.
Copyright © 2007 Ramez Elmasr and Shamkant B. Navathei Week 3 Outline Overview of Database Design Process Example Database Application (COMPANY) ER Model.
Entity-Relationship Modelling Introduced by Chen in 1976 The ER Model is used to construct the conceptual data model – independent of DBMS Most widely.
Sunday, June 28, Entity-Relationship and Enhanced Entity-Relationship Conceptual Data Models (Chapters 6 & Section 7.1)
Slides adapted from A. Silberschatz et al. Database System Concepts, 5th Ed. Entity-Relationship Model Database Management Systems I Alex Coman, Winter.
The (min,max) notation (1,1) (0,1) (1,N) (1,1). SUMMARY OF ER-DIAGRAM NOTATION FOR ER SCHEMAS Meaning ENTITY TYPE WEAK ENTITY TYPE RELATIONSHIP TYPE IDENTIFYING.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Reduction of an E-R Schema to Tables A database which conforms to an E-R diagram can be represented.
APPENDIX C DESIGNING DATABASES
Mapping ERM to relational database
Data Modeling Using the Entity-Relationship Model
Data Modeling Using the Entity-Relationship Model
© 2007 by Prentice Hall (Hoffer, Prescott & McFadden) 1 Entity Relationship Diagrams (ERDs)
1 © Prentice Hall, 2002 CMIS564: E/R Modeling Dr. Bordoloi Based on Chapter 3; Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott,
Chapter 3 Data Modeling Using the Entity-Relationship (ER) Model.
1. 2 Data Modeling 3 Process of creating a logical representation of the structure of the database The most important task in database development E-R.
Instructor :Huda Al-Omair
Conceptual Modeling with ER Diagrams Peter Chen introduced ER Diagrams.
Principles of Database Systems With Internet and Java Applications Today’s Topic Chapter 2: Representing Information with Data Models The lecture notes.
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
IS 325 Notes for Wednesday September 4, Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments.
Data Modeling Using the Entity-Relationship
ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.
SQL Structured Query Language Programming Course.
Copyright 2008 McGraw-Hill Ryerson 1 TECHNOLOGY PLUG-IN T5 DESIGNING DATABASE APPLICATIONS.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T5: Designing Database Applications Business Driven Technology.
EXAMPLE. Subclasses and Superclasses Entity type may have sub-grouping that need to be represented explicitly. –Example: Employee may grouped into.
MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj ER Model Lecture 4 Mapping an ER model to tables © Akhilesh Bajaj,
IS 230Lecture 4Slide 1 Entity Relationship to Relational Model Mapping Lecture 5.
Initial Design of Entity Types for the COMPANY Database Schema Based on the requirements, we can identify four initial entity types in the COMPANY database:
Chapter 7 Data Modeling with Entity Relationship Diagrams
CS 405G: Introduction to Database Systems Lecture 2 : Database Design I.
Chapter 2 : Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping Constraints Keys E-R Diagram Extended E-R Features Design of.
3 & 4 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Keys Consists of one or more attributes that determine other.
Database Management Systems MIT Lesson 02 – Database Design (Entity Relationship Diagram) By S. Sabraz Nawaz.
UNIT_2 1 DATABASE MANAGEMENT SYSTEM[DBMS] [Unit: 2] Prepared By Lavlesh Pandit SPCE MCA, Visnagar.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan Lecture-03 Introduction –Data Models Lectured by, Jesmin Akhter.
Database Design – Lecture 6 Moving to a Logical Model.
Database Systems – ER Diagrams EXAMPLE COMPANY DATABASE Requirements of the Company (oversimplified to illustrate) The company is organized into DEPARTMENTs.
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 3 Data Modeling Using Entity-Relationship Model.
1 ER Modeling BUAD/American University Mapping ER modeling to Relationships.
The Entity-Relationship Model, P. I R. Nakatsu. Data Modeling A data model is the relatively simple representation, usually graphic, of the structure.
Chapter 3: Modeling Data in the Organization. Business Rules Statements that define or constrain some aspect of the business Assert business structure.
EntityRelationshipDiagrams. Entity Relationship Models The E-R (entity-relationship) data model views the real world as a set of basic objects (entities)
CSE 412/598 DATABASE MANAGEMENT COURSE NOTES 3. ENTITY-RELATIONSHIP CONCEPTUAL MODELING Department of Computer Science & Engineering Arizona State University.
1 Information System Analysis Topic-3. 2 Entity Relationship Diagram \ Definition An entity-relationship (ER) diagram is a specialized graphic that illustrates.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Mapping Constraints Keys.
Copyright © 2016 Pearson Education, Inc. Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki Topi CHAPTER 2: MODELING DATA.
Data Modeling AND ER MODELS.
MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj ER Model Lecture 3 © Akhilesh Bajaj, 2000, 2002, All Rights.
Chapter 7 Data Modeling Using the Entity-Relationship (ER) Model
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
ER model Ashima Wadhwa.
E-R Diagram (Cont.) Draw ER Diagram for the following scenario:
Entity-Relationship Model
ER MODEL Lecture 3.
Entity-Relationship Model and Diagrams (continued)
Session 2 Welcome: The seventh learning sequence
ERD (Entity Relationship Diagrams)
Entity Relation Model Tingting Zhang.
Presentation transcript:

Conceptual Modeling with ER Diagrams Peter Chen introduced ER Diagrams

E-R Modeling E-R Modeling is a design methodology for modeling the –Entities –Relationships using a diagram with specified shapes for entities, relationships, roles of entities in these relationships, and cardinality.

E-R Diagram Conventions Symbol Meaning Entity Type Weak Entity Type Relationship Identifying Relationship Attribute

ER-Diagram Conventions - CONTINUED Symbol Meaning Key Attribute Multivalued Attribute Composite Attribute

Entities, Relationships and Attributes Employee A entity is a object or event which needs to be tracked. Attributes characterize entity sets and relationships. Relationships relate two entity sets EmployeeProject Assigned Name Date SSNum Name

Payroll Application A contractor does custom work (projects). He keeps track of employee time for each project. Besides materials, the customer is charged by invoice for employee time on his job. To keep track of employee time, the employee submits a time sheet with entries of project number, hours, description. These are entered into the system along with the employee ID. The hourly rate for the employee is used for each entry to generate a labor charge. The labor charges are totaled for each project and used as a basis for the customer invoice.

Understanding the Requirements Management End Users Analysts Conference Management – know high level business rules End users – have used paper system or previous software system and have expectations Analysts – have understanding of what can / cannot be done and must requirements into system

ER Diagrams for Payroll Step 1. Identify the Entity Sets with Attributes Customers : Name, Address,Phone,CustID Projects : Name,Description,ProjID,Total,CustID Employees : Name,SSNo,PayRate,EmpID LaborCharges : EmpID,ProjID,Description,Hours,Amount

ER Diagrams for Payroll Step 1. Identify Relationships between Entity Sets with any Attributes Customers Has Project … Project is Weak Entity Set Employee Works_On Project Employee Has_Labor_Charge For Project … Labor_Charge is Weak Entity Set

E-R Modeling – Entity Sets, Attributes, Relationships Racquet Club Example A Racquet Club has members with one year or two year contracts. Members pay contract amount up front, quarterly, or monthly. Members may reserve a court for the next day.

E-R Modeling – Entity Sets, Attributes, Relationships Racquet Club Example Continued Entity Sets –Members : Name, Start, Contract_Amount, Contract_Period, Initial_Balance, Member_ID –Payments : PayerID, Amount, Paid_Date, Payment_ID –Reservations : Member_ID, CourtNumber, Hour Relations : –Member - Makes – Payment –Member - Makes - Reservation

Data Modeling – Racquet Club Example

Keys, Cardinality Constraints and Participation Constraints A key of a relation is a minimal set of attributes and roles which uniquely determine each entity. A cardinality constraint m..n constrains the number of times a single entity can participate in a role of a relationship : m <= times <= n. A participation constraint ensures that an entity will particpate at least this many times.

ER-Diagram Cardinality Conventions Symbol Meaning Calculated Attribute Cardinality Constraints and Participation Constraints 0.. * * 1.. 1

Cardinality and Participation in the E-R model means that at least 1 d must participate in the A relation with C and that not more that 2 d’s can participate. If A is represented by a table, then there is at least one row and not more than 2 rows with a single c value.

Many-to-one, one-to-one, and many-to-many correspondences

Cardinality & Participation Constraints Library Circulation Motel/Hotel Video Store Employment Company

Cardinality & Participation Constraints Library Circulation Book is_checked_out to Patron Motel/HotelCustomer rents a room Video StoreCustomer rents a video Employment Company Applicant is hired for a job

Example of an E-R diagram with an ISA hierarchy.

Using IsA for data partitioning. New York CustomerPennsylvania Customer

Participation Constraints A participation constraint is a lower bound on the number of times an entity can particpate in a relation. Examples: An employee belongs to ONE department. This is a participation and a cardinality constraint EmployeeDepartment 0.. * * 1.. 1

Participation constraints.

Relationship Types – Two Entity Set Relations A customer will pay for at least one project Project Assigned To Employee Num-Hours Project Will Pay For Fixed-Cost Customer An employee is assigned to at least one project (participation)

Relationship Types – One & Three Entity Set Relations One Set : ReportsTo( SupID, SubID ) Three Sets : Sale( ProdID, CustID,SuppID;Date) Employee Reports_To subordinate supervisor Customer Product Supplier Sold Date Price

ER Diagrams for Payroll Customer Name Address Phone CustID Projects Name Description Total CustID ProjID Has

ER Diagrams for Payroll Employee Name SSNo PayRate EmpID TimeSheet Year Month EmpID TSID Has PayCheck Has Labor Charges Has TSID... NetPay TSID... Amount

The IS-A Relationship Employee Is-A Salaried Employee Hourly Employee disjoint Name SSNo Salary PayRate

Construct an ER Diagram Lawn Furniture Manufacturer Stores Information for Catalog of products and parts Stores Information for Manufacturing, including quantity on hand Identify product entities (picnic table and lawn chair) with attributes Identify relationships IsA and PartOf

The Part-Of Relationship Picnic_Table Lawn_Chair ProdNo Part_Of OutDoorProducts IsA TopBase Seats Quantity ProdNo Price

From E-R Diagrams to Relational Database Schema Converting entities into relations (tables) –Each entity becomes a relation –Each attribute of the entity becomes an attribute of that relation (column) –If attributes K 1... K n form a key of the entity, then K 1... K n form a candidate key of the relation.

From ER Diagrams to Relational Database Schema Translating Entities Employee Name SSNo Type HireDate Termination Create Table Employee ( Name char(20), Type char(1), HireDate date, Termination date, SSNo char(9), Primary Key (SSNo) )

From E-R Diagrams to Relational Database Schema Representing relationships in the database schema –R is a relationship between entity set A and weak entity set B A becomes a relation with primary key K and B+K becomes a relation with K being a foreign key – e.g. employees and dependents –R is a relationship between entity sets A,B and C A,B and C become relations with K A, K B, and K c as keys. R becomes a relation with foreign keys K A, K B, and K c

From ER Diagrams to Relational Database Schema Translating Relationships Customer Product Supplier Sold SaleDate Price Create Table Sold ( SaleDate Date, Price Currency, SaleID autonumber, Customer Integer, Supplier Integer, Product Integer, Primary Key (SaleID), Foreign Key ( Customer ) References Customers( CustID), Foreign Key ( Supplier ) References Suppliers( SuppID ), Foreign Key ( Product ) References Products ProdID ) ) SaleID

Translate into Schema Employee Is-A Salaried Employee Hourly Employee disjoint Name SSNo Salary PayRate

Translate Into Schema Picnic_Table Lawn_Chair ProdNo Part_Of OutDoorProducts IsA TopBase Seats Quantity ProdNo Price