Chapter 6 Developing Data Models for Business Databases.

Slides:



Advertisements
Similar presentations
Relational Database. Relational database: a set of relations Relation: made up of 2 parts: − Schema : specifies the name of relations, plus name and type.
Advertisements

Entity Relationship (E-R) Modeling Hachim Haddouti
Advanced Data Modeling
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
The Relational Database Model – some relations you might want to avoid!!!
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
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
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.
1 © Prentice Hall, 2002 Chapter 3: Modeling Data in the Organization Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
Modeling the Data: Conceptual and Logical Data Modeling
Concepts of Database Management Sixth Edition
Database Design (Data Modeling) DCO11310 Database Systems and Design By Rose Chang.
Fundamentals, Design, and Implementation, 9/e Chapter 5 Database Design.
1 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 6 Database Design 2: Design Methodology.
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 3: Modeling Data in the Organization
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 3 The Relational Data Model.
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
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.
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.
Developing Data Models for Business Databases (Part II)
Group16 Zhengqi Li Yan Li Quiz Presentation. 1. When converting a narrative requirements document into an ERD, which of the following would potentially.
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.
Concepts of Database Management Sixth Edition Chapter 6 Database Design 2: Design Method.
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.
Concepts of Database Management, Fifth Edition Chapter 6: Database Design 2: Design Methodology.
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.
Week 7-8 DBMS ER-Relational Mapping. ER-Relational Mapping.
1 ER Modeling BUAD/American University Mapping ER modeling to Relationships.
Database Design Slide 1 Database Design Lecture 7 part 2 Mapping ERD to Tables.
CHAPTER 2 : RELATIONAL DATA MODEL Prepared by : nbs.
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.
Week 2 Lecture The Relational Database Model Samuel ConnSamuel Conn, Faculty Suggestions for using the Lecture Slides.
Chapter 5 Understanding Entity Relationship Diagrams.
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.
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 2 The Relational Data Model. Outline Relational model basics Integrity rules Rules about referenced rows Relational Algebra.
Entity Relationship Modeling
Chapter 5 Database Design
Tables and Their Characteristics
Database Design – Lecture 4
Developing Data Models – Conversion Rules
Figure Specialization Hierarchy
DBMS ER-Relational Mapping
Entity Relationship (ER) Modeling
Presentation transcript:

Chapter 6 Developing Data Models for Business Databases

Outline Analysis of narrative problems Transformations for generating alternative designs Finalizing an ERD Schema Conversion Alternative notations

Analyzing Narrative Problems (I) Identify potential 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 Determine primary keys –Stable and single purpose –Identify other candidate keys

Problem Narrative Example (I)

Analyzing Narrative Problems (II) 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

Problem Narrative Example (II)

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

Attribute to Entity Type Transformation

Compound Attribute Transformation

Entity Type Expansion Transformation

Weak to Strong Entity Transformation

History Transformation (I)

History Transformation (II)

Generalization Hierarchy Transformation

Summary of Transformations

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

Documentation with the ER Assistant Attribute comments Entity type comments Relationship comments Design justifications Diagram notes

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 relationships Redundant relationships: derived from other relationships

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

Example Entity Type Cluster

Summary of Data Modeling Strategies 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

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.

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

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

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

Generalization Hierarchy Rule Mimic generalization hierarchy as much as possible –Each subtype table contains specific attributes 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

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

Optional 1-M Rule Separate table for each optional 1-M relationship Avoids null values Requires an extra table and join operation Controversial

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

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

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

ERD Rule Variations M-way relationships M-N relationships Relationships with attributes Self-referencing relationships Relationships connected to other relationships

Chen ERD Notation

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

Simple Class Diagram

Association Class

Generalization Relationship

Composition Relationship

Summary Data modeling is an important skill Use notation precisely Consider alternative designs Apply specialized concepts carefully Work many problems No standard ERD notation