Copyright © 2006 Quest Software Data Modeling: It’s All About the Relationships Presenter: Bert Scalzo, Oracle Domain Expert AUDIO.

Slides:



Advertisements
Similar presentations
Relational Database. Relational database: a set of relations Relation: made up of 2 parts: − Schema : specifies the name of relations, plus name and type.
Advertisements

Copyright © 2006 Quest Software Toad Tips & Tricks for DBA’s Bert Scalzo, Domain Expert, Oracle Solutions
Overview Begin 6:00 Quiz15 mins6:15 Review Table Terms25 mins6:40 Short Break10 mins6:50 SQL: Creating Tables60 mins7:50 Break10 mins8:00 Lab – Creating.
THE RELATIONAL DATABASE MODEL & THE DATABASE DEVELOPMENT PROCESS Fact of the Week: According to a Gartner study in ‘06, Microsoft SQL server had the highest.
Chapter 3 The Relational Model Transparencies © Pearson Education Limited 1995, 2005.
Fundamentals, Design, and Implementation, 9/e COS 346 Day 8.
Fundamentals, Design, and Implementation, 9/e Chapter 5 Database Design.
Chapter 3. 2 Chapter 3 - Objectives Terminology of relational model. Terminology of relational model. How tables are used to represent data. How tables.
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 6 Developing Data Models for Business Databases.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 COS 346 Day 10.
Relational Model and Relational Algebra Rose-Hulman Institute of Technology Curt Clifton.
The Relational Model 1 Prof. Sin-Min Lee Department of Mathematics and Computer Science Prof. Sin-Min Lee Department of Computer Science.
CS424 PK, FK, FD Normalization Primary and Foreign Keys Primary and foreign keys are the most basic components on which relational theory is based. Primary.
The Relational Model Codd (1970): based on set theory Relational model: represents the database as a collection of relations (a table of values --> file)
Chapter 6 Developing Data Models for Business Databases.
© 2008 Quest Software, Inc. ALL RIGHTS RESERVED. Managing Database Change with Data Modeling Bert Scalzo, PhD
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Database Architecture The Relational Database Model.
Exam 2 Review Dr. Bernard Chen Ph.D. University of Central Arkansas.
CS 380 Introduction to Database Systems (Chapter 5: The Relational Data Model and Relational Database Constraints)
Lecture 2 The Relational Model. Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical relations.
Chapter 4 The Relational Model Pearson Education © 2014.
© Pearson Education Limited, Chapter 2 The Relational Model Transparencies.
Relational Model Session 6 Course Name: Database System Year : 2012.
Chapter 4 The Relational Model.
Learningcomputer.com SQL Server 2008 – Entity Relationships in a Database.
Concepts of Database Management Seventh Edition Chapter 4 Keys and Relationship.
CG084&085 / / 1 The Relational Data Model Properties of Relations Keys and Constraints.
Fundamentals of Relational Database Yong Choi School of Business CSUB, Bakersfield.
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 5 The Relational Data Model.
Lecture 7 Integrity & Veracity UFCE8K-15-M: Data Management.
Concepts of Relational Databases. Fundamental Concepts Relational data model – A data model representing data in the form of tables Relations – A 2-dimensional.
Ihr Logo Fundamentals of Database Systems Fourth Edition El Masri & Navathe Chapter 5 The Relational Data Model and Relational Database Constraints.
1 The Relational Database Model. 2 Learning Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical.
9/7/2012ISC329 Isabelle Bichindaritz1 The Relational Database Model.
Database Design, Application Development, and Administration, 5 th Edition Copyright © 2011 by Michael V. Mannino All rights reserved. Chapter 6 Developing.
11/07/2003Akbar Mokhtarani (LBNL)1 Normalization of Relational Tables Akbar Mokhtarani LBNL (HENPC group) November 7, 2003.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
CS 3630 Database Design and Implementation. Database Schema Branch (Bno…) Staff (Sno…Bno) Owner (Ono…) PropertyForRent (Pno…Ono) Renter (Rno…) Viewing.
Chapter 4 Constraints Oracle 10g: SQL. Oracle 10g: SQL 2 Objectives Explain the purpose of constraints in a table Distinguish among PRIMARY KEY, FOREIGN.
A337 - Reed Smith1 Structure What is a database? –Table of information Rows are referred to as records Columns are referred to as fields Record identifier.
1 CS 430 Database Theory Winter 2005 Lecture 4: Relational Model.
The Relational Database Model & The Database Development Process
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
The Relational Model. 2 Relational Model Terminology u A relation is a table with columns and rows. –Only applies to logical structure of the database,
Logical Database Design and the Relational Model.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
CPSC 603 Database Systems Lecturer: Laurie Webster II, M.S.S.E., M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 5 Introduction to a First Course in Database Systems.
CHAPTER 2 : RELATIONAL DATA MODEL Prepared by : nbs.
The Relational Model © Pearson Education Limited 1995, 2005 Bayu Adhi Tama, M.T.I.
Copyright © 2006 Quest Software Quest RAC Tools Bert Scalzo, Domain Expert, Oracle Solutions
Lecture 4: Logical Database Design and the Relational Model 1.
Chapter 3 The Relational Model. Objectives u Terminology of relational model. u How tables are used to represent data. u Connection between mathematical.
Chapter 4 The Relational Model Pearson Education © 2009.
Lecture # 14 Chapter # 5 The Relational Data Model and Relational Database Constraints Database Systems.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Relational Data Model and Relational Database Constraints تنبيه.
Chapter 5 Database Design
Database, tables and normal forms
Quiz Questions Q.1 An entity set that does not have sufficient attributes to form a primary key is a (A) strong entity set. (B) weak entity set. (C) simple.
Chapter (9) ER and EER-to-Relational Mapping, and other Relational Languages Objectives How a relational database schema can be created from a conceptual.
Lecture # 13 (After 1st Exam)
Chapter (9) ER and EER-to-Relational Mapping, and other Relational Languages Objectives How a relational database schema can be created from a conceptual.
COS 346 Day 8.
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 4 The Relational Model Pearson Education © 2009.
The Relational Model Transparencies
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 4 The Relational Model Pearson Education © 2009.
Mapping an ERD to a Relational Database
Chapter (7) ER-to-Relational Mapping, and other Relational Languages
Presentation transcript:

