Entity Relationship Diagram (ERD) 22 February 2011.

Slides:



Advertisements
Similar presentations
ER Modeling Case Studies
Advertisements

Entity-Relationship (ER) Modeling
BUSINESS DRIVEN TECHNOLOGY Plug-In T4 Designing Database Applications.
CSE 441: Systems Analysis & Design ERD – Detailed Study LAB 4 Yusuf Altunel.
ENTITY RELATIONSHIP MODELLING
Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Copyright © 2015 Pearson Education, Inc. Database Design Chapters 17 and
Systems Development Life Cycle
L ECTURE 11 – D ATA M ODELLING Data Dictionaries Entity Relationship Diagram for Data Modelling Steps to Construct Entity Relationship Diagrams Validation.
System Analysis - Data Modeling
Entity Relationship Diagrams Basic Elements and Rules.
Entity-Relationship Model and Diagrams (continued)
Chapter Five Data Modeling with the Entity-Relationship Model.
Information Resources Management January 30, 2001.
Lecture 3 :Database Analysis and Design (II)
Chapter Five Data Modeling with the Entity-Relationship Model.
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
Slide 1 Chapter 05 – Part 1 Data Modeling with the Entity-Relationship Model.
APPENDIX C DESIGNING DATABASES
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 10 Structuring.
Entity-Relationship Design
Data Modeling and the Entity-Relationship Model Chapter Four DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
DATA MODELING AND DATABASE DESIGN DATA MODELING AND DATABASE DESIGN Part 1.
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
Entity-Relationship Modeling I The cautious seldom err. Confucius.
Computer System Analysis Chapter 10 Structuring System Requirements: Conceptual Data Modeling Dr. Sana’a Wafa Al-Sayegh 1 st quadmaster University of Palestine.
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.
CSE 441: Systems Analysis & Design
Conceptual Design Lecture - 2 Database Development.
Copyright 2001 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter 6 Structuring.
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
Data Modelling – ERD Entity Relationship Diagram’s Entity Relationship Diagrams and how to create them. 1.
IS 325 Notes for Wednesday September 4, Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments.
Copyright 2006 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Third Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
Copyright (c) 2014 Pearson Education, Inc. Introduction to Databases.
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.
Data Modelling. ICT5 Introduction Historical development with most organisations Small-scale origins Individual computers bought for particular applications.
Database Design Principles – Lecture 3
Copyright 2008 McGraw-Hill Ryerson 1 TECHNOLOGY PLUG-IN T5 DESIGNING DATABASE APPLICATIONS.
1.  An introduction to data modelling  The purpose of data modelling  Modelling data relationships 2.
1 Entity-Relationship Diagram. 2 Components of ERD: –Entity –Relationship –Cardinality –Attributes.
Next Back A-1 Management Information Systems for the Information Age Second Canadian Edition Copyright 2004 The McGraw-Hill Companies, Inc. All rights.
C-1 Management Information Systems for the Information Age Copyright 2004 The McGraw-Hill Companies, Inc. All rights reserved Extended Learning Module.
1 IRU – database design part one Geoff Leese September 2009.
Lecture 4 Conceptual Data Modeling. Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship,
IFS310: Module 6 3/1/2007 Data Modeling and Entity-Relationship Diagrams.
Description and exemplification of entity-relationship modelling.
Database Design – Lecture 4 Conceptual Data Modeling.
INTRODUCTION TO DATABASE DESIGN. Definitions Database Models: Conceptual, Logical, Physical Conceptual: “big picture” overview of data and relationships.
Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design.
Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin APPENDIX C DESIGNING DATABASES APPENDIX C DESIGNING DATABASES.
The Entity-Relationship Model, P. I R. Nakatsu. Data Modeling A data model is the relatively simple representation, usually graphic, of the structure.
Lecture 91 Introduction to Data Analysis and Logic Specification Objectives l Draw an entity-relationship diagram, and explain the types of entity relationships.
Chapter 3: Modeling Data in the Organization. Business Rules Statements that define or constrain some aspect of the business Assert business structure.
DBMS ER model-2 Week 6-7.
Entity Relationship Diagram (ERD). Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship.
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.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 10 Structuring.
Data Modeling AND ER MODELS.
Data Modeling and Entity-Relationship Model I
Entity Relationship Diagram ERD. Background Peter Chen developed ERDs in Charles Bachman and James Martin have added some slight refinements to.
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.
© The McGraw-Hill Companies, All Rights Reserved APPENDIX C DESIGNING DATABASES APPENDIX C DESIGNING DATABASES.
Entity-Relationship Diagram (ERD)
Entity-Relationship Design
Presentation transcript:

Entity Relationship Diagram (ERD) 22 February 2011

An Introduction to designing a Database A database is a collection of data that is organized in such a manner that its contents can be readily accessed, managed and updated An Entity Relationship model (ERM) may be used to aid the development of a database – An ER model may be represented pictorially by ERDs 2

What is a Data Model? A detailed model that captures overall structure of organizational data while being independent of any implementation considerations 3

Rationale for using Data Modelling? Typically data modelling is carried out parallel with other requirements analysis and structuring steps during the systems analysis phase During this phase a data model is developed for the current system Following this, the data model supporting the scope and requirements of the proposed system is developed 4

ERD’s Entity Relationship Diagram is a form of data modelling Data modelling involves examining the data objects in a system and identifying the relationship between these objects 5

What is an Entity Relationship Diagram (ERD)? An ERD depicts data in terms of the entities and relationships described in an information system The primary purpose of an ERD is to document the logical structure of a database 6

7 Two Approaches to ERD’s The two most popular approaches to contructing entity relationship diagrams are: – SSADM – Chen ERD Visio provides stencils for constructing ERD’s using these apporaches

8 ERD Symbols SSADMChen Entity Attribute Relationship Department Staff No. employs Staff No Department 2 2 employs

9 An Entity An entity is a thing of interest to a system about which information is kept For example in a Hospital Administration System, some likely entities would include: Patient, Doctor, Operation, Ward Each of these things are of interest to the system and would have data stored about them

10 Choosing Entities Example – A sale always starts with a customer receiving an estimate.The estimate then becomes an order. An order can be for one or more stock items. Each stock item belongs to a certain stock category (e.g. taps, sinks, cupboards etc.)

11 An Attribute An attribute is an item of data held about an entity In computer systems an attribute is a field of information Example : Sales System – Entity : Customer – Attributes : Customer Name, Customer Address, Customer Phone Number

12 Attributes Continued.. A key attribute uniquely identifies a specific occurrence of an entity This may also be referred to as a primary key Examples of primary keys include: – ISBN – Student Number – Staff ID

13 For Example In a Sales System, customer name and address are attributes of the entity customer. The primary key is likely to be Customer Code or Customer ID as the unique identifier for each customer in the system.

14 Designing a System: – Data Flow Diagramming External entities, process, data stores Answers question: “How will the data be used?” – Entity-Relationship Diagramming (ERDs) Depict entities and their relationships amongst each other Answers question: “What data will be captured in the database, and how will the data relate to each other?”

15 Example : Babysitter Service The AITP Service Club wants to run a babysitting service. Customers call to request a sitter and the Club Coordinator assigns an employee to sit for the customer from a list of employees available for the particular day requested.

16 Babysitting System Data is used to: – Assign employee to job – Determine availability Data to be captured in database: – Employee data – Job data – Customer data

17 Entity-Relationship Model A logical representation of the data of an organization or business area in graphical form

18 ERD - Babysitter Service Employee Job Customer assigned toRelated to

19 Babysitting System – Employee Attributes: EmpID, Name, Address, Phone Number, Available Hours, JobNo – Job Attributes: JobNo, JobDate, JobTime, EmpID – Customer Attributes: CusNo, Name, Address, Phone Number, JobNo

21 Entity Instance An entity instance is a single occurrence of an entity type. An entity type is described just once in a data model while many instances of that data type may be represented by data stored in the system. – There is one EMPLOYEE entity type in most organisations but there may be hundred or thousands of instances of this entity type in the company.

