SlideShare a Scribd company logo
1 of 62
Download to read offline
4




             Chapter 4

 Entity Relationship (ER) Modeling

           Database Systems:
Design, Implementation, and Management,
     Sixth Edition, Rob and Coronel

                                          1
4

           In this chapter, you will learn:
•How relationships between entities are
 defined and refined, and how such
 relationships are incorporated into the
 database design process
•How ERD components affect database
 design and implementation
•How to interpret the modeling symbols for the
 four most popular ER modeling tools
•That real-world database design often
 requires that you reconcile conflicting goals

   Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   2
4

   The Entity Relationship (ER) Model
•ER model forms the basis of an ER diagram
•ERD represents the conceptual database as
 viewed by end user
•ERDs depict the ER model’three main
                         s
 components:
  –Entities
  –Attributes
  –Relationships
   Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   3
4

                                         Entities
•Refers to the entity set and not to a single
 entity occurrence
•Corresponds to a table and not to a row in the
 relational environment
•In both the Chen and Crow’Foot models, an
                              s
 entity is represented by a rectangle
 containing the entity’name
                      s
•Entity name, a noun, is usually written in
 capital letters
   Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   4
4

                                      Attributes
•Characteristics of entities
•In Chen model, attributes are represented by
 ovals and are connected to the entity
 rectangle with a line
•Each oval contains the name of the attribute it
 represents
•In the Crow’Foot model, the attributes are
              s
 simply written in the attribute box below the
 entity rectangle
   Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   5
4

The Attributes of the STUDENT Entity




 Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   6
4

                                       Domains

•Attributes have a domain:

  –The attribute’set of possible values
                s

•Attributes may share a domain




   Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   7
4

                                 Primary Keys
•Underlined in the ER diagram

•Key attributes are also underlined in
 frequently used table structure shorthand

•Ideally composed of only a single attribute

•Possible to use a composite key:

  –Primary key composed of more than one
   attribute
   Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   8
4
            The CLASS Table (Entity)
            Components and Contents




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   9
4

                                      Attributes

•Composite attribute

•Simple attribute

•Single-value attribute

•Multivalued attributes




   Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   10
4

 A Multivalued Attribute in an Entity




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   11
4

Resolving Multivalued Attribute Problems
•Although the conceptual model can handle
 multivalued attributes, you should not
 implement them in the relational DBMS
  –Within original entity, create several new
   attributes, one for each of the original
   multivalued attribute’components
                          s
        •Can lead to major structural problems in the table
  –Create a new entity composed of original
   multivalued attribute’components
                        s

   Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   12
4
            Splitting the Multivalued
          Attribute into New Attributes




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   13
4

Components of the Multivalued Attribute




  Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   14
4
 A New Entity Set Composed of a
Multivalued Attribute’Components
                     s




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   15
4

                           Derived Attributes

•Attribute whose value may be calculated
 (derived) from other attributes

•Need not be physically stored within the
 database

•Can be derived by using an algorithm




   Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   16
4
      Depiction of a Derived Attribute




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   17
4
                                  Relationships
•Association between entities
•Participants:
   –Entities that participate in a relationship
•Relationships between entities always
 operate in both directions
•Relationship can be classified as 1:M
•Relationship classification is difficult to
 establish if you only know one side
    Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   18
4

             Connectivity and Cardinality
•Connectivity
  –Used to describe the relationship classification
•Cardinality
  –Expresses the specific number of entity
   occurrences associated with one occurrence
   of the related entity
•Established by very concise statements
 known as business rules

   Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   19
4

Connectivity and Cardinality in an ERD




 Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   20
4
                RELATIONSHIP Strength
•Existence dependence
  –Entity’existence depends on the existence of
         s
   one or more other entities
•Existence independence
  –Entity can exist apart from one or more related
   entities
•Weak (non-identifying) relationships
  –One entity is not existence-independent on
   another entity
•Strong (Identifying) Relationships
  –Related entities are existence-dependent
   Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   21
4
A Weak (Non-Identifying) Relationship
   Between COURSE and CLASS




 Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   22
