1 Data Modeling 2 Yong Choi School of Business CSUB.

Slides:



Advertisements
Similar presentations
Entity-Relationship (ER) Modeling
Advertisements

Entity Relationship (E-R) Modeling Hachim Haddouti
Entity Relationship (ER) Modeling
Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
Entity Relationship (ER) Modeling
Entity Relationship (ER) Modeling
Copyright © 2015 Pearson Education, Inc. Database Design Chapters 17 and
Systems Development Life Cycle
1 © Prentice Hall, 2002 Chapter 3: Modeling Data in the Organization Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
Modeling the Data: Conceptual and Logical Data Modeling
Database Design & Mapping
Chapter 3: Modeling Data in the Organization
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
1 MIS 340: Data Modeling 2 Yong Choi School of Business CSUB.
Data Modeling Yong Choi School of Business CSUB. Part # 2 2 Database Collection of data in electronic format – A digital library of organization Managed.
Chapter 3: Modeling Data in the Organization
CHAPTER 2: MODELING DATA IN THE ORGANIZATION © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition Jeffrey.
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter 3 © 2005 by Prentice Hall 1 Objectives Definition of terms Definition of terms Importance of data modeling Importance of data modeling Write good.
Data Modeling 1 Yong Choi School of Business CSUB.
Entity Relationship Modeling Objectives: To illustrate how relationships between entities are defined and refined. To know how relationships are incorporated.
Yong Choi School of Business CSUB
Entity-Relationship Modeling I The cautious seldom err. Confucius.
© 2007 by Prentice Hall (Hoffer, Prescott & McFadden) 1 Entity Relationship Diagrams (ERDs)
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,
1 © Prentice Hall, 2002 Chapter 3: Modeling Data in the Organization Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
Chapter 3: Modeling Data in the Organization
1. 2 Data Modeling 3 Process of creating a logical representation of the structure of the database The most important task in database development E-R.
Mapping from Data Model (ERD) to Relational Model Yong Choi School of Business CSUB.
Chapter 5 Entity Relationship (ER) Modelling
Chapter 5 Entity–Relationship Modeling
Chapter 2: Modeling Data in the Organization
IS 325 Notes for Wednesday September 4, Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments.
Copyright 2006 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Third Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
DATABASEMODELSDATABASEMODELS  A database model ◦ defines the logical design of data. ◦ Describes the relationships between different parts of data.
Concepts and Terminology Introduction to Database.
Mapping from Data Model (ERD) to Relational Model
Bordoloi CMIS 450 Database Design Dr. Bijoy Bordoloi Entity Relationship (E-R) Model.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 2: Modeling Data in the Organization.
1 Relational Databases and SQL. Learning Objectives Understand techniques to model complex accounting phenomena in an E-R diagram Develop E-R diagrams.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
Chapter 4 Entity Relationship (ER) Modeling.  ER model forms the basis of an ER diagram  ERD represents conceptual database as viewed by end user 
Initial Design of Entity Types for the COMPANY Database Schema Based on the requirements, we can identify four initial entity types in the COMPANY database:
Lecture 4 Conceptual Data Modeling. Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship,
Data Modeling Using the Entity-Relationship (ER) Model.
Chapter 9: Logical Database Design and the Relational Model (ERD Mapping)
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 4 Entity Relationship (ER) Modeling.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 4 ENTITY RELATIONSHIP (ER) MODELING Instructor Ms. Arwa Binsaleh 1.
Data Modeling Yong Choi School of Business CSUB. Part # 2 2 Study Objectives Understand concepts of data modeling and its purpose Learn how relationships.
Chapter 3: Modeling Data in the Organization. Business Rules Statements that define or constrain some aspect of the business Assert business structure.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 3: Modeling Data in the Organization Modern Database Management 9 th Edition Jeffrey.
McGraw-Hill/Irwin Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 6 Modeling the Data: Conceptual and Logical Data Modeling.
ERD :: 19 / 1 / Entity-Relationship (ER) Modeling. ER Modeling is a top-down approach to database design. Entity Relationship (ER) Diagram –A.
Data Modeling Using the Entity- Relationship (ER) Model
Entity Relationship Modeling
CHAPTER 2 - Database Requirements and ER Modeling
TMC2034 Database Concept and Design
Data Modeling for Database Design 1
ERD :: 19 / 1 / Entity-Relationship (ER) Modeling. ER Modeling is a top-down approach to database design. Entity Relationship (ER) Diagram –A.
Database Systems: Design, Implementation, and Management Tenth Edition
Data Modeling for Database Design 2
Review of Week 1 Database DBMS File systems vs. database systems
CHAPTER 2 - Database Requirements and ER Modeling
Chapter # 4 Entity Relationship (ER) Modeling.
Presentation transcript:

