COMP102: Introduction to Databases, 9.1

Similar documents
Chapter 12. Entity-Relationship Modeling

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

Database Management System 6 ER Modeling...

LECTURE 3: ENTITY-RELATIONSHIP MODELING

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

COMP102: Introduction to Databases, 13

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

Entity Relationship Modelling

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

Lecture 09. Spring 2018 Borough of Manhattan Community College

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

COMP 244. Entity Relationship Model Basics. Entity-Relationship Models. Key elements of the E-R model DATABASE CONCEPTS & APPLICATIONS

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

Elements of the E-R Model

Agenda: Understanding Relationship Types Degree and Cardinality with Examples

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

Entity Relationship Modeling

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

The Entity-Relationship Model. The Entity-Relationship model. The ER model. The Entity-Relationship model. E-R Model Constructs. E-R Model Constructs

Represent entities and relations with diagrams

MIT Database Management Systems Lesson 03: Entity Relationship Diagrams

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

Lecture3: Data Modeling Using the Entity-Relationship Model.

Chapter 17. Methodology Logical Database Design for the Relational Model

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

Entity Relationship Diagram (ERD): Basics

Conceptual Database Design. COSC 304 Introduction to Database Systems. Entity-Relationship Modeling. Entity-Relationship Modeling

Chapter 4. In this chapter, you will learn:

The Entity Relationship Model

Chapter # 4 Entity Relationship (ER) Modeling

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

Advance Database Management System

Database Systems. Overview - important points. Lecture 5. Some introductory information ERD diagrams Normalization Other stuff 08/03/2015

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

Multiple Choice Questions

Database Management Systems LECTURE NOTES 2

COSC 304 Introduction to Database Systems. Entity-Relationship Modeling

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

Conceptual Modeling in ER and UML

Conceptual Database Design

Information Technology Audit & Cyber Security

SOLUTIONS TO REVIEW QUESTIONS AND EXERCISES FOR PART 3 - DATABASE ANALYSIS AND DESIGN (CHAPTERS 10 15)

Chapter 4. The Relational Model

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

Chapter 2 Conceptual Modeling. Objectives

CMP-3440 Database Systems

Chapter 4 Entity Relationship Modeling In this chapter, you will learn:

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:

Lecture 03. Fall 2017 Borough of Manhattan Community College

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

A l Ain University Of Science and Technology

CSE 530A. ER Model. Washington University Fall 2013

CSIT5300: Advanced Database Systems

Lecture 03. Spring 2018 Borough of Manhattan Community College

COMP102: Introduction to Databases, 14

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

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

Chapter 2 ENTITY RELATIONSHIP MODEL

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

Entity-Relationship Model


Modern Systems Analysis and Design Seventh Edition

Chapter 2 Entity-Relationship Data Modeling: Tools and Techniques. Fundamentals, Design, and Implementation, 9/e

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

Chapter 3 Database Modeling and Design II. Database Modeling

Intro to DB CHAPTER 6

High Level Database Models

Chapter 6: Entity-Relationship Model

Database Systems. A Practical Approach to Design, Implementation, and Management. Database Systems. Thomas Connolly Carolyn Begg

Unit 2 - Data Modeling. Pratian Technologies (India) Pvt. Ltd.

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

Lecture 2: Entity Relationship Data Model 2. 1

A l Ain University Of Science and Technology

4. Entity Relationship Model

Chapter 2: Entity-Relationship Model

Sahaj Computer Solutions. Data Modeling using the Entity Relationship Model

Conceptual Data Modeling

Chapter 2 Entity-Relationship Data Modeling: Tools and Techniques. Fundamentals, Design, and Implementation, 9/e

COMP102: Introduction to Databases, 5 & 6

COMP102: Introduction to Databases, 4

CMSC 424 Database design Lecture 3: Entity-Relationship Model. Book: Chap. 1 and 6. Mihai Pop

Data Modeling Online Training

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

Introduction to Database Design

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

Conceptual Data Models for Database Design

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

Chapter 7: Entity-Relationship Model

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

Major components of ER diagram Practices

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

2. E-R Model. Entity Sets Relationship Sets Attributes

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

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

High-Level Database Models (ii)

SOFTWARE ENGINEERING Prof.N.L.Sarda Computer Science & Engineering IIT Bombay. Lecture #10 Process Modelling DFD, Function Decomp (Part 2)

ER to Relational Mapping

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

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

Transcription:

COMP102: Introduction to Databases, 9.1 Dr Muhammad Sulaiman Khan Department of Computer Science University of Liverpool U.K. 21/22 February, 2011

Database Analysis and Design Techniques: Entity-Relationship Modeling, part I

Specific topics for today: How to use Entity-Relationship (ER) modeling in database design. The basic concepts of an ER model called entities, relationships, and attributes. A diagrammatic technique based on UML for displaying an ER model.

