McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 6 Developing Data Models for Business Databases.

Slides:



Advertisements
Similar presentations
Entity Relationship (E-R) Modeling Hachim Haddouti
Advertisements

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.
D EVELOPING D ATA M ODELS Joe Meehean 1. B USINESS R EQUIREMENTS Business Narrative How the company works, what do they do Consistency and Simplicity.
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.
Entity Relationship (ER) Modeling
Entity Relationship (ER) Modeling
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.
Chapter 5 Understanding Entity Relationship Diagrams.
Fundamentals, Design, and Implementation, 9/e COS 346 Day 8.
Chapter 8 Normalization. © 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Outline Modification anomalies Functional dependencies.
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 7 Normalization of Relational Tables.
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter 6 Developing Data Models for Business Databases.
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 3 The Relational Data Model.
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 Modeling Objectives: To illustrate how relationships between entities are defined and refined. To know how relationships are incorporated.
Ch5: ER Diagrams - Part 2 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Developing Data Models for Business Databases (Part II)
Chapter 7 Data Modeling with Entity Relationship Diagrams Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Completing the Model Common Problems in Database Design.
Group16 Zhengqi Li Yan Li Quiz Presentation. 1. When converting a narrative requirements document into an ERD, which of the following would potentially.
Chapter 7 Normalization. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Modification anomalies Functional dependencies.
Chapter 12 View Design and Integration. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for view design.
Chapter 2 The Relational Data Model. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Relational model basics Integrity.
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 Tenth Edition Chapter 4 Entity Relationship (ER) Modeling.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
Lecture 4 Conceptual Data Modeling. Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship,
Database Design – Lecture 5 Conceptual Data Modeling – adding attributes.
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
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.
Chapter 9 Logical Database Design : Mapping ER Model To Tables.
Database Design – Lecture 4 Conceptual Data Modeling.
Database Systems: Design, Implementation, and Management Ninth Edition
1 ER Modeling BUAD/American University Mapping ER modeling to Relationships.
Entity Relationship Diagram (ERD). Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship.
Database Design Slide 1 Database Design Lecture 7 part 2 Mapping ERD to Tables.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 10 Structuring.
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.
1 Agenda TMA02 M876 Block 4. 2 Model of database development data requirements conceptual data model logical schema schema and database establishing requirements.
Lecture # 14 Chapter # 5 The Relational Data Model and Relational Database Constraints Database Systems.
IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign.
Chapter 5 Database Design
Tables and Their Characteristics
Database Design – Lecture 4
Developing Data Models – Conversion Rules
Figure Specialization Hierarchy
COS 346 Day 8.
Chapter 5 Advanced Data Modeling
Chapter 17 Designing Databases
Entity Relationship (ER) Modeling
Presentation transcript:

McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 6 Developing Data Models for Business Databases

6-2 Outline  Guidelines for analyzing business information needs  Transformations for generating alternative designs  Finalizing an ERD  Schema Conversion

6-3 Characteristics of Business Data Modeling Problems  Poorly defined  Conflicting statements  Wide scope  Missing details  Many stakeholders  Requirements in many formats  Add structure  Eliminate irrelevant details  Add missing details  Narrow scope

6-4 Goals of Narrative Problem Analysis  Consistency with narrative  No contradictions of explicit narrative statements  Identify shortcomings  Ambiguous statements  Missing details  Simplicity preference  Choose simpler designs especially in initial design  Add refinements and additional details later

6-5 Steps of Narrative Problem Analysis  Identify entity types and attributes  Determine primary keys  Add relationships  Determine connections  Determine relationship cardinalities  Simplify relationships

6-6 Determine Entity Types and Attributes  For entity types, find nouns that represent groups of people, places, things, and events  For attributes, look for properties that provide details about the entity types  Simplicity principal: consider as an attribute unless other details

6-7 Determine Primary Keys  Stable: never change after assigned  Single purpose: no other purpose  Good choices: automatically generated values  Compromise choice for industry practices  Identify other unique attributes

6-8 Entity Identification Example

6-9 Identify Relationships  Identify relationships connecting previously identified entity types  Relationship references involve associations among nouns representing entity types  Sentences that involve an entity type having another entity type as a property  Sentences that involve an entity type having a collection of another entity type

6-10 Relationship Simplification  Problem statement requires direct or indirect connections  Hub entity types to simplify  Connect other entity types  Sometimes associated with important documents  Reduce number of direct connections

