CIT 381 ER Modeling Difficulties - categories - generalization - three-way relationships.

Slides:



Advertisements
Similar presentations
More Diagramming & Practice with Relationship Modeling
Advertisements

ER to Relational Mapping. Logical DB Design: ER to Relational Entity sets to tables. CREATE TABLE Employees (ssn CHAR (11), name CHAR (20), lot INTEGER,
Logical DB Design: ER to Relational Entity sets to tables. Employees ssn name lot CREATE TABLE Employees (ssn CHAR (11), name CHAR (20), lot INTEGER, PRIMARY.
Transform an ER Model into a Relational Database Schema
Week 5 Relational Database Design by ER- -to-Relational Mapping.
BUSINESS DRIVEN TECHNOLOGY Plug-In T4 Designing Database Applications.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
The Entity-Relationship Model
Book Chapter 3 (part 2 ) From ER to Relational Model.
Mapping an ERD to a Relational Database To map an ERD to a relational database, five rules are defined to govern how tables are constructed. 1)Rule for.
CIT 381 Slides part 3. Review: One-to-many and many-to-one One movie is stored on many videos – many videos are in one store. Both relationships are mandatory.
Concepts of Database Management Sixth Edition
CIT 381 More ER Modeling - review one-to-many - one-to-one - recursive relationships.
Review Database Application Development Access Database Development ER-diagram Forms Reports Queries.
Chapter Five Data Modeling with the Entity-Relationship Model.
Motivation for IDEF1X Simplicity Common Standard Useful when relational model is target Air Force 1985 or thereabouts.
Database Design Chapter 2. Goal of all Information Systems  To add value –Reduce costs –Increase sales or revenue –Provide a competitive advantage.
Mapping of N:M Relationships PERSON-ID TITLE PERSON-NAME DATE-OF-BIRTH PERSON-ID PROJECT-ID HOURS-SPENT PROJECT-ID END-DATE START-DATE E-R Diagram PERSON.
Concepts of Database Management Seventh Edition
CIT 381 ER Basics - relationship types - foreign keys - ER Studio.
Chapter Five Data Modeling with the Entity-Relationship Model.
Chapter 7 Relational Database Design by ER- and EER-to-Relational Mapping Copyright © 2004 Pearson Education, Inc.
Entity Relationships. Relationships Relationships exist between entities The type of relationship is entirely dependent on the business rules The business.
CS 405G Introduction to Database Systems
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.
IS 325 Notes for Wednesday September 18, 2013.
Database. Basic Definitions Database: A collection of related data. Database Management System (DBMS): A software package/ system to facilitate the creation.
Conceptual Design Lecture - 2 Database Development.
Chapter 5 Entity–Relationship Modeling
Principles of Database Systems With Internet and Java Applications Today’s Topic Chapter 2: Representing Information with Data Models The lecture notes.
Principles of Database Design, Part II AIMS 2710 R. Nakatsu.
Database Design Principles – Lecture 3
What we’ve learnt Doc 5.69 Doc 5.70 Section 1-3. A simple database Related objects Tables hold the data Forms, reports, queries to access the data.
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.
Database Design and SQL Connie Wagner, Instructor.
Entity-Relationship (ER) Modelling ER modelling - Identify entities - Identify relationships - Construct ER diagram - Collect attributes for entities &
The Relational Model1 ER-to-Relational Mapping and Views.
Database Management System Quiz 1. A company needs to store information about: the employees identified by EmpNo, Name, Salary and Phone; departments.
Copyright © 2003 Addison-Wesley Sree Nilakanta. Copyright © 2003 Addison-Wesley Developing Relational Models What is the relational model and what is.
Concepts of Database Management, Fifth Edition Chapter 6: Database Design 2: Design Methodology.
An Entity Relationship (ER) Diagram is a graphic that shows the interrelationship between entities in a database.
 Entity-relationship models (ERM) Entity-relationship models (ERM)  Simple E-R Diagram Simple E-R Diagram  Weak Entity Weak Entity  Strong Entity.
© D. Wong Ch. 2 Entity-Relationship Data Model (continue)  Data models  Entity-Relationship diagrams  Design Principles  Modeling of constraints.
Description and exemplification of entity-relationship modelling.
Jozef Kuper.  Describe a Database  Entities  Atributes  Relationships.
CPSC 603 Database Systems Lecturer: Laurie Webster II, M.S.S.E., M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 2 Introduction to a First Course in Database Systems.
IST 318 – DB Administration Data Retrieval Using SELECT statements.
Lecture 3 Book Chapter 3 (part 2 ) From ER to Relational.
Database Design – Lecture 6 Moving to a Logical Model.
Copyright © Curt Hill Entities and Relationships The basics and what they have to do with database.
Lecture 03 Entity-Relationship Diagram. Chapter Outline.
Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin APPENDIX C DESIGNING DATABASES APPENDIX C DESIGNING DATABASES.
COP-5725 Practice Exercises
IST 220 – Intro to DB Lecture 4 Database Design thru ER Modeling.
Mapping E/R to RM, R. Ramakrishnan and J. Gehrke with Dr. Eick’s additions 1 Mapping E/R Diagrams to Relational Database Schemas Second Half of Chapter.
COMP 430 Intro. to Database Systems ER Implementation as Tables Slides use ideas from Chris Ré.
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.
Modeling: Entity-Relationship Diagrams
1 The Relational Data Model David J. Stucki. Relational Model Concepts 2 Fundamental concept: the relation  The Relational Model represents an entire.
Rationale Databases are an integral part of an organization. Aspiring Database Developers should be able to efficiently design and implement databases.
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
Entity Relationship Diagrams
SQL Relational Database Project
INF385T: Information Modeling — Class 11 Relational Database Design from ER Models Presented November 2 Karen Wickett,
From ER to Relational Model
IST 318 Database Administration
Entity-Relationship Modeling "Extended"
Database Systems Instructor Name: Lecture-11.
Mapping an ERD to a Relational Database
Presentation transcript:

CIT 381 ER Modeling Difficulties - categories - generalization - three-way relationships

Relationship types From ER Studio documentation

Categories and roles Suppose that we have employees with key ssn Some of the employees are staff and are paid hourly Other employees are paid a salary The can be handled easily using weak entities

Categories with weak entities Example from bighitvideo database. Note the implicit ‘Z’ - a one-to-one relationship.

Categories - more formal You do not need to use this notation. We mention it since you may see it.

Generalization Suppose we have three entities: company, pilot, and aircraft company has key compId (an int) pilot has key license (a char) An aircraft can be owned by either a company or a pilot (but not both) How do we model this? It’s hard!

Aircraft owner problem We need to ensure that one of the foreign keys is null and the other is not null.

An attempt: introduce an owner Now how to connect owner to the owning entities?

Connect the owner Still kind of strange, but still better. Must ensure that each ownerId appears just once as either a pilot or a company. (Can be modeled as a complete exclusive category.)

Subtleties with 3-way relationships Well, we don’t really have 3-way relationships, because we create bridge tables. But think of entities class, book, instructor

Three-way example Consider where the books used for a class depend on the instructor: classNuminstrNametitle CIT381ChrisBig DB CIT381CraigGood DB CIT381CraigMySQL Bk CIS313ChrisAlgorithms

Bridge table has three keys

Small change At most one book per class. Then title not part of key. Question: Should the dotted line be mandatory or optional?

Another change Several books per class, but books used do not depend on the instructor. This design avoids duplication. Why?