Entity-Relationship (ER) modeling Top-down approach to database design. Start by identifying the important data (called entities) and relationships between the data. Then add more details such as the information we want to hold about the entities and relationships (called attributes) and any constraints on the entities, relationships, and attributes.

Entities Entity: A set of objects with the same properties, which are identified by a user or organization as having an independent existence. Entity occurrence: Each uniquely identifiable object within the set, i.e., the entity.

Entities with physical and conceptual existence

ER diagram of entities

Relationships Relationship: A set of meaningful associations among entities. Relationship occurrence: Each uniquely identifiable association within the set, i.e., the relationship. Note: Relationship corresponds to a notion of relation in maths, where it basically means a subset of a given universe set.

ER diagram of relationships

Relationships Degree of a relationship: The number of participating entities in the relationship. Relationship of degree: one is unary. two is binary. three is ternary. four is quaternary. n is n-ary.

Example: ternary relationship

Example: unary relationship Relationship IsManager in entity Staff.

Recursive relationships Recursive relationship: Relationship where same entity participates more than once in different roles. Relationships may be given role names to indicate purpose that each participating entity plays in a relationship. Question: Can an unary relationship be recursive?

Example: Recursive relationship

Attributes Attribute: Property of an entity or a relationship. Hold values that describe each occurrence of an entity or relationship, and represent the main source of data stored in the database. Attribute can be classified as being: simple or composite single-valued or multi-valued or derived

Attributes Simple attribute: Attribute composed of a single component. Composite attribute: Attribute composed of multiple components. Single-valued attribute: Attribute that holds a single value for an entity occurrence. Multi-valued attribute: Attribute that holds multiple values for an entity occurrence. Derived attribute: Attribute that represents a value that is derivable from value of a related attribute, or set of attributes, not necessarily in the same entity.

Example: Kinds of Attributes Simple attribute: E.g., attribute catalogno in entity Video.. Composite attribute: E.g., attribute name in entity Staff, composed of (first name,last name). Single-valued attribute: E.g., attribute catalogno in entity Video. Multi-valued attribute: E.g., attribute category in entity Video; e.g., a video can have category Children and Comedy. Simple multi-valued attribute: E.g., attribute category as above. Derived attribute: E.g., attribute age derivable from attribute DOB date of birth. E.g., attribute nameofmgr (name of manager) in entity Branch, derivable from attributes mgrstaffno, staffno, name in entities Branch and Staff.

Keys Superkey: An attribute, or set of attributes, that uniquely identifies each entity occurrence. Candidate key: A superkey K such that no proper subset of K is a superkey within the entity. Primary key: The candidate key that is selected to identify each entity occurrence. Alternate keys: The candidate keys that are not selected as the primary key of the entity.

Example: ER diagram of entities and their attributes

Strong and weak entities Strong entity: Entity that is not dependent on the existence of another entity for its primary key. Weak entity: Entity that is partially or wholly dependent on the existence of another entity, or entities, for its primary key. Example: Actor and Video are strong entities, because we can distinguish one actor (video) from another actor (video, resp.) without the existence of any other entity; they have their own primary keys. Example: Role is weak entity, because we are not able to distinguish one Role entity occurrence from another without the existence of the Actor and Video entities; this entity has no primary key on its own.

Multiplicity constraints on relationships Multiplicity: Represents the number of occurrences of one entity that may relate to a single occurrence of an associated entity. Represents policies (called business rules) established by user or company.

Multiplicity constraints The most common degree for relationships is binary. Binary relationships are generally referred to as being: one-to-one (1:1) one-to-many (1:*) many-to-many (*:*)

Example: 1:1 relationship: (a) individual examples, (b) multiplicity (UML)

1:1 relationship: More precisely Note: Relationships are usually directed, e.g., from entity Staff to Branch and vice-versa. For each entity occurrence at one end, we set the range of entity occurrences at the other end that it can be associated with. Each staff member manages 0..1 branches. Each branch is managed by 1..1, i.e., precisely 1, staff members.

Example: 1:* relationship: (a) individual examples, (b) multiplicity (UML)

Example: *:* relationship: (a) individual examples, (b) multiplicity (UML)

Complex relationships Multiplicity is the number (or range) of possible occurrences of an entity type in an n-ary relationship when other (n 1) values are fixed.

Example: Complex relationship: (a) individual examples, (b) multiplicity (UML)

Summary of multiplicity constraints

Multiplicity Multiplicity is made up of two types of restrictions on relationships: Cardinality: Describes the maximum number of possible relationships for each participating entity. Participation: Determines whether all or only some entity occurrences participate in a relationship.

Example: Multiplicity as cardinality and participation constraints