Database Management COP4540, SCS, FIU Database Modeling Using the Entity-Relationship Model (Continued)

Slides:



Advertisements
Similar presentations
ER Modeling Case Studies
Advertisements

Conceptual Data Modeling: ER
Chapter 31 Chapter 3 Data Modeling Using the Entity-Relationship Model.
Conceptual Models Agenda - Steps in the design of a DB - Need for conceptual models - The Entity-Relationship Model (ER-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.
Database Management COP4540, SCS, FIU Database Modeling Using the Entity-Relationship Model (Chapter 3)
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
Chapter 3 Data Modeling Using the Entity-Relationship (ER) Model.
the Entity-Relationship Model
Lecture 2: Entity-Relationship Modeling
Entities and Attributes
Outline What is ER Model? And Why? Example COMPANY Database
Entity-Relationship Model. 2 Outline  What is ER Model? And Why?  Overview of Database Design Process  Example COMPANY Database  ER Model Concepts.
Database. Basic Definitions Database: A collection of related data. Database Management System (DBMS): A software package/ system to facilitate the creation.
Principles of Database Systems With Internet and Java Applications Today’s Topic Chapter 2: Representing Information with Data Models The lecture notes.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model.
Data Modeling Using the Entity-Relationship
SQL Structured Query Language Programming Course.
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.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
Chapter 7 Database Design and The E–R Model. 2 Goals n Facilitate DB design and represent the overall logical structure of the DB. n Definition Entities.
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.
Chapter 3 Data Modeling Using the Entity-Relationship (ER) Model Copyright © 2004 Pearson Education, Inc.
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 Management Systems MIT Lesson 02 – Database Design (Entity Relationship Diagram) By S. Sabraz Nawaz.
 Entity-relationship models (ERM) Entity-relationship models (ERM)  Simple E-R Diagram Simple E-R Diagram  Weak Entity Weak Entity  Strong Entity.
Slide Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model.
Weak Entity Sets A weak entity is an entity that cannot exist in a database unless another type of entity also exists in that database. Weak entity meets.
Entity-Relationship Model Chapter 3 II COSC 457 Sungchul Hong.
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
CSE 412/598 DATABASE MANAGEMENT COURSE NOTES 3. ENTITY-RELATIONSHIP CONCEPTUAL MODELING Department of Computer Science & Engineering Arizona State University.
Conceptual Modelling The Entity-Relationship (ER) Model The ER diagram Data Modelling.
Example COMPANY Database
Chapter 7 Data Modeling Using the Entity-Relationship (ER) Model
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Lecture # 16 July 26,2012 Data Modeling using the Entity Relationship.
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
Data Modeling Using the Entity- Relationship (ER) Model
Comp 1100 Entity-Relationship (ER) Model
Chapter 3 Data Modeling Using the Entity-Relationship Model
CS4222 Principles of Database System
Data Modeling Using the Entity- Relationship (ER) Model
Database Management Systems
ER model Ashima Wadhwa.
Entity Relationship Model
Entity-Relationship Model
Lecture3: Data Modeling Using the Entity-Relationship Model.
بسم الله الرحمن الرحيم.
Entity-Relationship Modeling "Extended"
Initial Design of Entity Types: EMPLOYEE, DEPARTMENT, PROJECT, DEPENDENT Gender.
Database Modeling using Entity Relationship Model (E-R Model)
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:

Database Management COP4540, SCS, FIU Database Modeling Using the Entity-Relationship Model (Continued)

Database Management COP4540, SCS, FIU Entity-Relationship Review Entities –Entity class vs. Entity instance Attributes –Single attribute vs. Multivalued attribute –Simple attribute vs. Composite attribute –Stored attribute vs. Derived attribute Relationships –Degree –Cardinality

Database Management COP4540, SCS, FIU An Example Database Application The company is organized into departments. Each departments 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. A department controls a number of projects, each of which has a unique name, a unique number, and a single location. We store each employee’s name, SSN, address, salary, sex, birth date, and age. 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. Each employee may have only one direct supervisor.

Database Management COP4540, SCS, FIU Database Design Steps (1) The Entity class DEPARTMENT and its properties DEPARTMENT name number locations manager projects Problems: How to express the start date of a manager? How to express the properties of a project?

Database Management COP4540, SCS, FIU Database Design Steps (2) The Entity class PROJECT and its properties PROJECT name number locations Problem: How to relate PORJECT and DEPARTMENT

Database Management COP4540, SCS, FIU Database Design Steps (3) The relationship between DEPARTMENT and PROJECT DEPARTMENT name number locations manager PROJECT name number locations Controls 1 N

Database Management COP4540, SCS, FIU Database Design Steps (4) The Entity class EMPLOYEE and its properties EMPLOYEE name firstnamelastname middle SSNaddress street city state zip birthdate age dept_name projectssupervisor Question: An entity or an attribute? salary

Database Management COP4540, SCS, FIU Database Design Steps (5) The Refinement of the Entity class EMPLOYEE EMPLOYEE supervision 1 N supervisorsupervisee DEPARTMENT Works_for 1 N PROJECT Works_on M N hours

Database Management COP4540, SCS, FIU Another relationship between EMPLOYEE and DEPARTMENT Database Design Steps (6) EMPLOYEE supervision 1 N supervisorsupervisee DEPARTMENT Works_for 1 N PROJECT Works_on M N hours Manages 1 1

Database Management COP4540, SCS, FIU EMPLOYEE supervision 1 N supervisorsupervisee DEPARTMENT Works_for 1N PROJECT Works_on M N hours Manages 1 1 name number locations Controls 1 N name number locations name firstname lastname middle street city state zipaddress birthdate age SSNsalary Final Design

Database Management COP4540, SCS, FIU Weak Entities Do not have key attributes of their own. Each has a dependent entity namely identifying owner Identifying relationship links itself and the owner. Weak entity identifier is its partial identifier combined with that of its owner. Donations –Double lined rectangular box. –Double lined diamond shape box.

Database Management COP4540, SCS, FIU Weak Entity (2) Key attributes come not (completely) from its own attributes, but from the keys from some other entity sets’. It is Represented by putting double rectangle around, and a double diamond around each relationship to which the weak E.S. is linked to an E.S. that provides part of its key. Use of many-one relationship (includes 1-1) essential.

Database Management COP4540, SCS, FIU Weak Entity Example Logins ( Addresses) Login name = user name + host name, e.g., login entity corresponds to a user name on a particular host, but the password table doesn't record the host, just the user name, e.g. yuanj. Key for a login = the user name at the host (which is unique for that host only) + the IP address of the host, which is unique globally.

Database Management COP4540, SCS, FIU user_name password HOST IP address At LOGIN N1 Example E-R Diagram

Database Management COP4540, SCS, FIU An Example Database Application The company is organized into departments. Each departments 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. A department controls a number of projects, each of which has a unique name, a unique number, and a single location. We store each employee’s name, SSN, address, salary, sex, birth date, and age. 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. Each employee may have only one direct supervisor. We want to keep track of the dependents of each employee for insurance purpose. We keep each dependent’s first name, sex, birth date and relationship to employee.

Database Management COP4540, SCS, FIU The Weak Entity DEPENDENT DEPENDENT namesex birthdate relationship EMPLOYEE Dependents_of 1 N SSN

Database Management COP4540, SCS, FIU EMPLOYEE supervision 1 N supervisorsupervisee DEPARTMENT Works_for 1N PROJECT Works_on M N hours Manages 1 1 name number locations Controls 1 N name number locations name firstname lastname middle street city state zipaddress birthdate age SSNsalary DEPENDENT name sex birthdate relationship Dependents_of 1 N

Database Management COP4540, SCS, FIU Example: Chain of “Weakness” Consider IP addresses consisting of a primary domain (e.g., edu) subdomain (e.g., fiu), and host (e.g. solix). –Key for primary domain = its name. –Key for secondary domain = its name + name of primary domain. –Key for host = its name + key of secondary domain = its name + name of secondary domain + name of primary domain.

Database Management COP4540, SCS, FIU Example E-R Diagram HOST DOMAIN name In SUB-DOMAIN In N 1 N 1 WWW WWW WWW EDU COM FIU MIT ORACLE