4
         A Weak Relationship
     Between COURSE and CLASS




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   23
4

                Relationship Participation
•Optional:

  –One entity occurrence does not require a
   corresponding entity occurrence in a particular
   relationship

•Mandatory:

  –One entity occurrence requires a
   corresponding entity occurrence in a particular
   relationship
   Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   24
4
  A Strong (Identifying) Relationship
   Between COURSE and CLASS




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   25
4
An Optional CLASS Entity in the Relationship
      PROFESSOR teaches CLASS




     Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   26
4
             COURSE and CLASS
          in a Mandatory Relationship




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   27
4

Relationship Strength and Weak Entities
•Weak entity meets two conditions
  –Existence-dependent:
        •Cannot exist without entity with which it has a
         relationship
  –Has primary key that is partially or totally
   derived from the parent entity in the
   relationship
•Database designer usually determines
 whether an entity can be described as weak
 based on the business rules
   Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   28
4
              A Weak Entity in an ERD




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   29
4

A Weak Entity in a Strong Relationship




 Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   30
4

                       Relationship Degree
•Indicates number of associated entities or
 participants
•Unary relationship
  –Association is maintained within a single entity
•Binary relationship
  –Two entities are associated
•Ternary relationship
  –Three entities are associated
   Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   31
4
        Three Types of Relationships




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   32
4
                 The Implementation
              of a Ternary Relationship




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   33
4

                  Recursive Relationships

•Relationship can exist between occurrences
 of the same entity set

•Naturally found within a unary relationship




   Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   34
4
              An ER Representation
            of Recursive Relationships




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   35
4
  The 1:1 Recursive Relationship
“
EMPLOYEE is Married to EMPLOYEE”




 Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   36
4
Implementation of the M:N Recursive
“PART Contains PART”    Relationship




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   37
4
  Implementation of the 1:M “
                            EMPLOYEE
Manages EMPLOYEE”     Recursive Relationship




  Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   38
4

                         Composite Entities

•Also known as bridge entities

•Composed of the primary keys of each of the
 entities to be connected

•May also contain additional attributes that
 play no role in the connective process



   Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   39
4
    Converting the M:N Relationship
      into Two 1:M Relationships




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   40
4
        The M:N Relationship
    Between STUDENT and CLASS




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   41
4

       A Composite Entity in an ERD




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   42
4

       Entity Supertypes and Subtypes
•Generalization hierarchy
  –Depicts a relationship between a higher-level
   supertype entity and a lower-level subtype
   entity

•Supertype entity
  –Contains shared attributes

•Subtype entity
  –Contains unique attributes
   Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   43
4

 Nulls Created by Unique Attributes




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   44
4

           A Generalization Hierarchy




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   45
4

                           Disjoint Subtypes

•Also known as non-overlapping subtypes

  –Subtypes that contain a subset of the
   supertype entity set

  –Each entity instance (row) of the supertype
   can appear in only one of the disjoint subtypes

•Supertype and its subtype(s) maintain a 1:1
 relationship

   Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   46
4
       The EMPLOYEE/PILOT
    Supertype/Subtype Relationship




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   47
4
           A Generalization Hierarchy
           with Overlapping Subtypes




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   48
4

A Comparison of ER Modeling Symbols




 Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   49
4
             The Chen Representation
              of the Invoicing Problem




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   50
4
    The Crow’Foot Representation
              s
       of the Invoicing Problem




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   51
4
           The Rein85 Representation
            of the Invoicing Problem




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   52
4
          The IDEF1X Representation
            of the Invoicing Problem




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   53
4

              Developing an ER Diagram

•Database design is an iterative rather than a
 linear or sequential process

•Iterative process

  –Based on repetition of processes and
   procedures




   Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   54
4

 A Supertype/Subtype Relationship




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   55
4
 A Supertype/Subtype Relationship
            in an ERD




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   56
4

        Components of the ER Model




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   57
4
  The Completed Tiny College ERD




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   58
4
   The Challenge of Database Design:
           Conflicting Goals
•Database design must conform to design
 standards