6-11 Relationship Identification Example

6-12 Diagram Refinements  Construct initial ERD  Revise many times  Generate feasible alternatives and evaluate according to requirements  Gather additional requirements if needed  Use transformations to suggest feasible alternatives

6-13 Attribute to Entity Type Transformation

6-14 Compound Attribute Transformation

6-15 Entity Type Expansion Transformation

6-16 Weak to Strong Entity Transformation

6-17 Attribute History Transformation

M Relationship Transformation

6-19 M-N Relationship Transformation

6-20 Limited History Transformation

6-21 Generalization Hierarchy Transformation

6-22 Summary of Transformations  Attribute to entity type  Compound attribute split  Entity type expansion  Weak entity to strong entity  Add history: attributes, 1-M relationships, and M-N relationships  Generalization hierarchy addition

6-23 Documenting an ERD  Important for resolving questions and communicating a design  Identify inconsistency and incompleteness in a specification  Identify situations when more than one feasible alternative exists  Do not repeat the details of the ERD  Incorporate documentation into the ERD

6-24 Documentation with the ER Assistant  Attribute comments  Entity type comments  Relationship comments  Design justifications  Diagram notes

6-25 Common Design Errors  Misplaced relationships: wrong entity types connected  Incorrect cardinalities: typically using a 1-M relationship instead of a M-N relationship  Missing relationships: entity types should be connected directly  Overuse of specialized modeling tools: generalization hierarchies, identification dependency, self-referencing relationships, M- way associative entity types  Redundant relationships: derived from other relationships

6-26 Resolving Design Errors  Misplaced relationships: use entity type clusters to reason about connections  Incorrect cardinalities: incomplete requirements: inferences beyond the requirements  Missing relationships: examine implications of requirements  Overuse of specialized modeling tools: only use when usage criteria are met  Redundant relationships: examine relationship cycles for derived relationships

6-27 Example Entity Type Cluster

6-28 Summary of Data Modeling Guidelines  Use notation precisely  Strive for simplicity  ERD connections  Avoid over connecting the ERD  Identify hub(s) of the ERD  Use specialized patterns carefully  Justify important design decisions

6-29 Summary of Basic Conversion Rules  Each entity type becomes a table.  Each 1-M relationship becomes a foreign key in the table corresponding to the child entity type (the entity type near the crow’s foot symbol).  Each M-N relationship becomes an associative table with a combined primary key.  Each identifying relationship adds a column to a primary key.

6-30 Application of Basic Rules (I) CREATE TABLE Course (… PRIMARY KEY (CourseNo) ) CREATE TABLE Offering (… PRIMARY KEY OfferNo, FOREIGN KEY (CourseNo) REFERENCES Course )

6-31 Application of Basic Rules (II) CREATE TABLE Enrollment (… PRIMARY KEY (StdSSN, OfferNo), FOREIGN KEY (StdSSN) REFERENCES Student, FOREIGN KEY OfferNo REFERENCES Offering )

6-32 Application of Basic Rules (III) Same conversion result as the previous slide Different application of rules

6-33 Generalization Hierarchy Rule  Mimic generalization hierarchy as much as possible  Each subtype table contains specific columns plus the primary key of its parent table.  Foreign key constraints for subtype tables  CASCADE DELETE option for referenced rows  Reduce need for null values  Need joins and outer joins to combine tables

6-34 Generalization Hierarchy Example Employee table: EmpNo (PK) SalaryEmp table: EmpNo (PK), EmpNo (FK) HourlyEmp table: EmpNo (PK), EmpNo (FK)

6-35 Optional 1-M Rule  Separate table for each optional 1-M relationship  Avoids null values  Requires an extra table and join operation  Controversial: in most cases 1-M rule is preferred

6-36 Optional 1-M Example CREATE TABLE Teaches (… PRIMARY KEY (OfferNo), FOREIGN KEY(OfferNo) REFERENCES Offering, FOREIGN KEY(FacSSN) REFERENCES Faculty )

Relationships CREATE TABLE Office (… PRIMARY KEY (OfficeNo), FOREIGN KEY(EmpNo) REFERENCES Employee, UNIQUE (EmpNo) )

6-38 Summary  Data modeling is an important skill  Use notation precisely  Preference for simpler designs  Consider alternative designs  Review design for common errors  Work many problems