Chapter 2 Conceptual Modeling. Objectives

Similar documents
Objectives Definition iti of terms Importance of data modeling Write good names and definitions for entities, relationships, and attributes Distinguis

Full file at

Essentials of Database Management (Hoffer et al.) Chapter 2 Modeling Data in the Organization

Related download: Instructor Manual for Modern Database Management 12th Edition by Hoffer Venkataraman Topi (Case studies included)

Represent entities and relations with diagrams

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

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

Chapter 1: The Database Environment

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

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

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

A l Ain University Of Science and Technology

Lecture3: Data Modeling Using the Entity-Relationship Model.

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

A l Ain University Of Science and Technology

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

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

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

Entity Relationship Modelling

Agenda: Understanding Relationship Types Degree and Cardinality with Examples

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

Conceptual Database Design (ER modeling) Chapter Three

Elements of the E-R Model

Advance Database Management System

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

Information Technology Audit & Cyber Security

MTAT Introduction to Databases

LECTURE 3: ENTITY-RELATIONSHIP MODELING

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

IS 263 Database Concepts

Modern Systems Analysis and Design Seventh Edition

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

CSC 261/461 Database Systems Lecture 7

CSC 261/461 Database Systems Lecture 6. Spring 2017 MW 3:25 pm 4:40 pm January 18 May 3 Dewey 1101

More on the Chen Notation

Entity Relationship Diagram (ERD): Basics

Chapter 6: Entity-Relationship Model

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

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

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

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

ER modeling. Lecture 4

Chapter 4. In this chapter, you will learn:

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

CSIT5300: Advanced Database Systems

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

COSC 304 Introduction to Database Systems. Entity-Relationship Modeling

CSE 880:Database Systems. ER Model and Relation Schemas

CMP-3440 Database Systems

Chapter 2: Entity-Relationship Model

ER DIAGRAM ER) diagram, a graphical representation of entities and their relationships to each other, typically used in computing in regard to the

Entity Relationship Modeling. From Rob and Coronel (2004), Database Systems: Design, Implementation, and Management

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

Data Modeling Using the Entity-Relationship (ER) Model

Conceptual Design. The Entity-Relationship (ER) Model

Intro to DB CHAPTER 6

MIS Database Systems Entity-Relationship Model.

Conceptual Data Models for Database Design

Sahaj Computer Solutions. Data Modeling using the Entity Relationship Model

Handout 2. A very brief intro to relational databases (with more coming later). Conceptual Data Modeling Entity-Relationship Diagrams.

COMP Instructor: Dimitris Papadias WWW page:

course 3 Levels of Database Design CSCI 403 Database Management Mines Courses ERD Attributes Entities title 9/26/2018

MIS2502: Data Analytics Relational Data Modeling - 1. JaeHwuen Jung

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


Multiple Choice Questions

Chapter 3 Database Modeling and Design II. Database Modeling

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

Objectives Definition iti of terms List five properties of relations State two properties of candidate keys Define first, second, and third normal for

Entity-Relationship Model. From Chapter 5, Kroenke book

Database Management System 6 ER Modeling...

Chapter # 4 Entity Relationship (ER) Modeling

Chapter 6: Entity-Relationship Model

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

Entity-Relationship Model

Full file at Modern Database Management, Eleventh Edition

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

Example: specific person, company, event, plant

CMPT 354 Database Systems I

The Entity Relationship Model

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

DATABASE SCHEMA DESIGN ENTITY-RELATIONSHIP MODEL. CS121: Relational Databases Fall 2017 Lecture 14

Database Applications (15-415)

L12: ER modeling 5. CS3200 Database design (sp18 s2) 2/22/2018

Conceptual Modeling in ER and UML

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

Chapter 7: Entity-Relationship Model

Topic 5: Mapping of EER Diagrams to Relations

Entity Relationship Data Model. Slides by: Shree Jaswal

Entity-Relationship Model &

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

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

Modeling Your Data. Chapter 2. cs542 1

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

The entity is an object of interest to the end user. entity correspond to the table not to a row- in the relational environment.

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

COMP102: Introduction to Databases, 9.1

Overview of Database Design Process. Data Modeling Using the Entity- Relationship (ER) Model. Two main activities:

Copyright 2016 Ramez Elmasr and Shamkant B. Navathei

Transcription:

Chapter 2 Conceptual Modeling Basic Entity Relationship Diagrams 1 Objectives Definition of terms Importance of data modeling Write good names and definitions for entities, relationships, and attributes Model attributes, entities, binary relationships and cardinalities Draw basic E-R diagrams for common business situations 2

Business Rules Statements that define or constrain some aspect of the business Assert business structure Control/influence business behavior Are expressed in terms familiar to end users Govern how data are stored and handled. Our DB app will (hopefully) automate business rules 3 E/R Modeling The E/R model is used to construct a conceptual data model a representation of the structure and constraints of a database and is the technology independent. 4

Sample E-R Diagram (Figure 2-1) 5 E-R Modeling An E-R model is based on: Entities Relationships between entities Attributes of entities and relationships E-R diagram a graphical representation of an E-R model 6

Basic E-R notation (Figure 2-2) Entity symbols A special entity that is also a relationship Attribute symbols Relationship symbols Relationship degrees specify number of entity types involved Relationship cardinalities specify how many of each entity type is allowed 7 Modeling Business Rules Business rules Statements that define the business Derived from policies and procedures Expressed in natural language for end users Expressed in data models for system developers A Good Business Rule is: (Table 2-1) Declarative what, not how Precise clear, agreed-upon meaning Atomic one statement Consistent internally and externally Expressible structured, natural language Distinct non-redundant Business-oriented understood by business people 8