Copyright © 2006 Quest Software Data Modeling: It’s All About the Relationships Presenter: Bert Scalzo, Oracle Domain Expert AUDIO INFORMATION Toll free: Toll: Confirmation Code:

1 About the Author … Domain Expert & Product Architect for Quest Software Oracle Background: Worked with Oracle databases for over two decades (starting with version 4) Work history includes time at both “Oracle Education” and “Oracle Consulting” Academic Background: Several Oracle Masters certifications BS, MS and PhD in Computer Science MBA (general business) Several insurance industry designations Key Interests: Data Modeling Database Benchmarking Database Tuning & Optimization "Star Schema" Data Warehouses Oracle on Linux – and specifically: RAC on Linux Articles for: Oracle’s Technology Network (OTN) Oracle Magazine, Oracle Informant PC Week (eWeek) Articles for: Dell Power Solutions Magazine The Linux Journal

2 Books by Author … Coming in 2008 …

3 Agenda Purpose –Identify the primary and secondary goals of a data modeling –Speculate as to why data models so often miss primary goal –Propose data modeling tools can’t make up for human error –Examine three well known yet often repeated relationship errors –Provide Best Practices to resolve these issues (i.e. avoid them) Overview –No such things “Partial Foreign Keys” –Neither do “Incomplete Foreign Keys” –Unification – what is it and when to do –Conclusion & Questions/Answers

4 Partial Foreign Keys Don’t Exist Q: Why can’t I make certain attributes of a unique identifier relate to the foreign key (FK) in a child any way I like? A: Because Relational Algebra, Relational Calculus, Codd, Date, and all that’s relational say “Heck No!!!” Three fundamental FK requirements: Relation R1 references R2 R1’s FK attributes have exactly the same domain R2’s PK attributes For each tuple (i.e. row) t1 in r(R1) and t2 in r(R2), either t1[FK] = t2[PK] (entirely),or t1[FK] is NULL

5 Example #1 Identifying relationship lost Toad Data Modeler won’t permit this error

Toad Data Modeler makes this less likely 6 Example #2 Identifying relationship overuse

7 Example #3 Identifying relationship misuse Toad Data Modeler can workaround error

8 Incomplete Foreign Keys Do Not Exist All or None Complete PK as the FK (i.e., both columns) or supply the FK with just column A Not referentially correct, but permitted since column B is optional Looks Safe Just as bad or actually worse Can be legal: A+B, or NULL+NULL Can be illegal: A+NULL or B+NULL

9 Toad Data Modeler will generate check constraint to be safe: constraint FK_COMPLETE check ((A is null and B is null) Or (A is not null and B is not null)) ANSI SQL 92 permits and databases such as Oracle support alternative matching rules for composite foreign keys, including: Match Full –Partially null foreign keys are not permitted. Either all components of the foreign key must be null, or the combination of values contained in the foreign key must appear as the primary or unique key value of a single row of the referenced table. Match Partial – Partially null composite foreign keys are permitted. Either all components of the foreign key must be null, or the combination of non-null values contained in the foreign key must appear in the corresponding portion of the primary or unique key value of a single row in the referenced table. Match None – Partially null composite foreign keys are permitted. If any column of a composite foreign key is null, then the non-null portions of the key do not have to match any corresponding portion of a parent key. Incomplete Foreign Keys Do Not Exist

10 Unification – not as scary as it sounds! Q: Why doesn’t Table_3 have columns A and B twice? A: We performed column level unification

11 …Otherwise we would have had this – with A & B duplicates in TABLE_3. Unification – not as scary as it sounds!

12 Let’s Test What We’ve Learned – Is This Model Okay? FK1 and FK2 both share the column SSN If employee has doctor’s report, but without associated accident, unifying FK1 and FK2 leads to incomplete FK (i.e., SSN without an accident date) Left side of Relationship2 is optional – therefore, model is correct

13 Thank you! Questions or Comments? Three Part Data Modeling Series: –Data Modeling: Common Mistakes and Their ImpactData Modeling: Common Mistakes and Their Impact –Data Modeling: It’s All About the RelationshipsData Modeling: It’s All About the Relationships –Data Modeling: Reality Requires Supertypes and SubtypesData Modeling: Reality Requires Supertypes and Subtypes Toad Data Modeler v3.2 –Reasonable cost, easy to use data modeling tool for the rest of us … –Support for Oracle 11g and Access , import from SQL script, SQL code generation by SCHEMA, and much more! –