Introduction to Database Design

Slides:



Advertisements
Similar presentations
Database Management Systems, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
Advertisements

Database Management Systems, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
1 541: Database Systems S. Muthu Muthukrishnan. 2 Overview of Database Design  Conceptual design: (ER Model is used at this stage.)  What are the entities.
1 Key Constraints Consider Works_In: An employee can work in many departments; a dept can have many employees. In contrast, each dept has at most one manager,
The Entity-Relationship (ER) Model
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
The Entity-Relationship Model
Comp3300/fall021 The Entity-Relationship Model Chapter 2 What are the steps in designing a database ? Why is the ER model used to create an initial design?
The Entity-Relationship Model
The Entity-Relationship Model Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY courtesy of Joe Hellerstein for some slides.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
1 The Entity-Relationship Model Chapter 2. 2 Overview of Database Design  Conceptual design: (ER Model is used at this stage.) –What are the entities.
Modeling Your Data Chapter 2. Overview of Database Design Conceptual design: –What are the entities and relationships in the enterprise? – What information.
Conceptual Design Using the Entity-Relationship (ER) Model
The Entity- Relationship Model CS 186 Fall 2002: Lecture 2 R &G - Chapter 2 A relationship, I think, is like a shark, you know? It has to constantly move.
The Entity-Relationship (ER) Model CS541 Computer Science Department Rutgers University.
Introduction to Database Design Entity Relationship Model.
1 Data Modeling Yanlei Diao UMass Amherst Feb 1, 2007 Slides Courtesy of R. Ramakrishnan and J. Gehrke.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
ER continued, and ER to Relational Mappings R&G Chapters 2, 3 Lecture 22.
Modeling Your Data Chapter 2. Part II Discussion of the Model: Good Design/ Bad Design?
1 The Entity-Relationship Model Chapter 2. 2 Database Design Process  Requirement collection and analysis  DB requirements and functional requirements.
The Entity-Relationship Model. 421B: Database Systems - ER Model 2 Overview of Database Design q Conceptual Design -- A first model of the real world.
1 The Entity-Relationship Model Chapter 2. 2 Overview of Database Design  Conceptual design : (ER Model is used at this stage.)  What are the entities.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
Chapter 2.  Conceptual design: (ER Model is used at this stage.) ◦ What are the entities and relationships in the enterprise? ◦ What information about.
CMPT 258 Database Systems The Entity-Relationship Model Part II (Chapter 2)
ICS 321 Spring 2011 High Level Database Models Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa 2/7/20111Lipyeow.
Christoph F. Eick: Designing E/R Diagrams 1 The Entity-Relationship Model Chapter 3+4.
LECTURE 1: Entity Relationship MODEL. Think before doing it! Like most of the software projects, you need to think before you do something. Before developing.
09/03/2009Lipyeow Lim -- University of Hawaii at Manoa 1 ICS 321 Fall 2009 Introduction to Database Design Asst. Prof. Lipyeow Lim Information & Computer.
Database Management Systems,1 Conceptual Design Using the Entity-Relationship (ER) Model.
1 Conceptual Design using the Entity- Relationship Model.
The Entity-Relationship (ER) Model. Overview of db design Requirement analysis – Data to be stored – Applications to be built – Operations (most frequent)
CSC 411/511: DBMS Design 1 1 Dr. Nan WangCSC411_L2_ER Model 1 The Entity-Relationship Model (Chapter 2)
ER & Relational: Digging Deeper R &G - Chapters 2 & 3.
Mapping E/R to RM, R. Ramakrishnan and J. Gehrke with Dr. Eick’s additions 1 Mapping E/R Diagrams to Relational Database Schemas Second Half of Chapter.
Modeling Your Data Chapter 2 cs5421. Part II Discussion of the Model: Good Design/ Bad Design? cs5422.
LECTURE 1: Entity Relationship MODEL. Think before doing it! Like most of the software projects, you need to think before you do something. Before developing.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
A short review on entity- relationship modelling.
1 Introduction to Data Management Lecture #3 (Conceptual DB Design) Instructor: Chen Li.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
COP Introduction to Database Structures
The Entity-Relationship Model
Design Concepts & ER Model
MODELS OF DATABASE AND DATABASE DESIGN
ER-to-Relational Mapping
The Entity-Relationship Model
Modeling Your Data Chapter 2 cs542
The Entity-Relationship Model
Mapping ER Diagrams to Tables
Instructor: Elke Rundensteiner
DATABASE MANAGEMENT SYSTEMS
The Entity-Relationship (ER) Model
The Entity-Relationship Model
The Entity-Relationship Model
The Entity-Relationship Model
The Entity-Relationship Model
The Entity-Relationship Model
The Entity-Relationship Model
Question Which of the following plays an important role in representing information about the real world in a database? Explain briefly 1)DDL.
The Entity-Relationship Model
The Entity-Relationship Model
The Entity-Relationship Model
The Entity-Relationship (ER) Model
Presentation transcript:

Introduction to Database Design Database Management Systems, 3rd ed., Ramakrishnan and Gehrke, Chapter 2

Figure 2.5: Roles Name SSN Lot Employees supervisor subordinate ReportsTo 2

Relationship Cardinalities: Mappings . . . . . . 1:1 1:N N:M 3

Key Constraint: 1:N FName SectNum CourseNum Room SSN Office Class Teaches Faculty Each class has only one (at most one) instructor. 4

N:M Relationship SName SectNum CourseNum Room SSN Major Class Takes Student More than 1 student may take a given class; more than 1 class may be taken by a given student. 5

1:1 Relationship Since Name FName SSN Office ID Major Faculty Mentors Student Each faculty member may serve as the mentor for only 1 student; each student may have only 1 mentor. 6

Participation Constraint Indicates whether existence of entity depends on its being related to another entity via a relationship set. Total participation constraint (existence dependency) – Every dependent entity must be related to an entity in the entity set on which it is dependent. Partial participation constraint – Some of the dependent entities are related to entities in the other entity set. 7

Example of Total Participation FName DName MainOffice SSN Office Faculty WorksFor Department Participation constraint: Each faculty member must work for some (i.e., at least one) department. A faculty entity cannot exist without being assigned to a department. Key constraint: Each faculty member may work for at most one department. 8

Figure 2.11: Weak Entity Set Name Cost PName Age SSN Lot Employees Policy Dependents Partial key is shown in blue rather than with a broken underline. 9

Figure 2.14: Entity vs. Attribute DName Name To From DID Budget SSN Lot Employees WorksIn4 Departments Problem with this design: Does not allow an employee to work in a given department over more than one time period. 10

Figure 2.15: Entity vs. Attribute DName Name DID Budget SSN Lot Employees WorksIn4 Departments From Duration To 11

ISA Hierarchy Name GPA ID Students Thesis Group ISA UnderGrads Grads 12

Figure 2.16 Name DBudget Since DName SSN DID Lot Budget Employees Manages2 Departments What are the problems with this design? 13

Revised Figure 2.16 Name SSN Lot Employees DBudget DName ISA Since DID Departments Other entity sets Manages2’ Managers 14

Figure 2.17 Name PName Age SSN Lot Dependents Employees Covers Cost PolicyID Policies 15

Figure 2.17 Name PName Age SSN Lot Dependents Employees Covers Beneficiary Policies Cost PolicyID 16

Subset of Figure 2.13 Departments PID StartedOn Projects PBudget Sponsors DID Budget Since DName 17

Figure 2.13 Departments PID StartedOn Projects PBudget Sponsors DID Since DName Monitors Employees Until SSN Name Lot 18

Figure 2.19 Name Lot SSN Employees StartedOn DName PBudget DID Budget PID Projects Sponsors2 Departments 19

Another Aggregation Example Information about applicants who have interviewed for a position at a company: CAddress ContactPhone CName Address ContactName Date Company Interview JobApplicant Phone SSN Name Fundamentals of Database Systems, Elmasri and Navathe 20

Example (continued) We want to associate a job offer with an interview. Why won’t this work? Company Interview JobApplicant JobOffer Attributes have been omitted for brevity. 21

Example (continued) Possible solution: Company Applied JobApplicant ResultsIn JobOffer Interview 22

Example (continued) More desirable solution conceptually: JobApplicant Company Interview ResultsIn JobOffer 23