Database Systems Instructor Name: Lecture-10.

Slides:



Advertisements
Similar presentations
Systems Development Life Cycle
Advertisements

Data Modeling is an Analysis Activity
1 © Prentice Hall, 2002 Chapter 3: Modeling Data in the Organization Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
Chapter 3: Modeling Data in the Organization
CHAPTER 2: MODELING DATA IN THE ORGANIZATION © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition Jeffrey.
© 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.
Chapter 3: Modeling Data in the Organization
Chapter 5 Entity–Relationship Modeling
Chapter 2: Modeling Data in the Organization
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
IS 325 Notes for Wednesday September 4, Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments.
Copyright (c) 2014 Pearson Education, Inc. Introduction to Databases.
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 2: Modeling Data in the Organization.
CS 370 Database Systems Lecture 9 The Relational model.
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)
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Data modeling using the entity-relationship model Chapter 3 Objectives How entities, tuples, attributes and relationships among entities are represented.
Database Management Systems MIT Lesson 02 – Database Design (Entity Relationship Diagram) By S. Sabraz Nawaz.
Entity Relationship Diagram. Introduction Definition: Entity-relationship diagram is a data-modeling technique that visualises entities, the attributes.
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.
Entity Relationship Diagram (ERD). Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 5 (Part a): Logical Database Design and the Relational Model Modern Database Management.
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.
Pree Thiengburanathum, CAMT, Chiang Mai University 1 Database System Modeling Data in the Organization October 31, 2009 Software Park, Bangkok Thailand.
Chapter 2: Modeling Data in the Organization
ENTITY RELATIONSHIP DIAGRAM. Objectives Define terms related to entity relationship modeling, including entity, entity instances, attribute, relationship.
Lecture # 14 Chapter # 5 The Relational Data Model and Relational Database Constraints Database Systems.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Lecture 3: Modeling Data in the Organization Modern Database Management 9 th Edition Jeffrey.
Entity Relationship Modeling
Business System Development
Introducing Databases
TMC2034 Database Concept and Design
Relational Database Design by ER- and EER-to- Relational Mapping
Chapter 4: Logical Database Design and the Relational Model
Chapter 4: Part B Logical Database Design and the Relational Model
Tables and Their Characteristics
Chapter -3- Data Modeling Using the Entity-Relationship Model
Database Design – Lecture 4
Relational Database Design by ER- and EERR-to-Relational Mapping
Relational Database Design by ER-to-Relational Mapping
Entity-Relationship Model
Database Systems Instructor Name: Lecture-12.
Overview of Entity‐Relationship Model
IST 318 Database Administration
Database Systems: Design, Implementation, and Management Tenth Edition
CHAPTER 4: LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL
Database Systems Instructor Name: Lecture-11.
Database Systems Instructor Name: Lecture-9.
Review of Week 1 Database DBMS File systems vs. database systems
Chapter 3: Modeling Data in the Organization
Relational Database Design by ER- and EER-to- Relational Mapping
CHAPTER 2 - Database Requirements and ER Modeling
Chapter 4 Entity Relationship (ER) Modeling
Entity Relation Model Tingting Zhang.
Entity-Relationship (E-R) Modeling
ER MODELING Instructor: SAMIA ARSHAD
Entity Relationship (ER) Modeling
CS4222 Principles of Database System
Chapter # 4 Entity Relationship (ER) Modeling.
© 2008 Pearson Prentice Hall, Experiencing MIS, David Kroenke
Relational Database Design by ER-to-Relational Mapping
Presentation transcript:

Database Systems Instructor Name: Lecture-10

Contents Participation Constraints Mandatory and Optional Cardinalities Modeling Time Dependent Data Multiple Relationships Keys 2

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) 3

Participation Constraint Types Total Participation Partial Participation 4

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 5

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. 6

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

Crow’s Foot - Notations 8

Relationships and Cardinalities – Mandatory Cardinality - Example 9

Relationships and Cardinalities –Optional Cardinality - Example 10

Cardinality Constraints on Ternary Relationship 11

Multiple Relationship In some situations an organisation may want to model more than one relationship between the same entity types The following figure shows two relationships between PROFESSOR and COURSE The relationship Is_Qualified associates professors with the courses they are qualified to teach A given course may have more than one person qualified to teach it, or (optionally) may not have any qualified instructors (such as a new course) Each professor should be qualified to teach at least one course (we hope!) 12

Multiple Relationship – Contd. The second relationship in this figure associates professors with the courses they actually teach during a given semester (where the maximum cardinality for a given semester is 4) This shows how a fixed constraint (upper or lower) can be recorded The attribute ‘Semester’ (which could be a composite attribute with components ‘Semester_Name’ and ‘Year’) is on the relationship Is_Scheduled) 13

Multiple Relationship – Contd. The second relationship in this figure associates professors with the courses they actually teach during a given semester (where the maximum cardinality for a given semester is 4) This shows how a fixed constraint (upper or lower) can be recorded The attribute ‘Semester’ (which could be a composite attribute with components ‘Semester_Name’ and ‘Year’) is on the relationship Is_Scheduled) 14

Multiple Relationship – Example 15

Multiple Relationship – Example 16

Keys Primary Key: An attribute or combination of attribute that uniquely identifies each row in a relation Composite Key: A primary key that consists of more than one attributes Foreign Key: An attribute in a relation that serves as primary key of another relation in the same database 17

Resolve Multivalued, Composite and Many-to-Many Relationship Keys – Contd. Resolve Multivalued, Composite and Many-to-Many Relationship 18

Primary Key and Foreign Key Notations 19

Table with Constraints CREATE TABLE Show ( show_id NUMBER NOT NULL, category_id NUMBER NOT NULL, act_id NUMBER NOT NULL, venue_id NUMBER NOT NULL, showdate DATE NULL, CONSTRAINT XPKShow PRIMARY KEY (show_id), CONSTRAINT FKShow_Cat FOREIGN KEY (category_id) REFERENCES Category, CONSTRAINT FKShow_Venue FOREIGN KEY (venue_id) REFERENCES Venue, CONSTRAINT FKShow_Act FOREIGN KEY (act_id) REFERENCES Act ); 20

???????????????? 21

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