•High processing speeds are often a top
 priority in database design

•Quest for timely information might be the
 focus of database design


   Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   59
4
          Various Implementations
      of a 1:1 Recursive Relationship




Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   60
4
                                      Summary
•Entity relationship (ER) model
  –Uses ER diagrams to represent conceptual
   database as viewed by the end user
  –Three main components
        •Entities
        •Relationships
        •Attributes
  –Includes connectivity and cardinality notations
•Connectivities and cardinalities are based on
 business rules
   Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   61
4

                       Summary (continued)

•ER symbols are used to graphically depict the
 ER model’components and relationships
            s
•ERDs may be based on many different ER
 models
•Entities can also be classified as supertypes
 and subtypes within a generalization
 hierarchy
•Database designers are often forced to make
 design compromises
   Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel   62

More Related Content

What's hot

Modern database management system chapter 1
Modern database management system chapter 1Modern database management system chapter 1
Modern database management system chapter 1AyeshaShoukat5
 
Methodology conceptual databases design roll no. 99 & 111
Methodology conceptual databases design roll no. 99 & 111Methodology conceptual databases design roll no. 99 & 111
Methodology conceptual databases design roll no. 99 & 111Manoj Nolkha
 
Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01Jotham Gadot
 
Management information system database management
Management information system database managementManagement information system database management
Management information system database managementOnline
 
Introduction: Databases and Database Users
Introduction: Databases and Database UsersIntroduction: Databases and Database Users
Introduction: Databases and Database Userssontumax
 
Database and Database Management (DBM): Health Informatics
Database and Database Management (DBM): Health InformaticsDatabase and Database Management (DBM): Health Informatics
Database and Database Management (DBM): Health InformaticsZulfiquer Ahmed Amin
 
Data base management system
Data base management systemData base management system
Data base management systemNavneet Jingar
 
Chapter 2 database environment
Chapter 2 database environmentChapter 2 database environment
Chapter 2 database environment>. <
 
Database management system
Database management systemDatabase management system
Database management systemRizwanHafeez
 

What's hot (20)

Database - Design & Implementation - 1
Database - Design & Implementation - 1Database - Design & Implementation - 1
Database - Design & Implementation - 1
 
Chapter 9
Chapter 9Chapter 9
Chapter 9
 
Modern database management system chapter 1
Modern database management system chapter 1Modern database management system chapter 1
Modern database management system chapter 1
 
Methodology conceptual databases design roll no. 99 & 111
Methodology conceptual databases design roll no. 99 & 111Methodology conceptual databases design roll no. 99 & 111
Methodology conceptual databases design roll no. 99 & 111
 
Week 3 database design
Week 3   database designWeek 3   database design
Week 3 database design
 
Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01
 
Management information system database management
Management information system database managementManagement information system database management
Management information system database management
 
Database
DatabaseDatabase
Database
 
ch1
ch1ch1
ch1
 
Introduction: Databases and Database Users
Introduction: Databases and Database UsersIntroduction: Databases and Database Users
Introduction: Databases and Database Users
 
Database and Database Management (DBM): Health Informatics
Database and Database Management (DBM): Health InformaticsDatabase and Database Management (DBM): Health Informatics
Database and Database Management (DBM): Health Informatics
 
Database Management System ppt
Database Management System pptDatabase Management System ppt
Database Management System ppt
 
Data base management system
Data base management systemData base management system
Data base management system
 
Assign 1
Assign 1Assign 1
Assign 1
 
Database systems introduction
Database systems introductionDatabase systems introduction
Database systems introduction
 
Chapter 2 database environment
Chapter 2 database environmentChapter 2 database environment
Chapter 2 database environment
 
Bab9
Bab9Bab9
Bab9
 
Introduction to Databases by Dr. Kamal Gulati
Introduction to Databases by Dr. Kamal GulatiIntroduction to Databases by Dr. Kamal Gulati
Introduction to Databases by Dr. Kamal Gulati
 
database ppt(2)
database ppt(2)database ppt(2)
database ppt(2)
 
