1. Convert a conceptual business process level REA model into a logical relational model 2. Convert a logical relational model into a physical implementation.

Slides:



Advertisements
Similar presentations
McGraw-Hill/Irwin Copyright © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. ENTERPRISE INFORMATION SYSTEMS A PATTERN BASED APPROACH Chapter.
Advertisements

BUSINESS DRIVEN TECHNOLOGY Plug-In T4 Designing Database Applications.
Chapter 3 Data Modeling Copyright © 2014 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent.
Copyright © 2015 Pearson Education, Inc. Database Design Chapters 17 and
Systems Development Life Cycle
1 © Prentice Hall, 2002 Chapter 3: Modeling Data in the Organization Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
Database Design & Mapping
The Relational Database Model:
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.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
Implementing an REA Model in a Relational Database
Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 18-1.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Introduction to Databases
The Relational Database Model
3 The Relational Model MIS 304 Winter Class Objectives That the relational database model takes a logical view of data That the relational model’s.
The Relational Database Model
1 © Prentice Hall, 2002 Chapter 3: Modeling Data in the Organization Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
3.1 CSIS 3310 Chapter 3 The Entity-Relationship Model Conceptual Data Modeling.
1 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management.
Module Title? DBMS E-R Model to Relational Model.
44220: Database Design & Implementation Logical Data Modelling Ian Perry Room: C48 Tel Ext.: 7287
Relational Model Session 6 Course Name: Database System Year : 2012.
Chapter 3 The Relational Model Transparencies Last Updated: Pebruari 2011 By M. Arief
McGraw-Hill/Irwin Copyright © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. ENTERPRISE INFORMATION SYSTEMS A PATTERN BASED APPROACH Chapter.
Data Modelling – ERD Entity Relationship Diagram’s Entity Relationship Diagrams and how to create them. 1.
The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
Concepts of Relational Databases. Fundamental Concepts Relational data model – A data model representing data in the form of tables Relations – A 2-dimensional.
Copyright 2008 McGraw-Hill Ryerson 1 TECHNOLOGY PLUG-IN T5 DESIGNING DATABASE APPLICATIONS.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T5: Designing Database Applications Business Driven Technology.
Implementing an REA Model in a Relational Database
© 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.
Relational Database. Database Management System (DBMS)
System Design System Design - Mr. Ahmad Al-Ghoul System Analysis and Design.
Implementing an REA Model in a Relational Database
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.
In this session, you will learn to: Map an ER diagram to a table Objectives.
Database Systems, 9th Edition 1.  In this chapter, students will learn: That the relational database model offers a logical view of data About the relational.
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 3 The Relational Database Model.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
The relational model A data model (in general) : Integrated collection of concepts for describing data (data requirements). Relational model was introduced.
1 ER Modeling BUAD/American University Mapping ER modeling to Relationships.
* Database is a group of related objects * Objects can be Tables, Forms, Queries or Reports * All data reside in Tables * A Row in a Table is a record.
Chapter 3: Modeling Data in the Organization. Business Rules Statements that define or constrain some aspect of the business Assert business structure.
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.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
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.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 18-1.
Chapter 3 The Relational Model. Objectives u Terminology of relational model. u How tables are used to represent data. u Connection between mathematical.
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.
Implementing an REA Model in a Relational Database
View Integration and Implementation Compromises
Chapter 6 Relational Database Design: Converting Conceptual Models to Relational Databases.
DESIGNING DATABASE APPLICATIONS
Chapter 5: Logical Database Design and the Relational Model
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter 4 Relational Model Characteristics
CHAPTER 4: LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL
Presentation transcript:

