BTM 382 Database Management Chapter 4: Entity Relationship (ER) Modeling Chitu Okoli Associate Professor in Business Technology Management John Molson.

Slides:



Advertisements
Similar presentations
Chapter # 4 BIS Database Systems
Advertisements

Entity Relationship (E-R) Modeling Hachim Haddouti
Entity Relationship (ER) Modeling
Chapter 4 Entity Relationship (E-R) Modeling
Entity Relationship (ER) Modeling
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
Chapter 4 Entity Relationship (E-R) Modeling
Entity Relationship (ER) Modeling
Entity Relationship (ER) Modeling
BTM 382 Database Management Chapter 6: Normalization of Database Tables Chitu Okoli Associate Professor in Business Technology Management John Molson School.
1 © Prentice Hall, 2002 Chapter 3: Modeling Data in the Organization Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
Entity Relationship (E-R) Modeling
Chapter 4 ENTITY-RELATIONSHIP MODELLING.
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 1 Data Models: Degrees of Data Abstraction l Modified ANSI/SPARC Framework.
CHAPTER 2: MODELING DATA IN THE ORGANIZATION © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition Jeffrey.
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter 4 Entity Relationship (E-R) Modeling
Chapter 4 Entity-Relationship modeling Transparencies © Pearson Education Limited 1995, 2005.
Entity-Relationship modeling Transparencies
© 2007 by Prentice Hall (Hoffer, Prescott & McFadden) 1 Entity Relationship Diagrams (ERDs)
1 © Prentice Hall, 2002 CMIS564: E/R Modeling Dr. Bordoloi Based on Chapter 3; Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott,
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 Chapter 3 Entity Relationship (E-R) Modeling Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Chapter 3: Modeling Data in the Organization
Entity-relationship Modeling Transparencies 1. ©Pearson Education 2009 Objectives How to use ER modeling in database design. The basic concepts of an.
Chapter 7 Data Modeling with Entity Relationship Diagrams Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
ITEC 3220M Using and Designing Database Systems Instructor: Prof. Z.Yang Course Website: 3220m.htm
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Chapter 5 Entity Relationship (ER) Modelling
Chapter 5 Entity–Relationship Modeling
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
© Pearson Education Limited, Chapter 7 Entity-Relationship modeling Transparencies.
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 4 Entity Relationship (ER) Modeling.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
Chapter 4 Entity Relationship (ER) Modeling.  ER model forms the basis of an ER diagram  ERD represents conceptual database as viewed by end user 
4 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Relationship Degree Indicates number of entities or participants.
Database Design – Lecture 5 Conceptual Data Modeling – adding attributes.
DeSiamorePowered by DeSiaMore1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
Chapter 9: Logical Database Design and the Relational Model (ERD Mapping)
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
1 A Demo of Logical Database Design. 2 Aim of the demo To develop an understanding of the logical view of data and the importance of the relational model.
3 & 4 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Keys Consists of one or more attributes that determine other.
Data modeling using the entity-relationship model Chapter 3 Objectives How entities, tuples, attributes and relationships among entities are represented.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 4 Entity Relationship (ER) Modeling.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 4 ENTITY RELATIONSHIP (ER) MODELING Instructor Ms. Arwa Binsaleh 1.
Entity Relationship Modeling
The Entity-Relationship Model, P. I R. Nakatsu. Data Modeling A data model is the relatively simple representation, usually graphic, of the structure.
Chapter 3: Modeling Data in the Organization. Business Rules Statements that define or constrain some aspect of the business Assert business structure.
Entity-Relationship Modeling. 2 Entity Type u Entity type –Group of objects with same properties, identified by enterprise as having an independent existence.
Chapter 8 Entity-Relationship Modeling Pearson Education © 2009.
Copyright © 2016 Pearson Education, Inc. Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki Topi CHAPTER 2: MODELING DATA.
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.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 3: Modeling Data in the Organization Modern Database Management 9 th Edition Jeffrey.
Department of Mathematics Computer and Information Science1 CS 351: Database Management Systems Christopher I. G. Lanclos Chapter 4.
BTM 382 Database Management Chapter 5: Advanced Data Modeling
TMC2034 Database Concept and Design
Tables and Their Characteristics
Database Design – Lecture 4
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Review of Week 1 Database DBMS File systems vs. database systems
Chapter 4 Entity Relationship (ER) Modeling
Entity-Relationship Diagram (ERD)
Entity Relationship (ER) Modeling
Chapter # 4 Entity Relationship (ER) Modeling.
Presentation transcript:

BTM 382 Database Management Chapter 4: Entity Relationship (ER) Modeling Chitu Okoli Associate Professor in Business Technology Management John Molson School of Business, Concordia University, Montréal 1

Attributes

