Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/1 Copyright © 2004 Please……. No Food Or Drink in the class.

Slides:



Advertisements
Similar presentations
Database Processing: Fundamentals, Design and Implementation, 9/e by David M. KroenkeChapter 1/1 Copyright © 2004 Please……. No Food Or Drink in the class.
Advertisements

Advanced Data Modeling
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeAppendix A/1 Copyright © 2004 Please……. No Food Or Drink in the class.
Entity-Relationship Model
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.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 COS 346 Day 6.
Fundamentals, Design, and Implementation, 9/e COS 346 Day 8.
Systems Development Life Cycle
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 COS 346 Day 9.
Fundamentals, Design, and Implementation, 9/e Chapter 5 Database Design.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 David M. Kroenke Database Processing Chapter 6 Transforming Data.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 COS 346 Day 10.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 COS 346 Day 8.
Methodology Logical Database Design for the Relational Model
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 COS 346 Day 7.
RELATIONSHIP  THE WAY TABLES ARE RELATED  A TABLE MUST PARTICIPATE IN AT LEAST ONE RELATIONSHIP  IN A BINARY RELATIONSHIP TWO ENTITIES PARTICIPATE 
Chapter Five Data Modeling with the Entity-Relationship Model.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 David M. Kroenke’s Chapter Six: Transforming Data Models into Database.
Fundamentals, Design, and Implementation, 9/e COS 346 Day 2.
Entity-Relationship Model
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 David M. Kroenke’s Chapter Six: Transforming ER Models into Database.
1 The Relational Model Mapping the ER Model to a Database Implementation.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 David M. Kroenke’s Chapter Six: Transforming ER Models into Database.
Transforming Data Models into Database Designs
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Chapter 14 & 15 Conceptual & Logical Database Design Methodology
Database Design.  Define a table for each entity  Give the table the same name as the entity  Make the primary key the same as the identifier of the.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 David M. Kroenke’s Chapter Five: Data Modeling with the Entity-Relationship.
Chapter 4 The Relational Model.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
Chapter Six Professor Adams’ Slides. Note that entities are shadowed, tables are not. Note that entities have no physical existence (blueprint) Note.
Database Processing: Fundamentals, Design and Implementation, 9/e by David M. KroenkeChapter 2/1 Copyright © 2004 Please……. No Food Or Drink in the class.
Database Processing: Fundamentals, Design and Implementation, 9/e by David M. KroenkeChapter 3/1 Copyright © 2004 Please……. No Food Or Drink in the class.
David M. Kroenke and David J. Auer Database Processing: F undamentals, Design, and Implementation Chapter Six: Transforming Data Models into Database Designs.
Database Design IST210 Class Lecture
Chapter 8 Data Modeling Advanced Concepts Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 6/1 Copyright © 2004 Please……. No Food Or Drink in the class.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 David M. Kroenke’s Chapter Six: Transforming Data Models into Database.
Chapter 9: Logical Database Design and the Relational Model (ERD Mapping)
Copyright 2006 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Third Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Component 4/Unit 6b Topic II Relational Databases Keys and relationships Data modeling Database acquisition Database Management System (DBMS) Database.
1 Chapter 17 Methodology - Local Logical Database Design.
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 8/1 Copyright © 2004 Please……. No Food Or Drink in the class.
Chapter 9 Logical Database Design : Mapping ER Model To Tables.
Database Processing: Fundamentals, Design and Implementation, 9/e by David M. KroenkeChapter 4/1 Copyright © 2004 Please……. No Food Or Drink in the class.
1 ER Modeling BUAD/American University Mapping ER modeling to Relationships.
1 © Prentice Hall, 2002 ITD1312 Database Principles Chapter 4B: Logical Design for Relational Systems -- Transforming ER Diagrams into Relations Modern.
Logical Database Design and the Relational Model.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 David M. Kroenke’s Chapter Six: Transforming Data Models into Database.
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Six: Transforming Data Models into Database Designs.
1 The Relational Data Model David J. Stucki. Relational Model Concepts 2 Fundamental concept: the relation  The Relational Model represents an entire.
Lecture # 14 Chapter # 5 The Relational Data Model and Relational Database Constraints Database Systems.
Chapter Six: Transforming Data Models into Database Designs 6-1.
Logical Database Design and the Rational Model
Chapter 5 Database Design
Chapter 4: Logical Database Design and the Relational Model
Transforming Data Models
COS 346 Day 8.
Database Processing: David M. Kroenke’s Chapter Six:
CHAPTER 4: LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL
Database Processing: David M. Kroenke’s Chapter Six:
Database Processing: David M. Kroenke’s Chapter Six:
Database Processing: David M. Kroenke’s Chapter Six:
Presentation transcript:

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/1 Copyright © 2004 Please……. No Food Or Drink in the class room Cell phones off Pagers on vibrate Phasers on stun