22 Choosing Entities Example – A sale always starts with a customer receiving an estimate.The estimate then becomes an order. An order can be for one or more stock items. Each stock item belongs to a certain stock category (e.g. taps, sinks, cupboards etc.)

23 From the narrative we can deduce: – An Estimate becomes and Order – An Estimate is issued to a particular Customer – An Estimate refers to a Stock Item(s) – An Order is placed by the Customer – An Order refers to a Stock Item(s) – A Stock Item refers to a particular Stock Category

24 From the narrative we can deduce: – An Estimate becomes and Order – An Estimate is issued to a particular Customer – An Estimate refers to a Stock Item(s) – An Order is placed by the Customer – An Order refers to a Stock Item(s) – A Stock Item refers to a particular Stock Category

25 Order System: ERD Customer Order Stock Item Stock Category Estimate Places Refers to Becomes Issued to Refers to

26 EntityPrimary KeyOther Attributes EstimateEstimate NumberDate Customer Number Stock Item Code OrderOrder NumberSame as Estimate CustomerCustomer NumberCustomer Name Customer Address Credit Limit Stock ItemStock Item CodeDescription Number in Stock Supplier Code Stock CategoryCategory CodeCategory Description

27 Entity Instance An entity instance is a single occurrence of an entity type. An entity type is described just once in a data model while many instances of that data type may be represented by data stored in the system. – There is one EMPLOYEE entity type in most organisations but there may be hundred or thousands of instances of this entity type in the company.

A relationship is an association between two entities that is important to the system. We must also consider the extent to which each entity is related to another. 28 ERD Relationships

Cardinality defines the minimum and maximum number of occurrences of one entity for a single occurrence of the other From the previous example we can say that: – A customer can place several orders if they wish – But an order can only be placed by one customer 29 The Cardinality of a Relationship

Cardinality is bi-directional This means that it must be defined for both directions of the entity relationship. 30 Cardinality

A one-to-one relationship occurs where a single occurrence of one entity relates to one occurrence of a second entity. 31 One-to-One Relationship (1:1) EstimateOrder An estimate can only become one order and an order is derived from one estimate. becomes

One-to-Many relationships occur when a single entity instance is related to many occurences of a second entity. 32 One-to-Many Relationship(1:N) CustomerEstimate One customer can be issued with many estimates (the relationship is described as one-to-many) is issued with

Many-to-many relationships occur where many instances of an entity relate to many instances of a second entity These relationships usually contain a hidden entity which should be extracted Usually N:M relationships are broken into one or more pairs of one-to-many relationships 33 Many-to-Many Relationship (N:M)

Many estimates refers to many stock items (or many stock items are referred to by many estimates) 34 N:M EstimateStock Item Refers to

35 Sales ERD Customer Order Stock Item Stock Category Estimate Places Refers to Becomes Issued to Refers to

Optional Cardinality – Where the analyst considers whether an entity occurrence at one end of the relationship can ever be present in the system without the presence of the corresonding occurrence of the entity at the other end of the relationship Mandatory Cardinality – When the occurrence of the entity at either end of the relationship must be present in the system 36 Cardinality

Some relationships are mandatory and some are optional 37 Mandatory - Mandatory DoctorPatient Is responsible for A doctor must be responsible for one or more patients and a patient must be registered with one and only one doctor Registered with

38 Optional – Mandatory DoctorPROJECT Is responsible for A doctor may be responsible for one or more patients and a patiente must be registered with one and only one doctor Registered with

A doctor must be responisble for one of more patients and a patient may be registered with one and only one doctor 39 Mandatory – Optional Doctor Patient Is responsible for Registered with

A doctor may be responsible for one or more patients and a patient may be registered with one and only one doctor 40 Optional – Optional Doctor Patient Is responsible for Registered with

Relationship Cardinality GraphicCardinality Exactly 1 0 or 1 1 or more 0 or many More than 1 41

Note || denotes 1 and only 42