Fundamental Database Module 2 Chapter 3 Part 1
Fundamental Database Module 2 Chapter 3 Part 1
INTRODUCTION:
Most of the basic concepts and definitions used in the entity relationship
model (ERM) were introduced in Chapter 2, Data Models. For example, the basic
components of entities and relationships and their representation should now be
familiar to you. This chapter goes much deeper and further, analyzing the graphic
depiction of relationships among the entities and showing how those depictions help
you summarize the wealth of data required to implement a successful design.
LEARNING OBJECTIVES:
We have learned in chapter 2 on Data Models that ERM forms the basis of an
ERD.
3.1.1 ENTITIES
Entity - is an object of interest to the end user. It can be a person, place, object,
event, or concept in the user environment about which the organization wishes to
maintain data.
- It refers to the entity set and not to a single entity occurrence. In other words,
the word entity in the ERM corresponds to a table—not to a row—in the
relational environment.
In ERM, a table row refers to an entity instance or entity occurrence.
In both the Chen and Crow’s Foot notations, an entity is represented by a
rectangle containing the entity’s name.
The entity name, a noun, is usually written in all capital letters.
Since the name represents a collection (or set) of items, it is always singular.
Use capital letters for the name of the entity.
Examples:
• Identifying owner - is the entity type on which the weak entity type depends.
• Identifying relationship - the relationship between weak entity type and its
owner.
• The relationship between the weak entity type and its owner is identified by
the double lined diamond symbol. See Example in Figure 3.1
Figure 3.1
3.1.2 ATTRIBUTES
For example: The STUDENT entity includes, among many others, the attributes
STU_LNAME, STU_FNAME, and STU_INITIAL.
In the original Chen notation, 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’s Foot notation, the attributes are written in the attribute box
below the entity rectangle. (See Figure 3.2.) Because the Chen representation
is rather space-consuming, software vendors have adopted the Crow’s Foot
attribute display.
Figure 3.2 The attributes of the STUDENT entity: Chen and Crow’s Foot
Required attribute - is an attribute that must have a value for each entity
instance. As shown in Figure 1.1, there are two boldfaced attributes in
the Crow’s Foot notation. This indicates that a data entry will be
required.
Domain
For example, the PROFESSOR and STUDENT entities may each have an
attribute named ADDRESS and could therefore share a domain.
The ERM uses identifiers to uniquely identify each entity instance. In the
relational model, such identifiers are mapped to primary keys in tables.
For instance, the CLASS entity can use a composite primary key composed
of the combination of CRS_CODE and CLASS_SECTION instead of using
CLASS_CODE.
If the CLASS_CODE is used as the primary key, the shorthand form is:
Example: The attribute ADDRESS can be subdivided into street, city, state,
and zip code. Similarly, the attribute PHONE_NUMBER can be subdivided into area
code and exchange number.
Example: A person may have several college degrees, and a household may
have several different phones, each with its own number.
In the Chen ERM, the multivalued attributes are shown by a double line
connecting the attribute to the entity. The Crow’s Foot notation does not
identify multivalued attributes.
The ERD in Figure 3.4 contains all of the components. In Figure 3.4, note that
CAR_VIN is the primary key, and CAR_COLOR is a multivalued attribute of
the CAR entity.
Derived Attributes
Figure 3.5
REFERENCES: