Information Resources Management February 6, 2001.

Slides:



Advertisements
Similar presentations
ER Modeling Case Studies
Advertisements

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.
Chapter 3: The Enhanced E-R Model
Advanced Data Modeling
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 6 Advanced Data Modeling.
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 5 Advanced Data Modeling.
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter 6 Advanced Data Modelling
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 6 Advanced Data Modeling.
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
Associative Entities A relationship cannot have attributes
Information Resources Management February 13, 2001.
1–1 The E-R Model Prof. Sin-Min Lee Department of Computer Science.
Data Modeling Advanced Concepts.
Information Resources Management January 30, 2001.
The Enhanced E-R (EER) Model
Chapter Five Data Modeling with the Entity-Relationship Model.
Chapter 2 Modeling Data in the Organization
Modern Systems Analysis and Design Third Edition
CSCI 6442 Entity-Relation Data Modeling Copyright 2012, David C. Roberts, all rights reserved.
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
Data Modeling Using the Entity-Relationship Model
1 © Prentice Hall, 2002 Chapter 3: Modeling Data in the Organization Modern Database Management 7th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R.
1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name Position (123) University Name.
Data Modeling using Entity Relationship Diagramming (ERD)
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.
Dr. Mohamed Osman Hegaz1 Conceptual data base design: The conceptual models: The Entity Relationship Model.
Instructor :Huda Al-Omair
Module Title? Data Base Design 30/6/2007 Entity Relationship Diagrams (ERDs)
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Chapter 8 Data Modeling Advanced Concepts Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
©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.
Lecture 4 Conceptual Data Modeling. Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship,
Database Design 3: Advanced Data Modeling Concepts CS 320.
©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.
UNIT_2 1 DATABASE MANAGEMENT SYSTEM[DBMS] [Unit: 2] Prepared By Lavlesh Pandit SPCE MCA, Visnagar.
Entity Relationship Modeling
Entity-Relation Model. E-R Model The Entity-Relationship (ER) model was originally proposed by Peter in 1976 ER model is a conceptual data model that.
advanced data modeling
Database Systems: Design, Implementation, and Management Ninth Edition
MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj ER Model Lecture 2 © Akhilesh Bajaj, 2000, 2002, 2003, 2004,
Slide 4-1 Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition Revised by IB & SAM, Fasilkom UI, 2005 Exercise 1. a property or description.
Chapter 3: Modeling Data in the Organization. Business Rules Statements that define or constrain some aspect of the business Assert business structure.
CSE 412/598 DATABASE MANAGEMENT COURSE NOTES 3. ENTITY-RELATIONSHIP CONCEPTUAL MODELING Department of Computer Science & Engineering Arizona State University.
©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.
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
Databases (CS507) CHAPTER 7.
Entity-Relationship Model
Entity-Relationship Model
Chapter 7: Entity-Relationship Model
Overview of Entity‐Relationship Model
MIS2502: Data Analytics Relational Data Modeling
Chapter 2 Modeling Data in the Organization
Chapter 5 Advanced Data Modeling
ER Modeling Case Studies
MIS2502: Data Analytics Relational Data Modeling
Entity-Relationship Diagram (ERD)
Entity Relation Model Tingting Zhang.
Database Management system
Database Management system
Presentation transcript:

Information Resources Management February 6, 2001

Agenda n Administrivia n Advanced E-R Modeling

Administrivia n Homework #2 n Homework #3

Difficulties with Previous E-R Modeling n employee’s billing rate may vary by project n attribute of the relationship between property and owner is percent owned n different types of bank accounts n customer must have at least one account of any type n tracking transactions

Also, Cannot Handle Situations Like n different kinds of property for sale n single family, duplex, apartment building, commercial, industrial n different kinds of projects n internal, DoD, joint venture, other govt, other n employee assigned to a project has a specific location just for that project n billing rate for an employee can vary by both project and location

Solutions n Associative Entities n Ternary (n-ary) relationships n Generalization/Specialization n Time Dependent Data (weak entities)

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

Associative Entities n 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. n NOUN

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

