The Entity Relationship Model

Similar documents
II. Review/Expansion of Definitions - Ask class for definitions

CS352 Lecture - The Entity-Relationship Model

A database can be modeled as: + a collection of entities, + a set of relationships among entities.

Database Management System 6 ER Modeling...

Intro to DB CHAPTER 6

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

Chapter 2: Entity-Relationship Model

A l Ain University Of Science and Technology

Chapter 4. The Relational Model

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

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

Database Management Systems LECTURE NOTES 2

Chapter 9: Relational DB Design byer/eer to Relational Mapping Relational Database Design Using ER-to- Relational Mapping Mapping EER Model

Conceptual Data Modeling

Chapter 2 Introduction to Relational Models

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

A l Ain University Of Science and Technology

Chapter 4. In this chapter, you will learn:

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

Design Process Modeling Constraints E-R Diagram Design Issues Weak Entity Sets Extended E-R Features Design of the Bank Database Reduction to

Chapter 6: Entity-Relationship Model

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

Chapter 6: Entity-Relationship Model

Chapter 6: Entity-Relationship Model

Introduction to Relational Databases. Introduction to Relational Databases cont: Introduction to Relational Databases cont: Relational Data structure

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 4 Entity Relationship (ER) Modeling

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 4 Entity Relationship (ER) Modeling

Advance Database Management System

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.

Conceptual Design. The Entity-Relationship (ER) Model

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

Example: specific person, company, event, plant

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 7 Data Modeling with Entity Relationship Diagrams

Sahaj Computer Solutions. Data Modeling using the Entity Relationship Model

CS352 Lecture - Data Models

Course Introduction & Foundational Concepts

DATA MODELING USING THE ENTITY-RELATIONSHIP MODEL. 1 Powered by POeT Solvers Limited

Basant Group of Institution

Topic 5: Mapping of EER Diagrams to Relations

Mahathma Gandhi University

Data Analysis 1. Chapter 2.1 V3.1. Napier University Dr Gordon Russell

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

ENTITY-RELATIONSHIP MODEL III. CS121: Relational Databases Fall 2017 Lecture 16

CS403- Database Management Systems Solved Objective Midterm Papers For Preparation of Midterm Exam

Chapter 6: Entity-Relationship Model

COMP Instructor: Dimitris Papadias WWW page:

6.1 RELATIONSHIP CONCEPTS

Database Systems ER Model. A.R. Hurson 323 CS Building

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

Translation to Relational Schema

ER to Relational Mapping

DATABASE SYSTEMS. Chapter 5 Entity Relationship (ER) Modelling DESIGN IMPLEMENTATION AND MANAGEMENT INTERNATIONAL EDITION ROB CORONEL CROCKETT

Non-overlappingoverlapping. Final outcome of the worked example On pages R&C pages R&C page 157 Fig 3.52

Review The Big Picture


Data Modeling Using the Entity-Relationship Model

Data about data is database Select correct option: True False Partially True None of the Above

Entity-Relationship Model. From Chapter 5, Kroenke book

U1. Data Base Management System (DBMS) Unit -1. MCA 203, Data Base Management System

Chapter 6: Entity-Relationship Model. The Next Step: Designing DB Schema. Identifying Entities and their Attributes. The E-R Model.

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

Relational Model. Rab Nawaz Jadoon DCS. Assistant Professor. Department of Computer Science. COMSATS IIT, Abbottabad Pakistan

CSCC43H: Introduction to Databases

The Next Step: Designing DB Schema. Chapter 6: Entity-Relationship Model. The E-R Model. Identifying Entities and their Attributes.

System Analysis And Design Methods ENTITY RELATIONSHIP DIAGRAM (ERD) Prof. Ali Khaleghi Eng. Hadi Haedar

Objectives of logical design... Transforming the ERD diagram into relations. Relational database components. Mapping a composite attribute

CSIT5300: Advanced Database Systems

Relational Model (cont d) & Entity Relational Model. Lecture 2

8) A top-to-bottom relationship among the items in a database is established by a

David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation

Data Modeling Using the Entity-Relationship (ER) Model

Entity Relationship Modelling

Lecture 14 of 42. E-R Diagrams, UML Notes: PS3 Notes, E-R Design. Thursday, 15 Feb 2007

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

ENTITY-RELATIONSHIP MODEL II. CS121: Relational Databases Fall 2017 Lecture 15

THE RELATIONAL DATABASE MODEL

COMP102: Introduction to Databases, 9.1

CS403- Database Management Systems Solved MCQS From Midterm Papers. CS403- Database Management Systems MIDTERM EXAMINATION - Spring 2010

MTAT Introduction to Databases

Distributed Database Systems By Syed Bakhtawar Shah Abid Lecturer in Computer Science

More on the Chen Notation

Review for Exam 1 CS474 (Norton)

Agenda: Understanding Relationship Types Degree and Cardinality with Examples

Informatics 1: Data & Analysis

Major components of ER diagram Practices

Chapter 2 Conceptual Modeling. Objectives

The Relational Model

Multiple Choice Questions

Represent entities and relations with diagrams

The DBMS accepts requests for data from the application program and instructs the operating system to transfer the appropriate data.

Database Design Principles

Chapter 12. Entity-Relationship Modeling

The Relational Model

CS221 Lecture: The Relational Data Model

Database Management System (15ECSC208) UNIT I: Chapter 2: Relational Data Model and Relational Algebra

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

CS275 Intro to Databases

Course Introduction & Foundational Concepts

4. Entity Relationship Model

Transcription:

The Entity Relationship Model CPS352: Database Systems Simon Miner Gordon College Last Revised: 2/4/15

Agenda Check-in Introduction to Course Database Environment (db2) SQL Group Exercises The Entity Relationship Model Group Exercise

Check-in

Matthew s Begats Matthew 1:1-17

The Entity Relationship Model

The ER Model Helps Us Design Databases. Entity relationship model as a conceptual database design tool Not a DBMS implementation No entity relationship databases available Entity relationship (ER) diagrams help us think about the structure of a data model Can be translated into relational schemas Which then can be implemented in a DBMS Analogous to use case or class diagrams in OO design

ER Model Concepts Entity an object being represented (along with its details) Entity set the set of all objects of a given kind Attribute individual fact about an entity Often simple (atomic) and single-valued Can be composite one attribute made up of multiple attributes Sometimes multi-valued Can be derived from other attributes Not necessarily stored with the entity, but calculated when needed Domain set of possible values for an attribute Keys set of attributes that uniquely identifies an entity Superkeys, candidate keys, and primary key

ER Diagrams Show Entity Sets and their Attributes. Entity set represented by rectangular box containing name of entity Attributes represented by ellipses containing attribute names Primary key attribute(s) underlined Composite attributes displayed with a hierarchical structure Multivalued attributes enclosed in double ellipses Derived attributes enclosed in a dashed ellipse Attributes connected by lines to entity set

Relationship Concepts Relationship the connection between two or more entities A relationship can be between an entity and itself Relationship set set of all relationships of a given type A subset of the Cartesian product of the entity sets Degree of a relationship set is how many entities are involved in it (i.e. binary, ternary, quadranary, etc.) Descriptive attribute a property of a relationship that does not apply to its associated entities Note that A relationship with more than two entities can always be converted to a new entity plus relationships between the new and original entities When a relationship of more than two entities is converted into a new entity, the original relationship s descriptive attributes become the new entity s attributes

Relationship Sets in ER Diagrams Relationship sets represented by diamonds Connected with associated entities by solid lines (potentially doubled or decorated with arrows) Descriptive attributes depicted the same way as entity attributes Converting a ternary+ relationship to a new entity

Mapping Constraints Limit the Entities in a Relationship Set. Restrictions as to what kind of subsets are possible in a relationship set Mapping cardinalities how many entities in each entity set can participate in the relationship Participation constraints when an entity in one entity set must participate in a relationship Existence dependencies when an entity in one entity set of a relationship is dependent on the existence of an entity in the other entity set Primary keys for relationship sets

Mapping Cardinalities One to one Any member of either entity set involved can participate in at most one instance of the relationship set Often represented by arrow heads pointing to both entities in ER diagram One to many / Many to one Basically the same concept (just in opposite directions) Entities in the one entity set can participate in multiple relationships Entities in the many entity set can participate in at most one Often represented by an arrow head pointing to the one in ER diagram Many to many Entities in either entity set can participate in multiple relationships Often represented by a solid line to all entities in the relationship (no arrow heads)

Participation Constraints Total participation constraint When the underlying reality of a relationship dictates that every entity in on entity set must participate in an instance of the relationship Represented by a double line between the relationship and the entity that must participate Example: every borrower must have a category

Existence Dependencies Weak entity set an entity set in which each entity is dependent on the existence of an entity from another entity set Has a partial key or discriminator which must be combined with attributes from the strong entity to uniquely identify it (no superkey) If the dominant strong entity is deleted, the subordinate weak entity ceases to exist Example: Fines owed by borrowers

Weak Entities in ER Diagrams Weak entity set represented by a double box Existence dependency relationship represented by a double diamond Partial key attributes underlined using a dashed line

Primary Keys for Relationship Sets Mapping Cardinality Many to many One to many Many to one One to one Key Union of key attributes in all involved entities Primary key of the many entity Primary key of either of the entities

Converting to the Relational Model Any database scheme consisting of entities and relationships can be represented by a series of tables One for each entity set One for each relationship set Except when the relationship can be folded into an entity

Converting Entities to Tables Strong entity set One row for each entity One column for each attribute Weak entity set One row for each entity One column for each attribute Add column(s) for the primary key of the strong entity on which the weak entity depends

Converting Relationships to Tables Relationship set One row for each relationship One column for each descriptive attribute Column(s) for primary key attributes of each participating entity set Folding in one to one and one to many relationships Into the many entity by including the foreign key of the one entity and any attributes These will be null for an entity that is not in any relationship

Generalized and Specialized Entities An entity set may contain multiple groups of similar entities with common and distinct attributes Example: different kinds of borrowers for students, faculty/staff, and community members Converting generalized/specialized entities to tables One big table One table per group One generalized table with common attributes and one specialized table per group

Group Exercise Complete Practice Exercise 7.1 On page 315 of Database System Concepts