Composite and multivalued attributes Composite vs. simple attributes –Composite attributes can be subdivided into composite parts (e.g. Address → StreetNumber, StreetName, City, Province, etc.) Not to be confused with a composite key! (key composed of multiple attributes) –Simple attributes cannot be meaningfully subdivided further (e.g. StreetNumber, City, Province) Multivalued vs. single-value attributes –Single-value attributes can have only a single value (e.g. a person can have only one Name, DateOfBirth, SIN) Even though Name is a composite attribute (it can be divided into FirstName, LastName), it is single-valued because a person still has only one name –Multivalued attributes can have many values (e.g. one person can have many multiple values of personal address, work address) Even though is a simple attribute (indivisible), it is multivalued because a person can have multiple addresses 3

Implementing multivalued attributes Multivalued attributes cannot be implemented explicitly in a physical RDBMS. There are two possible implementations: –Create several new attributes for each of the original multivalued attributes’ components (if there is a known, limited number of options) E.g. HomeAddress, WorkAddress, MailingAddress Drawback: will leave many nulls in table, especially if the attribute is composite, like Address –Create new entity composed of original multivalued attributes’ components (if there are many options, or number of options is unpredictable) E.g. Address table with attributes AddressID, AddressType (e.g. Home, Work, Mailing), AddressDetails Drawback: extra table complicates database design 4

Relationships

Properties of relationships Connectivity: 1:1, 1:M or M:N Participation –Mandatory (at least one entity required—minimum cardinality of 1) –Optional (entity not required—minimum cardinality of 0) Degree: how many entities involved in the relationship –unary/recursive, binary, ternary, n-degree Strength: –Strong (identifying) relationship if one entity is weak –Weak (non-identifying) relationship if both entities are strong 6

Properties of entities in relationships Cardinality: minimum and maximum number of entities on each side –e.g. (0,1), (1,1), (1,20), etc. Entity strength/Existence-dependence: –Strong (existence-independent): can exist without the other entity –Weak (existence-dependent): cannot exist without the other entity Technically, a weak entity is one where the PK of the existence- dependent entity includes the FK from the existence-independent entity, which is usually, but not always, the case Participation –Mandatory (at least one entity required—minimum cardinality of 1) –Optional (entity not required—minimum cardinality of 0) 7

Connectivity and Cardinality Connectivity –Describes the relationship classification –Three types: 1:1, 1:M, M:N Cardinality –Expresses minimum and maximum number of entity occurrences associated with one occurrence of related entity –“1” actually means 0 or 1 minimum and 1 maximum –“M” actually means 0 or 1 minimum and either a fixed maximum or ∞ maximum Right or wrong connectivity and cardinality is determined by business rules 8

Existence Dependence (for entities) Existence dependence –Entity exists in database only when it is associated with another related entity occurrence –E.g. a Chapter is dependent on a Book; a Room is dependent on a Building Existence independence –Entity can exist apart from one or more related entities –Sometimes such an entity is referred to as a strong or regular entity –E.g. a Book; a Building 9

Relationship Strength Weak (non-identifying) relationships –“Weak” because the entities could still exist even without the weak relationship (dotted line in ERD) –Exists if PK of related entity (many side) does not contain PK component of parent entity Strong (identifying) relationships –“Strong” because one of the entities (the entity on the many side) could not exist without the strong relationship (solid line in ERD) –“Identifying” because the identity (PK) of the entity on the many side depends on the other entity –Exists when PK of related entity (many side) contains PK component of parent entity Simple rule for ERDs: –By default, all relationships are weak (dotted line) –Exception: if an entity’s PK contains an FK, then the relationship that contributed that FK is strong (solid line) 10

11

12

Weak Entities Weak entity meets two conditions –Existence-dependent –Primary key partially or totally derived from parent entity in relationship Strong entity + weak entity = strong relationship –a weak entity cannot exist without a strong relationship to hold it Strong entity + strong entity = weak relationship –Both entities could still exist even without the relationship 13

14

Relationship Participation Optional participation –One entity occurrence does not require corresponding entity occurrence –Minimum cardinality is 0 Mandatory participation –One entity occurrence requires corresponding entity occurrence –Minimum cardinality is 1 15

Relationship degree 16

17

Unary/Recursive Relationships 18 is prerequisite to

Associative/Composite/Bridge Entities Used to implement M:N relationships Composed of primary keys of each of the entities to be connected May also contain additional attributes that play no role in connective process 19

20

ERD design considerations 21

Database Design Challenges: Conflicting Goals Database designers must make design compromises –Conflicting goals: design standards, processing speed, information requirements Important to meet logical requirements and design conventions Design is of little value unless it delivers all specified query and reporting requirements Some design and implementation problems do not yield “clean” solutions 22

Derived attribute Value may be calculated from other attributes Need not be physically stored within database Decision rule: Use a stored calculation (instead of a derived attribute) if: –Attribute’s value is constant (rarely changes) –Attribute is used frequently 23

Sources Most of the slides are adapted from Database Systems: Design, Implementation and Management by Carlos Coronel and Steven Morris. 11th edition (2015) published by Cengage Learning. ISBN 13: Database Systems: Design, Implementation and Management Other sources are noted on the slides themselves 24