Fundamentals, Design, and Implementation, 9/e Chapter 5 Database Design

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/3 Copyright © 2004  To understand the Elements of Database Design  To be able to identify primary keys and understand when to use a surrogate key  To understand the use of Referential Integrity Constraints  To understand the use of Referential Integrity Actions  To be able to represent Id-dependent, 1:1, 1:N, and N:M relationships in relations  To be able to represent Weak entities in relations  To be able to represent Supertype/Subtypes as relations  To be able to represent recursive relationships  To be to represent ternary relationships  To understand the ambiguity inherent in the use of NULL values CHAPTER OBJECTIVES

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/4 Copyright © 2004 The Database Design Process  Create tables and columns from entities and attributes  Select primary keys  Represent relationships  Specify constraints  Re-examine normalization criteria

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/5 Copyright © 2004 Transforming an Entity to a Table

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/6 Copyright © 2004 Selecting the Primary Key  An ideal primary key is short, numeric, and seldom changing  If there are more than one candidate keys (alternate identifiers), they should be evaluated and the best one chosen as the table’s primary key  If the entity has no identifier, an attribute needs to be selected as the identifier  In some situations, a surrogate key should be defined

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/7 Copyright © 2004 Surrogate Keys  A surrogate key is a unique, DBMS-supplied identifier used as the primary key of a relation  The values of a surrogate key have no meaning to the users and are normally hidden on forms and reports  DBMS does not allow the value of a surrogate key to be changed  Disadvantages: –Foreign keys that are based on surrogate keys have no meaning to the users –When data shared among different databases contain the same ID, merging those tables might yield unexpected results

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/8 Copyright © 2004 Representing Relationships  Relationships are expressed by placing the primary key of one table into a second table  The new column in the second table is referred to as a foreign key  Three principles of relationship representation –Preservation of referential integrity constraints –Specification of referential integrity actions –Representation of minimum cardinality

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/9 Copyright © 2004 Rules for Referential Integrity Constraints

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/10 Copyright © 2004 Specifying Referential Integrity Actions  If default referential integrity constraint is too strong, overriding the default referential integrity enforcement could be defined during database design  The policy will be programmed into triggers during implementation  Two referential integrity overrides –Cascading updates automatically change the value of the foreign key in all related child rows to the new value –Cascading deletions automatically delete all related child rows

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/11 Copyright © 2004 Enforcing Minimum Cardinality  If the minimum cardinality on the child is one, at least one child row must be connected to the parent  A required parent can be specified by making the foreign key value not null  A required child can be represented by creating update and delete referential integrity actions on the child and insert referential integrity actions on the parent  Such referential integrity actions must be declared during database design and trigger codes must be written during implementation

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/12 Copyright © 2004 Representing ID-Dependent Relationships  To represent ID-dependent relationships, primary key of the parent relation is added to the child relation  The new foreign key attribute becomes part of the child’s composite primary key  Referential integrity actions should be carefully determined –For cascading updates, data values are updated to keep child rows consistent with parent rows –If the entity represents multi-value attributes, cascading deletions are appropriate –Check user requirements when designing more complex situation

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/13 Copyright © 2004 Example: ID-Dependent Relationship

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/14 Copyright © 2004 Example: Cascading Deletion

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/15 Copyright © 2004 Representing Subtype Relationships  Called subtypes in the extended E-R model and categories in the IDEF1X model  Primary key of the supertype (or generic) entity is placed into the subtype (or category entity)  Category entities in IDEF1X are mutually exclusive in the categories –For complete categories, the generic entity will have to have exactly one category entity in that cluster –These constraints are enforced by properly specifying referential integrity actions

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/16 Copyright © 2004 Example: Subtype Relationship

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/17 Copyright © 2004 Representing Weak Entities  Weak entities logically depend on the existence of another entity in the database  Representing these entities are the same as modeling 1:1 or 1:N relationships  Referential integrity actions need to be specified to ensure that –When the parent is deleted, the weak entity is deleted as well –New weak entities have a parent with which to connect

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/18 Copyright © 2004 Example: Weak, Non ID- Dependent Relationships

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/19 Copyright © 2004 Representing Recursive Relationships  A recursive relationship is a relationship among entities of the same class  For 1:1 and 1:N recursive relationships, add a foreign key to the relation that represents the entity  For N:M recursive relationships, add a new intersection table that represents the N:M relationship

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/20 Copyright © 2004 Example: 1:1 Recursive Relationships

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/21 Copyright © 2004 Example: 1:N Recursive Relationships

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/22 Copyright © 2004 Example: M:N Recursive Relationships

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/23 Copyright © 2004 Representing Ternary and Higher-Order Relationships  Ternary and higher-order relationships can be treated as combinations of binary relationships  There are three types of binary constraints: MUST, MUST NOT, and MUST COVER –MUST NOT constraint: the binary relationship indicates combinations that are not allowed to occur in the ternary relationship –MUST COVER constraint: the binary relationship indicates all combinations that must appear in the ternary relationship  Because none of these constraints can be represented in the relational design, they must be documented as business rules and enforced in application programs or triggers

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/24 Copyright © 2004 Null values  A null value is an attribute value that has not been supplied  Null values are ambiguous as they can mean –The value is unknown –The value is inappropriate –The value is known to be blank  Inappropriate nulls can be avoided by –Defining subtype or category entities –Forcing attribute values through the use of not null –Supplying initial values  Ignore nulls if the ambiguity is not a problem to the users

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/25 Copyright © 2004 Summary  The data model and other written requirements are the starting points for creating a database design  The ideal primary key is short, numeric, and seldom changing  A surrogate key is a unique DBMS- supplied identifier used as the primary key of a relation

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/26 Copyright © 2004 Summary (Continued)  Relationships are represented by placing the primary key of a table into a related table as a foreign key  Referential integrity actions can be defined to modify the default behavior for preserving referential integrity constraints

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/27 Copyright © 2004 Summary (Continued)  For ID-dependent relationships, the primary key of the parent is placed in the child as: –Part of the primary key –A foreign key  A null value is an attribute value that has not be supplied

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/28 Copyright © 2004 Reminder DO NOT FORGET TO SIGN THE ATTENDANCE SHEET BEFORE YOU LEAVE TONIGHT