Appendix A Database Design. Data Modeling and the Entity-Relationship Model

Similar documents
Conceptual Design. The Entity-Relationship (ER) Model

LECTURE 3: ENTITY-RELATIONSHIP MODELING

More on the Chen Notation

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

A l Ain University Of Science and Technology

Example: specific person, company, event, plant

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

Database Logical Design

Entity Relationship Modelling

Chapter 3 Database Modeling and Design II. Database Modeling

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

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

Lecture3: Data Modeling Using the Entity-Relationship Model.

CSE 880:Database Systems. ER Model and Relation Schemas

Entity-Relationship Model &

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

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

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

CSC 261/461 Database Systems Lecture 7

A l Ain University Of Science and Technology

SWEN-220 Mathematical Models of Software. Conceptual to Relational Mapping

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

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

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

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

Database Logical Design

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

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

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

Database Management Systems LECTURE NOTES 2

ER modeling. Lecture 4

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

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

A good example of entities and relationships can be seen below.

Database Management System 6 ER Modeling...

Database Management Systems

MIT Database Management Systems Lesson 03: Entity Relationship Diagrams

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

Chapter 2 Conceptual Modeling. Objectives

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

Chapter 6: Entity-Relationship Model

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

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

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

COSC 304 Introduction to Database Systems. Entity-Relationship Modeling

The Entity Relationship Model

IS 263 Database Concepts

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

Intro to DB CHAPTER 6

Database: Introduction

Chapter 4. In this chapter, you will learn:

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

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

Entity Relationship Diagram (ERD) Dr. Moustafa Elazhary

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

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

Agenda: Understanding Relationship Types Degree and Cardinality with Examples

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

CSCC43H: Introduction to Databases

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

Data Modeling Using the Entity-Relationship Model

MIS2502: Data Analytics Relational Data Modeling. Jing Gong

Other Relational Languages

Introduction to Database Design

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

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

Data Modeling Using the Entity-Relationship (ER) Model

CMPT 354 Database Systems I

Information Systems (Informationssysteme)

Data Modeling using ER Model

COMP Instructor: Dimitris Papadias WWW page:

Information Technology Audit & Cyber Security

CSIT5300: Advanced Database Systems

Chapter 7: Entity-Relationship Model

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

PES Institute of Technology Bangalore South Campus (1 K.M before Electronic City,Bangalore ) Department of MCA. Solution Set - Test-II

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

Chapter 7: Entity-Relationship Model

The Entity-Relationship Model (ER Model) - Part 2

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

SUMMER EXAMINATIONS 2013

Conceptual Data Models for Database Design

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

Chapter # 4 Entity Relationship (ER) Modeling

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

Chapter 6: Entity-Relationship Model

Databases Tutorial. January 19,2012 Jing Chen Mcmaster University

Chapter 2: Entity-Relationship Model

2004 John Mylopoulos. The Entity-Relationship Model John Mylopoulos. The Entity-Relationship Model John Mylopoulos

LAB 2 Notes. Conceptual Design ER. Logical DB Design (relational) Schema Refinement. Physical DD

Relational Data Model

Chapter 7: Entity-Relationship Model

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

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

MIS2502: Data Analytics Relational Data Modeling. Jing Gong

Full file at

Database Applications (15-415)

2. E/R Design Considerations

A Guide to SQL, Ninth Edition. Chapter Two Database Design Fundamentals

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

Transcription:

Appendix A Database Design Data Modeling and the Entity-Relationship Model 1

Three Stages of Database Development The three stages of database development are: 1. Requirements Analysis Stage 2. Component Design Stage 3. Implementation Stage 2 2

The Requirements Analysis Stage Sources of requirements User Interviews Forms Reports Queries Use Cases Business Rules 3 3

Requirements Become the E-R Data Model After the requirements have been gathered, they are transformed into an Entity Relationship (E-R) Data Model. The most important elements of E-R Models are: Entities Attributes Identifiers Relationships 4 4

Entities Entities represent the basic objects of information you are tracking Begin by thinking of them as separate and distinct sets. Examples: Hint: Entities are usually nouns Business Customers Employees Inventory Items Orders Veterinary Clients Pets Appointments Services 5 5

Attributes Entities have attributes that describe the entity s characteristics: FirstName LastName SSN HiredDate Attributes have a data type and properties. For each set of entities, determine what attributes will be stored in the database 6 6

Relationships Entities can be associated with one another in relationships. Relationship degree defines the number of entity classes participating in the relationship: Degree 2 is a binary relationship and is the most common. Degree 3 is a ternary relationship. Avoid this. The type of relationship is called the cardinality: 1-1, 1-M, M-N 7 7

One-to-One Binary Relationship 1:1 (one-to-one) A single entity instance in one entity class is related to a single entity instance in another entity class. -An employee may have no more than one locker; and -A locker may only be accessible by one employee (a) One-to-One Relationship 8 8

One-to-Many Binary Relationship 1:N (one-to-many) A single entity instance in one entity class is related to many entity instances in another entity class. - A quotation is associated with only one item; and - An item may have several quotations (b) One-to-Many Relationship 9 9

Many-to-Many Binary Relationship N:M (many-to-many) Many entity instances in one entity class are related to many entity instances in another entity class: - a supplier may supply several items; and - a particular item may be supplied by several suppliers. (c) Many-to-Many Relationship 10

Entity-Relationship Diagrams The diagrams in previous slides are called Entity-Relationship diagrams. Entity classes are shown by rectangles. Relationships are shown by diamonds. The name of the entity is shown inside the rectangle. The name of the relationship is shown near the diamond. 11

Developing an E-R Diagram Heather Sweeney Designs example Heather Sweeney is an interior designer who specializes in home kitchen design. She offers a variety of free seminars at home shows, kitchen and appliance stores, and other public locations. She earns revenue by selling books and videos that instruct people on kitchen design. She also offers private consultations on kitchen designs 12

Heather Sweeney Designs: The Seminar Customer List Example Seminar Customer List 13

Step 1: Identify the Entities Customers Seminars Products 14

Step 2: Identify the Attributes Customers LastName, FirstName, Phone, Address, City, State, Zip Seminars SeminarTitle, SeminarDate, SeminarTime, Location Products Description, UnitPrice, QuantityOnHand 15

Step 3: Identify the Relationships Think of verbs: Customers attend seminars Seminars are attended by customers Customers order products Products are ordered by customers 16

Step 4: Determine the Relationship Cardinalities Cardinalities are: One-to-One (1:1) One-to Many (1:M) and Many-to-Many (M:N) 17

Step 5: Create an E-R Diagram E-R stands for Entity-Relationship Use the following: Entities Attributes Relationships 18

Step 5: E-R Diagram Initial version 19

Step 6: Identify the Primary Keys Consult with the client about the data Add an attribute if necessary Indicate on the diagram with an underline Customers -lastname, firstname, phone, address, city, state, zip -No candidate key, so add custid to be the primary key Seminars -Attributes: seminartitle, seminardate, seminartime, location -No candidate key, so add SID to be the primary key Products -Attributes: productname, description, unitprice, qtyinstock -Assume product names are unique, so use productname as PK 20

Step 6: Identify the Primary Keys Final Version 21

Create the Database Tables Make one table for each entity set Add a table for each M:N relationship that contains the primary keys from the participating tables as a composite primary key If there is a 1:M (or M:1) relationship. Add the primary key from the 1 side to the M side table as a foreign key. 22

Result from Example Five tables: Customers (custid, firsname, lastname, street, city, state, zip, email) Seminars (SID, seminartitle, seminardate, seminartime, location) Products (productname, description, unitprice, qtyinstock) Attends (custid, SID) Purchases (custid, productname) 23

Tables Formal term: Relation Other formal terms 24

Keys Primary keys uniquely identify each row in a table Primary keys must also be minimal Candidate keys are fields that could serve as the primary key Alternate keys are the candidate keys not chosen 25

Composite Keys (multi-field) 26

Relationships: One-to-Many 27

Relationships: Many-to-Many 28

Relationships: One-to-One 29