ITS232 Introduction To Database Management Systems

Slides:



Advertisements
Similar presentations
Chapter # 4 BIS Database Systems
Advertisements

Entity Relationship Diagrams
Entity Relationship (E-R) Modeling
ITS232 Introduction To Database Management Systems
Entity Relationship (E-R) Modeling Hachim Haddouti
Entity Relationship (ER) Modeling
Chapter 4 Entity Relationship (E-R) Modeling
Entity Relationship (ER) Modeling
Concepts of Database Management Seventh Edition Chapter 6 Database Design : ERD Model.
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
Entity Relationship (ER) Modeling
Entity Relationship (E-R) Modeling
Entity Relationship Diagrams
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 1 Data Models: Degrees of Data Abstraction l Modified ANSI/SPARC Framework.
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter 4 Entity Relationship (E-R) Modeling
CSCI 242 Relational Data Modeling Copyright 2011, David C. Roberts, all rights reserved.
Modern Systems Analysis and Design Third Edition
BTM 382 Database Management Chapter 4: Entity Relationship (ER) Modeling Chitu Okoli Associate Professor in Business Technology Management John Molson.
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.
Yong Choi School of Business CSUB
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.
3 Chapter 3 Entity Relationship (E-R) Modeling Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
Computer System Analysis Chapter 10 Structuring System Requirements: Conceptual Data Modeling Dr. Sana’a Wafa Al-Sayegh 1 st quadmaster University of Palestine.
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Chapter 7 Data Modeling with Entity Relationship Diagrams Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
ITEC 3220M Using and Designing Database Systems Instructor: Prof. Z.Yang Course Website: 3220m.htm
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
1 ER Modeling BUAD/American University 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 (ER) Modeling.  ER model forms the basis of an ER diagram  ERD represents conceptual database as viewed by end user 
Database Design – Lecture 5 Conceptual Data Modeling – adding attributes.
DeSiamorePowered by DeSiaMore1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
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.
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.
3 & 4 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Keys Consists of one or more attributes that determine other.
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
Data Modeling Yong Choi School of Business CSUB. Part # 2 2 Study Objectives Understand concepts of data modeling and its purpose Learn how relationships.
1 Database Systems Entity Relationship (E-R) Modeling.
The Entity-Relationship Model, P. I R. Nakatsu. Data Modeling A data model is the relatively simple representation, usually graphic, of the structure.
ITS232 Introduction To Database Management Systems Siti Nurbaya Ismail Faculty of Computer Science & Mathematics, Universiti Teknologi MARA (UiTM), Kedah.
Chapter 8 Entity-Relationship Modeling Pearson Education © 2009.
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.
Entity Relationship Modeling
TMC2034 Database Concept and Design
Entity Relationship (E-R) Modeling
Entity Relationship (E-R) Modeling
Tables and Their Characteristics
Database Design – Lecture 4
Siti Nurbaya Ismail Senior Lecturer
Entity Relationship Diagrams
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Review of Week 1 Database DBMS File systems vs. database systems
Chapter 4 Entity Relationship (ER) Modeling
Entity Relationship (ER) Modeling
Chapter # 4 Entity Relationship (ER) Modeling.
Lecture 10 Structuring System Requirements: Conceptual Data Modeling
Presentation transcript:

ITS232 Introduction To Database Management Systems CHAPTER 4 Entity Relationship (E-R) Modeling (ERD) Siti Nurbaya Ismail Faculty of Computer Science & Mathematics, Universiti Teknologi MARA (UiTM), Kedah | sitinurbaya@kedah.uitm.edu.my | http://www.sitinur151.wordpress.com | | A2-3039 | ext:2561 | 012-7760562 |

Chapter 4: Entity Relationship (E-R) Modeling 4.0 Entity Relationship (E-R) Modeling 4.1 The Entity Relationship (ER) Model 4.2 Developing An E-R Diagram 4.3 Database Design Challenges

Chapter 4: Entity Relationship (E-R) Modeling Basic Modeling Concept A model is description or analogy used to visualize something that cannot be directly observed.

Chapter 4: Entity Relationship (E-R) Modeling Basic Modeling Concept Relatively simple representations of complex real world data structures A data model represents: data structures and their characteristics relation and constraints Can be physical or abstract: car, student = physical subject, register = abstract Used by database designer as: communications tools to communicate and understanding between a client and the database designer, which the database to be develop.

Chapter 4: Entity Relationship (E-R) Modeling Basic Modeling Concept The importance of data modeling: Data constitute the most basic information units employed by a system Application is created to manage data and to transform data to information View different people views the same data differently based on their understanding Model helps different user to have the holistic view of the same data

