1 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski Chapter 6 Database Design 2: Design Methodology Spring 2006.

Slides:



Advertisements
Similar presentations
Concepts of Database Management Seventh Edition Chapter 6 Database Design : ERD Model.
Advertisements

IT420: Database Management and Organization
Entity-Relationship Model
Data Modeling and the Entity-Relationship Model
Data Modeling and the Entity-Relationship Model
Copyright © 2015 Pearson Education, Inc. Database Design Chapters 17 and
Accounting System Design
Systems Development Life Cycle
Concepts of Database Management Sixth Edition
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 COS 346 Day 6.
Database Design & Mapping
Concepts of Database Management Sixth Edition
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.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 David M. Kroenke Database Processing Tenth Edition Chapter 5 Data.
Chapter Five Data Modeling with the Entity-Relationship Model.
LIS 557 Database Design and Management William Voon Michael Cole Spring '04.
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 5-1 COS 346 Day 6.
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.
Data Modeling and the Entity-Relationship Model Chapter Four DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 5 th Edition.
Concepts of Database Management Seventh Edition
Entity-Relationship Model
Slide 1 Chapter 05 – Part 1 Data Modeling with the Entity-Relationship Model.
APPENDIX C DESIGNING DATABASES
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
 An entity-relationship (ER) diagram is a specialized graphic that illustrates the interrelationships between entities in a database.  An Entity Relationship.
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 5 1 © Prentice Hall, 2002 Chapter 5: Transforming EER Diagrams into Relations Mapping Regular Entities to Relations 1. Simple attributes: E-R attributes.
1. 2 Data Modeling 3 Process of creating a logical representation of the structure of the database The most important task in database development E-R.
1 Chapter 1 Overview of Database Concepts. 2 Chapter Objectives Identify the purpose of a database management system (DBMS) Distinguish a field from a.
Chapter 5 Entity–Relationship Modeling
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
IS 325 Notes for Wednesday September 4, Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments.
The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.
Principles of Database Design, Part II AIMS 2710 R. Nakatsu.
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.
1 Relational Databases and SQL. Learning Objectives Understand techniques to model complex accounting phenomena in an E-R diagram Develop E-R diagrams.
Concepts of Database Management Eighth Edition Chapter 6 Database Design 2: Design Method.
Concepts of Database Management Sixth Edition Chapter 6 Database Design 2: Design Method.
Chapter 1Introduction to Oracle9i: SQL1 Chapter 1 Overview of Database Concepts.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-1 David M. Kroenke’s, 10 th ed. Chapter.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
Data Modeling IST210 Class Lecture.
Next Back A-1 Management Information Systems for the Information Age Second Canadian Edition Copyright 2004 The McGraw-Hill Companies, Inc. All rights.
C-1 Management Information Systems for the Information Age Copyright 2004 The McGraw-Hill Companies, Inc. All rights reserved Extended Learning Module.
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
Chapter 9: Logical Database Design and the Relational Model (ERD Mapping)
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
IMS 4212: Introduction to Data Modeling—Relationships 1 Dr. Lawrence West, Management Dept., University of Central Florida Relationships—Topics.
Concepts of Database Management, Fifth Edition Chapter 6: Database Design 2: Design Methodology.
In this session, you will learn to: Map an ER diagram to a table Objectives.
Relational Theory and Design
Databases Illuminated Chapter 3 The Entity Relationship Model.
Chapter 9 Logical Database Design : Mapping ER Model To Tables.
BSA206 Database Management Systems Lecture 2: Introduction to Oracle / Overview of Database Concepts.
Concepts of Database Management Seventh Edition Chapter 6 Database Design 2: Design Method.
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.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 5 (Part a): Logical Database Design and the Relational Model Modern Database Management.
1 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski Chapter 6 Database Design 2: Design Methodology Spring 2006.
Concepts of Database Management, Fifth Edition Chapter 6: Database Design 2: Design Methodology.
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Five: Data Modeling with the Entity-Relationship.
Teanna Clarke 6aQ What is a Entity-Relationship Diagram?  An Entity-Relationship Diagram (ERD) is a tool that graphically shows the connections among.
Rationale Databases are an integral part of an organization. Aspiring Database Developers should be able to efficiently design and implement databases.
Database Design Chapters 17 and 18.
Chapter 5 Database Design
Concepts of Database Management Seventh Edition
Database Processing: David M. Kroenke’s Chapter Five:
Presentation transcript:

1 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski Chapter 6 Database Design 2: Design Methodology Spring 2006

2 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski Exercise #4 u Due: Feb 22 for full credit, March 1 for 50% credit u Points: 20 points u Pratt & Adamski (End of Chapters 5 & 6) u Assignments must have cover sheet with your name. u Chapter 5 [pp ]: Answer questions 1, 2, 3 for Premiere Products and questions 2, 4 for Henry Books. Omit 4NF, answer the questions for 3NF. u Chapter 6 pp [ ]: Answer questions 2, 4 for Premiere Products and questions 1, 2, 3 for Henry Books. Turn in ERD and copies of new tables and attributes. (Alternatively, use DBDL.)

