Associative Entities A relationship cannot have attributes

Slides:



Advertisements
Similar presentations
Exercise 1 Consider the ER diagram below. Assume that an employee may work in up to two departments or may not be assigned to any department. Assume that.
Advertisements

Entity-Relationship (ER) Modeling
1 © Prentice Hall, 2002 Chapter 4: The Enhanced E-R Model and Business Rules Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott,
Text-Book Chapters (7 and 8) Entity-Relationship Model
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,
System Analysis - Data Modeling
CS157A Lecture 3 ER Diagram Prof. Sin-Min Lee Department of Computer Science San Jose State University.
Chapter 4 © 2005 by Prentice Hall 1 Objectives Definition of terms Definition of terms Use of supertype/subtype relationships Use of supertype/subtype.
Information Resources Management February 6, 2001.
Review Questions What is data modeling? What is the actual data model that is created called? Data modeling is a technique for organizing and documenting.
Information Resources Management February 13, 2001.
Data Modeling Advanced Concepts.
Information Resources Management January 30, 2001.
Database Design Chapter 2. Goal of all Information Systems  To add value –Reduce costs –Increase sales or revenue –Provide a competitive advantage.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
Slides adapted from A. Silberschatz et al. Database System Concepts, 5th Ed. Entity-Relationship Model Database Management Systems I Alex Coman, Winter.
The Enhanced E-R (EER) Model
IS 4420 Database Fundamentals Chapter 4: The Enhanced ER Model and Business Rules Leon Chen.
Chapter Five Data Modeling with the Entity-Relationship Model.
Chapter 2: Entity-Relationship Model (Continued)
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Chapter 3: The Enhanced E-R Model
 Keys are special fields that serve two main purposes: ◦ Primary keys are unique identifiers of the relation in question. Examples include employee numbers,
Data Modeling Using the Entity-Relationship Model
1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name Position (123) University Name.
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.
Database System Concepts, 5th Ed. Chapter 6: Entity-Relationship Model.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
Module Title? Data Base Design 30/6/2007 Entity Relationship Diagrams (ERDs)
Entity Relationship Diagrams Objectives s Learn the Elements of the E-R model (entities, attributes, and relationships) s Show how to apply the E-R model.
ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
1 Relational Databases and SQL. Learning Objectives Understand techniques to model complex accounting phenomena in an E-R diagram Develop E-R diagrams.
© Pearson Education Limited, Chapter 7 Entity-Relationship modeling Transparencies.
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.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
Chapter 2 : Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping Constraints Keys E-R Diagram Extended E-R Features Design of.
1 The Enhanced Entity Relationship Diagrams (E-ERDs)
ITTelkom Entity Relationship Diagram (1) CS2343 Perancangan Basisdata Relasional.
UNIT_2 1 DATABASE MANAGEMENT SYSTEM[DBMS] [Unit: 2] Prepared By Lavlesh Pandit SPCE MCA, Visnagar.
Chapter 3: The Enhanced E-R Model
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,
Database Systems Supertypes and Subtypes Lecture # 10.
Entity Relationship Modeling
ICOM 5016 – Introduction to Database Systems Lecture 5 Dr. Manuel Rodriguez Department of Electrical and Computer Engineering University of Puerto Rico,
Chapter 9 Structuring System Data Requirements Modern Systems Analysis and Design Fifth Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
CIS 210 Systems Analysis and Development Week 6 Part I Structuring Systems Data Requirements,
The Entity-Relationship Model, P. I R. Nakatsu. Data Modeling A data model is the relatively simple representation, usually graphic, of the structure.
© 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,
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Mapping Constraints Keys.
Copyright © 2016 Pearson Education, Inc. Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki Topi CHAPTER 3: THE ENHANCED.
Lecture 26 Enterprise Systems Development ( CSC447 ) COMSATS Islamabad Muhammad Usman, Assistant Professor.
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Appendix H: The Semantic Object Model.
Data Modeling Advanced Concepts Updated 20/4/2015 TMC2034 Database Concept and Design1.
Lecture # 14 Chapter # 5 The Relational Data Model and Relational Database Constraints Database Systems.
Modeling data in the Organization
LECTURE 4: Chapter 4: The Enhanced E-R Model
Entity-Relationship Model
Entity-Relationship Model
Entity Relationship Diagrams
Super Entity & Sub Entity
Entity Relationship Diagrams
Overview of Entity‐Relationship Model
Chapter 6: Entity-Relationship Model
Chapter 5 Advanced Data Modeling
Chapter 7: Entity-Relationship Model
Entity-Relationship Diagram (ERD)
Database Management system
Presentation transcript:

Associative Entities A relationship cannot have attributes What happens when one or more attributes exist for a relationship? Employee – Project – Billing Rate

Associative Entities An associative entity is an entity type that associates the instances of more or more entity types and contains attributes that are specific to the relationship between those entity instances.

Converting a relationship to an associative entity Example Employee’s billing rate can vary by project (employee to project, many-to-many) Billing Rate Employee Project

Example: Attribute of the relationship between property and owner is percent owned % Owned Owner Property

Ternary Relationship simultaneous relationship among one instance from each of exactly three entity sets An associative entity is not required but is typical.

Ternary Relationships – Cardinality “one” – one instance of an entity is associated with each unique pair of the other two entities. “many” – more than one instance of an entity is associated with each unique pair from each of the other two entities.

Example (one-to-one-to-one): Employee is assigned a phone number for a project. A phone number is used only for that employee and project.

Example (one-to-one-to-one): Employee Has Project Phone Number Note: An employee could still be assigned to multiple projects but would have a unique phone number for each project assignment.

Example (one-to-one-to-many): Employee assigned to a project works at one location for that project but can work at different locations for different projects. At a location an employee only works on one project, but there can be many employees working on that same project.

Example (one-to-one-to-many): Employee Has Project Location

Example (one-to-many-to-many): Employee on a project has one manager. Manager can manage several projects. Each project has one manager. Manager can manage the same employee on different projects.

Example (one-to-many-to-many): Employee Has Project Manager

Example (many-to-many-to-many): Employees use many skills on many projects and each project has many employees with varying skills.

Example (many-to-many-to-many): Employee Has Project Skill

Ternary Relationships Why not just make the ternary relationship an associative entity? Location Employee Project

Good idea if possible. However, “Business Rules” Need for separate (strong) entity What if location also related to other entities? No longer valid as associative entity If you can safely get rid of ternary (or n-ary) relationships, DO IT. However, don’t trade correctness for ease of implementation.

Example: Employee assigned to a project works at one location and is only assigned to one project. However, projects can be at more than one location and have multiple employees working on them at each location. Multiple projects can be at the same location. Draw the E-R Diagram.

Update your E-R Diagram. Example: Now, suppose employees have a billing rate that varies with both project and location. Update your E-R Diagram.

Generalization/ Specialization Generalization: Defining a general entity type from a set of more specialized ones (bottom-up). Specialization: Defining one or more specialized entities from a more general one based on distinguishing characteristics (top-down).

Examples: Generalization: Bank account generalized from checking, savings, and loan. Specialization: Property for sale divided into single family, duplex, apartment, commercial, or industrial.

Why use generalization or specialization? clarity more fully describe situation conversion to OO (inheritance) different relationships only apply to specific subtypes monthly charges only made to checking accounts different relationships only apply to the supertype customer must have an account with the bank different (additional) attributes for the subtypes

Generalization/ Specialization Applies to entities only Types: disjoint – can be only one subtype overlapping – can be more than one subtype Completeness Constraint – subtypes fully inclusive of supertype

Generalization/ Specialization Disjoint – student can be undergraduate, masters, or doctoral Overlapping – major can be history, philosophy, or mathematics

Example A company sells products whose price can change at most once a day. Need to be able to track the price history.

Multivalued Attribute Product ID Product Description Price Price History Effective Date Product Type