Database management system
Database management systemDatabase management system
Database management system
 

Similar to Database design, implementation, and management -chapter04

02010 ppt ch04
02010 ppt ch0402010 ppt ch04
02010 ppt ch04ams1ams1
 
Fundamentals of Database ppt ch04
Fundamentals of Database ppt ch04Fundamentals of Database ppt ch04
Fundamentals of Database ppt ch04Jotham Gadot
 
Entity relationship (er) modeling
Entity relationship (er) modelingEntity relationship (er) modeling
Entity relationship (er) modelingDhani Ahmad
 
Unit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptxUnit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptxMaryJoseph79
 
Gilbane Boston 2012: XML and SQL: Not Dead Yet
Gilbane Boston 2012: XML and SQL: Not Dead YetGilbane Boston 2012: XML and SQL: Not Dead Yet
Gilbane Boston 2012: XML and SQL: Not Dead YetPeter O'Kelly
 
Sorting & Extracting Data
Sorting & Extracting DataSorting & Extracting Data
Sorting & Extracting Datamary_ramsay
 
Lucene/Solr Revolution 2015: Where Search Meets Machine Learning
Lucene/Solr Revolution 2015: Where Search Meets Machine LearningLucene/Solr Revolution 2015: Where Search Meets Machine Learning
Lucene/Solr Revolution 2015: Where Search Meets Machine LearningJoaquin Delgado PhD.
 
Lucene/Solr Revolution 2015: Where Search Meets Machine Learning
Lucene/Solr Revolution 2015: Where Search Meets Machine LearningLucene/Solr Revolution 2015: Where Search Meets Machine Learning
Lucene/Solr Revolution 2015: Where Search Meets Machine LearningS. Diana Hu
 
Where Search Meets Machine Learning: Presented by Diana Hu & Joaquin Delgado,...
Where Search Meets Machine Learning: Presented by Diana Hu & Joaquin Delgado,...Where Search Meets Machine Learning: Presented by Diana Hu & Joaquin Delgado,...
Where Search Meets Machine Learning: Presented by Diana Hu & Joaquin Delgado,...Lucidworks
 
Types of data bases
Types of data basesTypes of data bases
Types of data basesJanu Jahnavi
 
Chapter-2- Lesson 1 The Database-Design.ppt
Chapter-2- Lesson 1 The Database-Design.pptChapter-2- Lesson 1 The Database-Design.ppt
Chapter-2- Lesson 1 The Database-Design.pptmicayaseloisa
 
Advanced data modeling
Advanced data modelingAdvanced data modeling
Advanced data modelingDhani Ahmad
 
Coronel Morris_DatabaseSystems_14e_PPT_Mod04.pptx
Coronel Morris_DatabaseSystems_14e_PPT_Mod04.pptxCoronel Morris_DatabaseSystems_14e_PPT_Mod04.pptx
Coronel Morris_DatabaseSystems_14e_PPT_Mod04.pptxssusera16bcf1
 
DBMS & Data Models - In Introduction
DBMS & Data Models - In IntroductionDBMS & Data Models - In Introduction
DBMS & Data Models - In IntroductionRajeev Srivastava
 
introduction-to-dbms-unit-1.ppt
introduction-to-dbms-unit-1.pptintroduction-to-dbms-unit-1.ppt
introduction-to-dbms-unit-1.pptrekhasai2468
 
Fundamentals of Database ppt ch02
Fundamentals of Database ppt ch02Fundamentals of Database ppt ch02
Fundamentals of Database ppt ch02Jotham Gadot
 

Similar to Database design, implementation, and management -chapter04 (20)

02010 ppt ch04
02010 ppt ch0402010 ppt ch04
02010 ppt ch04
 
Fundamentals of Database ppt ch04
Fundamentals of Database ppt ch04Fundamentals of Database ppt ch04
Fundamentals of Database ppt ch04
 
03 chapter
03 chapter03 chapter
03 chapter
 
