CSE 530A. ER Model. Washington University Fall 2013

Similar documents
Introduction to Database Design

Introduction to Database Design

Database Design. ER Model. Overview. Introduction to Database Design. UVic C SC 370. Database design can be divided in six major steps:

Overview. Introduction to Database Design. ER Model. Database Design

CSE 530A. ER Model to Relational Schema. Washington University Fall 2013

MIS Database Systems Entity-Relationship Model.

Database Applications (15-415)

The Entity-Relationship Model. Overview of Database Design. ER Model Basics. (Ramakrishnan&Gehrke, Chapter 2)

Introduction to Database Design. Dr. Kanda Runapongsa Dept of Computer Engineering Khon Kaen University

The Entity-Relationship Model

Contents. Database. Information Policy. C03. Entity Relationship Model WKU-IP-C03 Database / Entity Relationship Model

The Entity-Relationship (ER) Model

The Entity-Relationship Model

The Entity-Relationship Model. Steps in Database Design

The Entity-Relationship Model. Overview of Database Design

Conceptual Design. The Entity-Relationship (ER) Model

The Entity-Relationship (ER) Model 2

CIS 330: Web-driven Web Applications. Lecture 2: Introduction to ER Modeling

The Entity-Relationship Model

CSIT5300: Advanced Database Systems

Database Management Systems. Chapter 3 Part 2

Data Modeling. Yanlei Diao UMass Amherst. Slides Courtesy of R. Ramakrishnan and J. Gehrke

From ER to Relational Model. Book Chapter 3 (part 2 )

ER Model Overview. The Entity-Relationship Model. Database Design Process. ER Model Basics

CS/INFO 330 Entity-Relationship Modeling. Announcements. Goals of This Lecture. Mirek Riedewald

High Level Database Models

Database Management Systems. Chapter 2 Part 2

COMP Instructor: Dimitris Papadias WWW page:

Introduction to Database Design

Overview of db design Requirement analysis Data to be stored Applications to be built Operations (most frequent) subject to performance requirement

OVERVIEW OF DATABASE DEVELOPMENT

Review The Big Picture

SYLLABUS ADMIN DATABASE SYSTEMS I WEEK 2 THE ENTITY-RELATIONSHIP MODEL. Assignment #2 changed. A2Q1 moved to A3Q1

High-Level Database Models (ii)

1/24/2012. Chapter 7 Outline. Chapter 7 Outline (cont d.) CS 440: Database Management Systems

Database Design CENG 351

Introduction to Data Management. Lecture #3 (Conceptual DB Design) Instructor: Chen Li

COMP 244. ER-Diagram Notations. Entity-Relationship Diagrams DATABASE CONCEPTS & APPLICATIONS. Database Concepts & Applications 1.

Database Applications (15-415)

2. DatabaseDesign. Master I Software Engineering. Dr. Imed Bouchrika Dept of Mathematics & Computer Science University of Souk-Ahras

COMP 244 DATABASE CONCEPTS & APPLICATIONS

CONCEPTUAL DESIGN: ER TO RELATIONAL TO SQL

The Relational Model 2. Week 3

CS2 Current Technologies Lecture 5: Data Modelling and Design

ER Model. Objectives (2/2) Electricite Du Laos (EDL) Dr. Kanda Runapongsa Saikaew, Computer Engineering, KKU 1

CS 146 Database Systems

Entity-Relationship Diagrams

Chapter (4) Enhanced Entity-Relationship and Object Modeling

Database Applications (15-415)

VARDHAMAN COLLEGE OF ENGINEERING Shamshabad , Hyderabad B.Tech. CSE IV Semester (VCE - R11) T P C 3+1* -- 4 (A1511) DATABASE MANAGEMENT SYSTEMS

Introduction to Data Management. Lecture #3 (Conceptual DB Design)

CSC 261/461 Database Systems Lecture 8. Spring 2018

CSC 261/461 Database Systems Lecture 8. Fall 2017

ENTITY-RELATIONSHIP. The database design process can be divided into six steps. The ER model is most relevant to the first three steps:

Relational Model. Topics. Relational Model. Why Study the Relational Model? Linda Wu (CMPT )

Introduction to Databases

Introduction to Data Management. Lecture #3 (Conceptual DB Design)

Databases Model the Real World. The Entity- Relationship Model. Conceptual Design. Steps in Database Design. ER Model Basics. ER Model Basics (Contd.

ER Model. CSC 343 Winter 2018 MICHAEL LIUT

Conceptual Data Modeling

The Relational Model (ii)

The Relational Model. Chapter 3. Comp 521 Files and Databases Fall

Database Systems. Course Administration

Modeling Your Data. Chapter 2. cs542 1

CMPT 354 Database Systems I

Conceptual Design. The Entity-Relationship (ER) Model

Database Management Systems. Syllabus. Instructor: Vinnie Costa

Chapter 4. Enhanced Entity- Relationship Modeling. Enhanced-ER (EER) Model Concepts. Subclasses and Superclasses (1)

CIS 330: Applied Database Systems. ER to Relational Relational Algebra

CIS 330: Applied Database Systems

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Conceptual Data Models for Database Design

The Relational Model. Chapter 3

The Relational Model

Overview of Database Design Process Example Database Application (COMPANY) ER Model Concepts

The Relational Model. Chapter 3. Database Management Systems, R. Ramakrishnan and J. Gehrke 1

The Relational Model. Outline. Why Study the Relational Model? Faloutsos SCS object-relational model

Database Management System (15ECSC208) UNIT I: Chapter 1: Introduction to DBMS and ER-Model

Database Systems ( 資料庫系統 )

Database Systems. Lecture2:E-R model. Juan Huo( 霍娟 )

Chapter 2: Entity-Relationship Model. Entity Sets. Entity Sets customer and loan. Attributes. Relationship Sets. A database can be modeled as:

The Relational Model. Why Study the Relational Model? Relational Database: Definitions

Database Design Using E/R Model

THE ENTITY- RELATIONSHIP (ER) MODEL CHAPTER 7 (6/E) CHAPTER 3 (5/E)

LECTURE 3: ENTITY-RELATIONSHIP MODELING

The Relational Model. Chapter 3. Comp 521 Files and Databases Fall

CSC 261/461 Database Systems Lecture 10

Enhanced Entity-Relationship (EER) Modeling

Chapter 2: Entity-Relationship Model

LAB 3 Notes. Codd proposed the relational model in 70 Main advantage of Relational Model : Simple representation (relationstables(row,

Using High-Level Conceptual Data Models for Database Design A Sample Database Application Entity Types, Entity Sets, Attributes, and Keys

E-R Model. Hi! Here in this lecture we are going to discuss about the E-R Model.

Chapter Outline. Note 1. Overview of Database Design Process Example Database Application (COMPANY) ER Model Concepts

Lecture3: Data Modeling Using the Entity-Relationship Model.

Databases Model the Real World. The Entity- Relationship Model. Conceptual Design. Steps in Database Design. ER Model Basics. ER Model Basics (Contd.

Chapter 2 ENTITY RELATIONSHIP MODEL

Data Modeling with the Entity Relationship Model. CS157A Chris Pollett Sept. 7, 2005.

COIS Databases

MIT Database Management Systems Lesson 03: Entity Relationship Diagrams

Entity-Relationship Model

Transcription:

CSE 530A ER Model Washington University Fall 2013

Database Design Requirements Analysis Conceptual Database Design Creates an abstract model Logical Database Design Converts abstract model to concrete schema Schema Refinement Improve schema Physical Database Design Improve performance Application and Security Design Modify schema for application considerations

Entity-Relationship (ER) Model Conceptual design model Describes the data in terms of entities (things) and their relationships Attempts to model the real world

Entities and Attributes An entity is a thing, distinguishable from other things E.g., a person An entity set is a collection of similar things E.g., people Entities are not necessarily physical objects E.g., a baseball game

Entities and Attributes An entity is described by a set of attributes E.g., a person might have a name and social security number An attribute has a domain of possible values E.g., name might be a 50 character string

Keys The key for an entity set is a minimal set of attributes which uniquely identifies each entity Might be single attribute or multiple attributes E.g., social security number for employees Might be more than one candidate key If so then one is chosen as the primary key

Entity Sets ssn name employees Entity sets are represented by rectangles Attributes are ovals

Relationships A relationship is an association between two (or more) entities A relationship set is the set of relationships between two (or more) entity sets E.g., works_in might be a relationship set between the employees entity set and the departments entity set A relationship set can have descriptive attributes Information about the relationships, not the entities

Relationship Sets since ssn name id name employees works_in departments Relationship sets are diamonds

Roles The entity sets participating in a relationship set need not be unique E.g., a reports_to relationship set might exist between employees and employees The entity set then plays different roles in the relationship set E.g., supervisor and underling

Roles ssn name employees supervisor underling reports_to

Key Constraints Relationship sets can be Many-to-many E.g., an employee might work in multiple departments and a department might have multiple employees One-to-many E.g., an employee might manage multiple departments but each department has only one manager One-to-one E.g., each department has only one manager and each employee is only allowed to manage one department

Many-to-Many An employee might work in multiple departments and a department might have multiple employees 111-11-1111 42 222-22-2222 333-33-3333 35 76 employees works_in departments

One-to-Many An employee might manage multiple departments but each department has only one manager 111-11-1111 42 222-22-2222 333-33-3333 35 76 employees manages departments

One-to-Many An employee might manage multiple departments but each department has only one manager ssn name id name employees manages departments

One-to-Many An employee might manage multiple departments but each department has only one manager ssn name id name employees 1 manages N departments

One-to-One Each department has only one manager and each employee is only allowed to manage one department 111-11-1111 42 222-22-2222 333-33-3333 35 76 employees manages departments

One-to-One Each department has only one manager and each employee is only allowed to manage one department ssn name id name employees manages departments

One-to-One Each department has only one manager and each employee is only allowed to manage one department ssn name id name employees 1 manages 1 departments

Participation Constraints The participation of an entity set in a relationship set can be Total: every entity must participate in the relationship set E.g., every department must have a manager Partial: not every entity must participate E.g., not every employee manages a department

Participation Constraints Partial Participation Total Participation 111-11-1111 42 222-22-2222 333-33-3333 35 76 employees manages departments

Participation Constraints ssn name id name employees 1 manages 1 departments Partial Participation Total Participation

Weak Entity Sets Weak entity sets are entity sets whose attributes do not uniquely identify entities without including the primary key of the identifying owner The identifying relationship set is a one-tomany from the owning entity set to the weak entity set

Weak Entity Sets dname does not uniquely identify a dependent Two employees might have dependents with the same name Must use the primary key of the identifying owner (the ssn of the employee) together with the dname ssn name dname age employees insurance dependents

Class Hierarchies Sometimes, entities are classified into subsets with different attributes Attributes from the parent entity set are inherited by the child entity sets, but the child entity sets have other attributes E.g., the employees entity set might have the subclasses hourly_employees and salaried_employees Defines an is-a relationship

Class Hierarchies ssn name employees hourly_wage ISA salary hourly_emps salaried_emps

Aggregation Aggregation allows a relationship set to participate in another relationship set E.g., suppose departments sponsor projects and assign employees to monitor the sponsorships We might want "monitors" to be a relationship set between "employees" and "sponsors", but relationship sets associate two or more entities, not other relationship sets

Aggregation ssn name employees monitors until pid budget since id name projects sponsors departments

Design Considerations Entity vs Attribute Not always clear if a property should be modeled as an attribute or another entity set E.g., should address be an attribute of employee or a separate entity set Entity vs Relationship Sometimes what seems like a relationship set might be better modeled as an entity set E.g., instead of a manages relationship set it might be better to have a managers entity set (as a subclass of employees)

Design Considerations Binary vs Ternary Relationships Aggregation vs Ternary Relationships