Entity-Relationship Model Chapter 3 II COSC 457 Sungchul Hong.

Slides:



Advertisements
Similar presentations
the Entity-Relationship (ER) Model
Advertisements

Conceptual Data Modeling: ER
Chapter 31 Chapter 3 Data Modeling Using the Entity-Relationship Model.
Data modeling using the entity-relationship model Sept. 2012Yangjun Chen ACS Outline: Data modeling using ER-model (Chapter 3 - 3rd, 4th, 5th ed.)
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Conceptual Models Agenda - Steps in the design of a DB - Need for conceptual models - The Entity-Relationship Model (ER-Model)
Copyright © 2004 Pearson Education, Inc.. Chapter 3 Data Modeling Using the Entity-Relationship Model.
Copyright © 2007 Ramez Elmasr and Shamkant B. Navathei Week 3 Outline Overview of Database Design Process Example Database Application (COMPANY) ER Model.
Data modeling using the entity-relationship model Winter 2006Ron McFadyen Entity-relationship model (ER model) P. 49: “This model and its variations.
Class Number – CS 304 Class Name - DBMS Instructor – Sanjay Madria Instructor – Sanjay Madria Lesson Title – ER Model.
CS 405G Introduction to Database Systems
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas.
Data Modeling Using the Entity-Relationship Model
Data Modeling Using the Entity-Relationship Model
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
Chapter 3 Data Modeling Using the Entity-Relationship (ER) Model.
the Entity-Relationship Model
Entities and Attributes
Entity-Relationship Model. 2 Outline  What is ER Model? And Why?  Overview of Database Design Process  Example COMPANY Database  ER Model Concepts.
Entity-Relationship (ER) Data Model 概念資料模式 (Based on Chapter 3 in Fundamentals of Database Systems by Elmasri and Navathe, Ed. 4)
Database. Basic Definitions Database: A collection of related data. Database Management System (DBMS): A software package/ system to facilitate the creation.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Data Modeling Using the Entity-Relationship
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model.
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model.
Data Modeling Using the Entity- Relationship (ER) Model.
Chapter 7: Modeling Data in the Organization Dr. Taysir Hassan Abdel Hamid IS Department Faculty of Computer and Information Assiut University March 8,
Initial Design of Entity Types for the COMPANY Database Schema Based on the requirements, we can identify four initial entity types in the COMPANY database:
CS 405G: Introduction to Database Systems Lecture 2 : Database Design I.
Data modeling using the entity-relationship model Chapter 3 Objectives How entities, tuples, attributes and relationships among entities are represented.
Database Management COP4540, SCS, FIU Database Modeling Using the Entity-Relationship Model (Continued)
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Conceptual Modeling and Database Design.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Data Modeling Using the Entity-Relationship (ER) Data Model (Based on Chapter 3 in Fundamentals of Database Systems by Elmasri and Navathe, Ed. 3)
Copyright © 2007 Ramez Elmasr and Shamkant B. Navathei Slide 3- 1.
Data Modelling Using Entity-Relationship (ER) Model
Database Systems – ER Diagrams EXAMPLE COMPANY DATABASE Requirements of the Company (oversimplified to illustrate) The company is organized into DEPARTMENTs.
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 3 Data Modeling Using Entity-Relationship Model.
Data Modeling Using the Entity-Relationship (ER) Data Model.
Data Modeling Using the Entity- Relationship (ER) Model.
Chapter 3: Data Modeling Using the Entity-Relationship (ER) Data Model
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
CSE 412/598 DATABASE MANAGEMENT COURSE NOTES 3. ENTITY-RELATIONSHIP CONCEPTUAL MODELING Department of Computer Science & Engineering Arizona State University.
Database Management COP4540, SCS, FIU Database Modeling Using the Entity- Relationship Model (Continued)
1 CSE 480: Database Systems Lecture 3: Entity-Relationship Diagram Reference: Read Chapter 3 (5 th Edition) or 7 (6 th edition)
Conceptual Modelling The Entity-Relationship (ER) Model The ER diagram Data Modelling.
Chapter 7 Data Modeling Using the Entity-Relationship (ER) Model
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Lecture # 17 July 28,2012 Data Modeling using the Entity Relationship.
Data Modeling Using the Entity- Relationship (ER) Model
Comp 1100 Entity-Relationship (ER) Model
Databases (CS507) CHAPTER 7.
Chapter 3 Data Modeling Using the Entity-Relationship Model
Data Modeling Using the Entity- Relationship (ER) Model
Database Management Systems
ER model Ashima Wadhwa.
Entity-Relationship Model
Lecture3: Data Modeling Using the Entity-Relationship Model.
بسم الله الرحمن الرحيم.
Company Requirements.
Entity-Relationship Modeling "Extended"
Initial Design of Entity Types: EMPLOYEE, DEPARTMENT, PROJECT, DEPENDENT Gender.
376a. Database Design Dept. of Computer Science Vassar College
Conceptual Data Modeling Using Entities & Relationships
Mapping an ERD to a Relational Database
Entity Relation Model Tingting Zhang.
Entity-Relationship Modeling "Extended"
Entity-Relationship Modeling "Extended"
Presentation transcript:

Entity-Relationship Model Chapter 3 II COSC 457 Sungchul Hong

COMPANY Database DEPARTMENT –Name, Number, {Locations}, Manager, ManagerStartDate PROJECT –Name, Number, Location, ControllingDepartment EMPLOYEE –Name (FName, MInit, LName), SSN, Sex, Address, Salary, BirthDate, Department, Supervisor, {WorksOn(Project, Hours)} DEPENDENT –Employee, DependentName, Sex, BirthDate, Relationship

Relationship, Relationship Types, and Structural Constraints In the initial design of entity types, relationships are typically captured in the from of attributes. The attribute Manager of DEPARTMENT refers to an employee who manages the department.

Relationship Types, Set and Instances A relationship type R among n entity types E 1, E 2, …, E n defines a set of associations or a relationship set among entities from these types. The relationship set R is a set of relationship instances r i, where each r i associates n individual entities (e 1, e 2, …, e n ), and each entity e j in r i is a member of entity type E j, 1  j  n. A relationship type is a mathematical relation on E 1, E 2, …, E n, or alternatively it can be defined as a subset of the Cartesian product E 1  E 2  …E n. Relationship instance r i =(e 1,e 2, …, e n )

Mathematical Relations Sets D 1 and D 2 where D 1 = {2, 4} and D 2 ={1, 3, 5}. Cartesian product D 1  D 2, is the set of all ordered pairs such that the first element is a member of D 1 and the second element is a member of D 2. –D 1  D 2 ={(2, 1), (2, 3), (2, 5), (4, 1), (4, 3), (4, 5)}

Example The company is organized into departments. Each department has a unique name, a unique number, and a particular employee who manages the department. We keep track of the start date when that employee began managing the department. A department may have several locations.

Example (2) A department controls a number of projects, each of which has a unique name, a unique number, and single location. We store each employee’s name, social security number, address, salary, sex, and birth date. An employee is assigned to one department but may work on several projects, which are not necessarily controlled by the same department. We keep track of the number of hours per week that an employee works on each project. We also keep track of the direct supervisor of each employee.

User Requirement Example (3) We want to keep track of the dependents of each employee for insurance purposes. We keep each dependent’s first name, sex, birth date, and relationship to the employee.

Relationship Degree, Role Names, and Recursive Relationship Degree of a Relationship Type –The number of participating entity types. Binary, ternary, quaternary, and etc. –E.g. WORKS_FOR has degree 2 or binary Relationships as Attributes –Attribute Department of the EMPLOYEE entity Role Names and Recursive Relationships –The role name signifies the role that a participating entity from the entity type plays in each relationship instance.

Binary Relationship Employee Project Works_on

SupplierProject Part Supply

Employee Supervise

Constraints on Relationship Types Cardinality Ratios for Binary Relationships –1:1 (MANAGES EMPLOYEE : DEPARTMENT) –1:N (WORK_FOR DEPARTMENT : EMPLOYEE) –M:N (WORKS_ON EMPLOYEE : PROJECT) Participation Constraints and Existence Dependences (structural constraints) –Total participation (Double lines) –Partial dependences

Attributes of Relationship Types 1:1 1:N N:M –Some attributes may be determined by the combination of participating entities in a relationship. –Attributes must be specified as relationship attributes

Min: Max:

Min: Max: Min: Max:

Min: Max: Min: Max:

The (min,max) notation relationship constraints (0,1) (1,1) (1,N) (1,M) (1,N)

Weak Entity Types Entity types that do not have key attributes of their own. The relationship type that relates a weak entity type to its owner is called the identifying relationship of the weak entity type. Partial key: the set of attributes that can uniquely identify weak entities that are related to the same owner entity. Example: Employee{SSN, LName, FName} Dependant{FName, DOB}

Example Relationships MANAGES WORKS_FOR CONTROLS SUPERVISION WORKS_ON DEPENDENTS_OF