Entity relationship (er) modeling
Entity relationship (er) modelingEntity relationship (er) modeling
Entity relationship (er) modeling
 
oracle
oracle oracle
oracle
 
Unit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptxUnit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptx
 
Gilbane Boston 2012: XML and SQL: Not Dead Yet
Gilbane Boston 2012: XML and SQL: Not Dead YetGilbane Boston 2012: XML and SQL: Not Dead Yet
Gilbane Boston 2012: XML and SQL: Not Dead Yet
 
Sorting & Extracting Data
Sorting & Extracting DataSorting & Extracting Data
Sorting & Extracting Data
 
Lucene/Solr Revolution 2015: Where Search Meets Machine Learning
Lucene/Solr Revolution 2015: Where Search Meets Machine LearningLucene/Solr Revolution 2015: Where Search Meets Machine Learning
Lucene/Solr Revolution 2015: Where Search Meets Machine Learning
 
Lucene/Solr Revolution 2015: Where Search Meets Machine Learning
Lucene/Solr Revolution 2015: Where Search Meets Machine LearningLucene/Solr Revolution 2015: Where Search Meets Machine Learning
Lucene/Solr Revolution 2015: Where Search Meets Machine Learning
 
Where Search Meets Machine Learning: Presented by Diana Hu & Joaquin Delgado,...
Where Search Meets Machine Learning: Presented by Diana Hu & Joaquin Delgado,...Where Search Meets Machine Learning: Presented by Diana Hu & Joaquin Delgado,...
Where Search Meets Machine Learning: Presented by Diana Hu & Joaquin Delgado,...
 
Types of data bases
Types of data basesTypes of data bases
Types of data bases
 
Chapter 09
Chapter 09Chapter 09
Chapter 09
 
Chapter-2- Lesson 1 The Database-Design.ppt
Chapter-2- Lesson 1 The Database-Design.pptChapter-2- Lesson 1 The Database-Design.ppt
Chapter-2- Lesson 1 The Database-Design.ppt
 
Advanced data modeling
Advanced data modelingAdvanced data modeling
Advanced data modeling
 
Coronel Morris_DatabaseSystems_14e_PPT_Mod04.pptx
Coronel Morris_DatabaseSystems_14e_PPT_Mod04.pptxCoronel Morris_DatabaseSystems_14e_PPT_Mod04.pptx
Coronel Morris_DatabaseSystems_14e_PPT_Mod04.pptx
 
DBMS & Data Models - In Introduction
DBMS & Data Models - In IntroductionDBMS & Data Models - In Introduction
DBMS & Data Models - In Introduction
 
introduction-to-dbms-unit-1.ppt
introduction-to-dbms-unit-1.pptintroduction-to-dbms-unit-1.ppt
introduction-to-dbms-unit-1.ppt
 
Fundamentals of Database ppt ch02
Fundamentals of Database ppt ch02Fundamentals of Database ppt ch02
Fundamentals of Database ppt ch02
 
Data models
Data modelsData models
Data models
 

More from Beni Krisbiantoro

Pembahasan Soal UKK TKJ 2017 - Paket 3
Pembahasan Soal UKK TKJ 2017 - Paket 3Pembahasan Soal UKK TKJ 2017 - Paket 3
Pembahasan Soal UKK TKJ 2017 - Paket 3Beni Krisbiantoro
 
Pembahasan Soal UKK TKJj 2017 - Paket 2
Pembahasan Soal UKK TKJj 2017 - Paket 2Pembahasan Soal UKK TKJj 2017 - Paket 2
Pembahasan Soal UKK TKJj 2017 - Paket 2Beni Krisbiantoro
 
Membangun Aplikasi SMS dengan Gammu dan PHP Framework CodeIgniter
Membangun Aplikasi SMS dengan Gammu dan PHP Framework CodeIgniterMembangun Aplikasi SMS dengan Gammu dan PHP Framework CodeIgniter
Membangun Aplikasi SMS dengan Gammu dan PHP Framework CodeIgniterBeni Krisbiantoro
 
