Ch03 The Relational Database Model
1
Chapter 3
The Relational Database Model
Answers to Review Questions
1. What is the difference between a database and a table?
A table, a logical structure that represents an entity set, is only one of the components of a database.
The database is a structure that houses one or more tables and metadata. The metadata are data about data.
Metadata include the data (attribute) characteristics and the relationships between the entity sets.
2. What does it mean to say that a database displays both entity integrity and referential integrity?
Entity integrity describes a condition in which all tuples within a table are uniquely identified by their primary
key. The unique value requirement prohibits a null primary key value, because nulls are not unique.
Referential integrity describes a condition in which a foreign key value has a match in the corresponding table
or in which the foreign key value is null. The null foreign key “value” makes it possible not to have a
corresponding value, but the matching requirement on values that are not null makes it impossible to have an
invalid value.
3. Why are entity integrity and referential integrity important in a database?
Entity integrity and referential integrity are important because they are the basis for expressing and
implementing relationships in the entity relationship model. Entity integrity ensures that each row is uniquely
identified by the primary key. Therefore, entity integrity means that a proper search for an existing tuple (row)
will always be successful. (And the failure to find a match on a row search will always mean that the row for
which the search is conducted does not exist in that table.) Referential integrity means that, if the foreign key
contains a value, that value refers to an existing valid tuple (row) in another relation. Therefore, referential
integrity ensures that it will be impossible to assign a non-existing foreign key value to a table.
4. What are the requirements that two relations must satisfy in order to be considered union-
compatible?
In order for two relations to be union-compatible, both must have the same number of attributes (columns) and
corresponding attributes (columns) must have the same domain. The first requirement is easily identified be
a cursory glance at the relations' structures. If the first relation has 3 attributes then the second relation must
also have 3 attributes. If the first table has 10 attributes, then the second relation must also have 10 attributes.
The second requirement is more difficult to assess and requires understanding the meanings of the attributes
in the business environment. Recall that an attribute's domain is the set of allowable values for that attribute.
To satisfy the second requirement for union-compatibility, the first attribute of the first relation must have the
same domain as the first attribute of the second relation. The second attribute of the first relation must have
the same domain as the second attribute of the second relation. The third attribute of the first relation must
have the same domain as the third attribute of the second relation, and so on.
5. Which relational algebra operators can be applied to a pair of tables that are not union-compatible?
The Product, Join, and Divide operators can be applied to a pair of tables that are not union-compatible. Divide
does place specific requirements on the tables to be operated on; however, those requirements do not include
union-compatibility. Select (or Restrict) and Project are performed on individual tables, not pairs of tables.
(Note that if two tables are joined, then the result is a single table and the Select or Project operator is
performed on that single table.)
Why is this page out of focus?
This is a Premium document. Become Premium to read the whole document.
Why is this page out of focus?
This is a Premium document. Become Premium to read the whole document.
Why is this page out of focus?
This is a Premium document. Become Premium to read the whole document.
Why is this page out of focus?
This is a Premium document. Become Premium to read the whole document.
Why is this page out of focus?
This is a Premium document. Become Premium to read the whole document.