1. Convert a conceptual business process level REA model into a logical relational model 2. Convert a logical relational model into a physical implementation using Microsoft Access 3. Explain the difference between conceptual, logical, and physical database models 4. Enter transaction data into a relational database 5. Interpret a physical database implementation in Microsoft Access to determine what must have been the underlying logical model 6. Interpret a logical relational model to determine what the underlying conceptual model must have been 7. Recognize and implement various application level controls to facilitate the integrity of data entered into a relational database

 A Conceptual model represents reality in an abstracted form › Hardware and software independent › Independent of any logical model type  A Logical model represents reality in the format required by a particular database model › Hardware and software independent › Depends on the chosen logical model type  A Physical model is created specifically for a particular database software package › Dependent on hardware, software › Dependent on the chosen logical model type

 Based on set theory and predicate logic  A relational database consists of tables (relations) that are linked together via the use of primary and foreign keys › A FOREIGN KEY is a primary key from a different table that has been posted into the table to create a link between the two tables

 Relational database tables are made up of rows and columns › Rows are called the table extension or tuples  The ordering of rows in a table does not matter › Columns are called the table intension or schema  The ordering of columns in a table does not matter  All values in a column must conform to the same data format (e.g. date, text, currency, etc.) › Each cell in a database table (a row-column intersection) can contain only one value  no repeating groups are allowed

SalespersonIDName123456Fred Francis SaleIDDateAmountSalespersonID061401A6/14$4, B6/14$6, A6/15$1,

 Some principles of the relational model › Entity Integrity  A primary key in a table must not contain a null value  Guarantees uniqueness of entities and enables proper referencing of primary key values by foreign key values › Referential Integrity  A value for a foreign key in a table must either  Be null (blank)  Match exactly a value for the primary key in the table from which it was posted › One Fact, One Place  Fact = a pairing of a candidate key attribute value with another attribute value  Facts are found in the extensional data

One fact in multiple places

One Fact-One Place Violations Multiple facts in one place

 Step 1: Create a separate table to represent each entity in the conceptual model › 1A: Each attribute of the entity becomes a column in the relational table › 2A: Each instance (member) of the entity set will become a row in the relational table

 Step 2: Create a separate table to represent each many-to-many relationship in the conceptual model › You must create a separate table to represent the relationship  The primary keys of the related entity tables are posted into the relationship table to form its primary key. This kind of primary key is called a composite or concatenated primary key  This avoids redundancy  There are no exceptions to this rule!!! › If you post a foreign key in either direction, redundancy will be a problem for many-to-many relationships

 Maximum Cardinalities › The general rule is to post into a “1” entity table  This avoids “repeating groups” redundancy › You can NEVER post into an “N” entity  This causes “repeating groups” redundancy  Minimum Cardinalities › The general rule is to post into a “1” (mandatory) entity table  This avoids null values in the foreign key column › This rule should be violated in some circumstances (to be discussed soon)

Student#NameAddress1TonyCleveland 2Emily New York 3LeighBirmingham Course#NameAcg4401AIS Acg3101 FAR 1 Course# * Student#*

Example: Many-Many Relationship Student#NameAddress1TonyCleveland 2Emily New York 3LeighBirmingham Course#NameAcg4401AIS Acg3101 FAR 1 Student#Course#1Acg4401 1Acg3101 2Acg4401 2Acg3101 3Acg3101

 Step 3: For participation cardinality pattern (1,1)-(1,1), consider whether the two entities are conceptually separate or whether they should be combined › If they should remain separate, then  3A: Post the primary key from one entity’s table into the other entity’s table as a foreign key  DO NOT make a separate table

SaleIDDateAmountS16/12$10 S26/12$15 S36/13$12 CR-IDDateAmountCR16/12$10 CR26/12$15 CR36/13$12 CR-ID * CR1 CR2 CR3 S-ID * S1 S2 S3 Choose ONE of these; DO NOT do both!!! Sale Cash Receipt yields (1,1) SaleID Date Amount CR-ID Date Amount

 Step 4: For remaining relationships that have (1,1) cardinality pair in one entity set, post the related entity’s primary key into the (1,1) entity’s table as a foreign key › I.e., for the following cardinality patterns (0,N)-(1,1) (1,N)-(1,1) (1,1)-(0,N) (1,1)-(1,N) (0,1)- (1,1) (1,1)-(0,1)  Do NOT make a separate table  Post a foreign key INTO the (1,1) entity’s table from the other entity’s table

Sale Customer Is-to (1,1) (0,N) SaleID Date Amount CustID Name City (1,N) orSaleIDDateAmountS16/12$10 S26/12$15 S36/13$12 CincinnatiStevenC2 Walnut Creek HeatherC1AddressNameCust-ID Cust-ID* C3DaveCincinnati S-ID*

