Week 4 Lecture Conceptual Data Modeling

Slides:



Advertisements
Similar presentations
Entity Relationship Diagrams
Advertisements

Entity-Relationship (ER) Modeling
Entity Relationship (ER) Modeling
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
Modern Systems Analysis and Design Third Edition
Systems Development Life Cycle
System Analysis - Data Modeling
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 10 Structuring.
Systems Analysis Requirements structuring Process Modeling Logic Modeling Data Modeling  Represents the contents and structure of the DFD’s data flows.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Chapter 10 Structuring System Requirements: Conceptual Data Modeling.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Entity Relationship Diagrams
Chapter 4 Entity Relationship (ER) Modeling
Chapter 4 Entity Relationship (E-R) Modeling
Modern Systems Analysis and Design Third Edition
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 10 Structuring.
Entity-Relationship Design
1 © Prentice Hall, 2002 Chapter 3: Modeling Data in the Organization Modern Database Management 7th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R.
1 © Prentice Hall, 2002 CMIS564: E/R Modeling Dr. Bordoloi Based on Chapter 3; Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott,
Computer System Analysis Chapter 10 Structuring System Requirements: Conceptual Data Modeling Dr. Sana’a Wafa Al-Sayegh 1 st quadmaster University of Palestine.
3.1 CSIS 3310 Chapter 3 The Entity-Relationship Model Conceptual Data Modeling.
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Data Modeling ERM ERD.
Chapter 8 Structuring System Data Requirements
Dr. Mohamed Osman Hegaz1 Conceptual data base design: The conceptual models: The Entity Relationship Model.
Chapter 8 Structuring System Data Requirements
BIS 360 – Lecture Six (Part 2) Conceptual Data Modeling (Chapter 10 and partial Chapter 12)
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Concepts and Terminology Introduction to Database.
Database Design. The process of developing database structures from user requirements for data a structured methodology Structured Methodology - a number.
Chapter 4 Entity Relationship (ER) Modeling.  ER model forms the basis of an ER diagram  ERD represents conceptual database as viewed by end user 
Lecture 4 Conceptual Data Modeling. Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship,
Database Design – Lecture 5 Conceptual Data Modeling – adding attributes.
DeSiamorePowered by DeSiaMore1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Data modeling using the entity-relationship model Chapter 3 Objectives How entities, tuples, attributes and relationships among entities are represented.
Database Design. The process of developing database structures from user requirements for data a structured methodology Structured Methodology - a number.
Entity Relationship Modeling
Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design.
Chapter 9 Structuring System Data Requirements Modern Systems Analysis and Design Fifth Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
Modern Systems Analysis and Design Third Edition
Chapter 10 Designing Databases. Objectives:  Define key database design terms.  Explain the role of database design in the IS development process. 
Logical Database Design and the Relational Model.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 10 Structuring.
Department of Mathematics Computer and Information Science1 CS 351: Database Management Systems Christopher I. G. Lanclos Chapter 4.
IS 4420 Database Fundamentals Chapter 3: Modeling Data in the Organization Leon Chen.
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
Modeling data in the Organization
Chapter 10 Structuring System Requirements: Conceptual Data Modeling
Logical Database Design and the Rational Model
Database Design.
Modern Systems Analysis and Design Third Edition
Chapter 5: Logical Database Design and the Relational Model
Tables and Their Characteristics
Entity Relationship Diagrams
Chapter 9 Structuring System Data Requirements
Chapter 10 Structuring System Requirements: Conceptual Data Modeling
Modern Systems Analysis and Design Third Edition
Data Modeling for Database Design 2
Review of Week 1 Database DBMS File systems vs. database systems
Modern Systems Analysis and Design Third Edition
Chapter 10 Structuring System Requirements: Conceptual Data Modeling
ER MODELING Instructor: SAMIA ARSHAD
Entity Relationship (ER) Modeling
Lecture 10 Structuring System Requirements: Conceptual Data Modeling
Presentation transcript:

Week 4 Lecture Conceptual Data Modeling CSE2132 Database Systems Week 4 Lecture Conceptual Data Modeling Conceptual Data Modeling 4. 1

Aims of Database Design Reduce data redundancy. Provide stable data structures that can be readily changed with changing user requirements. Allow users to make ad hoc requests for data. · Maintain complex relationships between data elements. Support a large variety of decision needs. Hawryszkiewycz I J (1984) Database Analysis and Design p 2 Conceptual Data Modeling 4. 2

Design Criteria - data availability - data reliability - data currency - data consistency - data flexibility - data efficiency Verify these criteria are satisfied via technical review Conceptual Data Modeling 4. 3

Database Design - the process of developing database structures from user requirements for data - a structured methodology Structured Methodology - a number of ordered formal processes with known inputs and expected outputs Objectives 1. derive relationships 2. evolve to meet user requirements 3. user requests are met within reasonable time limits Conceptual Data Modeling 4. 4