Business Intelligence - Overview
Business Intelligence - Overview Business Intelligence - Overview
Business Intelligence - Overview Beni Krisbiantoro
 
Javascript Guide - Belajar Pemrograman JavaScript
Javascript Guide - Belajar Pemrograman JavaScriptJavascript Guide - Belajar Pemrograman JavaScript
Javascript Guide - Belajar Pemrograman JavaScriptBeni Krisbiantoro
 
Tutorial Installasi Ubuntu 11.04 untuk Webhost dengan Webmin dan Virtualmin
Tutorial Installasi Ubuntu 11.04 untuk Webhost dengan Webmin dan VirtualminTutorial Installasi Ubuntu 11.04 untuk Webhost dengan Webmin dan Virtualmin
Tutorial Installasi Ubuntu 11.04 untuk Webhost dengan Webmin dan VirtualminBeni Krisbiantoro
 
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk WebhostingTutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk WebhostingBeni Krisbiantoro
 
Belajar PHP Framework CodeIgniter 2.x
Belajar PHP Framework CodeIgniter 2.xBelajar PHP Framework CodeIgniter 2.x
Belajar PHP Framework CodeIgniter 2.xBeni Krisbiantoro
 

More from Beni Krisbiantoro (12)

Pembahasan Soal UKK TKJ 2017 - Paket 3
Pembahasan Soal UKK TKJ 2017 - Paket 3Pembahasan Soal UKK TKJ 2017 - Paket 3
Pembahasan Soal UKK TKJ 2017 - Paket 3
 
Pembahasan Soal UKK TKJj 2017 - Paket 2
Pembahasan Soal UKK TKJj 2017 - Paket 2Pembahasan Soal UKK TKJj 2017 - Paket 2
Pembahasan Soal UKK TKJj 2017 - Paket 2
 
Tutorial Mikrotik Bagian 1
Tutorial Mikrotik Bagian 1Tutorial Mikrotik Bagian 1
Tutorial Mikrotik Bagian 1
 
Tutorial Mikrotik Bagian 2
Tutorial Mikrotik Bagian 2Tutorial Mikrotik Bagian 2
Tutorial Mikrotik Bagian 2
 
Membangun Aplikasi SMS dengan Gammu dan PHP Framework CodeIgniter
Membangun Aplikasi SMS dengan Gammu dan PHP Framework CodeIgniterMembangun Aplikasi SMS dengan Gammu dan PHP Framework CodeIgniter
Membangun Aplikasi SMS dengan Gammu dan PHP Framework CodeIgniter
 
Business Intelligence - Overview
Business Intelligence - Overview Business Intelligence - Overview
Business Intelligence - Overview
 
Javascript Guide - Belajar Pemrograman JavaScript
Javascript Guide - Belajar Pemrograman JavaScriptJavascript Guide - Belajar Pemrograman JavaScript
Javascript Guide - Belajar Pemrograman JavaScript
 
Tutorial Installasi Ubuntu 11.04 untuk Webhost dengan Webmin dan Virtualmin
Tutorial Installasi Ubuntu 11.04 untuk Webhost dengan Webmin dan VirtualminTutorial Installasi Ubuntu 11.04 untuk Webhost dengan Webmin dan Virtualmin
Tutorial Installasi Ubuntu 11.04 untuk Webhost dengan Webmin dan Virtualmin
 
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk WebhostingTutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk Webhosting
 
ARP Spoofing
ARP SpoofingARP Spoofing
ARP Spoofing
 
Belajar PHP Framework CodeIgniter 2.x
Belajar PHP Framework CodeIgniter 2.xBelajar PHP Framework CodeIgniter 2.x
Belajar PHP Framework CodeIgniter 2.x
 
VNC User Guide
VNC User GuideVNC User Guide
VNC User Guide
 

