Data Modeling Using the Entity-Relationship (ER) Model.

Slides:



Advertisements
Similar presentations
Chapter # 4 BIS Database Systems
Advertisements

Entity Relationship Diagrams
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
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.
Entity Relationship (ER) Modeling
Entity Relationship (ER) Modeling
Systems Development Life Cycle
Data Modeling using the Entity-Relationship (ER) Model
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 7.1.
Entity-Relation Modeling Hun Myoung Park, Ph.D., Public Management and Policy Analysis Program Graduate School of International Relations International.
System Analysis - Data Modeling
Systems Analysis Requirements structuring Process Modeling Logic Modeling Data Modeling  Represents the contents and structure of the DFD’s data flows.
Copyright 2006 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Third Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
Entity Relationship Diagrams
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 7.1.
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter 8 Structuring System Data Requirements
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
Data Modeling 1 Yong Choi School of Business CSUB.
Modern Systems Analysis and Design Third Edition
Data Modeling 1 Yong Choi School of Business CSUB.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 10 Structuring.
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas.
Entity Relationship Modeling Objectives: To illustrate how relationships between entities are defined and refined. To know how relationships are incorporated.
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
1 © Prentice Hall, 2002 Chapter 3: Modeling Data in the Organization Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
Computer System Analysis Chapter 10 Structuring System Requirements: Conceptual Data Modeling Dr. Sana’a Wafa Al-Sayegh 1 st quadmaster University of Palestine.
1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name Position (123) University Name.
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.
Data Modeling ERM ERD.
Chapter 7 Data Modeling with Entity Relationship Diagrams Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Chapter 5 Entity Relationship (ER) Modelling
Copyright 2001 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter 6 Structuring.
BIS 360 – Lecture Six (Part 2) Conceptual Data Modeling (Chapter 10 and partial Chapter 12)
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Essentials of Systems Analysis and Design Fourth Edition Joseph S. Valacich Joey F.
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
Copyright 2006 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Third Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T5: Designing Database Applications Business Driven Technology.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 2: Modeling Data in the Organization.
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 
Lecture 4 Conceptual Data Modeling. Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship,
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
Data modeling using the entity-relationship model Chapter 3 Objectives How entities, tuples, attributes and relationships among entities are represented.
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.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management
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.
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.
ERD :: 19 / 1 / Entity-Relationship (ER) Modeling. ER Modeling is a top-down approach to database design. Entity Relationship (ER) Diagram –A.
Entity Relationship Modeling
Business System Development
TMC2034 Database Concept and Design
Tables and Their Characteristics
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
Review of Week 1 Database DBMS File systems vs. database systems
Fundamentals of Databases CSU 07203
Chapter 4 Entity Relationship (ER) Modeling
ER MODELING Instructor: SAMIA ARSHAD
Chapter # 4 Entity Relationship (ER) Modeling.
Presentation transcript:

Data Modeling Using the Entity-Relationship (ER) Model

Entity Relationship Modeling Objectives: To illustrate how relationships between entities are defined and refined. To know how relationships are incorporated into the database design process. To describe how ERD components affect database design and implementation.

What is Conceptual Database Design? Process of describing the data, relationships between the data, relationships between the data, and the constraints on the data. After analysis - Gather all the essential data required and understand how the data are related The focus is on the data, rather than on the processes. The output of the conceptual database design is a Conceptual Data Model ( + Data Dictionary)

Gathering Information for Conceptual Data Modeling Two perspectives Top-down Data model is derived from an intimate understanding of the business. Bottom-up Data model is derived by reviewing specifications and business documents.

Database Systems Composite versus Simple (Atomic) Attributes Composite attributes can be divided into smaller subparts, which represent more basic attributes with independent meanings. Address attribute of the EMPLOYEE entity can be subdivided into Street_address, City, State, and Zip.

Database Systems Composite versus Simple (Atomic) Attributes simple or atomic attributes Attributes that are not divisible.

Database Systems Single-Valued versus Multivalued Attributes Single Value attributes have a single value for a particular entity Age is a single-valued attribute of a person Multivalued Attributes attribute can have a set of values for the same entity a Colors attribute for a car, or a College_degrees attribute for a person. Cars with one color have a single value, two-tone cars have two color values. person may have two or more degrees;

Database Systems Stored versus Derived Attributes the Age and Birth_date attributes of a person Age can be determined from the current (today’s) date and the value of that person’s Birth_date The Age attribute is hence called a derived attribute and is said to be derivable from the Birth_date attribute, which is called a stored attribute

Database Systems Entity and its keys Regular entity Any entity that has a unique key Weak entity An entity type with no key

Slide FIGURE 7.1 The ER conceptual schema diagram for the COMPANY database.

Entity-Relationship (ER) Modeling. ER Modeling is a `top-down approach to database design. Entity Relationship (ER) Diagram A detailed, logical representation of the entities, associations and data elements for an organization or business Notation uses three main constructs Data entities Relationships Attributes Chen Model & Crow’s Foot Model

Person, place, object, event or concept about which data is to be maintained named property or characteristic of an entity Association between the instances of one or more entity types Represents a set or collection of objects in the real world that share the same properties Chen Notation EntityNameVerb Phrase AttributeName

Crow’s Foot Notation EntityName Entity Attribute EntityName List of Attributes Relationship Verb phrase Acceptable

Entities Examples of entities: Person: EMPLOYEE, STUDENT, PATIENT Place: STORE, WAREHOUSE Object: MACHINE, PRODUCT, CAR Event: SALE,REGISTRATION, RENEWAL Concept: ACCOUNT, COURSE Guidelines for naming and defining entity types: An entity type name is a singular noun An entity type should be descriptive and specific An entity name should be concise Event entity types should be named for the result of the event, not the activity or process of the event.

Attributes Example of entity types and associated attributes: STUDENT: Student_ID, Student_Name, Home_Address, Phone_Number, Major Guidelines for naming attributes: An attribute name is a noun. An attribute name should be unique To make an attribute name unique and clear, each attribute name should follow a standard format Similar attributes of different entity types should use similar but distinguishing names.

Identifier Attributes Candidate key Attribute (or combination of attributes) that uniquely identifies each instance of an entity type Some entities may have more than one candidate key Ex: A candidate key for EMPLOYEE is Employee_ID, a second is the combination of Employee_Name and Address. If there is more than one candidate key, need to make a choice. Identifier A candidate key that has been selected as the unique identifying characteristic for an entity type

Referential Attributes Name IdNum DeptID Ali 105 LG Mary 106 IT John 107 ENG Lim 108 IT Name IdNum DeptID Ali 105 LG Mary 106 IT John 107 ENG Lim 108 IT Instance of Lecturer. Referential attribute: Ties the lecturer entity to another entity that is department. Make Reference to another instance in another table

Example Staff StaffID NameGender IC Staff StaffID Name Gender IC PK

Relationships  Associations between instances of one or more entity types that is of interest  Given a name that describes its function. relationship name is an active or a passive verb.  Associations between instances of one or more entity types that is of interest  Given a name that describes its function. relationship name is an active or a passive verb. Author Book Relationship name: writes An author writes one or more books A book can be written by one or more authors.

Degree of Relationships Degree: number of entity types that participate in a relationship Three cases Unary: between two instances of one entity type Binary: between the instances of two entity types Ternary: among the instances of three entity types

Cardinality and Connectivity Relationships can be classified as either one – to – one one – to – many many – to –many Cardinality : minimum and maximum number of instances of Entity B that can (or must be) associated with each instance of entity A. Connectivity

2.4 Cardinality and Connectivity ProfessorClass teaches A professor teaches class OR A class is taught by professor How Many?? ProfessorClass teaches

2.4 Cardinality and Connectivity ProfessorClass teaches ProfessorClass teaches 1M Connectivity (1,1) (1,4) Cardinality

Connectivity Chen Model 1 to represent one. M to represent many Crow’s Foot many One One or many 1 M Mandatory one, means (1,1) Optional? – we’ll see after this

Binary Relationships 1:M relationship Relational modeling ideal Should be the norm in any relational database design The 1: M relationship between PAINTER and PAINTING

The Implemented 1:M relationship between PAINTER and PAINTING

Binary Relationships 1:1 relationship Should be rare in any relational database design A single entity instance in one entity class is related to a single entity instance in another entity class Could indicate that two entities actually belong in the same table

The 1:1 Relationship Between PROFESSOR and DEPARTMENT

Binary Relationships M:N relationships Must be avoided because they lead to data redundancies. Can be implemented by breaking it up to produce a set of 1:M relationships Can avoid problems inherent to M:N relationship by creating a composite entity or bridge entity This will be used to link the tables that were originally related in a M:N relationship The composite entity structure includes-as foreign keys-at least the primary keys of the tables that are to be linked.

The M:N Relationship Between STUDENT and CLASS This CANNOT be implemented as shown next….. Bowser Smithson Accounting 1 (ACCT-211) Intro to Microcomputing (CIS-220) Intro to Statistics (QM- 261)

The tables have many redundancies!! + CLASS_CODE CLASS_CODE + STU_NUM

Changing the M:N relationship to TWO 1:M relationships

Converting the M:N relationship into TWO 1:M relationships Foreign keys reference the primary keys in the other tables of which it has a relationship with The database designer has 2 main options to define a composite table’s primary key: either use the combination of those foreign keys or create a new primary key.

Mandatory vs. Optional Cardinalities Specifies whether an instance must exist or can be absent in the relationship A Lecturer may handle zero or many classes. A class is handled by one and only one Lecturer. Optional Mandatory LecturerClass (0,N)(1,1) handles 1 M

How to Evaluate a Data Model? A good data model has the following: Accuracy and completeness Non redundancy Enforcement of business rules Data Reusability Stability and Flexibility Communication Effectiveness Simplicity

A Common Mistake Modeling the business processes or functions instead of the data. What data we want to keep?? We are interested in modeling the data, NOT the processes or functions that use or generate those data.

Example: MemberBooks Searches MN Is this part of the data requirement? Are we interested to know the books searched by the members? If answer is NO, then DO NOT include that as a relationship. Use other appropriate diagramming techniques to capture the business processes such as Data Flow Diagram. Do not mix up the use of ER Modeling with DFD.