Database Design, Application Development, and Administration, 6 th Edition Copyright © 2015 by Michael V. Mannino. All rights reserved. Chapter 5 Understanding.

Slides:



Advertisements
Similar presentations
BUSINESS DRIVEN TECHNOLOGY Plug-In T4 Designing Database Applications.
Advertisements

Database Systems: Design, Implementation, and Management Tenth Edition
Advanced Data Modeling
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/1 Copyright © 2004 Please……. No Food Or Drink in the class.
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.
The Relational Database Model
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.
Chapter 5 Understanding Entity Relationship Diagrams.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 3 The Entity- Relationship Model.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 7.1.
Entity-Relation Modeling Hun Myoung Park, Ph.D., Public Management and Policy Analysis Program Graduate School of International Relations International.
Entity Relationship (E-R) Modeling
Fundamentals, Design, and Implementation, 9/e COS 346 Day 8.
System Analysis - Data Modeling
Fundamentals, Design, and Implementation, 9/e Chapter 5 Database Design.
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.
Entity Relationship Diagrams
Data Modeling Entity - Relationship Models. Models Used to represent unstructured problems A model is a representation of reality Logical models  show.
Fundamentals, Design, and Implementation, 9/e COS 346 Day 2.
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 2 Introduction to Database Development.
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter Five Data Modeling with the Entity-Relationship Model.
Chapter 6 Developing Data Models for Business Databases.
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.
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.
3 Chapter 3 Entity Relationship (E-R) Modeling Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
Chapter 7 Data Modeling with Entity Relationship Diagrams Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Database Design, Application Development, and Administration, 5 th Edition Copyright © 2011 by Michael V. Mannino All rights reserved. Chapter 2 Introduction.
Lecture 2 The Relational Model. Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical relations.
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.
5 Copyright © 2006, Oracle. All rights reserved. Understanding Entity Relationship Diagrams ( 實體關係圖 ) Part II.
Concepts and Terminology Introduction to Database.
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 
Database Design – Lecture 5 Conceptual Data Modeling – adding attributes.
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.
Database Systems: Design, Implementation, and Management Ninth Edition
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 10 Structuring.
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.
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.
Logical Database Design and the Rational Model
Business System Development
Chapter 5 Database Design
Database Design – Lecture 4
Developing Data Models – Conversion Rules
Chapter 5 Advanced Data Modeling
Presentation transcript:

Database Design, Application Development, and Administration, 6 th Edition Copyright © 2015 by Michael V. Mannino. All rights reserved. Chapter 5 Understanding Entity Relationship Diagrams

Slide 2Chapter 5: Understanding Entity Relationship Diagrams Outline  Notation basics  Understanding relationships  Generalization hierarchies  Business rule representation  Diagram rules  Alternative notations

Slide 3Chapter 5: Understanding Entity Relationship Diagrams Basic Symbols

Slide 4Chapter 5: Understanding Entity Relationship Diagrams Cardinalities

Slide 5Chapter 5: Understanding Entity Relationship Diagrams Cardinality Notation

Slide 6Chapter 5: Understanding Entity Relationship Diagrams Classification of Cardinalities  Minimum cardinality based  Mandatory: existence dependent  Optional  Maximum cardinality based  Functional  1-M  M-N  1-1

Slide 7Chapter 5: Understanding Entity Relationship Diagrams Summary of Cardinalities

Slide 8Chapter 5: Understanding Entity Relationship Diagrams Optional Relationship Example

Slide 9Chapter 5: Understanding Entity Relationship Diagrams More Relationship Examples

Slide 10Chapter 5: Understanding Entity Relationship Diagrams Comparison to Access Notation

Slide 11Chapter 5: Understanding Entity Relationship Diagrams Understanding Relationships  Identification dependency  M-N relationships with attributes  Self identifying relationships  M-way relationships  Equivalence between M-N and 1-M relationships

Slide 12Chapter 5: Understanding Entity Relationship Diagrams Identification Dependency

Slide 13Chapter 5: Understanding Entity Relationship Diagrams M-N Relationships with Attributes

Slide 14Chapter 5: Understanding Entity Relationship Diagrams M-N Relationships with Attributes (II)

Slide 15Chapter 5: Understanding Entity Relationship Diagrams Instance Diagrams for Self- Referencing Relationships

Slide 16Chapter 5: Understanding Entity Relationship Diagrams ERD Notation for Self- Referencing Relationships

Slide 17Chapter 5: Understanding Entity Relationship Diagrams Associative Entity Types for M-way Relationships

Slide 18Chapter 5: Understanding Entity Relationship Diagrams 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

