1 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management.

Slides:



Advertisements
Similar presentations
Database Design Process
Advertisements

Data Modeling is an Analysis Activity
Modeling the Data: Conceptual and Logical Data Modeling
Concepts of Database Management Sixth Edition
© 2005 by Prentice Hall Chapter 3a Database Design Modern Systems Analysis and Design Fourth Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
© 2008 Prentice Hall Business Publishing Accounting Information Systems, 11/e Romney/Steinbart1 of 121 C HAPTER 16 Implementing an REA Model in a Relational.
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 5 The Relational Database Model: Introduction
CHAPTER 2: MODELING DATA IN THE ORGANIZATION © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition Jeffrey.
Chapter 3 © 2005 by Prentice Hall 1 Objectives Definition of terms Definition of terms Importance of data modeling Importance of data modeling Write good.
1 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management.
Chapter 3 Data Modeling Fundamentals of Database Management Systems by
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
1 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management.
Mapping ERM to relational database
Introduction to Databases
Chapter 7 Logical Database Design
1 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management.
Data Modeling and the Entity-Relationship Model Chapter Four DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
© 2007 by Prentice Hall (Hoffer, Prescott & McFadden) 1 Entity Relationship Diagrams (ERDs)
1 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management.
Chapter 5 1 © Prentice Hall, 2002 Chapter 5: Transforming EER Diagrams into Relations Mapping Regular Entities to Relations 1. Simple attributes: E-R attributes.
Chapter 3: Modeling Data in the Organization
1 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management.
Converting ER model Into Relational Table
Relational DB Components
Conversion from ER diagram to relational model
Fundamentals of Database Management Systems, 2nd ed
DATABASEMODELSDATABASEMODELS  A database model ◦ defines the logical design of data. ◦ Describes the relationships between different parts of data.
1 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management.
PLUG IT IN 3 Fundamentals of Relational Database Operations.
1 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management.
1 Nassau Community CollegeProf. Vincent Costa Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights ReservedAn Introduction.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 2: Modeling Data in the Organization.
1 Relational Databases and SQL. Learning Objectives Understand techniques to model complex accounting phenomena in an E-R diagram Develop E-R diagrams.
Chapters 15 &16 Conceptual and Logical Database Design Methodology.
© Pearson Education Limited, Chapter 7 Entity-Relationship modeling Transparencies.
Chapter 1Introduction to Oracle9i: SQL1 Chapter 1 Overview of Database Concepts.
IS 230Lecture 4Slide 1 Entity Relationship to Relational Model Mapping Lecture 5.
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.
Lecture 4 Conceptual Data Modeling. Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship,
IE 423 – Design of Decision Support Systems Data modeling and database development.
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.
An Entity Relationship (ER) Diagram is a graphic that shows the interrelationship between entities in a database.
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.
1 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski Chapter 6 Database Design 2: Design Methodology Spring 2006.
1 ER Modeling BUAD/American University Mapping ER modeling to Relationships.
Chapter 3: Modeling Data in the Organization. Business Rules Statements that define or constrain some aspect of the business Assert business structure.
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.
Database Design Slide 1 Database Design Lecture 7 part 2 Mapping ERD to Tables.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 5 (Part a): Logical Database Design and the Relational Model Modern Database Management.
IE 423 – Design of Decision Support Systems Data modeling and database development.
Copyright © 2016 Pearson Education, Inc. Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki Topi CHAPTER 2: MODELING DATA.
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.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 3: Modeling Data in the Organization Modern Database Management 9 th Edition Jeffrey.
Logical Design 12/10/2009GAK1. Learning Objectives How to remove features from a local conceptual model that are not compatible with the relational model.
Conversion from ER diagram to relational model 1 ER is a visual model The relational model is a matemathical model.
Converting ER/EER to logical schema; physical design issues 1.
Chapter 4: Part B Logical Database Design and the Relational Model
CSCI-100 Introduction to Computing
Order Database – ER Diagram
CHAPTER 4: LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL
Presentation transcript:

1 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management international, open membership, not- for-profit technology standards consortium. Session 6 Designing a Database ITE 252 Database Management

2 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management international, open membership, not- for-profit technology standards consortium. Homework HW#1: Create an E-R diagram modeled after the Good Reading Bookstores E-R diagram (Figure 3-19 in your text and slide 14 here) for a publisher of music (limit to MP3s). Draw the diagram by hand and write up a description similar to the one in section (pp.95-95) in your text. Due next class

3 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management Designing Relational Tables Typical process for converting E-R diagrams to relational tables: – Each entity converts to table – For many-to-many relationships, each associative entity converts to table – Attributes become table columns – Ensure foreign keys appear in proper places in tables To convert single entity, create table of same name with column for each attribute

4 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management Salesperson Entity and Table

5 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management international, open membership, not- for-profit technology standards consortium. Converting Binary Relationships Greater importance in selecting identifier and primary key – Identifier and primary key define foreign key that establishes relationships between tables Often more than one way to represent entity relationships as relational tables

6 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management international, open membership, not- for-profit technology standards consortium. Example: Converting 1-1 Binary Relationship

7 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management international, open membership, not- for-profit technology standards consortium. Example: Converting 1-1 Binary Relationship

8 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management international, open membership, not- for-profit technology standards consortium. Example: Converting 1-1 Binary Relationship

9 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management international, open membership, not- for-profit technology standards consortium. Example: Converting 1-1 Binary Relationship Converting one-to-one Salesperson/Office relationship – Options: Convert relationship to single/combined table Convert relationship to two tables

10 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management international, open membership, not- for-profit technology standards consortium. Example: Converting 1-1 Binary Relationship Considerations: – Business environment considers Salesperson and Office as separate entities – Modality of zero at Salesperson entity in E-R diagram (office may have no one assigned) – Salesperson entity in E-R diagram has relationships with other entities

11 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management international, open membership, not- for-profit technology standards consortium. Example: Converting 1-1 Binary Relationship Solution 1: – Combine two entities into one table

12 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management international, open membership, not- for-profit technology standards consortium. Example: Converting 1-1 Binary Relationship Solution 2: – Two separate tables – Office Number as foreign key in Salesperson table

13 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management international, open membership, not- for-profit technology standards consortium. Example: Converting 1-1 Binary Relationship Solution 3: – Two separate tables – Salesperson Number as foreign key in Office table

14 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management Example: Converting 1-M Binary Relationship

15 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management Example: Converting 1-M Binary Relationship Each occurrence of Salesperson is related to zero or more occurrences of Customer Unique identifier of entity on “one” side is placed as foreign key in entity of “many” side

16 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management Example: Converting 1-M Binary Relationship

17 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management Example: Converting M-M Binary Relationship

18 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management Example: Converting M-M Binary Relationship Most relational DBMS systems DO NOT directly support many-to-many relationships Solution: Include associative entity to establish relationship May use composite key as primary key in associative entity A key that is defined by multiple columns is called a composite key

19 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management Example: Converting M-M Binary Relationship

20 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management Example: Converting M-M Binary Relationship not required

21 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management Example: Converting 1-1 Unary Relationship

22 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management Example: Converting 1-1 Unary Relationship With: – Only one entity type involved, and – One-to-one relationship Conversion requires only one table

23 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management Example: Converting 1-M Unary Relationship each salesperson manages zero or more salespersons each salesperson is managed by a manager

24 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management Example: Converting 1-M Unary Relationship each salesperson is managed by a manager

25 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management Example: Converting M-M Unary Relationship Many-to-many unary relationship: – For example: one product can be constructed out of set or subset of other products – General rule in conversion: Number of tables equal to number of entity types plus one more table for many-to-many relationship – M-M unary relationship - 2 tables – M-M binary relationship - 3 tables – M-M ternary relationship - 4 four tables

26 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management Example: Converting M-M Unary Relationship

27 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management Example: Converting M-M Unary Relationship

28 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management international, open membership, not- for-profit technology standards consortium. Homework Read Chapter 4.1- pp