Example 2: Posting into a (1,1) Sale Cash Receipt yields (1,1) (0,1) SaleID Date Amount CR-ID Date Amount SaleIDDateAmount S16/12$10 S26/12$15 S36/13$12 CR-IDDateAmountCR16/12$10 CR26/12$15 CR36/13$12 CR46/13$1,000 CR-ID* S-ID*

 Step 5: For remaining relationships that have (0,1) cardinality pair by one or both of the entities, consider load I.e., for the following cardinality patterns (0,N)-(0,1) (1,N)-(0,1) (0,1)-(0,N) (0,1)-(1,N) (0,1)-(0,1)  The rule for maximum cards requires posting into a (0,1) or making a separate table  The rule for minimum cards says you shouldn’t post into the (0,1) › 5A: Post the related entity’s primary key into the (0,1) entity’s table as a foreign key for any relationships for which that results in a high load › 5B: Create a separate table for any relationships for which posting a foreign key results in low load  Note: For (0,1)-(0,1), step 5A, post whichever direction results in highest load; if neither direction yields high load, then follow step 5B

 Some cash disbursements (13/26) pay for purchases › If we post Receiving Report# into Cash Disbursement, 13 out of 26 will be non-null › This is a medium load › Might be worth breaking minimum rule › Consider other posting option  Most purchases (14/18) result in cash disbursements › If we post Check# into Purchase, 14 out of 18 will be non-null › This is a high load › Worth breaking the minimum rule

 Few purchases (3/18) result in purchase returns › If we post Purchase Return Slip# into Purchase, only 3 out of 18 will be non-null › This is low load › Must either make a separate table or consider posting the other direction  Can’t post receiving report# into purchase return because one purchase return slip # can be associated with multiple purchases

 If relationship becomes a separate table, then relationship attributes are placed in that table  If relationship can be represented by a posted foreign key, relationship attribute is posted alongside the foreign key

Relationship Attribute Placement If relationship becomes a separate table, then relationship attributes are placed in that table If relationship can be represented by a posted foreign key, relationship attribute is posted alongside the foreign key

 What facts are in multiple places in this table?  Reverse engineer to get the ER model that this table must represent  Is the ER model that results in this table correct?  What SHOULD the ER model have been instead?  What is the correct relational model?EmpIDEmpNamePayrate Hours Worked Dept#DeptName8532Andy$1336D423Audit 7352Jennifer$1445D423Audit 215Arlie$2050D777ISAAS 4332Craig$1860D821Tax 74Steven$2264D821Tax Employee

Department Assigned to EmplID Empname HoursWorked Payrate DeptID DeptName EmpIDEmpNamePayrate Hours Worked Dept#8532Andy$1336D Jennifer$1445D Arlie$2050D Craig$1860D821 74Steven$2264D821 Dept#DeptNameD423Audit D777ISAAS D821Tax Employee Department

 What facts are in multiple places?  How could this be avoided?Warehouse#AddressQOHW1 123 Oak 2,14,784 W2 456 Pine 4,23,873 Product # DescriptionStdCostQOHAB12Granddaddy$5,0002,4 BC445Mama$3,00014,23 DD2Littlebabe$100784,873 Warehouse#Product#W1AB12 W1BC445 W1DD2 W2AB12 W2BC445 W2DD2 Inventory Warehouse InventoryInWarehouse

Fixing Multiple Facts in One Place Warehouse#Address W1 123 Oak W2 456 Pine Product # DescriptionStdCostAB12Granddaddy$5,000 BC445Mama$3,000 DD2Littlebabe$100 Warehouse#Product#QOHW1AB122 W1BC44514 W1DD2784 W2AB124 W2BC44523 W2DD2873 Inventory Warehouse InventoryInWarehouse

 The relational model is based on set theory and predicate logic and the resultant relations (tables) can be manipulated for information retrieval purposes if they are properly constructed  To create well-behaved tables, follow the rules we discussed › Conversion rules for cardinality patterns › One Fact-One Place  Think at the data (extensional) level!!  When creating physical databases, use the conceptual and logical models to help you realize the important issues and potential pitfalls