DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH

Slides:



Advertisements
Similar presentations
THE EXTENDED ENTITY RELATIONSHIP MODEL (EERM)
Advertisements

Data Modeling. What are you keeping track of? You begin to develop a database by deciding what you are going to keep track of. Each thing that you are.
Advanced Data Modeling
1 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 2 Relational Theory DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH.
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.
CHAPTER 3: THE ENHANCED E-R MODEL © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition Jeffrey A. Hoffer,
© 2005 by Prentice Hall 1 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B.
Chapter 4 © 2005 by Prentice Hall 1 Objectives Definition of terms Definition of terms Use of supertype/subtype relationships Use of supertype/subtype.
Entity-Relationship Model and Diagrams (continued)
Information Resources Management February 13, 2001.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Chapter 3: Modeling Data in the Organization
Database Design Chapter 2. Goal of all Information Systems  To add value –Reduce costs –Increase sales or revenue –Provide a competitive advantage.
Concepts of Database Management Seventh Edition
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.
Chapter 3: The Enhanced E-R Model
© 2007 by Prentice Hall (Hoffer, Prescott & McFadden) 1 The Relational Model (Advanced)
 Keys are special fields that serve two main purposes: ◦ Primary keys are unique identifiers of the relation in question. Examples include employee numbers,
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,
Normalization Rules for Database Tables Northern Arizona University College of Business Administration.
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.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 3: The Enhanced E-R Model Modern Database Management 10 th Edition Jeffrey A. Hoffer,
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
RELATIONSHIPS Generally there are two main database types: flat-file and relational.
1 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 4 DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH Chapter 4 Normalization.
Chapter 8 Data Modeling Advanced Concepts Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Databases. Not All Tables Are Created Equal Spreadsheets use tables to store data and formulas associated with that data The “meaning” of data is implicit.
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 Sixth Edition Chapter 6 Database Design 2: Design Method.
IS 475/675 - Introduction to Database Design
1 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH Chapter 8 Creating.
C-1 Management Information Systems for the Information Age Copyright 2004 The McGraw-Hill Companies, Inc. All rights reserved Extended Learning Module.
Chapter 9: Logical Database Design and the Relational Model (ERD Mapping)
1 A Demo of Logical Database Design. 2 Aim of the demo To develop an understanding of the logical view of data and the importance of the relational 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.
Access Review. Access Access is a database application A database is a collection of records and files organized for a particular purpose Access supports.
1 The Enhanced Entity Relationship Diagrams (E-ERDs)
In this session, you will learn to: Map an ER diagram to a table Objectives.
CHAPTER 3: THE ENHANCED E-R MODEL © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition Jeffrey A. Hoffer,
CHAPTER 3: THE ENHANCED E-R MODEL © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition Jeffrey A. Hoffer,
1 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 1 DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH Chapter 1 The Role.
1 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 6 DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH Chapter 6 Creating.
Database Systems: Design, Implementation, and Management Ninth Edition
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.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 4: The Enhanced E-R Model Modern Database Management 9 th Edition Jeffrey A. Hoffer,
Copyright © 2016 Pearson Education, Inc. Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki Topi CHAPTER 3: THE ENHANCED.
Lecture 4: Logical Database Design and the Relational Model 1.
Data Modeling Advanced Concepts Updated 20/4/2015 TMC2034 Database Concept and Design1.
Logical Database Design and the Rational Model
Chapter 4: Logical Database Design and the Relational Model
Chapter 4: The Enhanced ER Model and Business Rules
Chapter 4: Part B Logical Database Design and the Relational Model
Chapter 5: Logical Database Design and the Relational Model
Database Management System 1 (ITED123A)
Chapter 3: The Enhanced E-R Model
CHAPTER 4: LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL
Chapter 5 Advanced Data Modeling
DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH
Presentation transcript:

DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH Chapter 5 DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH Raymond Frost – John Day – Craig Van Slyke Chapter 5 Advanced Database Designs Database Design and Development: A Visual Approach © 2006 Prentice Hall

Recursive Relationships Chapter 5 Recursive Relationships Original Design of the Enrollment Database Exhibit 5-1: Enrollment Database Design Database Design and Development: A Visual Approach © 2006 Prentice Hall

Mentor Recursive Relationships Chapter 5 Mentor Recursive Relationships Instructor 11 mentors instructors 22 and 33. Instructor 33 mentors instructor 44. Exhibit 5-2: Mentor Relationships for Enrollment Database Database Design and Development: A Visual Approach © 2006 Prentice Hall

Implementing a Recursive Relationship Chapter 5 Implementing a Recursive Relationship A foreign key (INSTRUCTOR$id) is added to the INSTRUCTOR table, which is a copy of the primary key of that same table. Exhibit 5-3: Data Relationships for Mentor Recursive Relationship Database Design and Development: A Visual Approach © 2006 Prentice Hall

