Database Systems: Types of Attributes, Entity Types, Entity Sets, Keys, and Value Sets
Database Systems: Types of Attributes, Entity Types, Entity Sets, Keys, and Value Sets
Database Systems
Lecture 9
Database Management
Systems
Today’s agenda
• Types of Attributes
• Entity types
• Entity sets
• Key attributes
3
Database Management
Systems
Types of Attributes
• Several types of attributes occur in the ER
model:
▫ simple versus composite
▫ single-valued versus multivalued
▫ stored versus derived.
4
Database Management
Systems
Database Management
Systems
Database Management
Systems
Database Management
Systems
Database Management
Systems
Null Values
• In some cases a particular entity may not have an
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. Other
example is college_degrees
• For such situations, a special value called null is
created.
• Null can also be used if we do not know the value of an
attribute for a particular entity such as phone # of a
person
9
Database Management
Systems
Unknown Values
• 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 example, 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
HomePhone attribute of a person is null.
10
Database Management
Systems
Complex Attributes
• Composite and multivalued attributes can be
nested in an arbitrary way.
• We can represent arbitrary nesting by grouping
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.
11
Database Management
Systems
Database Management
Systems
Entity Types
• Entities with the same basic attributes are
grouped or typed into an entity type. For
example, the EMPLOYEE entity type or the
PROJECT entity type.
• An entity type defines a collection (or set) of
entities that have the same attributes.
• Each entity type in the database is described by
its name and attributes.
13
Database Management
Systems
Entity Sets
• The collection of all entities of a particular entity
type in the database at any point in time is called an
entity set
Database Management
Systems
Database Management
Systems
Database Management
Systems
17
Database Management
Systems
Database Management
Systems
Database Management
Systems
Database Management
Systems