Chapter 5 Understanding Entity Relationship Diagrams.

Slides:



Advertisements
Similar presentations
Group G10 Minh Anderson Thomas Hickerson. Q1: In the crow’s foot notation, entity types are denoted by boxes.
Advertisements

BUSINESS DRIVEN TECHNOLOGY Plug-In T4 Designing Database Applications.
Advanced Data Modeling
Entity Relationship (ER) Modeling
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
Copyright © 2015 Pearson Education, Inc. Database Design Chapters 17 and
Systems Development Life Cycle
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 6 Advanced Data Modeling.
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 5 Advanced Data Modeling.
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter 6 Advanced Data Modelling
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 6 Advanced Data Modeling.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 6 Advanced Data Modeling.
1 © Prentice Hall, 2002 Chapter 3: Modeling Data in the Organization Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
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.
ISMT221 Information Systems Analysis and Design Entity-Relationship Diagram Lab 4 Tony Tam.
System Analysis - Data Modeling
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 5 Understanding Entity Relationship Diagrams.
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 6 Developing Data Models for Business Databases.
Chapter Five Data Modeling with the Entity-Relationship Model.
Chapter 3: Modeling Data in the Organization
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
CS424 PK, FK, FD Normalization Primary and Foreign Keys Primary and foreign keys are the most basic components on which relational theory is based. Primary.
Chapter 6 Developing Data Models for Business Databases.
Chapter 4 Entity-Relationship modeling Transparencies © Pearson Education Limited 1995, 2005.
Chapter 3 © 2005 by Prentice Hall 1 Objectives Definition of terms Definition of terms Importance of data modeling Importance of data modeling Write good.
Class Agenda – 04/04/2006 Discuss database modeling issues
Ch5: ER Diagrams - Part 2 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
© 2007 by Prentice Hall (Hoffer, Prescott & McFadden) 1 Entity Relationship Diagrams (ERDs)
Chapter 7 Data Modeling with Entity Relationship Diagrams Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Entity Relationship Diagrams Objectives s Learn the Elements of the E-R model (entities, attributes, and relationships) s Show how to apply the E-R model.
Copyright (c) 2014 Pearson Education, Inc. Introduction to Databases.
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
5 Copyright © 2006, Oracle. All rights reserved. Understanding Entity Relationship Diagrams ( 實體關係圖 ) Part II.
Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.
Chapter 8 Data Modeling Advanced Concepts Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
5 Copyright © 2006, Oracle. All rights reserved. Understanding Entity Relationship Diagrams ( 實體關係圖 ) Part I.
Chapter 9 View Design and Integration. © 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Outline Motivation for view design.
Database Design, Application Development, and Administration, 5 th Edition Copyright © 2011 by Michael V. Mannino All rights reserved. Chapter 6 Developing.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
Chapter 4 Entity Relationship (ER) Modeling.  ER model forms the basis of an ER diagram  ERD represents conceptual database as viewed by end user 
C-1 Management Information Systems for the Information Age Copyright 2004 The McGraw-Hill Companies, Inc. All rights reserved Extended Learning Module.
Database Design – Lecture 5 Conceptual Data Modeling – adding attributes.
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
1 A Demo of Logical Database Design. 2 Aim of the demo To develop an understanding of the logical view of data and the importance of the relational model.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 4 Entity Relationship (ER) Modeling.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 4 ENTITY RELATIONSHIP (ER) MODELING Instructor Ms. Arwa Binsaleh 1.
Database Design – Lecture 4 Conceptual Data Modeling.
Database Systems: Design, Implementation, and Management Ninth Edition
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.
Copyright © 2016 Pearson Education, Inc. Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki Topi CHAPTER 2: MODELING DATA.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 3: Modeling Data in the Organization Modern Database Management 9 th Edition Jeffrey.
McGraw-Hill/Irwin Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 6 Modeling the Data: Conceptual and Logical Data Modeling.
Ch 05. Basic Symbols ( manino ). Cardinalities Cardinality Notation.
Chapter 5 Understanding Entity Relationship Diagrams.
Department of Mathematics Computer and Information Science1 CS 351: Database Management Systems Christopher I. G. Lanclos Chapter 4.
Database Design, Application Development, and Administration, 6 th Edition Copyright © 2015 by Michael V. Mannino. All rights reserved. Chapter 5 Understanding.
Data Modeling Advanced Concepts Updated 20/4/2015 TMC2034 Database Concept and Design1.
Lecture # 14 Chapter # 5 The Relational Data Model and Relational Database Constraints Database Systems.
Database Design – Lecture 4
Developing Data Models – Conversion Rules
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter 5 Advanced Data Modeling
Mapping an ERD to a Relational Database
Presentation transcript:

Chapter 5 Understanding Entity Relationship Diagrams

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Notation basics Understanding relationships Generalization hierarchies Diagram rules

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Basic Symbols

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Cardinalities

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Cardinality Notation

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Classification of Cardinalities Minimum cardinality based –Mandatory: existence dependent –Optional Maximum cardinality based –Functional –1-M –M-N –1-1

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Summary of Cardinalities

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. More Relationship Examples

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Comparison to Access Notation

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Understanding Relationships Identification dependency M-N relationships with attributes Self identifying relationships M-way relationships Equivalence between M-N and 1-M relationships

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Identification Dependency

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. M-N Relationships with Attributes

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. M-N Relationships with Attributes (II)

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Instance Diagrams for Self- Referencing Relationships

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. ERD Notation for Self- Referencing Relationships

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Associative Entity Types for M-way Relationships

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Relationship Equivalence Replace M-N relationship –Associative entity type –Two identifying 1-M relationships M-N relationship versus associative entity type –Largely preference –Associative entity type is more flexible in some situations

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Associative Entity Type Example

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Generalization Hierarchies

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Inheritance Subtypes inherit attributes of supertypes (direct and indirect) Allows abbreviation of attribute list Applies to code (methods) as well as attributes (data)

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Generalization Constraints

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Multiple Levels of Generalization

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Comprehensive Example

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Diagram Rules Ensure that ERD notation is correctly used Similar to syntax rules for a computer language Completeness rules: no missing specifications Consistency rules: no conflicts among specifications Supported by the ER Assistant

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Completeness Rules Primary Key Rule: all entity types have a PK (direct, indirect, or inherited) Naming Rule: all entity types, relationships, and attributes have a name Cardinality Rule: cardinality is specified in both directions for each relationship Entity Participation Rule: all entity types participate in an at least one relationship except for entity types in a generalization hierarchy Generalization Hierarchy Participation Rule: at least one entity type in a generalization hierarchy participates in a relationship

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Primary Key Rule Issue Primary key rule is simple in most cases For some weak entities, the PK rule is subtle –Weak entity with only one 1-M identifying relationship –Weak entity must have a local key to augment the borrowed PK from the parent entity type –Violation of PK rule if local key is missing

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. PK Rule Violation Example

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Naming Consistency Rules Entity Name Rule: entity type names must be unique Attribute Name Rule: attribute names must be unique within each entity type and relationship Inherited Attribute Rule: attribute names in a subtype do not match inherited (direct or indirect) attribute names.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Connection Consistency Rules Relationship/Entity Connection Rule: relationships connect two entity types (not necessarily distinct) Relationship/Relationship Connection Rule: relationships are not connected to other relationships Redundant Foreign Key Rule: foreign keys are not used.

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Identification Dependency Rules Weak entity rule: weak entities have at least one identifying relationship Identifying relationship rule: at least one participating entity type must be weak for each identifying relationship Identification dependency cardinality rule: the minimum and maximum cardinality must equal 1 for a weak entity in all identifying relationships

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Example of Diagram Errors

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Corrected ERD

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Support in the ER Assistant Version 2 of the ER Assistant supports the diagram rules Relationship formation rules are supported by diagram construction Other rules are supported by the Check Diagram feature For the Redundant Foreign Key rule, the ER Assistant detects FKs that have the same name as the associated PKs

McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Summary Data modeling is an important skill Crow’s Foot ERD notation is widely used Use notation precisely Use the diagram rules to ensure structural consistency and completeness Understanding the ERD notation is a prerequisite to applying the notation on business problems