3 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski One-to-One [1:1] Relationship Considerations u 1:N [maximum cardinality] relationships are the standard. Let’s start by examining how to treat 1:1 relationships u Implementing a one-to-one relationship by simply including the primary key of each table as a foreign key in the other table l A problem is that there is no guarantee that the information will match

4 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski 1:1 Relationship Considerations (con’t) u One possible solution is to create a single table. OK? l Although workable, two features are not particularly attractive: 1. Combines columns of two different entities into a single table. Violates “single theme” table notion. 2. If possible for one entity to exist without the other, then this would cause an insertion/deletion anomaly

5 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski 1:1 Relationship Considerations (con’t) u Better solution!! l Create two separate tables for Customers and Sales Reps and to include the primary key of one of them as a foreign key in the other l This foreign key would also be designated as an alternate key

6 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski 1:1 Relationship Considerations Figure 6.20 (6.25) (4 th Ed.) Include primary key of each table as foreign key in the other. OVERKILL!

7 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski 1:1 Relationship Considerations Figure 6.22 Implemented in a single table. Possible Anomalies? Add new Rep: Tyler Harris? What if Tyler has no customers?

8 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski 1:1 Relationship Considerations Figure :1 relationship implemented by including primary key of one table as foreign key in ONLY the other.

9 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski Many-to-Many [N:M] Relationship Considerations u Complex issues arise when more than two entities are related in a N:M relationship [binary relationship] u Many-to-many-to-many [N:M:P] relationship – involves multiple entities [tertiary or higher relationships] u Crucial issue in making the determination between a single many-to-many-to-many relationship and two (or three) many- to-many relationships is the independence of each entity. l Birth [Mother, Father, Child] One vs. multiple relations u Parent:Child vs. Mother:Father:Child

10 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski Future N:M:P slide u Birth [Mother, Father, Child] vs. … Mom Baby Dad

11 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski Null Values u Null - a special value (not a blank) u Null - actually represents the absence of a value in a field (undefined) u Nulls - used when a value is either unknown or not applicable [“UNK” or “N/A”] u NULL is a SQL reserved word: SELECT * FROM EMP WHERE PHONENO=NULL;

12 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski Table Split to Avoid Null Values Figure 6.27 Nulls are absence of values

13 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski Entity Subtypes u Entity subtype – table that is a subtype of another table u Incomplete category – records that do not fall into the subtype u Complete categories – all records fall into the categories

14 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski Entity Subtypes Incomplete Categories Figure 6.29

15 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski Student Table Split into Subtypes Helps to Avoid Nulls Figure 6.31

16 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski Two Entity Subtypes Complete Categories Figure 6.33

17 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski Entity-Relationship Model [Chen: Extended ERDs] u Various ERD methodologies use different symbols to represent data; non-standardized notation u E.g., Entities are drawn as rectangles u Relationships are drawn as diamonds with lines connecting the entities involved in relationships

18 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski ERD 1:N Relationship Diamond Symbol Figure 6.34 Often 1:N is placed inside the Diamond symbol

19 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski ERD 1:N Relationship Crow’s Foot Symbol Figure 6.42

20 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski One-to-Many Relationship (with Property/Attribute Ovals) Figure 6.37

21 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski Many-to-Many Relationship Letter Designators (m:n) Figure 6.35

22 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski N:M Relationship with Attributes Figure 6.38

23 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski Composite Entity u Composite entity - an entity that exists to implement a many-to-many relationship l A.k.a., Intersection Table or Association Table l Essentially both an entity and a relationship l Represented in an E-R diagram by a diamond within a rectangle

24 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski Composite Entity [OrderLine] Figure 6.39 Attribute Ovals

25 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski Complete ER Diagram Figure 6.40

26 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski Maximum & Minimum Cardinality u Maximum Cardinality – the most items that can appear on either side of a relationship u Minimum Cardinality – the least number of items that must be included in a relationship u An entity in a relationship with minimum cardinality of zero plays an optional role in the relationship u An entity with a minimum cardinality of one plays a mandatory role in the relationship

27 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski Representing Cardinality Figure 6.43

28 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski Summary u Database design is a two-part process (logical & physical) of determining an appropriate database structure to satisfy a given set of requirements u Entity-relationship (ER) model is a method of representing the structure of a database using an ER diagram (ERD): Examples: ERDx & IDEF1X u A database design is represented in a language called Database Design Language (DDL) u One-to-One [1:1] and One-to-Many [1:N] relationships require attention to primary keys u N:M relationships require Composite tables