The Entity-Relationship Model



Similar documents
Conceptual Design Using the Entity-Relationship (ER) Model

The Entity-Relationship Model

Introduction to Database Systems CS4320/CS5320. CS4320/4321: Introduction to Database Systems. CS4320/4321: Introduction to Database Systems

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

Review: Participation Constraints

Outline. Data Modeling. Conceptual Design. ER Model Basics: Entities. ER Model Basics: Relationships. Ternary Relationships. Yanlei Diao UMass Amherst

Database Design Process

2. Conceptual Modeling using the Entity-Relationship Model

Database Design Process

The Relational Model. Ramakrishnan&Gehrke, Chapter 3 CS4320 1

Winter Winter

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

Lecture 6. SQL, Logical DB Design

Database Design Overview. Conceptual Design ER Model. Entities and Entity Sets. Entity Set Representation. Keys

Data Modeling. Database Systems: The Complete Book Ch ,

DATABASE DESIGN. - Developing database and information systems is performed using a development lifecycle, which consists of a series of steps.

CSC 742 Database Management Systems

Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model

Chapter 3. Data Modeling Using the Entity-Relationship (ER) Model

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

Database Design. Database Design I: The Entity-Relationship Model. Entity Type (con t) Chapter 4. Entity: an object that is involved in the enterprise

Chapter 2: Entity-Relationship Model

COMP 378 Database Systems Notes for Chapter 7 of Database System Concepts Database Design and the Entity-Relationship Model

Chapter 2: Entity-Relationship Model. E-R R Diagrams

Lecture 12: Entity Relationship Modelling

Review Entity-Relationship Diagrams and the Relational Model. Data Models. Review. Why Study the Relational Model? Steps in Database Design

IV. The (Extended) Entity-Relationship Model

Chapter 2: Entity-Relationship Model. Entity Sets. " Example: specific person, company, event, plant

Database Management Systems

Bridge from Entity Relationship modeling to creating SQL databases, tables, & relations

not necessarily strictly sequential feedback loops exist, i.e. may need to revisit earlier stages during a later stage

Databases and BigData

BİL 354 Veritabanı Sistemleri. Entity-Relationship Model

A brief overview of developing a conceptual data model as the first step in creating a relational database.

Entity-Relationship Model

Chapter 8 The Enhanced Entity- Relationship (EER) Model

CS 4604: Introduc0on to Database Management Systems. B. Aditya Prakash Lecture #5: En-ty/Rela-onal Models- - - Part 1

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

XV. The Entity-Relationship Model

Foundations of Information Management

Why Is This Important? Schema Refinement and Normal Forms. The Evils of Redundancy. Functional Dependencies (FDs) Example (Contd.)

Reverse Engineering of Relational Databases to Ontologies: An Approach Based on an Analysis of HTML Forms

The E-R èentity-relationshipè data model views the real world as a set of basic objects èentitiesè and

Database Design Process. Databases - Entity-Relationship Modelling. Requirements Analysis. Database Design

Lesson 8: Introduction to Databases E-R Data Modeling

Relational Schema Design

The Entity-Relationship Model

Entity - Relationship Modelling

Lecture Notes INFORMATION RESOURCES

Data Modeling: Part 1. Entity Relationship (ER) Model

Unit 5: Object-Role Modeling (ORM)

Modern Systems Analysis and Design

Schema Refinement and Normalization

three Entity-Relationship Modeling chapter OVERVIEW CHAPTER

Chapter 10. Practical Database Design Methodology. The Role of Information Systems in Organizations. Practical Database Design Methodology

Requirement Analysis & Conceptual Database Design. Problem analysis Entity Relationship notation Integrity constraints Generalization

Entity-Relationship Model. Purpose of E/R Model. Entity Sets

Schema Design and Normal Forms Sid Name Level Rating Wage Hours

Chapter 10 Practical Database Design Methodology and Use of UML Diagrams

Database Design Methodologies

SCHEMAS AND STATE OF THE DATABASE

Unit 2.1. Data Analysis 1 - V Data Analysis 1. Dr Gordon Russell, Napier University

OVERVIEW 1.1 DATABASE MANAGEMENT SYSTEM (DBMS) DEFINITION:-

We know how to query a database using SQL. A set of tables and their schemas are given Data are properly loaded

Entity Relationship Diagram

7.1 The Information system

Designing a Database Schema

Foundations of Information Management

Concepts of Database Management Eighth Edition. Chapter 1 Introduction to Database Management

Database Design. Goal: specification of database schema Methodology: E-R Model is viewed as a set of

Data Modeling Basics

Skills for Employment Investment Project (SEIP)

ER modelling, Weak Entities, Class Hierarchies, Aggregation

BCS THE CHARTERED INSTITUTE FOR IT BCS HIGHER EDUCATION QUALIFICATIONS BCS Level 5 Diploma in IT. September 2013 EXAMINERS REPORT

Data Analysis 1. SET08104 Database Systems. Napier University

Relational Database Concepts

Chapter 10 Practical Database Design Methodology and Use of UML Diagrams

Information Management

CSCI-GA Database Systems Lecture 7: Schema Refinement and Normalization

Course: CSC 222 Database Design and Management I (3 credits Compulsory)

Chapter 2. Data Model. Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel

Database Fundamentals: 1

DATABASE MANAGEMENT SYSTEMS SOLUTIONS MANUAL THIRD EDITION

DATABASE INTRODUCTION

A Comparative Analysis of Entity-Relationship Diagrams 1

How To Write A Diagram

RELATIONSHIP STRENGTH

1 Class Diagrams and Entity Relationship Diagrams (ERD)

Database Design Methodology

There are five fields or columns, with names and types as shown above.

Database Systems. Session 3 Main Theme. Enterprise Data Modeling Using The Entity/Relationship (ER) Model. Dr. Jean-Claude Franchitti

Entity/Relationship Modelling. Database Systems Lecture 4 Natasha Alechina

Object-Oriented Data Modeling

A Tool for Generating Relational Database Schema from EER Diagram

Concepts of Database Management Seventh Edition. Chapter 6 Database Design 2: Design Method

ER & EER to Relational Mapping. Chapter 9 1

DISCLAIMER OVERVIEW WHY DO WE MODEL WHAT IS QUALITY? Jeff Jacobs,

Transcription:

The Entity-Relationship Model Overview of Database Design Requirements analysis Conceptual design data model Logical design Schema refinement: Normalization Physical tuning Conceptual Design Entities Conceptual design: (ER Model is used at this stage.) What are the entities and relationships in the enterprise? What information about these entities and relationships should we store in the database? What are the integrity constraints or business rules that hold? A database `schema in the ER Model can be represented pictorially (ER diagrams). Can map an ER diagram into a relational schema.

ER Model Basics Relationships Entity: Real-world object distinguishable from other objects. An entity is described (in DB) using a set of attributes Entity Set: A collection of similar entities. E.g., all employees All entities in an entity set have the same set of attributes Each entity set has a key Each attribute has a domain d ER Model Basics (Contd.) Relationships (Contd.) Relationship: Association among two or more entities. E.g., Attishoo works in Pharmacy department. Relationship Set: Collection of similar relationships. An n-ary relationship set R relates n entity sets E1... En Each relationship in R involves entities e1 in E1,..., en in En subordinate supervisor Reports_To Want to capture supervisor-subordinate relationship

Relationships (Contd.) Ternary Relationship Parts Parts Suppliers Suppliers Contract Want to capture information that a Supplier s supplies Part p to Department d How are these different? Key Constraints from to 2 d An employee can work in many departments; a dept can have many employees d 3 d Each dept has at most one manager, according to the key constraint on Manages. Manages d from Duration to

Key Constraints: Examples Participation Constraints Example Scenario 1: An inventory database contains information about parts and manufacturers. Each part is constructed by exactly one manufacturer. Example Scenario 2: A customer database contains information about customers and sales persons. Each customer has exactly one primary sales person. What do the ER diagrams look like? An employee can work in many departments; a dept can have many employees Each employee works in at least one department according to the participation constraint on d d Participation Constraints: Examples Exercise: What does this mean? Example Scenario 1 (Contd.): Each part is constructed by exactly one or more manufacturer. d Example Scenario 2: Each customer has exactly one primary sales person. Manages

Weak Entities A weak entity can be entified uniquely only by consering the primary key of another (owner) entity. Owner entity set and weak entity set must participate in a oneto-many relationship set (one owner, many weak entities). Weak entity set must have total participation in this entifying relationship set. cost Policy p Dependents age ISA (`is a ) Hierarchies As in C++, or other PLs, attributes are inherited. If we declare A ISA B, every A entity is also consered to be a B entity. hourly_wages hours_worked Hourly_Emps ISA contract Contract_Emps Overlap constraints: Can Joe be an Hourly_Emps as well as a Contract_Emps entity? (Allowed/disallowed) Covering constraints: Does every entity also have to be an Hourly_Emps or a Contract_Emps entity? (Yes/no) Reasons for using ISA: To add descriptive attributes specific to a subclass. To entify entities that participate in a relationship. Aggregation Used when we have to model a relationship involving (entitity sets and) a relationship set. Aggregation allows us to treat a relationship set as an entity set for purposes of participation in (other) relationships. p started_on Projects p Monitors Sponsors until d Aggregation vs. ternary relationship: Monitors is a distinct relationship, with a descriptive attribute. Also, can say that each sponsorship is monitored by at most one employee. Class Exercise Give two real-life examples where each of the following would occur: A key constraint A participation constraint A weak entity set

Class Exercise Draw ER diagram for a database used to manage SI440 class (at least 3 entities) Specify entities, attributes, entifiers Specify relationships Specify constraints Class Exercise Drugwarehouse.com has offered you a free lifetime supply of prescription drugs (no questions asked) if you design its database schema. Given the rising cost of health care, you agree. Here is the information that you gathered: Patients are entified by their SSN, and we also store their s and age Doctors are entified by their SSN, and we also store their s and specialty Each patient has one primary care physician Each doctor has at least one patient Conceptual Design Using the ER Model Design choices: Should a concept be modeled as an entity or an attribute? Should a concept be modeled as an entity or a relationship? Identifying relationships: Binary or ternary? Aggregation? Constraints in the ER Model: A of data semantics can (and should) be captured. But some constraints cannot be captured in ER diagrams. Summary of Conceptual Design Conceptual design follows requirements analysis ER model popular for conceptual design Basic constructs: entities, relationships, and attributes Some additional constructs: weak entities, ISA hierarchies, and aggregation. Note: There are many variations on ER model.