Module 2: Conceptual Data Modeling with ERD

Slides:



Advertisements
Similar presentations
Chapter # 4 BIS Database Systems
Advertisements

More Diagramming & Practice with Relationship Modeling
Database Design Lessons 2 & 3 Database Models, Entities, Relationships.
Chapter 6: Entity-Relationship Model (part I)
ENTITY RELATIONSHIP MODELLING
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
Chapter 4 Entity Relationship (E-R) Modeling
Basic Symbols.
Agenda for Week 1/31 & 2/2 Learn about database design
Review Questions What is data modeling? What is the actual data model that is created called? Data modeling is a technique for organizing and documenting.
Further Data Modelling …and the effect of time. Plan Introduction Structured Methods –Data Flow Modelling –Data Modelling –Relational Data Analysis –Further.
Lecture 3 :Database Analysis and Design (II)
Systems Analysis and Design in a Changing World, 6th Edition
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Database Design Concepts Info1408
Database Design Concepts Lecture 7 Introduction to E:R Modelling Identifying Entities.
Entity/Relationship Modelling
APPENDIX C DESIGNING DATABASES
Things are bad. Children no longer obey their parents and everyone is writing a book. -- Marcus Tillius Cicero.
Oracle Academy -Week 1-.
DATA MODELING AND DATABASE DESIGN DATA MODELING AND DATABASE DESIGN Part 1.
IT 244 Database Management System Data Modeling 1 Ref: A First Course in Database System Jeffrey D Ullman & Jennifer Widom.
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Advanced Entity Relationship Concepts. Advanced Concepts UIDs Intersection Entities Recursive Relationships Roles Subtypes Exclusivity Historical Fan.
Entity Relationship Diagrams
Chapter 7 Data Modeling with Entity Relationship Diagrams Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Overview of Database Development
CSE 441: Systems Analysis & Design
Database. Basic Definitions Database: A collection of related data. Database Management System (DBMS): A software package/ system to facilitate the creation.
Module Title? Data Base Design 30/6/2007 Entity Relationship Diagrams (ERDs)
Conceptual Design Lecture - 2 Database Development.
Database Design Sections 6 & 7 Second Normal Form (2NF), Unique Identifiers (UID), Third Normal Form (3NF), Arcs, Hierarchies and Recursive relationships.
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
1 Relational Database Development Alison Taylder Consultant ITC-ILO, Turin 25 th November 2004.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T5: Designing Database Applications Business Driven Technology.
1.  An introduction to data modelling  The purpose of data modelling  Modelling data relationships 2.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 Domain Classes.
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 
Overview of Database Development Data Modeling and Relational Database Design.
1 IRU – database design part one Geoff Leese September 2009.
Lecture 4 Conceptual Data Modeling. Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship,
DeSiamorePowered by DeSiaMore1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Database Design 3: Advanced Data Modeling Concepts CS 320.
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.
IMS 4212: Introduction to Data Modeling—Relationships 1 Dr. Lawrence West, Management Dept., University of Central Florida Relationships—Topics.
Description and exemplification of entity-relationship modelling.
ERD ( Conceptual data model From the statement of data requirements a conceptual data model is produced. This describes.
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.
INTRODUCTION TO DATABASE DESIGN. Definitions Database Models: Conceptual, Logical, Physical Conceptual: “big picture” overview of data and relationships.
Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin APPENDIX C DESIGNING DATABASES APPENDIX C DESIGNING DATABASES.
Lecture 91 Introduction to Data Analysis and Logic Specification Objectives l Draw an entity-relationship diagram, and explain the types of entity relationships.
Entity Relationship Diagram (ERD). Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship.
2 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Data Models Why data models are important About the basic data-modeling.
Department of Mathematics Computer and Information Science1 CS 351: Database Management Systems Christopher I. G. Lanclos Chapter 4.
Distribution of Marks For Second Semester Internal Sessional Evaluation External Evaluation Assignment /Project QuizzesClass Attendance Mid-Term Test Total.
1 Database Design Sections 6 & 7 First Normal Form (1NF), Second Normal Form (2NF), Unique Identifiers (UID), Third Normal Form (3NF), Arcs, Hierarchies.
Creating an ERD Part 1 Define the Problem
DATA MODELING AND DATABASE DESIGN
Entity/Relationship Modelling
Let try to identify the conectivity of these entity relationship
© The McGraw-Hill Companies, All Rights Reserved APPENDIX C DESIGNING DATABASES APPENDIX C DESIGNING DATABASES.
Database Systems: Design, Implementation, and Management Tenth Edition
ITEC 3220A Using and Designing Database Systems
DATA MODELING AND DATABASE DESIGN
Entity-Relationship Design
Presentation transcript:

Module 2: Conceptual Data Modeling with ERD Entities ERD Modeling Identify and Model Entities Define Relationships Entity Relationship Layout ERD Modeling Relationship and Frequencies Special Relationship Types Objectives At the end of this module, you will be able to: Identify entities. Determine entity relationships. Name the three types of relationships. Determine a relationship’s optionality and degree. Model entities and relationships. Create relationship grids.

Entities An entity, like a noun, is a person, place, thing, or event about which the system is to maintain, correlate, and display information. An entity must be within the scope of the system; not all nouns are entities. Entities versus Associated Information Entity = Table Entities versus Associated Information Entity (Table) Information (Attributes) ======= ==================== Course Course Name Course Section Course Start Time Student Student Name Address Phone What other attributes might be identified for the Student entity?

Instance of an Entity Instance of an Entity: An entity instance refers to one distinct entity occurrence. (= Record) Examples: Joe Smith, along with his address and so on, is an occurrence of STUDENT. Algebra 101 is an instance of COURSE. An instance is the same as a record (row) in a table (entity) in the relational database.

Instance of an Entity (continued) Practice: Identify the entities in the following description by circling the nouns. Remember, entities must be within the scope of the system. “Buffalo Records and CDs has been in business for only three years and we have already expanded our business to five stores. We’ve decided it might be about time to get a computer to keep track of some of these things that we keep losing information on. For instance, just last week when we did our item inventory, I was sure we had a copy of that new Guns and Roses CD, but a customer came in just yesterday looking for it and it was nowhere to be found? Thought we better get a bit more organized. Anyway, we have 20 employees now. We need to keep track of their names, addresses, phone numbers, social security numbers, and birth dates. We like to send our employees birthday cards, or cards for other special occasions. Like Joe over there - his wife just had a baby yesterday.” Question: What are some examples of the entities defined above? Store Employee Merchandise (Item Inventory) Customer

Classifying Entities Entities are classified by three types: Entities can tangible and intangible. Question: What are other examples of the above types of entities?

ERD Modeling Entity Relationship Attribute Domain Modeling Conventions - Entities Entity Relationship Diagrams (ERDs) are part of the business model. The diagrams visually represent entities and the business relationships between them. Entity A thing of significance, real or imagined, about which information needs to be stored. Usually derived from nouns in the “interview” notes: Requirements Modeling (Analysis) – To identify what our client wants for the To-Be (future) system. Relationship Identifies how one entity relates to, or is associated with, another entity. Usually derived from verbs in the interview notes. Attribute Any single item of information that serves to qualify, identify, classify, or express the state of an entity. Domain A set of business validation rules, format constraints or other properties that apply to attributes. A domain may be a: List of values. Range of values. Attributes in the same domain are subject to a common set of validation checks.

Modeling Conventions - Entities Entities have singular unique names. They are pictorially represented by a rounded box, as in the following: Employee Employee Customer Customer Order Order

Identifying and Modeling an Entity Determine the significant nouns. Determine a logical name for the entity. Write a description for the entity. Interview end-users to determine the objects of significance about which they need to maintain and correlate information. Determining Entities Determine the nouns. Are they things of significance? Is there information of interest that needs to be maintained or correlated for the noun? Determine a logical name for the entity. Write a description for the entity. An example may be “A customer has significance as a person or company who purchases or orders goods.”

Defining a Relationship Types of Relationships Naming Relationships Relationships Naming Syntax

Types of Relationships A relationship is a two-directional, significant association between two entities, or an entity and itself Types of Relationships Pictorially represented by a line between two entities. Three types of relationships exist: One to One (1:1) One to Many (1:M) Many to Many (M:M) One to One Relationship: Boeing Commercial Aircraft Division Salesperson is assigned to one and only one customer (one airline company). Entity A: Customers (airline companies) Entity B: Salespersons Entity B Entity A An instance of Entity A relates to one and only one instance of Entity B. Entity B relates to one and only one instance of entity A.

Types of Relationships (continued) One to Many (1:M) Entity A Entity B One to Many: One salesperson has several customers. Entity A: Customers Entity B: Salespersons An instance of Entity B relates to one or more instances of Entity A. An instance of Entity A relates to one and only one instance of Entity B.

Types of Relationships (continued) Many to Many (M:M) Entity A Entity B Many to Many: Entity A: Students Entity B: Courses Useful Relationship Names The following is a partial list of some useful relationship names: about  subject of allocated for  used by applied to  subject of assigned to  performed by at  location of based on  basis for child of  parent to classification for  of covered by  for defined by  part of definition of description of  for for  shown on initiated by  initiated for made up of  for operated by  operated for ordered by  filled by owned by  owner of part of  composed of part of  associated with required by  performed on responsible for  responsibility of site of  in source of  based on subject of  applied to An instance of Entity A relates to one or more instance of Entity B. An instance of Entity B relates to one or more instance of Entity A.

Naming Relationships Each end of a relationship must have a name to describe the relationship, an optionality, and a degree. Appropriate naming helps to understand the relationship, exposing potential problems early on. for SALE ITEM SALE Useful Relationship Names The following is a partial list of some useful relationship names: about  subject of allocated for  used by applied to  subject of assigned to  performed by at  location of based on  basis for child of  parent to classification for  of covered by  for defined by  part of definition of description of  for for  shown on initiated by  initiated for made up of  for operated by  operated for ordered by  filled by owned by  owner of part of  composed of part of  associated with required by  performed on responsible for  responsibility of site of  in source of  based on subject of  applied to Made up of Each SALE must be made up of one or more SALE ITEMs. Each SALE ITEM must be for one and only SALE. Relationship Naming Syntax Each ENTITY A [must be/may be] relationship end name [one and only one/one or more] ENTITY B

Conditional Relationships A relationship may not always exist. for Ticket Passenger Holder of Each Passenger may be the holder of one or more Tickets. Each Ticket must be for one and only one Passenger.

Conditional Relationships (continued) Read the Relationship in Each Direction First read left to right: for Ticket Passenger Each Ticket must be for one and only one Passenger. Then read right to left: Ticket Passenger Holder of Each Passenger may be the holder of one or more Tickets.

Practice: Defining a Relationship In this practice exercise, you will describe a relationship. Read and define the following relationships: Enrolled in Student Course Attended by “A student may be enrolled in one or many courses; a course may be attended by one or many students.” “A patient may receive one or more treatments; Each treatment must be for one and only one Patient.” Where a treatment is unique to each patient The relationship between “treatment” and “patient” can be also considered a M:M (many to many) relationship because a treatment (e.g. surgery) can be given for many patients. (Note: This argument was raised by a student, after I finished Module 2 on April 16, 2005. She will receive a big extra credit. (^_^) as a reward. I am very pleased to see many of you begin to understand the relational data modeling.) for Treatment Patient receive

*Entity Relationship Layout Always draw crow’s-feet pointing up or to the left. Place larger, more dynamic entities toward the upper left of the diagram. Avoid crossed lines.

*ERD Modeling Relationships and Frequencies (1:1) Rare (1:M) Very Rare (1:M) Common (1:M) Rare (1:M) Very Common (M:M) Common (M:M) Rare

Reading a Diagram Entity Relationship Diagram Sale Item Product Sale In this practice exercise, you will read a diagram and describe the relationships. Read the following diagram and describe the relationships: Sale Item identifier of Part of Entity Relationship Diagram contained in made up of Product Part of Comprised of Managed by Sold by Sale Employee Initiated by Located in Manager of The initiator of The location for Located in Customer State Located of

*Special Relationship Types Dependent Relationships Associative Relationships Intersection Entity

Dependent Relationships (1:M) A One to Many relationship my be represented as 1:M or 1 to M and specifies one or more in one direction and only one in the other direction. 1:M relationships can be called “dependent,” “hierarchical,” or “parent/child.” Treatment for Patient receive 1:M relationships are very common. 1:M relationships that are mandatory in both directions are uncommon. Model multi-level hierarchical data as several 1:M relationships: City within Made up of Country within Made up of Continent

Associative Relationships (M:M) A Many to Many, or M:M relationship indicates a degree of one or more in both directions. Student Enrolled in Course Attended by Each student may be enrolled in one or more courses. Each Course may be attended by one or more Students. Automobile Serviced by Mechanic services M:M relationships are very common. M:M relationships are usually optional in both directions. M:M relationships will be “resolved” by using intersection entities because relational models do not directly accommodate them.

Intersection Entity (Associative Entity) Intersection (or Associative) Entities are created to decompose a M:M into two 1:M relationships, with the Intersection Entity being the “child” of both original “parent” entities. Service Serviced by Mechanic services Performed on receives Automobile

Review Entities ERD Modeling Identify and Model Entities Define Relationships Entity Relationship Layout ERD Modeling Relationships and Frequencies Special Relationship Types 1. What three types of entities exist: 2. In what directions should crow’s feet always be drawn (ideally)? 3. What is the most common type of relationship? 4. What can 1:M relationships be called?