Entity Relationship Diagram
Entity Relationship Diagram
Submitted to:
JULIUS SARENO
Submitted by:
Conceptual Existence
Viewing Sale
Inspection Work Experience
Instructor Student
Relationship name
Binary is a relationship of degree two. As shown in the figure 2.1.1. below, the
entity type Person has a relationship to the books, which is the loan, a person can loan
zero or more books, but it depends upon the limit of the system.
Drug
Figure 2.1.2. Ternary degree of relationship between the entity types, Doctor,
Patient and Drug
Recursive relationship (unary) is a relationship type where the same entity type
participates more than once in different roles.
Subject
Is
prerequisite
for
3. Attributes
Attributes are the properties of a particular entity types. It holds the values that
describe the entity and represent the main part of the data stored in the database. A
relationship type that associates entities can also have attributes similar to those of an
entity type. Attributes can be classified as simple or composite; single-valued or multi-
valued; or derived. Oval shape is used when interpreting attributes in graphical form.
Customer ID Places
Customer StreetNo
City
Figure 3. 1. A segment of an ERD depicting the Customer entity type with attributes.
Simple attribute is an attribute composed of a single component with an
independent existence. These attributes cannot be further subdivided into smaller
components and it sometimes called atomic attributes. For example, LastName is a
single-valued attribute of a student and cannot be further subdivided. In figure 3.1,
CustomerName is a simple attribute.
Composite attribute is defined as an attribute that composed of multiple
components, each with an independent existence. These attributes can be further divided
to yield smaller components with an independent existence of their own.
For example, an address attribute can be subdivided into the following attributes:
address
street
barangay
city
province
Therefore, the values of the composite attribute is the concatenation of the values
of its subdivided simple attributes.
Age Person
DateOfBirth
Figure 3. 2. The stored attributes and derived attributes of the Person entity type.
4. Key
Key is an attribute that determines the values of other attributes within the entity.
A key might consist of more than one attribute. Superkey is any key that identifies each
entity uniquely.
Candidate key is the minimal set of attributes that uniquely identifies each
occurrence of an entity types. It also descried as a superkey without redundancies.
Primary key is the candidate key that is selected to uniquely identify each
occurrence of an entity types. It cannot contain null entries.
Composite key is a candidate key that consist of two or more attributes.
A strong entity type is not existence-dependent on some other entity type while
a weak entity type is existence-dependent on some other entity type.
5. Cardinality and Participation Constraints
Cardinality describes the maximum number of possible relationship occurrences
for an entity participating in a given relationship type. Minimum cardinality of a
relationship is the minimum number of instances of entity B that may be associated with
each instance of entity A while maximum cardinality of a relationship is the maximum
number of instances of entity B that may be associated with each instance of entity A.
Crows Foot Notation is used for depicting the cardinality and participation constraints.
1 M
MOVIE Is Stocked
As
DVD
PATIENT 1 M
Has PATIENT
Recorded
HISTORY
EMPLOYEE Is Assigned
To PROJECT