A Good Data Name is: Related to business, not technical Meaningful and self-documenting Unique Readable Composed of words from an approved list Repeatable Written in standard syntax 9 Modeling Entities and Attributes 10

Entities Things in the real world, physical or not: person, place, object, event, concept Entity Type collection of entities that share properties or characteristics Entity type is always SINGULAR Represented by a rectangle Entity Instance each of the instances of an entity type Student 11 Entity Types and Instances 12

What Should an Entity Be? SHOULD BE: An object that we are trying to model An object that will have many instances in the database SHOULD NOT BE: A user of the database system An output of the database system (e.g. a report) 13 Figure 2-4 Example of inappropriate entities System user Inappropriate entities System output Appropriate entities 14

Attributes Attribute - property or characteristic of an entity type that is of interest to the organization. Classifications of attributes: Required versus Optional Attributes Simple versus Composite Attribute Single-Valued versus Multi-valued Attribute Stored versus Derived Attributes Identifier Attributes 15 Required vs. Optional Attributes Required must have a value for every entity (or relationship) instance with which it is associated Optional may not have a value for every entity (or relationship) instance with which it is associated 16

Figure 2-7 A composite attribute An attribute broken into component parts Figure 2-8 Entity with multivalued attribute (Skill) and derived attribute (Years Employed) Multivalued an employee can have more than one skill Derived from date employed and current date 17 Identifiers (Keys) Identifier (Key) - an attribute (or combination of attributes) that uniquely identifies individual instances of an entity type Simple Key versus Composite Key Candidate Key an attribute that could be a key satisfies the requirements for being a key 18

Criteria for Selecting Identifiers Will not change in value over the life of each instance of the entity type. Will not be NULL. No intelligent identifiers (containing e.g. locations or people that might change) Substitute new, simple (e.g., surrogate attribute) keys for long, composite keys (e.g., entity type of Game: Game# instead of Home_Team and Visitor_Team) 19 Figure 2-9 Simple and composite identifier attributes The identifier is boldfaced and underlined 20

Practice: Person Produce an E-R diagram for the following situation: We have one entity, called Person, with the following attributes: ID (the identifier); Name, which is composed of one or more given names and one or more family names; one or more aliases; an address (composed of street, city, state, zip); date of birth; and age, which can be calculated from the date of birth. 21 Relationships Association between two or more entities Represented by connecting lines 22

Figure 2-10 Relationship types and instances a) Relationship type (Completes) b) Relationship instances 23 Relationships Degree Unary (next lecture) Binary Ternary (next lecture) Cardinality constraints One-to-One One-to-Many Many-to-Many 24

Degree of relationships from Figure 2-2 One entity related to another of the same entity type Entities of two different types related to each other Entities of three different types related to each other 25 Figure 2-12 Examples of relationships of different degrees Binary relationships 26

Cardinality Constraints The number of instances of one entity that can/must be associated with each instance of another entity Basic relationship Relationship with cardinality constraints 27 Cardinality Constraints Minimum Cardinality If zero, then optional If one or more, then mandatory Maximum Cardinality The maximum number 28

Interpreting Cardinalities A student majors in zero or one programs. 29 Interpreting Cardinalities A program has zero or more students. 30

STUDENT PROGRAM s1 s2 s3 s4 s5 s6 s7 s8...... p1 p2 p3 p4 p5 p6 p7 p8 31 Cardinality Constraints 32

Figure 2-17 Examples of mandatory cardinalities A patient history is recorded for one and only one patient A patient must have recorded at least one history, and can have many 33 34

Figure 2-17 Examples of optional / mandatory cardinalities A project must be assigned to at least one employee, and may be assigned to many An employee can be assigned to any number of projects, or may not be assigned to any at all 35 Quick Check So now you try it. Add cardinality constraints to the following diagram A person is national of zero or more countries A country has one or more people. 36

Practice Cardinality Constraints Draw an example for each type of cardinality constraint: 1. Mandatory one 2. Mandatory many 3. Optional one 4. Optional many 37 38

Maximum Cardinalities Looking at the MAXIMUM cardinality on BOTH sides, we classify relationships as: 1:1 1:M M:1 M:N 40 1-to-1 1-to Many Many-to-1 Many-to-Many 41

Practice: Products We have two kinds of entities: Products and Categories. For each product we keep its identifier, name, price, wholesale price, and profit margin, which is calculated from the price and the wholesale price. For each category we keep its identifier and its name. Each product belongs to zero or more categories and each category can have zero or more products. 42 43

Practice : CD We have three entities: CD, PERSON and SONG. A CD has a number, which is its identifier, and a title A person has an ID and a name, divided into first, last A song has an ID, a title and a length We keep track of which person is a song s author. A person can author many songs and a song has exactly one author. We keep track of which people perform on a CD. Zero or more people can perform on a CD, and people can perform on zero or more CDs. We keep track of which songs are included on a CD. One or more songs are included on a CD, and a song is included in zero or more CDs. 45 46

Practice : CD 47 Review Conceptual modeling Business rules E-R Model Entity Entity Identifier Relationship Degree Cardinality One-to-Many Relationship 48

Relevant Textbook Exercises Exercise #1, page 101 Exercise #2 (a, b, e, h), pages 101-102 Exercise #17 (a, e, f, g), pages 105-106 Exercise #19 49