1 Data Modeling 2 Yong Choi School of Business CSUB

Entities??? Made up for the class…….ambiguous… Look for Noun but avoid noun w/o attributes And also avoid proper noun ANG Laboratory has several chemists who work on one or more projects. Chemists also may use certain kinds of equipment on each project. The organization would like to store the chemist’s employee identification number, his/her name, up to three phone numbers, his/her project identification number and the date on which the project started. Every piece of equipment, the chemist uses, has a serial number and a cost.

Entities Chemist Project Equipment

Entities’ Attributes??? ANG Laboratory has several chemists who work on one or more projects. Chemists also may use certain kinds of equipment on each project. The organization would like to store the chemist’s employee identification number, his/her name, up to three phone numbers, his/her project identification number and the date on which the project started. Every piece of equipment, the chemist uses, has a serial number and a cost.

5 entities, attributes and identifiers Project Proj# Start-Date Chemist Phone# Emp# Equipment Serial# cost

Use Case Diagram Example: Placing Order Start by listing a sequence of steps a user might take in order to complete an action. For example a customer placing an order with a sales company might follow these steps. 1.Browse catalog and select items. 2.Call sales representative. 3.Supply shipping information. 4.Supply payment information. 5.Receive conformation number from salesperson.

Source:

Example of Completed USD

9 How to find relationships? Relationship: –Association between entities –Two entities can have more than one type of relationship –look for a verb

More about Relationship Description of each relationship should be bidirectional. Operate in both directions –Relationship between Student and Curriculum A student is enrolled in many curriculums. Each curriculum is being studied by many students.

Relationships ??? ANG Laboratory has several chemists who work on one or more projects. Chemists also may use certain kinds of equipment on each project. The organization would like to store the chemist’s employee identification number, his/her name, up to three phone numbers, his/her project identification number and the date on which the project started. Every piece of equipment, the chemist uses, has a serial number and a cost.

Entities/Relationships & their Attributes Chemist Phone# Project Proj# Start-Date Equipment Works-On Uses Date-Assigned Emp# Serial# cost Assign-Date

Steps for creating an ERD Identify the entities –look for nouns Identify the attributes –look for entity characteristics Identify the relationships –look for a verb between entities

Degree of Relationship Degree of a Relationship describes the number of entity participation –Unary (Recursive) Relationship: One instance related to another of the same entity type –Binary Relationship: Instances of two different entities related to each other –Ternary Relationship: Instances of three different types related to each other

Relationships Entities can be associated with one another in relationships. Relationship degree defines the number of entity classes participating in the relationship: –Unary relationship. –binary relationship. –ternary relationship.

Degree of Relationship …

Unary (recursive) Relationship It is possible for an entity to have a relationship to itself—this is called a recursive relationship.

Binary Relationship

Ternary Relationship

Type of Relationships (Cardinality) One – to – One (1:1) –Each instance in the relationship will have exactly one related member on the other side One – to – Many (1:M) –A instance on one side of the relationship can have many related members on the other side, but a member on the other side will have a maximum of one related instance Many – to – Many (M:N) –Instances on both sides of the relationship can have many related instances on the other side

Optional Relationship The Optionality is a property of an attribute which specify if a value is mandatory or optional. To identify optional relationship, look for auxiliary verb such as can or may

22 Type of Relationship (Cardinality) The organization would like to store the date the chemist was assigned to the project and the date an equipment item was assigned to a particular chemist working on a particular project. A chemist must be assigned at least to one (or more) project and one (or more) equipment. Projects and equipments must be managed by only one chemist. A given project need not be assigned an equipment.

