The Entity-Relationship Model, P. I R. Nakatsu. Data Modeling A data model is the relatively simple representation, usually graphic, of the structure.

Slides:



Advertisements
Similar presentations
Entity Relationship (E-R) Modeling Hachim Haddouti
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.
Chapter 4 Entity Relationship (E-R) Modeling
Entity Relationship (ER) Modeling
IT420: Database Management and Organization
Entity-Relationship Model
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.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 3 The Entity- Relationship Model.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 COS 346 Day 6.
Entity Relationship (E-R) Modeling
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 David M. Kroenke Database Processing Tenth Edition Chapter 5 Data.
Chapter Five Data Modeling with the Entity-Relationship Model.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 3 The Entity- Relationship Model.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 COS 346 Day 6.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 David M. Kroenke’s Chapter Five: Data Modeling with the Entity-Relationship.
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Entity-Relationship Model
Chapter 4 Entity Relationship (E-R) Modeling
Chapter Five Data Modeling with the Entity-Relationship Model.
 Keys are special fields that serve two main purposes: ◦ Primary keys are unique identifiers of the relation in question. Examples include employee numbers,
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 David M. Kroenke’s Chapter Five: Data Modeling with the Entity-Relationship.
© 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 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
3 Chapter 3 Entity Relationship (E-R) Modeling Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
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.
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
Entity Relationship Diagrams Objectives s Learn the Elements of the E-R model (entities, attributes, and relationships) s Show how to apply the E-R model.
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
Principles of Database Design, Part II AIMS 2710 R. Nakatsu.
Copyright (c) 2014 Pearson Education, Inc. Introduction to Databases.
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 2: Modeling Data in the Organization.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-1 David M. Kroenke’s, 10 th ed. Chapter.
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 
Data Modeling IST210 Class Lecture.
Database Design – Lecture 5 Conceptual Data Modeling – adding attributes.
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
Chapter 7 Data Modeling with Entity Relationship Diagrams
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
1 A Demo of Logical Database Design. 2 Aim of the demo To develop an understanding of the logical view of data and the importance of the relational model.
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.
Entity Relationship Modeling
Chapter 4 The Semantic Object Model David M. Kroenke Database Processing © 2000 Prentice Hall.
Data Modeling Using the Entity-Relationship (ER) Data Model.
Chapter 3: Modeling Data in the Organization. Business Rules Statements that define or constrain some aspect of the business Assert business structure.
Entity Relationship Diagram (ERD). Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship.
CSE 412/598 DATABASE MANAGEMENT COURSE NOTES 3. ENTITY-RELATIONSHIP CONCEPTUAL MODELING Department of Computer Science & Engineering Arizona State University.
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Five: Data Modeling with the Entity-Relationship.
Copyright © 2016 Pearson Education, Inc. Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki Topi CHAPTER 2: MODELING DATA.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 3: Modeling Data in the Organization Modern Database Management 9 th Edition Jeffrey.
Department of Mathematics Computer and Information Science1 CS 351: Database Management Systems Christopher I. G. Lanclos Chapter 4.
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
Tables and Their Characteristics
Database Design – Lecture 4
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter 4 Entity Relationship (ER) Modeling
Database Processing: David M. Kroenke’s Chapter Five:
Entity Relationship (ER) Modeling
Presentation transcript:

The Entity-Relationship Model, P. I R. Nakatsu

Data Modeling A data model is the relatively simple representation, usually graphic, of the structure of the database. The database designer usually employs data models as communication tools to facilitate interaction among the designer, the applications programmer, and the end user.

Entity-Relationship (ER) Modeling The ER model serves as the basic database blueprint. Entity: anything about which data are to be collected and stored (corresponds to a table; represented by a rectangle) Attribute: a characteristic of an entity (corresponds to a column in a table) Relationship: describes an association between entities (represented by a line joining the two entities together).

Database Systems, 9th Edition

Entities Something that users want to track. © 2000 Prentice Hall

Attributes (properties) Describe the entity’s characteristics. Entity:Employee Attributes:LastName, FirstName, DateOfHire, DateofBirth

Figure 4.3 – Depicting Attributes on an ERM 7

Types of Attributes Required vs. Optional Simple vs. Composite Single-valued vs. Multi-valued Derived (or Calculated) Identifier Provide examples of each type.

Advantages and Disadvantages of Storing Derived Attributes 9

Identifier An attribute or attributes that name or identify entity instances. Note: Can either be unique or nonunique Entity: Employee Identifier 1: SocialSecurityNumber Identifier 2: LastName, FirstName

Relationship Types One-to-One e.g., one dean to one university one head-of-state to one country One-to-Many e.g., one painter paints many paintings one customer places many orders Many-to-Many e.g., students enroll in courses

Determining the Relationship type: 1:1, 1:M, M:N Two questions to identify the relationship type between A and B: –How many instances of B are related to one instance of A? –How many instances of A are related to one instance of B?

Cardinality in an ER Diagram Cardinality expresses the minimum and maximum (min, max) number of entity occurrences associated with one occurrence of the related entity.

Expressing Minimum Cardinality: Hash Marks and Ovals Hash mark (or vertical line): indicates a mandatory relationship (min cardinality of 1) Circle: indicates an optional relationship (min cardinality of 0)

Expressing Optional/Mandatory Relationships On ER Diagram

ER Diagram Problem 1 Acme Insurance Company employs hundreds of claims adjustors across the U.S. As part of its agreement when joining the company, each adjustor is assigned to a company automobile. A claims adjustor works on a number of insurance claims. Sometimes a team of adjustors (two or more adjustors) will work together on a single claim, and there is always at least one adjustor assigned to a claim. Draw the ER Diagram for this situation. Include relationship types using crow’s foot notation, cardinalities in parentheses notation, and hash marks / circles to indicate optional/mandatory relationships.

Existence Dependence 17 Existent DependentExistent Independent Entity exists in the database only when it is associated with another related entity occurrence. Entity exists apart from all of its related entities Referred to as a strong entity or regular entity.

Weak Entity Conditions –Existence-dependent –Has a primary key that is partially or totally derived from parent entity in the relationship –An entity that is not weak is called a strong entity. 18

Weak Entity Examples Example 1: Building (BuildingName) Apartment (BuildingName, Apartment#) Example 2: Employee (EmployeeNo) Dependent (EmployeeNo, DependentNo)

Two Types of Relationships HAS-A relationships: The term is used because an entity has a relationship with another entity (1:1, 1:M, M:N) IS-A relationships: This term refers to relationships between super-types and sub-types.

Entity Supertypes and Subtypes Entity supertype –Generic entity type related to one or more entity subtypes –Contains common characteristics Entity subtype –Contains unique characteristics of each entity subtype

Database Systems, 9th Edition 22

Database Systems, 9th Edition 23

Disjoint and Overlapping Subtypes Disjoint subtypes (denoted by d) –Each entity instance of the supertype can appear in only one of the subtypes. Overlapping subtypes (denoted by o) –Each entity instance of the supertype can appear in more than one subtype.

Completeness Constraint Specifies whether a supertype occurrence must be a member of at least one subtype Partial completeness –Symbolized by a circle over a single line –Some supertype occurrences are not members of any subtype Total completeness –Symbolized by a circle over a double line –Every supertype occurrence must be a member of at least one subtype

Database Systems, 9th Edition 26

ER Diagram Problem 2 ABC University is made up of several departments. Each department employs several professors, and each professor is always assigned to a single department. A rule in the university stipulates that a department must consist of between 4 and 20 professors, inclusive. Each department is chaired by a department chair, who is a professor. Draw the ER Diagram for this situation.