Entity Relationship Diagram (ERD). Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship.

Slides:



Advertisements
Similar presentations
Entity-Relationship (ER) Modeling
Advertisements

Information System Analysis Lab 7. ERD entity-relationship diagram is a data modeling technique that creates a graphical representation of the entities,
Copyright © 2015 Pearson Education, Inc. Database Design Chapters 17 and
Systems Development Life Cycle
1 © Prentice Hall, 2002 Chapter 3: Modeling Data in the Organization Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
Database Design & Mapping
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Database Design Chapter 2. Goal of all Information Systems  To add value –Reduce costs –Increase sales or revenue –Provide a competitive advantage.
CHAPTER 2: MODELING DATA IN THE ORGANIZATION © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition Jeffrey.
Database Systems: Design, Implementation, and Management Tenth Edition
Entity-Relationship Design
Trisha Cummings.  Most people involved in application development follow some kind of methodology.  A methodology is a prescribed set of processes through.
Entity-Relationship Modeling I The cautious seldom err. Confucius.
© 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,
1 © Prentice Hall, 2002 Chapter 3: Modeling Data in the Organization Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
IT 244 Database Management System Data Modeling 1 Ref: A First Course in Database System Jeffrey D Ullman & Jennifer Widom.
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
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)
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
Entity Relationship Diagram (ERD) 22 February 2011.
Data Modelling – ERD Entity Relationship Diagram’s Entity Relationship Diagrams and how to create them. 1.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
IS 325 Notes for Wednesday September 4, Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments.
Principles of Database Design, Part II AIMS 2710 R. Nakatsu.
Database Processing: Fundamentals, Design and Implementation, 9/e by David M. KroenkeChapter 2/1 Copyright © 2004 Please……. No Food Or Drink in the class.
DATABASEMODELSDATABASEMODELS  A database model ◦ defines the logical design of data. ◦ Describes the relationships between different parts of data.
Chapter 2 Data Models Database Systems: Design, Implementation, and Management, Rob and Coronel Adapted for INFS-3200.
Database Design Principles – Lecture 3
1 Relational Databases and SQL. Learning Objectives Understand techniques to model complex accounting phenomena in an E-R diagram Develop E-R diagrams.
Chapter 4 Entity Relationship (ER) Modeling.  ER model forms the basis of an ER diagram  ERD represents conceptual database as viewed by end user 
Database Systems. Entity Relationship Diagram How to Develop an ERD? Typically you will start with a case study or perhaps a logical model of the system.
1 Entity-Relationship Diagram. 2 Components of ERD: –Entity –Relationship –Cardinality –Attributes.
C-1 Management Information Systems for the Information Age Copyright 2004 The McGraw-Hill Companies, Inc. All rights reserved Extended Learning Module.
Lecture 4 Conceptual Data Modeling. Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship,
DeSiamorePowered by DeSiaMore1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Description and exemplification of entity-relationship modelling.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 4 Entity Relationship (ER) Modeling.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management
Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design.
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.
Dr. Chaitali Basu Mukherji
DBMS ER model-2 Week 6-7.
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.
2 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Data Models Why data models are important About the basic data-modeling.
1 Information System Analysis Topic-3. 2 Entity Relationship Diagram \ Definition An entity-relationship (ER) diagram is a specialized graphic that illustrates.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 3: Modeling Data in the Organization Modern Database Management 9 th Edition Jeffrey.
Department of Mathematics Computer and Information Science1 CS 351: Database Management Systems Christopher I. G. Lanclos Chapter 4.
ENTITY RELATIONSHIP DIAGRAM. Objectives Define terms related to entity relationship modeling, including entity, entity instances, attribute, relationship.
Rationale Databases are an integral part of an organization. Aspiring Database Developers should be able to efficiently design and implement databases.
Data Modeling Using the Entity- Relationship (ER) Model
Data Modeling Using the ERD
Entity-Relationship Model
Tables and Their Characteristics
CS 174: Server-Side Web Programming February 12 Class Meeting
ERD’s REVIEW DBS201.
Database Design Chapters 17 and 18.
Database Modeling using Entity Relationship Model (E-R Model)
Entity-Relationship Diagram (ERD)
IT 244 Database Management System
E.R. Examples.
Entity Relation Model Tingting Zhang.
Presentation transcript:

Entity Relationship Diagram (ERD)

Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship and cardinality, and primary key. Describe the entity modeling process. Discuss how to draw an entity relationship diagram. Describe how to recognize entities, attributes, relationships, and cardinalities.

Database Model A database can be modeled as: –a collection of entities, –relationship among entities. Database systems are often modeled using an Entity Relationship (ER) diagram as the "blueprint" from which the actual data is stored — the output of the design phase.

Entity Relationship Diagram (ERD) ER model allows us to sketch database designs ERD is a graphical tool for modeling data. ERD is widely used in database design ERD is a graphical representation of the logical structure of a database ERD is a model that identifies the concepts or entities that exist in a system and the relationships between those entities

Purposes of ERD An ERD serves several purposes The database analyst/designer gains a better understanding of the information to be contained in the database through the process of constructing the ERD. The ERD serves as a documentation tool. Finally, the ERD is used to communicate the logical structure of the database to users. In particular, the ERD effectively communicates the logic of the database to users.

