Database Systems Instructor Name: Lecture-9.

Slides:



Advertisements
Similar presentations
Chapter # 4 BIS Database Systems
Advertisements

Entity Relationship (ER) 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.
Entity Relationship (ER) Modeling
IT420: Database Management and Organization
System Analysis - Data Modeling
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Ch5: ER Diagrams - Part 2 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Entity-Relationship Diagrams
© 2007 by Prentice Hall (Hoffer, Prescott & McFadden) 1 Entity Relationship Diagrams (ERDs)
1 © Prentice Hall, 2002 Chapter 3: Modeling Data in the Organization Modern Database Management 7th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R.
Chapter 3: Modeling Data in the Organization
Chapter 7 Data Modeling with Entity Relationship Diagrams Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Chapter 5 Entity Relationship (ER) Modelling
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
DATABASEMODELSDATABASEMODELS  A database model ◦ defines the logical design of data. ◦ Describes the relationships between different parts of data.
ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 2: Modeling Data in the Organization.
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.
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
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
advanced data 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.
Copyright © 2016 Pearson Education, Inc. Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki Topi CHAPTER 2: MODELING DATA.
© 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.
ENTITY RELATIONSHIP DIAGRAM. Objectives Define terms related to entity relationship modeling, including entity, entity instances, attribute, relationship.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Lecture # 17 July 28,2012 Data Modeling using the Entity Relationship.
ENTITY-RELATIONSHIP MODELLING. Objectives: How to use Entity–Relationship (ER) modelling in database design. Basic concepts associated with ER model.
Entity Relationship (E-R) Model
Modeling data in the Organization
Entity Relationship Modeling
Databases (CS507) CHAPTER 7.
Logical Database Design and the Rational Model
Business System Development
TMC2034 Database Concept and Design
CSIS 115 Database Design and Applications for Business
Tables and Their Characteristics
Chapter -3- Data Modeling Using the Entity-Relationship Model
TYPES OF RELATIONSHIPS
Entity-Relationship Modelling
بسم الله الرحمن الرحيم.
Overview of Entity‐Relationship Model
Module 8 – Database Design Using the E-R Model
Chapter 4 Entity Relationship (ER) Modeling
Entity-Relation Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Entity-Relationship Modelling
CHAPTER 4: LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL
Database Systems Instructor Name: Lecture-11.
Database Systems Instructor Name: Lecture-10.
Review of Week 1 Database DBMS File systems vs. database systems
Database Systems Instructor Name: Lecture-8.
Chapter 3: Modeling Data in the Organization
CHAPTER 2 - Database Requirements and ER Modeling
Chapter 4 Entity Relationship (ER) Modeling
ER MODELING Instructor: SAMIA ARSHAD
Entity Relationship (ER) Modeling
Chapter # 4 Entity Relationship (ER) Modeling.
Chapter 6b: Database Design Using the E-R Model
Presentation transcript:

Database Systems Instructor Name: Lecture-9

Contents Degree of Relationship Cardinality of Binary Relationship 2

Degree of Relationship Number of Participating Entity Types in a Relationship Types of Degrees of Relationship Unary Binary Ternary 3

Unary Relationship It is the relationship between Entity Instance of the same Entity Type, also called Recursive Relationship Usual Situations When Unary Relationship exist are: One to One Relationship, when an entity instance is associated with exactly one entity instance, for example, married to in PERSON entity type One to Many Relationship, when an entity instance is associated with more than one entity instance 4

Unary Relationship-Contd. To Establish a Sequence, Cycle or Priority List between entity instances Employee Manages Employees Courses are pre-requisite to other courses Categories with lower level of categories 5

Unary Relationship-Example 6

Binary Relationship Relationship between two Entity Types It is the most common type of relationship encountered in ER Diagram 7

Binary Relationship- Example 8

Ternary Relationship It is a simultaneous relationship among instances of THREE entity types 9

Ternary Relationship- Example 10

Ternary Relationship Caution: A Ternary relationship is not three binary relationship as the relationship supply with attribute cannot be associated with any of the given Entity Type With associative Entity Type the Ternary Relationship becomes: 11