Example: n Attribute of the relationship between property and owner is percent owned OwnerProperty % Owned

Example: n Students take one or more courses n A course could be offered before any students register for it n Students are awarded mid-term and final grades for each course for which they are registered n Attributes for students include student ID, name, department n Attributes for course include course number, name, department Draw the E-R diagram

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

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

Ternary Relationships - Cardinality n For the entity in question, n For one instance of the entity, n How many unique pairs of the other entities can there be? n One n More than one (many)

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): EmployeeProject Phone Number Has 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): EmployeeProject Location Has

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): EmployeeProject Manager Has

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): EmployeeProject Skill Has

Ternary Relationships n Why not just make the ternary relationship an associative entity? EmployeeProject Location

Good idea if possible. However, n “Business Rules” n Need for separate (strong) entity n What if location also related to other entities? n 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: n 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.

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

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

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

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

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

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

Completeness Constraint n Disjoint: n Completeness – student must be one and only one of the three n None – “at large” student is simply a student and the additional specialization isn’t needed

Completeness Constraint n Overlapping: n Completeness – major must be at least one of the three listed n None - other majors not individually broken out but possible

Drawing It – Disjoint  - subset and direction indicator d

Drawing It – Overlapping O

Drawing It – Completeness Constraint Double line d O

Examples d Student undergmasters doctor

Examples O Major history philosp math

Time Dependent Data n keep history over time n need to track changing attribute and know its past values n “timestamp” n year, month, day, etc… n as precise as nanoseconds

Two Approaches n multivalued attribute n additional entity (weak)

Example n 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 Description Effective Date Price Price History Product Type Product

Additional Entity Why is price history a weak entity?? ProductHas Price History

Warnings for Time Dependent Data n Is it necessary? n How long must it be kept? n Will it get “cleaned up”? How? When? n Do other entities have relationships to the history information? n What happens to sales by product type if the product type is changed? n Exactly how much historical information needs to be kept? What attributes have historical values?

The Steps in E-R Modeling n classify entities and attributes n identify generalization hierarchies n define relationships n All three simultaneous and iterative

Exercise 1 n A real estate firm lists property for sale. The following describes this organization: n The firm has a number of sales offices in several states n Each sales office is assigned one or more employees. An employee must be assigned to only one sales office. n For each sales office, there is always one employee assigned to manage that office. An employee may manage only the sales office to which she is assigned. n The firm lists property for sale. n Each unit or property must be listed with one (and only one) of the sales offices. A sales office may have any number of properties listed, or may have no properties listed. n Each unit of property has one or more owners. An owner may own more than one unit of property. An attribute of the relationship between property and owner is percent owned.

Exercise 1 - New n Property listed must be at least one of the following types: single family, apartment, commercial, industrial. n Single family property can be a house, duplex, condo, or townhouse. More than one is possible (ie, condo and townhouse) n A history of previous listings should be kept along with the sales prices and selling employees. n In a sales office, each employee has security access to one or more PCs. Managers have access to all PCs in their office as well as other offices. Different employees can have different levels of access. This access needs to be tracked. n Zoning information is kept for commercial and industrial properties only. n Gifts of varying values (based on the purchase price) are given to the purchasers of single family houses or townhouses only.

Exercise 2 n Construct an E-R diagram for a bank database that shows the basic relationships among customers, checking accounts, savings accounts, loans, loan officers, and the bank branches where various accounts and loans are taken out. You also want to keep track of transactions on accounts and loans, and maintain the current balance in each account and the balance of the loan.

Exercise 2 - New n CDs (certificates of deposit) are also offered. A CD must be one of four types – small, medium, large, and jumbo. The interest rate and minimum term vary with the type of CD and customer. “Special” customers (this is indicated in the customer information) receive higher interest rates or shorter terms. Customers who open a large or jumbo CD get to choose a free gift from a list of available ones. The gifts for each type of CD are different. n A loan officer may work at more than one branch. When an officer is assigned to multiple branches, she has a unique phone number at each branch. All other bank employees each have a unique phone number.