Components of an ERD An ERD typically consists of four different graphical components: 1. Entity 2. Relationship 3. Cardinality 4. Attribute

Classification of Relationship Optional Relationship –An Employee may or may not be assigned to a Department –A Patient may or may not be assigned to a Bed Mandatory Relationship –Every Course must be taught by at least one Teacher –Every mother have at least a Child

Cardinality Constraints  Express the number of entities to which another entity can be associated via a relationship set. Cardinality Constraints - the number of instances of one entity that can or must be associated with each instance of another entity. Minimum Cardinality –If zero, then optional –If one or more, then mandatory Maximum Cardinality –The maximum number

Cardinality Constraints (Contd.) For a binary relationship set the mapping cardinality must be one of the following types: –One to one A Manager Head one Department and vice versa –One to many ( or many to one) An Employee Works in one Department or One Department has many Employees –Many to many A Teacher Teaches many Students and A student is taught by many Teachers

Cardinality Constraints (Contd.)

Cardinality Constraints Example In our model, we wish to indicate that each school may enroll many students, or may not enroll any students at all. We also wish to indicate that each student attends exactly one school. The following diagram indicates this optionality and cardinality:

Cardinality Constraints Example (Contd.)

General Steps to create an ERD Identify the entity Identify the entity's attributes Identify the Primary Keys Identify the relation between entities Identify the Cardinality constraint Draw the ERD Check the ERD

Steps in building an ERD

Developing an ERD The process has ten steps: 1. Identify Entities 2. Find Relationships 3. Draw Rough ERD 4. Fill in Cardinality 5. Define Primary Keys 6. Draw Key-Based ERD 7. Identify Attributes 8. Map Attributes 9. Draw fully attributed ERD 10. Check Results

A Simple Example A company has several departments. Each department has a supervisor and at least one employee. Employees must be assigned to at least one, but possibly more departments. At least one employee is assigned to a project, but an employee may be on vacation and not assigned to any projects. The important data fields are the names of the departments, projects, supervisors and employees, as well as the supervisor and employee number and a unique project number.

Identify entities One approach to this is to work through the information and highlight those words which you think correspond to entities. A company has several departments. Each department has a supervisor and at least one employee. Employees must be assigned to at least one, but possibly more departments. At least one employee is assigned to a project, but an employee may be on vacation and not assigned to any projects. The important data fields are the names of the departments, projects, supervisors and employees, as well as the supervisor and employee number and a unique project number. A true entity should have more than one instance

Find Relationships Aim is to identify the associations, the connections between pairs of entities. A simple approach to do this is using a relationship matrix (table) that has rows and columns for each of the identified entities.

Find Relationships (Contd.) Go through each cell and decide whether or not there is an association. For example, the first cell on the second row is used to indicate if there is a relationship between the entity "Employee" and the entity "Department".

Identified Relationships Names placed in the cells are meant to capture/describe the relationships. So you can use them like this A Department is assigned an employee A Department is run by a supervisor An employee belongs to a department An employee works on a project A supervisor runs a department A project uses an employee

Draw Rough ERD Draw a diagram and: Place all the entities in rectangles Use diamonds and lines to represent the relationships between entities. General Examples

Drawing Rough ERD (Contd.)

Fill in Cardinality Supervisor –Each department has one supervisor. Department –Each supervisor has one department. –Each employee can belong to one or more departments Employee –Each department must have one or more employees –Each project must have one or more employees Project –Each employee can have 0 or more projects.

Fill in Cardinality (Contd.) The cardinality of a relationship can only have the following values –One and only one –One or more –Zero or more –Zero or one

Cardinality Notation

Cardinality Examples

ERD with cardinality

Examples

ERD for Course Enrollment

ERD for Course Registration

Rough ERD Plus Primary Keys

Identify Attributes In this step we try to identify and name all the attributes essential to the system we are studying without trying to match them to particular entities. The best way to do this is to study the forms, files and reports currently kept by the users of the system and circle each data item on the paper copy. Cross out those which will not be transferred to the new system, extraneous items such as signatures, and constant information which is the same for all instances of the form (e.g. your company name and address). The remaining circled items should represent the attributes you need. You should always verify these with your system users. (Sometimes forms or reports are out of date.) The only attributes indicated are the names of the departments, projects, supervisors and employees, as well as the supervisor and employee NUMBER and a unique project number.

Map Attributes For each attribute we need to match it with exactly one entity. Often it seems like an attribute should go with more than one entity (e.g. Name). In this case you need to add a modifier to the attribute name to make it unique (e.g. Customer Name, Employee Name, etc.) or determine which entity an attribute "best' describes. If you have attributes left over without corresponding entities, you may have missed an entity and its corresponding relationships. Identify these missed entities and add them to the relationship matrix now.

Map Attributes (Contd.)

Draw Fully Attributed ERD

Check ERD Results Look at your diagram from the point of view of a system owner or user. Is everything clear? Check through the Cardinality pairs. Also, look over the list of attributes associated with each entity to see if anything has been omitted.

Questions Feel Free to ask any Questions ?