0% found this document useful (0 votes)
41 views20 pages

Database Systems: Types of Attributes, Entity Types, Entity Sets, Keys, and Value Sets

The document discusses various concepts related to entity relationship modeling including: 1) Types of attributes such as composite, simple, single-valued, multivalued, stored, and derived. 2) Entity types which define a collection of entities that share the same attributes. 3) Entity sets which represent the collection of all entities of a particular entity type. 4) Key attributes which uniquely identify each entity in an entity set.

Uploaded by

Haider Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views20 pages

Database Systems: Types of Attributes, Entity Types, Entity Sets, Keys, and Value Sets

The document discusses various concepts related to entity relationship modeling including: 1) Types of attributes such as composite, simple, single-valued, multivalued, stored, and derived. 2) Entity types which define a collection of entities that share the same attributes. 3) Entity sets which represent the collection of all entities of a particular entity type. 4) Key attributes which uniquely identify each entity in an entity set.

Uploaded by

Haider Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

1

Database Systems
Lecture 9

Types of Attributes, Entity Database Management Systems


Types, Entity Sets, Keys, and
Value Sets
2

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

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 can be subdivided into
StreetAddress, City, State, and Zip,

• Attributes that are not divisible are called


simple or atomic attributes.
5

Database Management
Systems

A hierarchy of composite attributes


6

Database Management
Systems

Single-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 example, a Colors attribute for a
car, or a CollegeDegrees attribute for a person.
• Such attributes are called multivalued.
• Multivalued attributes may have lower and upper
bounds to constrain the no-of values allowed for each
individual entity.
7

Database Management
Systems

Stored versus Derived Attributes


• In some cases, two (or more) attribute values are
related-for example, the Age and BirthDate attributes
of a person.
• The Age attribute is hence called a derived attribute
and is said to be derivable from the BirthDate attribute,
which is called a stored attribute.
• Some attribute values can be derived from the related
entities such as no-of employees of a department entity
can be derived by counting no-of employees related to
that department.
8

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

A complex attribute: AddressPhone.


12

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

• Entity set is usually referred to using the same


name as the entity type.

▫ For example, all employees of an organization form


an entity set. Like all students, all courses, all of them
form entity set of different entity types
14

Database Management
Systems

Two entity types, EMPLOYEE and COMPANY,


and some member entities of each
The collection of entities of a particular entity type are grouped into an
entity set, which is also called the extension of the entity type.
15

Database Management
Systems

Key Attributes of an Entity Type


• An important constraint on the entities of an
entity type is the key or uniqueness constraint on
attributes.
• An entity type usually has an attribute whose
values are distinct for each individual entity in
the entity set.
• Such an attribute is called a key attribute, and its
values can be used to identify each entity
uniquely
16

Database Management
Systems
17

Database Management
Systems

A key attribute may be composite. For example, VehicleTagNumber is a key


of the CAR entity type with components (Number, State).
18

Database Management
Systems

Value Sets (Domains) of Attributes


• Each simple attribute of an entity type is associated with
a value set (or domain of values),
• This specifies the set of values that may be assigned to
that attribute for each individual entity.
• Value sets are typically specified using the basic data
types such as integer, float, string, etc.,
• For example, if the range of ages allowed for employees
is between 16 and 70, we can specify the value set of the
Age attribute of employee to be set of integer numbers
between 16 and 70.
• Value sets are not displayed in the ER diagram.
19

Database Management
Systems

Weak Entity and Strong Entity


• Weak entity is an entity type whose instances
cannot exist without being linked with instances
of some other entity type, i.e., they cannot exist
independently.
• An entity type whose instances can exist
independently, that is, without being linked to
the instances of any other entity type is called
strong entity type.
20

Database Management
Systems

Preliminary design of entity types for the


COMPANY database

You might also like