Database Systems: Design, Implementation, and Management Tenth Edition Chapter 5 Advanced Data Modeling.

Slides:



Advertisements
Similar presentations
Entity-Relationship (ER) Modeling
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.
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.
Normalization of Database Tables Special adaptation for INFS-3200
Fundamentals, Design, and Implementation, 9/e COS 346 Day 8.
Normalization of Database Tables
© 2005 by Prentice Hall Chapter 3a Database Design Modern Systems Analysis and Design Fourth Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
Fundamentals, Design, and Implementation, 9/e Chapter 5 Database Design.
The Relational Database Model
The Relational Database 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.
Chapter 3: Modeling Data in the Organization
The Relational Database Model. 2 Objectives How relational database model takes a logical view of data Understand how the relational model’s basic components.
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 1 Data Models: Degrees of Data Abstraction l Modified ANSI/SPARC Framework.
Chapter 5 Normalization of Database Tables
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 5 Normalization of Database Tables.
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.
3 1 Chapter 3 The Relational Database Model Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
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.
Chapter 3 © 2005 by Prentice Hall 1 Objectives Definition of terms Definition of terms Importance of data modeling Importance of data modeling Write good.
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
1 © Prentice Hall, 2002 CMIS564: E/R Modeling Dr. Bordoloi Based on Chapter 3; Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott,
1 © Prentice Hall, 2002 Chapter 3: Modeling Data in the Organization Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
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 Tenth Edition
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 6 Normalization of Database Tables.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 5 Normalization of Database.
The Relational Database Model
Chapter 8 Data Modeling Advanced Concepts Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
DataBase Management System What is DBMS Purpose of DBMS Data Abstraction Data Definition Language Data Manipulation Language Data Models Data Keys Relationships.
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
Database Application Design and Data Integrity AIMS 3710 R. Nakatsu.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
3 & 4 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Keys Consists of one or more attributes that determine other.
3 1 Chapter 3 The Relational Database Model Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 6 Advanced Data Modeling.
Database Systems: Design, Implementation, and Management Ninth Edition
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 5 (Part a): Logical Database Design and the Relational Model Modern Database Management.
Chapter 3 The Relational Database Model. Database Systems, 10th Edition 2 * Relational model * View data logically rather than physically * Table * Structural.
CHAPTER 2 : RELATIONAL DATA MODEL Prepared by : nbs.
DATA MODELING AND DATABASE DESIGN DATA MODELING AND DATABASE DESIGN Part 2.
Mapping ER to Relational Model Each strong entity set becomes a table. Each weak entity set also becomes a table by adding primary key of owner entity.
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.
BTM 382 Database Management Chapter 5: Advanced Data Modeling
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.
Logical Database Design and the Rational Model
Chapter 5 Database Design
Chapter 4 Logical Database Design and the Relational Model
Chapter 4: Logical Database Design and the Relational Model
Figure Specialization Hierarchy
Database Systems: Design, Implementation, and Management Tenth Edition
CHAPTER 4: LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL
Chapter 5 Advanced Data Modeling
Review of Week 1 Database DBMS File systems vs. database systems
Chapter 3: Modeling Data in the Organization
Mapping an ERD to a Relational Database
Presentation transcript:

Database Systems: Design, Implementation, and Management Tenth Edition Chapter 5 Advanced Data Modeling

Entity Integrity: Selecting Primary Keys Primary key is the most important characteristic of an entity –Single attribute or some combination of attributes Primary keys and foreign keys work together to implement relationships Properly selecting primary key has direct bearing on efficiency and effectiveness Database Systems, 10th Edition2

Natural Keys and Primary Keys Natural key is a real-world identifier used to uniquely identify real-world objects –Familiar to end users and forms part of their day-to-day business vocabulary Generally, data modeler uses natural identifier as primary key of entity being modeled May instead use composite primary key or surrogate key –Surrogate key - a PK created to simplify the identification of entity instances Has no meaning, exists only to distinguish one entity from another (e.g., Autonumber) Database Systems, 10th Edition3

Primary Key Guidelines Attribute that uniquely identifies entity instances in an entity set –Could also be combination of attributes Main function is to uniquely identify an entity instance or row within a table Guarantee entity integrity, not to “describe” the entity Primary keys and foreign keys implement relationships among entities –Behind the scenes, hidden from user Database Systems, 10th Edition4