Complete ER Diagram Chemist Phone# Project Proj# Start-Date Equipment Works-On Uses Date-Assigned N 1 N1 Emp# Serial# cost Assign-Date

Steps for developing an ERD 1 User Interviews (group members) Forms (competitor’s form) Reports (competitors annual report) Use Cases Business Rules (create yours by bench marching competitors’ rules) based on business operation manual, procedure, and standard

Steps for developing an ERD 2 Identify the entities Identify the attributes Identify the relationships –Beginner: look for relationship-type related words and phrases such as zero, none, a, one, several, many….. –Optional relationship: look for auxiliary verbs such as may, might, can and based upon own judgment..) Finalize business rules

Data Model Notation 1-to-1 relationship 1-to-M relationship M-to-N relationship

Data Model Notation

weak entity relationship (see the next slide) optional relationship recursive relationship Employee

Weak Entity relationship A weak entity is an entity that cannot be uniquely identified and existed by itself alone. Thus, a weak entity is an entity that exists only if it is related to a set of uniquely determined entities (owners of the weak entity). –More examples on the textbook Each employee might have none or multiple dependents. However, dependents must belong to at least one employee. EMP DEP weak entity notation

1:1 relationship A person must have one and only one DNA pattern and eac pattern must be applied to one and only one person.

1:1 with optional relationship (OR) on one side A person might not or might be a programmer, but a programmer must be a person.

1:M relationship Each department hires many employees, and each employee is hired by one department.

1:M with OR on many side A person might be a member or might not, but could be found multiple times (if the member entity represents membership in multiple clubs, for instance). A member must have only a single person.

1:M with OR on both side A person might have no phone, one phone or lots of phones, and that a phone might be un-owned or can only be owned by a person.

M:N relationship Each student takes many classes, and a class must be taken by many students. ** Many-to-many relationships cannot allowed in the data model because they cannot be represented by the relational model (see the next slide for the reason) ** STUDENT CLASS TAKE IS_TAKEN_BY

Example M:N Relationship 3 to 3 30 to to to ,000 to 30, , 000 to 300, 000 Table to represent Entity

Example of M:N Many-to-many relationships is a second sign of complex data. When x relates to many y's and y relates to many x's, it is a many-to-many relationship. In our example schema, a color swatch can relate to many types of sweaters and a type of sweater can have many color swatches.

Transformation of M:N 1.When transform to relational model, many redundancies can be generated. –The relational operations become very complex and are likely to cause system efficiency errors and output errors. –Break the M:N down into 1:N and N:1 relationships using bridge entity (weak entity). CLASSSTUDENTENROLL

Converting M:N Relationship to Two 1:M Relationships Bridge Entity

ENROLL entity becomes a weak entity of both STUDENT entity and CLASS entity MUST have a composite (unique) identifier  STU_NUM (from STUDENT entity) and CLASS_CODE (from CLASS entity)

M:N with optionality on both side A person might or might not work for an employer, but could certainly moonlight for multiple companies. An employer might have no employees, but could have any number of them. After broken down, optional relationship notation on both side of associative entity

Recursive relationship Each student is taught by a STA (student teaching assistant). Each STA can teach several students. A recursive relationship is an entity is associated with itself. Student teaches is taught by

Data Modeling Errors In general, there are two classes of E-R modeling errors that lead to normalization problems: –Incomplete data model error –Miss-modeled problem domain error Read next two slides…

In Complete Data Model Occur in situations where the systems analysts is tasked to build a computer-based information system that is limited in scope. A key objective for successful information system project management is the definition of a limited, yet adequate project scope--a scope that enables the production of system deliverables within a reasonable time period. Limiting a project's scope often results in information systems that are based on limited data models. Limited information systems are fairly common throughout the IS world where dissimilar technologies prevent data sharing and work against the concept of a shared, enterprise-wide database.

Miss-modeled problem domain error The miss-modeled problem domain error is actually a class of errors including those that arise whenever systems analysts lack a complete understanding of the problem domain. These include errors such as depicting an attribute as single-valued when, in fact, the attribute is multi-valued, or depicting a single entity which includes attributes that should be assigned to two separate entities, or miss-modeling the connectivity or degree of a relationship.