Professional Documents
Culture Documents
Peter Chen introduced the E-R model in 1976 Has many variations
Lecture 2 - ERD
10.3
3 4
Entity
A person, place, object, event or concept in the user environment about which the organization wishes to maintain data Represented by a rectangle in E-R diagrams Naming Conventions should follow an established standard E.g. capitalize the names of entities
Entity
Attribute
also termed as Properties they are characteristics of an entity Can be included as named bubbles attached to the entity multi-valued attributes are often shown in a diagram by the use of a double circle multi-valued attributes may have multiple values
Attribute
Multi-valued Attributes
During database modeling, it is often desirable to decompose this situation into two separate entities since a multi-valued attribute often results when we capture only a single data attribute of what would otherwise be modeled as an entity.
10
Multi-valued Attributes
Relationship
An association between the instances of one or more entity types that is of interest to the organization Association indicates that an event has occurred or that there is a natural link between entity types Relationships are always labeled with verb phrases
11
12
14
Degree of Relationship
Degree Number of entity types that participate in a relationship Three cases Unary A relationship between two instances of one entity type Binary A relationship between the instances of two entity types Ternary A simultaneous relationship among the instances of three entity types Not the same as three binary relationships
15
16
Binary Relationship
1
Chen Model
1 to represent one. M to represent many
M
Crows Foot
One many Mandatory one , means (1,1)
One or many
17
18
Unary Relationships
Ternary Relationships
19
20
Cardinality
Weak Entity
an occurrence of one entity cannot exist unless
Maximum cardinality
expresses the number of occurrences of one entity related to another entity. E,g, 1:1, 1:M, M:N
box.
Minimum cardinality
expresses the number of occurrences of one entity related to another entity. expresses how many occurrences of one entity must, at a minimum, be associated with occurrences of another entity
21 22
Examples
Examples cont
23
24
We need to create a database schema design based on the following (simplified) requirements of the COMPANY Database: The company is organized into DEPARTMENTs. Each department has a name, number and an employee who manages the department. We keep track of the start date of the department manager. A department may have several locations. Each department controls a number of PROJECTs. Each project has a unique name, unique number and is located at a single location.
25
Slide 3- 27
28
Chasm Trap
A model suggests the existence of a relationship between entities, but the pathway does not exist between certain entity occurrences. It occurs where there is a relationship with partial participation, which forms part of the pathway between entities that are related.
29
30
31
32
33
34
35
36
39