Database design, implementation, and management -chapter04

  • 1. 4 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel 1
  • 2. 4 In this chapter, you will learn: •How relationships between entities are defined and refined, and how such relationships are incorporated into the database design process •How ERD components affect database design and implementation •How to interpret the modeling symbols for the four most popular ER modeling tools •That real-world database design often requires that you reconcile conflicting goals Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 2
  • 3. 4 The Entity Relationship (ER) Model •ER model forms the basis of an ER diagram •ERD represents the conceptual database as viewed by end user •ERDs depict the ER model’three main s components: –Entities –Attributes –Relationships Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 3
  • 4. 4 Entities •Refers to the entity set and not to a single entity occurrence •Corresponds to a table and not to a row in the relational environment •In both the Chen and Crow’Foot models, an s entity is represented by a rectangle containing the entity’name s •Entity name, a noun, is usually written in capital letters Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 4
  • 5. 4 Attributes •Characteristics of entities •In Chen model, attributes are represented by ovals and are connected to the entity rectangle with a line •Each oval contains the name of the attribute it represents •In the Crow’Foot model, the attributes are s simply written in the attribute box below the entity rectangle Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 5
  • 6. 4 The Attributes of the STUDENT Entity Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 6
  • 7. 4 Domains •Attributes have a domain: –The attribute’set of possible values s •Attributes may share a domain Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 7
  • 8. 4 Primary Keys •Underlined in the ER diagram •Key attributes are also underlined in frequently used table structure shorthand •Ideally composed of only a single attribute •Possible to use a composite key: –Primary key composed of more than one attribute Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 8
  • 9. 4 The CLASS Table (Entity) Components and Contents Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 9
  • 10. 4 Attributes •Composite attribute •Simple attribute •Single-value attribute •Multivalued attributes Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 10
  • 11. 4 A Multivalued Attribute in an Entity Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 11
  • 12. 4 Resolving Multivalued Attribute Problems •Although the conceptual model can handle multivalued attributes, you should not implement them in the relational DBMS –Within original entity, create several new attributes, one for each of the original multivalued attribute’components s •Can lead to major structural problems in the table –Create a new entity composed of original multivalued attribute’components s Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 12
  • 13. 4 Splitting the Multivalued Attribute into New Attributes Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 13
  • 14. 4 Components of the Multivalued Attribute Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 14
  • 15. 4 A New Entity Set Composed of a Multivalued Attribute’Components s Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 15
  • 16. 4 Derived Attributes •Attribute whose value may be calculated (derived) from other attributes •Need not be physically stored within the database •Can be derived by using an algorithm Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 16
  • 17. 4 Depiction of a Derived Attribute Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 17
  • 18. 4 Relationships •Association between entities •Participants: –Entities that participate in a relationship •Relationships between entities always operate in both directions •Relationship can be classified as 1:M •Relationship classification is difficult to establish if you only know one side Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 18
  • 19. 4 Connectivity and Cardinality •Connectivity –Used to describe the relationship classification •Cardinality –Expresses the specific number of entity occurrences associated with one occurrence of the related entity •Established by very concise statements known as business rules Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 19
  • 20. 4 Connectivity and Cardinality in an ERD Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 20
  • 21. 4 RELATIONSHIP Strength •Existence dependence –Entity’existence depends on the existence of s one or more other entities •Existence independence –Entity can exist apart from one or more related entities •Weak (non-identifying) relationships –One entity is not existence-independent on another entity •Strong (Identifying) Relationships –Related entities are existence-dependent Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 21
  • 22. 4 A Weak (Non-Identifying) Relationship Between COURSE and CLASS Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 22
  • 23. 4 A Weak Relationship Between COURSE and CLASS Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 23
  • 24. 4 Relationship Participation •Optional: –One entity occurrence does not require a corresponding entity occurrence in a particular relationship •Mandatory: –One entity occurrence requires a corresponding entity occurrence in a particular relationship Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 24
  • 25. 4 A Strong (Identifying) Relationship Between COURSE and CLASS Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 25
  • 26. 4 An Optional CLASS Entity in the Relationship PROFESSOR teaches CLASS Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 26
  • 27. 4 COURSE and CLASS in a Mandatory Relationship Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 27
  • 28. 4 Relationship Strength and Weak Entities •Weak entity meets two conditions –Existence-dependent: •Cannot exist without entity with which it has a relationship –Has primary key that is partially or totally derived from the parent entity in the relationship •Database designer usually determines whether an entity can be described as weak based on the business rules Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 28
  • 29. 4 A Weak Entity in an ERD Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 29
  • 30. 4 A Weak Entity in a Strong Relationship Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 30
  • 31. 4 Relationship Degree •Indicates number of associated entities or participants •Unary relationship –Association is maintained within a single entity •Binary relationship –Two entities are associated •Ternary relationship –Three entities are associated Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 31
  • 32. 4 Three Types of Relationships Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 32
  • 33. 4 The Implementation of a Ternary Relationship Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 33
  • 34. 4 Recursive Relationships •Relationship can exist between occurrences of the same entity set •Naturally found within a unary relationship Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 34
  • 35. 4 An ER Representation of Recursive Relationships Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 35
  • 36. 4 The 1:1 Recursive Relationship “ EMPLOYEE is Married to EMPLOYEE” Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 36
  • 37. 4 Implementation of the M:N Recursive “PART Contains PART” Relationship Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 37
  • 38. 4 Implementation of the 1:M “ EMPLOYEE Manages EMPLOYEE” Recursive Relationship Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 38
  • 39. 4 Composite Entities •Also known as bridge entities •Composed of the primary keys of each of the entities to be connected •May also contain additional attributes that play no role in the connective process Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 39
  • 40. 4 Converting the M:N Relationship into Two 1:M Relationships Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 40
  • 41. 4 The M:N Relationship Between STUDENT and CLASS Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 41
  • 42. 4 A Composite Entity in an ERD Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 42
  • 43. 4 Entity Supertypes and Subtypes •Generalization hierarchy –Depicts a relationship between a higher-level supertype entity and a lower-level subtype entity •Supertype entity –Contains shared attributes •Subtype entity –Contains unique attributes Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 43
  • 44. 4 Nulls Created by Unique Attributes Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 44
  • 45. 4 A Generalization Hierarchy Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 45
  • 46. 4 Disjoint Subtypes •Also known as non-overlapping subtypes –Subtypes that contain a subset of the supertype entity set –Each entity instance (row) of the supertype can appear in only one of the disjoint subtypes •Supertype and its subtype(s) maintain a 1:1 relationship Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 46
  • 47. 4 The EMPLOYEE/PILOT Supertype/Subtype Relationship Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 47
  • 48. 4 A Generalization Hierarchy with Overlapping Subtypes Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 48
  • 49. 4 A Comparison of ER Modeling Symbols Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 49
  • 50. 4 The Chen Representation of the Invoicing Problem Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 50
  • 51. 4 The Crow’Foot Representation s of the Invoicing Problem Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 51
  • 52. 4 The Rein85 Representation of the Invoicing Problem Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 52
  • 53. 4 The IDEF1X Representation of the Invoicing Problem Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 53
  • 54. 4 Developing an ER Diagram •Database design is an iterative rather than a linear or sequential process •Iterative process –Based on repetition of processes and procedures Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 54
  • 55. 4 A Supertype/Subtype Relationship Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 55
  • 56. 4 A Supertype/Subtype Relationship in an ERD Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 56
  • 57. 4 Components of the ER Model Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 57
  • 58. 4 The Completed Tiny College ERD Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 58
  • 59. 4 The Challenge of Database Design: Conflicting Goals •Database design must conform to design standards •High processing speeds are often a top priority in database design •Quest for timely information might be the focus of database design Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 59
  • 60. 4 Various Implementations of a 1:1 Recursive Relationship Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 60
  • 61. 4 Summary •Entity relationship (ER) model –Uses ER diagrams to represent conceptual database as viewed by the end user –Three main components •Entities •Relationships •Attributes –Includes connectivity and cardinality notations •Connectivities and cardinalities are based on business rules Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 61
  • 62. 4 Summary (continued) •ER symbols are used to graphically depict the ER model’components and relationships s •ERDs may be based on many different ER models •Entities can also be classified as supertypes and subtypes within a generalization hierarchy •Database designers are often forced to make design compromises Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel 62