NOTES LINK: https://drive.google.com/file/d/1uKon...
Entities and Their Attributes. The basic concept that the ER model represents is
an entity, which is a thing or object in the real world with an independent existence.
An entity may be an object with a physical existence (for example, a particular person,
car, house, or employee) or it may be an object with a conceptual existence (for
instance, a company, a job, or a university course).Composite versus Simple (Atomic) Attributes. Composite attributes can be
divided into smaller subparts, which represent more basic attributes with independent
meanings. For example, the Address attribute of the EMPLOYEE entity shown
in Figure 3.3 can be subdivided into Street_address, City, State, and Zip,3 with the
values ‘2311 Kirby’, ‘Houston’, ‘Texas’, and ‘77001’. Attributes that are not divisible
are called simple or atomic attributesSingle-Valued versus Multivalued Attributes. Most attributes have a single
value for a particular entity; such attributes are called single-valued. For example,
Age is a single-valued attribute of a person. In some cases an attribute can have a
set of values for the same entity—for instance, a Colors attribute for a car, or a
College_degrees attribute for a person. Cars with one color have a single value,
whereas two-tone cars have two color values.Stored versus Derived Attributes. In some cases, two (or more) attribute values
are related—for example, the Age and Birth_date attributes of a person. For a
particular person entity, the value of Age can be determined from the current
(today’s) date and the value of that person’s Birth_date. The Age attribute is hence
called a derived attribute and is said to be derivable from the Birth_date attribute,
which is called a stored attribute. Some attribute values can be derived from related
entities; for example, an attribute Number_of_employees of a DEPARTMENT entity
can be derived by counting the number of employees related to (working for) that
department.NULL Values. In some cases, a particular entity may not have components of a composite attribute between parentheses ( ) and separating
the components with commas, and by displaying multivalued attributes between
braces { }. Such attributes are called complex attributes. For example, if a person
can have more than one residence and each residence can have a single address and
multiple phones, an attribute Address_phone for a person can be specified as shown
in Figure 3.5.4 Both Phone and Address are themselves composite attributesan applicable value
for an attribute. For example, the Apartment_number attribute of an address applies
only to addresses that are in apartment buildings and not to other types of residences,
such as single-family homes. Similarly, a College_degrees attribute applies
only to people with college degrees. For such situations, a special value called NULL
is created. An address of a single-family home would have NULL for its
Apartment_number attribute, and a person with no college degree would have
NULL for College_degrees. NULL can also be used if we do not know the value of an
attribute for a particular entity—for example, if we do not know the home phone
number of ‘John Smith’ in Figure 3.3. The meaning of the former type of NULL is
not applicable, whereas the meaning of the latter is unknown. The unknown category
of NULL can be further classified into two cases. The first case arises when it is known
that the attribute value exists but is missing—for instance, if the Height attribute of a
person is listed as NULL. The second case arises when it is not known whether the
attribute value exists—for example, if the Home_phone attribute of a person is NULL.
Complex Attributes. Notice that, in general, composite and multivalued attributes
can be nested arbitrarily. We can represent arbitrary nesting by grouping