Database Reference
In-Depth Information
Unique identifier. The primary key identifies each tuple uniquely.
Atomic values. Each value of every attribute is atomic. That is, for a single tuple,
the value of each attribute must be single-valued. Multiple values or repeating
groups of attributes are not allowed for any attribute in a tuple.
Domain constraint. The value of each attribute must be an atomic value from a
certain domain.
Column homogeneity. Each column gets values from the same domain.
Order of columns. The sequence of the columns is insignificant. The sequence may
be changed without changing the meaning or use of the relation. The primary key
may be in any column, not necessarily in the first column. Columns may be stored
in any sequence and, therefore, must be addressed by column names and not by
column positions.
Order of rows. The sequence of the rows is insignificant. Rows may be reordered
or interchanged without any consequence. New rows may be inserted anywhere in
the relation. It does not matter whether rows are added at the beginning, middle,
or end of a relation.
Entity Integrity
Consider the relation EMPLOYEE. The rows in the relation represent individual
employees in an organization. The rows represent real-world entities. Each row rep-
resents a specific employee. Similarly, a row in the relation CUSTOMER stands for
a particular customer. In other words, each tuple or row in a relation must be
uniquely identified because each tuple represents a single and distinct entity. The
entity integrity rule in the relational data model establishes this principle for an
entity.
But, how is a specific row or tuple in a relation uniquely identified? As you know,
the primary key serves this function. The primary key value of each tuple or row
uniquely identifies that row. Therefore, the entity integrity rule is a rule about
the primary key that is meant to identify rows uniquely. The rule applies to single
relations.
Entity identity rule: No part of the primary key of any tuple in a relation can have a
null value.
Figure 8-7 presents three relations, EMPLOYEE, PROJECT, and ASSIGN-
MENT. The relations EMPLOYEE and PROJECT have primary keys with single
attributes; two attributes make up the primary key for the ASSIGNMENT relation.
The figure explains how violation of the entity identify rule affects the integrity of
the data model.
Note the null values present in a few rows; because of these rows the entity
integrity rule is violated in the relation. If two or more rows have null values as
primary key values, how can you distinguish between these rows? Which row
Search WWH ::




Custom Search