Chapter 4: Entity Relationship (E-R) Modeling Basic Modeling Concept Three Level ANSI-SPARC Architecture View 1 View 2 View n Conceptual Schema Internal Schema Database User n User 2 User 1 … -user’s view External Model 1. External level Conceptual Model -designer’s view -h/w independent -s/w independent ERD 2. Conceptual level -DBMS’s view -h/w independent -s/w dependent Internal Model 3. Internal level -h/w dependent -s/w dependent Physical Model Physical data organization

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.1 The Entity Relationship (E-R) Model Based on the set theory and the relational theory, it is used as tools to: translate different views of data among managers, users and programmers to fit into a common work define data processing and constraints to help meet the different views help implement the database considered as a stage in a database design preceding/before the relational database modeling gives data structures representation of: what information to be stored the relationships between informational elements and constraint on the data structure relationship

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.1 The Entity Relationship (E-R) Model ER model forms the basis of an ER diagram (ERD) ERD represents conceptual database as viewed by end user ERDs depict/shows database’s main components: Entities Attributes Relationships

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.1 The Entity Relationship (E-R) Model: Entity Entity Represents an object from the real world Collection of similar entities that made up entity sets Refers to entity set and not to single entity occurrence Corresponds to table and not to row in relational environment In both Chen and Crow’s Foot models, entity is represented by rectangle containing entity’s name Entity name, a noun, is usually written in capital letters

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.1 The Entity Relationship (E-R) Model: Attribute Attribute Characteristics of entities Property that explains about entity Correspondents to fields of a table Primary key are underline with a straight line Foreign key are underline with dotted line or an * Chen Model attributes are represented by ovals and are connected to entity rectangle with a line each oval contains the name of attribute it represents Crow’s Foot Model attributes are written in attribute box below entity rectangle

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.1 The Entity Relationship (E-R) Model The Attributes of the STUDENT entity: Chen & Crow’s Foot

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.1 The Entity Relationship (E-R) Model: Relationship Relationship Associates between entities/connection between two or more entities Logical interaction among the entities in a relational database Operate in both directions Chen Model Crow’s Foot Model

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram Development of ER model is an Iterative Process that involved: Step1: General narrative of organizational operations developed Step2: Basic E-R Model graphically depicted and reviewed Step3: Modifications made to incorporate newly discovered ER components Repeat process: Until designers and users agree on complete E-R Diagram

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Model Components ENTITY Variations of entity: Weak Recursive Composite Supertype/Subtype ATTRIBUTE Types of attribute: Simple attributes Composite attributes Multivalued attributes Derived attributes RELATIONSHIP Relationship can be describes by: Degree of the relationship Connectivity of the relationship Cardinality of the relationship Participation

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Entity Entity Corresponds to table and not to row in relational environment Represented by rectangle containing entity’s name Entity name, a noun, is usually written in capital letters Examlpe: Entity STUDENT with attributes

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Entity Variations of Entity: Weak Entity Recursive Entity Composite Entity Entity Supertype and Subtype

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Entity Variations of Entity: Weak Entity Existence-dependent Entity B depends on Entity A to exist. If A does not exist then B cannot exist too Primary key partially or totally derived from parent entity in relationship Database designer determines whether an entity is weak based on business rules

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Entity

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Entity

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Entity Variations of Entity: Recursive Entity Entity set that have relationship with the same entity set Example: EMPLOYEE entity EMPLOYEE employeeNO employeeNAME manage 1 employeeMANAGER EMPLOYEE employeeNO employeeNAME married 1 employeeSPOUSE employeeNO employeeNAME employeeSPOUSE 111 Ali 444 222 Ah Chong 333 Bazil Sheriz employeeNO employeeNAME employeeMANAGER 111 Ali 333 222 Ah Chong Bazil 444 Sheriz

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Entity Variations of Entity: Composite Entity Originally a relationship between 2 entities that involved in M:N relationship Composite entity takes its primary key from both entities that it bridges Example: enroll STUDENT studentID studentNAME enroll M grade COURSE courseID courseNAME N STUDENT STUDENT_COURSE / ENROLL COURSE studentID studentNAME 200922222 200933333 200944444 200955555 studentID courseID grade 200922222 ITS232 A+ CSC318 B+ 200933333 CSC203 B 200955555 A- courseID courseNAME ITS232 Database CSC318 IP CSC203 OS

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Entity Variations of Entity: Entity Supertype & Subtype Parent-Child relationship Supertypecontains the shared attributes an entity type that include distinct subclasses that required to be presented in data model parent Subtype contains the unique attributes an entity type that has a distinct role and also a member of supertype child

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Entity Variations of Entity: Entity Supertype & Subtype Example: Superype (EMPLOYEE) Subtype (Engineer & Full-Time)

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Entity Variations of Entity: Entity Supertype & Subtype Have two types of relationship: Disjoint Overlapping Unique subtype Non-overlapping: subtypes can be one of the types Overlapping: Subtypes can be either one or both of the subtypes Indicate with: G Gs

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Entity Variations of Entity: Entity Supertype & Subtype Example: Disjoint & Overlap Overlap Disjoint G Gs

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Entity Variations of Entity: Entity Supertype & Subtype Example: Disjoint

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Entity Variations of Entity: Entity Supertype & Subtype Example: Disjoint & Overlap

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Attributes Attributes Represented by ovals that are connected to entity with a line Oval contains of attribute (field) it represents PK are underlined with straight line FK are underlined with doted line or * Example: Entity STUDENT with attributes name, course, studentID, address, email STUDENT studentID name course email address

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Attributes Attributes types: Simple Attributes Composite Attributes Multivalued Attributes Derived Attributes

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Attributes Attributes types: Simple Attributes An attribute composed of single component with an independent existence Cannot be subdivided into smaller components Example: gender, martial statues STUDENT studentID phoneNO age gender name address addressTOWN addressPOSTCODE addressNO Simple Attributes

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Attributes Attributes types: Composite Attributes An attribute composed of multiple components, each with an independent existence Can be further subdivide to additional attributes Example: name  first, middle, last address street, city, state, zip Composite Attributes STUDENT studentID phoneNO age gender name address addressTOWN addressPOSTCODE addressNO

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Attributes Attributes types: Multivalued Attributes attribute that holds multiple values for each occurrence of an entity type Should not be implemented multivalued attributes in relational database Can simplifies multivalued attributes by: Create several attributes Create new entity of the original multivalued attributes components Example: phone number handset,office,home qualification diploma,degree,master

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Attributes Attributes types: Multivalued Attributes Contact hobbies contactid firstname lastname hobbies 1639 George Barnes reading 5629 Susan Noble hiking, movies 3388 Erwin Star hockey, skiing 5772 Alice Buck 1911 Frank Borders photography, travel, art 4848 Hanna Diedrich cooking, movies

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Attributes Attributes types: Multivalued Attributes Contact hobbies studentid gender age address contactnum 1639 M 18 Klang 0123456734, 0333721341 5629 Temerloh 0199871234, 094602721, 094602721 3388 19 Jerantut 0199112344, 094601234 5772 F Hulu Klang 0193448900, 0355446712 1911 Besut 0199556301, 4848 Machang 0144543331, 095723992

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Attributes Attributes types: Multivalued Attributes Can simplifies multivalued attributes by: Create several attributes Create new entity of the original multivalued attributes components STUDENT age gender address handsetNO homephoneNO studentID gender STUDENT studentID handsetNO age address CONTACT has homephoneNO studentID*

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Attributes Attributes types: Derived Attributes An attributes that represents a value that is derived from the value of related attribute or set of attributes, not necessarily in the same entity type. Need not be physically stored within database Example: age

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Attributes

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Relationship Relationship Associations /connection between entities Logical interaction among the entities in a relational database Operates in both directions Naming Relationships: Relationship name is a verb phrase Avoid vague names Defining Relationships: Definition explains what action is being taken and why it is important Give examples to clarify the action Optional participation should be explained Explain reasons for any explicit maximum cardinality Explain any restrictions on participation in the relationship Explain extent of the history that is kept in the relationship Explain whether an entity instance involved in a relationship instance can transfer participation to another relationship instance

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Relationship Relationship is described by: Degree of the relationship Connectivity of the relationship Cardinality of the relationship Participation

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Relationship Relationship is described by: Degree of the relationship Indicates number of associated entities within the relationship There are three types: Unary Relationship Association is maintained within single entity Binary Relationship Two entities are associated (1:1, 1:M, M:N) c. Ternary Relationship Three entities are associated

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Relationship

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Relationship PK FK EID Name Super_EID 111 Ikhsan 222 Eizan 333 Nawal 444 Fairuz A PK FK Unary Relationship Type R, we identify the relation A represents the entity type involves in this relationship. Include in this relation one more time as foreign key the primary of itself. The two keys (primary key and foreign key) are the same but they represents two entities of different roles relate to this relationship.

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Relationship 1-1 Binary Relationship Type R, identify relation A and B that correspond to the entity types participating in R. The relationship itself can be mapped using one of the following approaches: Using foreign key: This is the most popular approach. Choose one of the participating relation, say A (usually one with total participation) ; include in A as the foreign key the primary key of B. If R has attributes then put them in the relation A as well. Merged relation: If both participations of two related entity type are total then we can merge two entity types and the relationship into a relation. Defining relationship relation: Define a relation R to represent the relationship. All attributes of relationship is included in R. In addition, put the primary keys of two relations A , B into R. The primary keys of R is combination of primary keys of A and B. A B A B R

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Relationship A B 1-N Binary Relationship Type: For each 1-N Binary Relationship Type R, identify two relations A and B correspond to two entity types participating in R. A represents the entity type at 1-side and B represents the entity type at N-side. Include the primary key of A as the foreign key in B. This foreign key represent the relationship type R.

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Relationship A B S M-N Binary Relationship Type: For each M-N Binary Relationship Type R, identify two relation A, B represent two entity type participating in R. Create a new relation S to represent R. Include in S as foreign keys the primary keys of A and B and all the simple attributes of R. The combination of primary keys of A and B will make the primary key of S.

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Relationship Ternary Relationship Type: For each n-ary ( > 2 ) Relationships create a new relation to represent the relationship. The primary key of the new relation is the combination of the primary keys of the participating entities that hold the N (many) side. In most cases of an n-ary relationship all the participating entities hold a many side

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Relationship Relationship is described by: Connectivity of the relationship Logical interaction among entities in a relational database There are three types: 1:1 1:M M:N UiTMBRANCH have RECTOR 1 1 STUDENT under PROGRAM 1 M 1 M register N STUDENT COURSE

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Relationship Relationship is described by: Cardinality of the relationship Express the specific (minimum and maximum) number of entity occurrences associated with one occurrence of the related entity Function of organizational policy  business rules

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Relationship Relationship is described by: Cardinality of the relationship Example 1: One student can register 1 to 9 courses One course maximum can have 35 student (1,9) (0,35) STUDENT register COURSE N M

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Relationship Relationship is described by: Cardinality of the relationship Example 2: One lecturer can teaches maximum 3 courses One course can be thought by 1 lecturer only (0,3) (1,1) LECTURER teach COURSE M 1

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Relationship Relationship is described by: Cardinality of the relationship Example 3:

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Relationship Relationship is described by: Cardinality of the relationship Relationship Strength  Existence Dependence Existence dependence Entity exists in database only when it is associated with another related entity occurrence Existence independence Entity can exist apart from one or more related entities Sometimes such an entity is referred to as a strong or regular entity

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Relationship Relationship is described by: Cardinality of the relationship From Existence Dependence, exist two relationship strength: Weak Relationship Entity not existence-independent on other entity PK of related entity doesn’t contain PK component of parent entity Non-Identifying Relationship Strong Relationship Existence dependence PK of related entity contains PK component of parent entity Identifying Relationship

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Relationship Database Systems, 9h Edition

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Relationship

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Relationship Relationship is described by: Participation Determines whether all or some entity occurrences participates in a relationship There are two types: Optional (Partial) One entity occurrence does not require corresponding entity occurrence in particular relationship Mandatory (Total) One entity occurrence requires corresponding entity occurrence in particular relationship

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Chen Model: Relationship Relationship is described by: Participation Example 1: One lecturer can teaches maximum 3 courses One course can be thought by 1 lecturer only connectivity (0,3) (1,1) LECTURER teach COURSE M 1 One course can be thought by one lecturer only ‘not all lecturer teaches course’ optional participation for course One lecturer can teaches maximum 3 courses cardinality ‘all courses are taught’ (mandatory participation for lecturer) participation

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Comparison of E-R Model Alternate style developed to enable easier use of CASE tools. Chen Model The Chen notation favors conceptual modeling Crow’s Foot Model Crow’s Foot notation favors a more implementation-oriented approach UML Model UML notation can be used for both conceptual and implementation modeling

Comparison of E-R Modeling Symbols Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Comparison of E-R Model Comparison of E-R Modeling Symbols Cardinality & Participation Chen Model Crow’s Foot Model Entity Weak Entity Composite Entity Relationship line Relationship Option Symbol One (1) Symbol Many (M) Symbol 1 M

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Comparison of E-R Model Chen Model

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.2 Developing An E-R Diagram: Comparison of E-R Model Crow’s Foot Model

Chapter 4: Entity Relationship (E-R) Modeling 4 Chapter 4: Entity Relationship (E-R) Modeling 4.3 Database Design Challenges Conflicting Goals Database designers often must make design compromises that are trigged by conflicting goals, such as comply with the design standards, processing speed and information requirements. In order to do so, it is very important to have the entities, attributes, and relationships clearly identified and well-defined there is a need in balancing between the customer needs and a design that meets logical requirements and conventions The more thinking and modeling is done the less money and time are needed later on for rework Additional concerns are security, performance, shared access and integrity