Conceptual Design in the System Lifecycle Enterprise Modeling Project Identification and Selection Project Initiation and Planning } Conceptual Data Modeling Analysis Logical Database Design Logical design Physical design Physical Database Design Implementation Database Implementation Maintenance DB Maintenance Conceptual Data Modeling 4. 5

The Entity-Relationship Model Represents major data objects and the relationships between them. Widely used commercially in Australia. Originated by Chen in 1976 and adapted in the 'Information Engineering' approach. An Entity model is composed of textual descriptions of objects and a graphical representation called an Entity Relationship Diagram Conceptual Data Modeling 4. 6

ER Diagram Notation Attribute Entity Multivalued Attribute Weak Entity Derived Attribute Associative Entity Identifying Relationship Relationship Conceptual Data Modeling 4. 7

Entity Relationship Modelling Entities form relationships with one another and each entity may be described by one or more attributes. Customer Places (Placed By) Sale Order ENTITY RELATIONSHIP ATTRIBUTE CUSTOMER Any person or organization who purchases goods Customer Number, Customer Name, Customer Phone Conceptual Data Modeling 4. 8

Entity Type Sometimes referred to as an entity set. A set of objects about which we wish to store information. Smith, Jones, Brown Entity instances i.e members of the set LECTURER LECTURER Entity Type or Entity Set is a classification of similar instances. Conceptual Data Modeling 4. 9

Entity Type In practice Entity Instance is often shortened to 'Instance’ and Entity type is shortened to Entity. Entity names should be brief but unambiguous i.e clearly reflect the meaning . Entities should be named in the singular and are often recognized as nouns or noun phrases. Entities can model any object set of interest i.e physical, conceptual, events etc. Conceptual Data Modeling 4. 10

Entity Type versus Weak Entity Type A strong entity type (i.e. an entity type) exists independently of other entity types. A weak entity type is an entity type whose existence depends on some other entity type. The entity type on which the weak entity type depends is called the identifying owner Emp_ID E_Name D_Name D_O_B EMPLOYEE has DEPENDENT Conceptual Data Modeling 4. 11

Attributes An attribute is a property or characteristic of an entity type that is of interest to the organization. Years_Employed is a derived attribute. Skill is a multi-valued attribute. Address is a composite attribute Street Employee_Name Postcode Employee_ID Address Skill Years_Employed EMPLOYEE Date_Employed Conceptual Data Modeling 4. 12

Attribute Types A data item or element that describes one entity type. STUDENT RESULT Student#, Subject Code, Year, Semester, Grade S1 COT423 1990 1 N S1 COT423 1990 2 HD Primary Key or Identifier Some or all of the attributes describing an entity type which serve to uniquely identify each entity instance. Conceptual Data Modeling 4. 13

Value Sets or Domains Each attribute type describes one entity type and is based on an underlying domain or value set. EMPLOYEE Emp# Emp-Gender Emp-Name Emp-Hire-Date E1 Female Jones 20/6/89 DEPENDENT Emp# Depend-Name Depend-Sex Birthdate E1 Smith Male 23/6/46 Conceptual Data Modeling 4. 14

Relationship A named association between two entity types. Entity type Relationship Type Entity Type CUSTOMER Places (Placed By) SALES ORDER Conceptual Data Modeling 4. 15

Relationship Relationship names should indicate the role or reason for the association in both directions. A relationship may have attributes. CUSTOMER Places (Placed By) SALES ORDER Conceptual Data Modeling 4. 16

Relationship Instances A relationship instance is an association between two entity instances. CUSTOMER SALES ORDER Smith Places Order# 651 Jones Places Order# 375 A relationship type is a classification of relationship instances. Places (Placed By) CUSTOMER SALES ORDER Conceptual Data Modeling 4. 17

Degree of Relationship is paid 1 1 Employee Salary Binary contain 1 m Binary Order Part 1 m is a leader/ member is a leader/ member Employee Employee Unary m n m runs on p Ternary Computer Op. System n Software Conceptual Data Modeling 4. 18

Relationship Cardinality (Maximal Cardinalities) One to One One to Many Many to Many Employee Customer Supplier Leads (Lead by) Supplies (Supplied by) Places (Placed by) Project Sales Order Item Relationships represent the 'Business Rules' of the organisation. Conceptual Data Modeling 4. 19

Relationship Cardinality (Minimal Cardinalities) The entity participation in the relationship may be mandatory or optional. CUSTOMER SALES ORDER Places (Placed By) A Customer may place many Sales Orders. A Sales Order must be placed by one Customer. Conceptual Data Modeling 4. 20