Ternary Relationship- Example 12

Ternary Relationship – How to Resolve? Convert all ternary relationship to associative entities 13

Notations for Relationship Weak Relationship also called defining relationship 14

Relationship Constraints Limits the possible combination of entities that participate in the corresponding relationship set For Example, if company rule dictates that an employ can work for only one Manager, this is a constraint on relationship One student can be enrolled in many courses One student majors in one department WHY, relationship constraints? Better Manipulation of Data Enforce Constraints If not represented in conceptual model, the domain knowledge may be lost 15

Types of Cardinality on Binary Relationship One to one One to many ( or many to one) Many to many 16

Notations for Cardinality on Binary Relationship – Crow’s Foot Notation 17

One-to-One Relationship A single Entity Instance from Entity Type is associated with a single Entity Instance of another Entity Type 18

One-to-One Relationship - Example 19

One-to-Many Relationship A single Entity Instance in one Entity Type is associated with a multiple Entity Instances of another Entity Type Also, called Parent – Child Relationship OR Master– Detail Relationship (Oracle) 20

One-to-Many Relationship - Example 21

Many-to-Many Relationship Each Entity Instance in one Entity Type is associated with a multiple Entity Instances of another Entity Type; and vice versa. 22

Many-to-Many Relationship - Example 23

Cardinality Constraint on Binary Relationship Cardinality Constraint specifies: Number of Instances of One Entity Type that must be associated with each Instances of another Entity Type OR Maximum Number of Relationship Instances that an Entity can participate in. ATTRIBUTE ON RELATIONSHIPS Attribute on one-to-one relationship can be moved to either side of Entity Type Attribute on one-to-many relationship can only be moved to “many” side of the relationship 24

Cardinality Constraints – Contd. Cardinality means “count” and expressed as number Minimum Cardinality: The minimum number of instances of one Entity that may participate in a relationship with each Instance of another Entity Maximum Cardinality: The maximum number of instances of one Entity that may participate in a relationship with each Instance of another Entity 25

Cardinality means “count” and expressed as number Minimum Cardinality Cardinality means “count” and expressed as number Minimum Cardinality: The minimum number of instances of one Entity that may participate in a relationship with each Instance of another Entity 26

Minimum Cardinality – Contd. Minimum is generally stated as either ‘Zero’ or ‘One’ Zero (optional participation): participation in relationship by the entity is option One (Mandatory participation): Participation in relationship by the entity is mandatory 27

Minimum Cardinality – Example 28

Cardinality with Optional and Mandatory Participation – Example 29

Participation Constraint It defines whether the existence of an entity depends on its being related to another entity via relationship type. This is also alternative way to define minimum cardinality constraint and its implications (optional, mandatory) 30

Participation Constraint Types Total Participation Partial Participation 31

Case I – Total Participation If company policy states that Every Employee Must work for a department, Then Employee Entity Only Exist if it participate in at least ONE work-for relationship It is total participation as Every Entity Instance in the EMPLOYEE entity type must be related to a department via work-for relationship Total Participation is also called Existence Dependency 32

Case II – Partial Participation We do not expect every employee to manage a department, so the participation of employee in manage relationship is Partial Some or part of employees from employee set are related to some departments; and not all employees. 33

Maximum Cardinality Maximum Number of One Entity that may be associated with each instance of another Entity Crow’s Foot 34

Crow’s Foot - Notations 35

Relationships and Cardinalities – Mandatory Cardinality - Example 36

Relationships and Cardinalities –Optional Cardinality - Example 37

Cardinality Constraints on Ternary Relationship 38

???????????????? 39

Assignment – What I was Expecting major Department offers Is double major allowed? Can a student have more than 1 advisor? Is joint appointment of faculty possible? Can two profs share to teach the same course? Can a professor teach more than one course? Can a professor stay without affiliated with a department? faculty Courses teaches Professor advisor enrollment Students 40

Erroneous Relationship Receives or summarize the data, transfer, translate or calculate data 41