ER Diagram with a Recursive Relationship Chapter 5 ER Diagram with a Recursive Relationship With the foreign key added, there is now a one-to-many relationship between instructors. Exhibit 5-4: Enrollment Database Diagram with Recursive Relationship Database Design and Development: A Visual Approach © 2006 Prentice Hall

Chapter 5 Bill-of-Materials A bill-of-materials is a structure that shows a relationships between products. This is a many-to-many relationship: a product can have many sub-products, and a product can be a sub-product in many larger products. Exhibit 5-5: Bill-of-Materials Example Database Design and Development: A Visual Approach © 2006 Prentice Hall

Bill-of-Materials in Table Form Chapter 5 Bill-of-Materials in Table Form Trying to represent a many-to-many recursive relationship does not work since you could not determine how many component columns would be needed, and there will be a large number of empty cells. Exhibit 5-6: Bill of Materials Table Database Design and Development: A Visual Approach © 2006 Prentice Hall

ER Diagram for a Many-to-Many Recursive Relationship Chapter 5 ER Diagram for a Many-to-Many Recursive Relationship As with all many-to-many relationships, a many-to-many recursive relationship is represented with an associative table. In this case, however, the associative table is linked back to the same table (PRODUCT), with both halves of its primary key being foreign keys from the PRODUCT table. Exhibit 5-7: Bill-of Materials ER Diagram Database Design and Development: A Visual Approach © 2006 Prentice Hall

Many-to-Many Recursive Relationship Data Chapter 5 Many-to-Many Recursive Relationship Data Exhibit 5-8: Bill-of-Materials Database Tables Database Design and Development: A Visual Approach © 2006 Prentice Hall

Supertype/Subtype Hierarchies Chapter 5 Supertype/Subtype Hierarchies The first four columns apply to all equipment but the last four apply to only some equipment, which results in empty cells. Exhibit 5-9: Equipment Entity and Data Database Design and Development: A Visual Approach © 2006 Prentice Hall

Equipment Supertype/Subtype Hierarchy Chapter 5 Equipment Supertype/Subtype Hierarchy Supertype Entity: General entity with the common field. Subtype Entites: specialized entities with unique fields. Partial Specialization: Instances of the supertype don’t have to belong to a subtype. Total Specialization: Instances of the supertype must belong to a subtype. Disjoint rule: Supertype may belong to, at most, one subtype. Overlap rule: Supertype may belong to multiple subtypes. Exhibit 5-10: Equipment Supertype/Subtype Hierarchy Database Design and Development: A Visual Approach © 2006 Prentice Hall

Supertype/Subtype Example Chapter 5 Supertype/Subtype Example All three tables share four common fields. Exhibit 5-11: STUDENT, FACULTY and STAFF tables Database Design and Development: A Visual Approach © 2006 Prentice Hall

Person Supertype/Subtype Hierarchy Chapter 5 Person Supertype/Subtype Hierarchy Step 1: Tables Start by identifying three different tables. Step 2: Fields and Keys - Add the fields and designate the primary keys. Step 3: Recognize Common Fields - Make sure that the fields actually store the same data for each entity. Exhibit 5-12: Person Supertype/Subtype Hierarchy Database Design and Development: A Visual Approach © 2006 Prentice Hall

Person Supertype/Subtype Hierarchy Chapter 5 Person Supertype/Subtype Hierarchy Step 4: Create Supertype/Subtype Hierarchy Put Common fields into new table: PERSON. The overlap rule requires adding discriminating fields to each subtype. Fields specific to a category are put in matching subtypes. Primary keys of supertype is coped into subtypes as foreign keys. Step 5: Determine Total/Partial Specialization and Disjoint/Overlap Rule Overlap Rule is in effect since a person can be in more than one subtype. Total Specialization is in effect since data will only be stored about these three categories. Exhibit 5-12: Person Supertype/Subtype Hierarchy Database Design and Development: A Visual Approach © 2006 Prentice Hall

More Complex Supertype/Subtype Example Chapter 5 More Complex Supertype/Subtype Example Subtypes not only contain different data, but can also be involved in different relationships with other tables. Here, an athlete student subtype is involved in a relationship with a team. Exhibit 5-13: Athlete/SGA Hierarchy Database Design and Development: A Visual Approach © 2006 Prentice Hall

Complex Design Example: Summer Reading Fun Chapter 5 Complex Design Example: Summer Reading Fun Step 1: Tables The problem statement refers to five entities: students, books, skills, fiction books and non-fiction books. Exhibit 5-14: Summer Reading Fun Step-by-Step Design Database Design and Development: A Visual Approach © 2006 Prentice Hall

Complex Design Example: Summer Reading Fun Chapter 5 Complex Design Example: Summer Reading Fun Step 2: Relationships Fiction and Non-fiction are subtypes of books. Since there are no other types of books, we have total specialization. The disjoint rule is in effect since a book cannot be both fiction and non-fiction. A student has many skills and a skill is related to many students. A student reads many books and a book is read by many students. A book can be used to develop many skills and a skill can be developed in many books. Exhibit 5-14: Summer Reading Fun Step-by-Step Design Database Design and Development: A Visual Approach © 2006 Prentice Hall