5

When to Use Composite Primary Keys Composite primary keys useful in two cases: –As identifiers of composite entities In which each primary key combination is allowed once in M:N relationship –As identifiers of weak entities In which weak entity has a strong identifying relationship with the parent entity Automatically provides benefit of ensuring that there cannot be duplicate values Database Systems, 10th Edition6

7 Composite PK of ENROLL ensures a student can not register for the same class twice

When to Use Composite Primary Keys When used as identifiers of weak entities normally used to represent: –Real-world object that is existent-dependent on another real-world object –Real-world object that is represented in data model as two separate entities in strong identifying relationship Dependent entity exists only when it is related to parent entity –EMPLOYEE and DEPENDENT – latter uses a composite PK containing employee id –LINE exists only as part of INVOICE Database Systems, 10th Edition8

When To Use Surrogate Primary Keys Especially helpful when there is: –No natural key –Selected candidate key has embedded semantic contents –Selected candidate key is too long or cumbersome Database Systems, 10th Edition9

When To Use Surrogate Primary Keys If you use surrogate key: –Ensure that candidate key of entity in question performs properly –Use “unique index” and “not null” constraints Database Systems, 10th Edition10

Database Systems, 10th Edition 11 When To Use Surrogate Primary Keys A catering hall has a number of rooms it rents for small parties –What should be the PK? DATE,TIME_START,ROOM –What if, in addition to the room, additional equipment were to be used from the RESOUCE table –Composite key for linking table would be DATE,TIME_START,ROOM, RSC_ID Quite lengthy If that became FK in another entity, it would be quite complex to maintain –Instead use numeric, single attribute surrogate key

Design Cases: Learning Flexible Database Design Data modeling and design requires skills acquired through experience Experience acquired through practice Four special design cases that highlight: –Importance of flexible design –Proper identification of primary keys –Placement of foreign keys Database Systems, 10th Edition12

Design Case 1: Implementing 1:1 Relationships Foreign keys work with primary keys to properly implement relationships in relational model Put primary key of the “one” side on the “many” side as foreign key –Primary key: parent entity –Foreign key: dependent entity Database Systems, 10th Edition13

Design Case 1: Implementing 1:1 Relationships In 1:1 relationship, there are two options: –Place a foreign key in both entities (not recommended) –Place a foreign key in one of the entities Primary key of one of the two entities appears as foreign key of other Database Systems, 10th Edition14

Database Systems, 10th Edition 15

Design Case 2: Maintaining History of Time-Variant Data Normally, existing attribute values are replaced with new value without regard to previous value Time-variant data: –Values change over time –Must keep a history of data changes Keeping history of time-variant data equivalent to having a multivalued attribute in your entity Must create new entity in 1:M relationships with original entity New entity contains new value, date of change Database Systems, 10th Edition16

Database Systems, 10th Edition 17

Database Systems, 10th Edition 18

Design Case 3: Fan Traps Design trap occurs when relationship is improperly or incompletely identified –Represented in a way not consistent with the real world Most common design trap is known as fan trap Fan trap occurs when one entity is in two 1:M relationships to other entities –Produces an association among other entities not expressed in the model Database Systems, 10th Edition19

Database Systems, 10th Edition 20

Database Systems, 10th Edition 21

Design Case 4: Redundant Relationships Redundancy is seldom a good thing in database environment Occurs when there are multiple relationship paths between related entities Main concern is that redundant relationships remain consistent across model Some designs use redundant relationships to simplify the design In the following example, the relationship between DIVISION and PLAYER is not needed as all information can be obtained through TEAM Database Systems, 10th Edition22

Database Systems, 10th Edition 23

Database Systems, 10th Edition 24

Portion of Tiny College ERD Database Systems, 10th Edition 25

Tiny College - New Requirement Tiny College wants to keep track of the history of all administrative appointments (date of appointment and date of termination). The Tiny College chancellor may want to know how many deans worked in the College of Business between January 1, 1960 and January 1, 2010 or who the dean of the College of Education was in Given that information, create the complete ERD containing all primary keys, foreign keys, and main attributes. Database Systems, 10th Edition 26

Tiny College ERD Database Systems, 10th Edition 27