Associative Entity The presence of a relationship with one or more attributes suggests that the relationship should perhaps be represented as an entity. An associative entity is an entity type that associates the instances of one or more entity types and contains attributes that are peculiar to the relationship between those entity instances. COURSE EMPLOYEE completes C_No Date_Completed EMPLOYEE COURSE CERTIFICATE Conceptual Data Modeling 4. 21

Abstractions in Conceptual Database Design Classification abstraction: Class BICYCLE (black bicycle, my bicycle .... ) Aggregation abstraction: Aggregation BICYCLE (wheel, seat, handle bar .. ) Generalization abstraction: Generalization VEHICLE(bicycle, car, truck .. ) VEHICLE GENERALISATION CAR BICYCLE AGGREGATION WHEEL SEAT HANDLEBAR PEDAL CLASSIFICATION STANDARD BAR STRAIGHT BAR RACER BAR Conceptual Data Modeling 4. 22

Synonyms or Aliases Be careful to differentiate between things and their names. ITEM = PART = PRODUCT ??? SYNONYM or ALIAS The same object called different names by different people. This problem concerns entity types, relationship types and attribute types. Conceptual Data Modeling 4. 23

Homonyms Different things called the same name by different people ?? EMPLOYEE START DATE In the Personnel area this may mean the date an employee started with the company. In a given department this may mean the date an employee started with the department. This problem also concerns entity types, relationships types and attribute types. Conceptual Data Modeling 4. 24

Identifying Entity Types Entity type names are generally nouns or noun phrases. Can the entity type be defined in one or two sentences ? What are some typical attributes describing the entity type ?? Which attributes uniquely identify each entity instance ? Conceptual Data Modeling 4. 25

Identify the Entity Types ABC COMPANY SALES ORDER Order # ____________ Order Date __ / __ / __ Customer Name __________________________________ Customer Address________________________________ _________________________________________________ Item# Description Qty-ord Unit-Price Ext-Price ____ _______________ _______ $_______ $_______ Conceptual Data Modeling 4. 26

Building an ER Model List the major entity types in the system and note the relationship types between them. Represent the entity types by named rectangles. Identify relationship types between entity types including relationship degree and nature. Conceptual Data Modeling 4. 27

Entity Type Proforma Entity Name ________________ Aliases___________________ Definition ______________________________________________ Purpose ______________________________________________ Name of Entity Super-type _______________________________________ Sub-type Predicate _______________________________________ Sub-type Class Disjoint / Overlapping Total / Partial Number of Instances ___________________________________________ Inserts per period ______________ Deletes per period ________ Insert, Update & Delete Procedures Conceptual Data Modeling 4. 28

Relationship Definition Entity 1 Name ____________ ____ Entity 2 Name __________________ Relationship Name (E1 to E2) _______________ Aliases _______________ Relationship Name (E2 to E1) _______________ Aliases _______________ Definition, Description & Purpose Degree (E1 to E2) 1:1, 1:m, m:1, m:n Nature (E1 to E2) M:O, O:M, O:O, M:M Referential Integrity Rules Cascade (C), Nullify (N), Restrict (R) E1 to E2 Delete ________ Update ________ E2 to E1 Delete ________ Update ________ Conceptual Data Modeling 4. 29

Attribute Definition Entity Name ___________________________ OK Value Attribute Name Domain Name Primary Foreign Key Nulls Default Validation Rules Key References OK Value Conceptual Data Modeling 4. 30

Domain Definition Domain Name ___________________ Aliases _______________________ Definition ____________________________________________________ Valid Values and Meanings ________________________________________ ________________________________________________________________ Data Type ________ Size ________ Validation Rules Comments Conceptual Data Modeling 4. 31

ER Modelling Exercises For each of the following problems prepare an Entity Relationship diagram. For relationship types you should name the relationship in both directions;indicate the degree i.e. 1:1, 1:m, m:n; and the nature i.e optional or mandatory. Entity types should be defined in one or two sentences and some possible attribute types identified together with the likely primary key of the entity type. You should also attempt to identify some of the domains or value sets on which the attribute types are based. 1. A Company is made up of several Divisions with each Division employing many Salespersons. Salespersons write many Orders with each Order relating to only one Salesperson and one Customer. Many Items may be ordered on an Order and a given Item may appear on many Orders. 2. The Pearcey Centre for Computing runs a number of evening Courses with each course being identified by a four character course code. Each course runs at a certain time on a certain evening. Students may enrol in any number of courses concurrently provided the courses are not running at the same time on the same evening. Conceptual Data Modeling 4. 32

A Possible Answer to 1. 1. A Company is made up of several Divisions with each Division employing many Salespersons. Salespersons write many Orders with each Order relating to only one Salesperson and one Customer. Many Items may be ordered on an Order and a given Item may appear on many Orders. belongs to Company Item (contains many) places Order has Division Salesperson Customer employs Conceptual Data Modeling 4. 33