Complex Design Example: Summer Reading Fun Chapter 5 Complex Design Example: Summer Reading Fun Step 3: Resolve Many-to-Many Relationships Associative Entities are created to resolve the many-to-many relationships. There is also a many-to-many recursive relationship between skills: some skills are related to other skills as prerequisites. The recursive relationship between skills is resolved with the PREREQ associative entity. Exhibit 5-14: Summer Reading Fun Step-by-Step Design Database Design and Development: A Visual Approach © 2006 Prentice Hall

Complex Design Example: Summer Reading Fun Chapter 5 Complex Design Example: Summer Reading Fun Step 4: Fields The fields identified in the problem statement are added to the tables. Exhibit 5-14: Summer Reading Fun Step-by-Step Design Database Design and Development: A Visual Approach © 2006 Prentice Hall

Complex Design Example: Summer Reading Fun Chapter 5 Complex Design Example: Summer Reading Fun Step 5: Keys Primary keys are created for STUDENT, SKILL, and BOOK. Primary keys from tables related to associative entities are copied into the associative tables as foreign keys: the pair of foreign keys becomes the primary key of the associative tables. The primary key in the BOOK supertype table is copied into the subtype tables as foreign keys, which also serve as the primary keys of those tables. Exhibit 5-14: Summer Reading Fun Step-by-Step Design Database Design and Development: A Visual Approach © 2006 Prentice Hall

Complex Design Example: Summer Reading Fun Chapter 5 Complex Design Example: Summer Reading Fun Data Types Exhibit 5-15: Summer Reading Fun ER Diagram With Data Types Database Design and Development: A Visual Approach © 2006 Prentice Hall

Complex Design: Swampland Real Estate Chapter 5 Complex Design: Swampland Real Estate Step 1: Tables The problem statement refers to seven entities: property, agency, area, outlet, client and the single-family and condo property types. Exhibit 5-16: Swampland Real Estate Step-by-Step Design Database Design and Development: A Visual Approach © 2006 Prentice Hall

Complex Design: Swampland Real Estate Chapter 5 Complex Design: Swampland Real Estate Step 2: Relationships Clients are related to properties in two ways: as a buyer and as a seller. Singlefamily and condo are subtypes of books. Since there are other types of property, we have partial specialization. The disjoint rule is in effect since a property cannot be both single family and condo. Clients can also refer other clients to the agency, so there is a recursive relationship between clients. Exhibit 5-16: Swampland Real Estate Step-by-Step Design Database Design and Development: A Visual Approach © 2006 Prentice Hall

Complex Design: Swampland Real Estate Chapter 5 Complex Design: Swampland Real Estate Step 3: Resolve Many-to-Many Relationships The many-to-many relationship between properties and outlets is resolved by adding the PROPERTYOUTLET associative table. Exhibit 5-16: Swampland Real Estate Step-by-Step Design Database Design and Development: A Visual Approach © 2006 Prentice Hall

Complex Design: Swampland Real Estate Chapter 5 Complex Design: Swampland Real Estate Step 4: Fields The fields identified in the problem statement are added to the tables. Exhibit 5-16: Swampland Real Estate Step-by-Step Design Database Design and Development: A Visual Approach © 2006 Prentice Hall

Complex Design: Swampland Real Estate Chapter 5 Complex Design: Swampland Real Estate Step 5: Keys Each one-to-many relationship is represented by duplicating the primary key from the one side of the relationship into the table on the many side as a foreign key. The primary keys of the tables linked to the associative are duplicated into the associate table as foreign keys. These two foreign keys are combined with the ad date to be the primary key of the associative table. The client recursive relationship is resolved by duplicating the primary key into the same table as a foreign key. The primary key in the PROPERTY supertype table is copied into the subtype tables as foreign keys, which also serve as the primary keys of those tables. Exhibit 5-16: Swampland Real Estate Step-by-Step Design Database Design and Development: A Visual Approach © 2006 Prentice Hall

Complex Design: Swampland Real Estate Chapter 5 Complex Design: Swampland Real Estate Data Types Exhibit 5-17: Swampland Real Estate ER Diagram Database Design and Development: A Visual Approach © 2006 Prentice Hall

Practice Exercise 6: Event Planning Sheet Chapter 5 Practice Exercise 6: Event Planning Sheet Exhibit 5-18: The Event Planning Sheet Database Design and Development: A Visual Approach © 2006 Prentice Hall

Practice Exercise 6: Recipe Card Chapter 5 Practice Exercise 6: Recipe Card Exhibit 5-19: A Recipe Card Database Design and Development: A Visual Approach © 2006 Prentice Hall

Practice Exercise 6: Second Recipe Card Chapter 5 Practice Exercise 6: Second Recipe Card Exhibit 5-20: A Second Recipe Card Database Design and Development: A Visual Approach © 2006 Prentice Hall