Slide 19Chapter 5: Understanding Entity Relationship Diagrams Associative Entity Type Example

Slide 20Chapter 5: Understanding Entity Relationship Diagrams Generalization Hierarchies

Slide 21Chapter 5: Understanding Entity Relationship Diagrams Inheritance  Subtypes inherit attributes of supertypes (direct and indirect)  Allows abbreviation of attribute list  Applies to code (methods) as well as attributes (data)

Slide 22Chapter 5: Understanding Entity Relationship Diagrams Generalization Constraints

Slide 23Chapter 5: Understanding Entity Relationship Diagrams Multiple Levels of Generalization

Slide 24Chapter 5: Understanding Entity Relationship Diagrams Comprehensive Example

Slide 25Chapter 5: Understanding Entity Relationship Diagrams Business Rules  Enforce organizational policies  Promote efficient communication  Formal representation in ERD  Informal representation in documentation associated with an ERD  Use rules language to formally represent in relational database after conversion

Slide 26Chapter 5: Understanding Entity Relationship Diagrams Formal Representation  Primary key constraints: entity identification  Named relationships: direct connections among business entities  Identification dependency: knowledge of other entities for identification  Cardinalities: restrict number of related entities in a business situation  Generalization hierarchies: classification of business entities and organizational policies

Slide 27Chapter 5: Understanding Entity Relationship Diagrams Informal Representation  Specify as documentation associated with elements of an ERD  Candidate key constraints: alternate ways to identify business entities  Reasonable values: fixed collection of values or consistent with another attribute  Null value constraints: data collection completeness  Default values: simplify data entry and provide value when unknown

Slide 28Chapter 5: Understanding Entity Relationship Diagrams 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

Slide 29Chapter 5: Understanding Entity Relationship Diagrams 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

Slide 30Chapter 5: Understanding Entity Relationship Diagrams 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

Slide 31Chapter 5: Understanding Entity Relationship Diagrams PK Rule Violation Example

Slide 32Chapter 5: Understanding Entity Relationship Diagrams 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.

Slide 33Chapter 5: Understanding Entity Relationship Diagrams Relationship Names  No uniqueness requirement  Participating entities provide a context for relationship names  Use unique names as much as possible to distinguish relationships  Must provide unique names for multiple relationships between the same entity types

Slide 34Chapter 5: Understanding Entity Relationship Diagrams 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.

Slide 35Chapter 5: Understanding Entity Relationship Diagrams 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

Slide 36Chapter 5: Understanding Entity Relationship Diagrams Example of Diagram Errors

Slide 37Chapter 5: Understanding Entity Relationship Diagrams Corrected ERD

Slide 38Chapter 5: Understanding Entity Relationship Diagrams Support in the ER Assistant  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

Slide 39Chapter 5: Understanding Entity Relationship Diagrams ERD Variations  No standard ERD notation  Symbol variations  Placement of cardinality symbols  Rule variations  Be prepared to adjust to the ERD notation in use by each employer

Slide 40Chapter 5: Understanding Entity Relationship Diagrams ERD Rule Variations  Lack of ERD standards  M-way relationships  M-N relationships  Relationships with attributes  Self-referencing relationships  Relationships connected to other relationships  Adapt to notations in work environments

Slide 41Chapter 5: Understanding Entity Relationship Diagrams Chen ERD Notation

Slide 42Chapter 5: Understanding Entity Relationship Diagrams Aqua Data Studio  Supports a variety of DBMSs through query and DBA tools  Data modeling tool  Similar appearance as Crow’s Foot notation used in the textbook  Some relational model notation  Several levels of diagram detail  Manipulate ERD regions (subsets) to reduce complexity

Slide 43Chapter 5: Understanding Entity Relationship Diagrams Aqua Data Studio Example

Slide 44Chapter 5: Understanding Entity Relationship Diagrams ADS Generalization Example

Slide 45Chapter 5: Understanding Entity Relationship Diagrams Unified Modeling Language  Standard notation for object-oriented modeling  Objects  Object features  Interactions among objects  UML supports class diagrams, interface diagrams, and interaction diagrams  More complex than ERD notation

Slide 46Chapter 5: Understanding Entity Relationship Diagrams Simple Class Diagram

Slide 47Chapter 5: Understanding Entity Relationship Diagrams Association Class

Slide 48Chapter 5: Understanding Entity Relationship Diagrams Generalization Relationship

Slide 49Chapter 5: Understanding Entity Relationship Diagrams Composition Relationship

Slide 50Chapter 5: Understanding Entity Relationship Diagrams 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