Databas – Part III
Chapter 4 The Relational Model
Review Questions
4.1 Discuss each of the following concepts in the context of the relational data model:
(a) Relation A table with columns and rows.
(b) Attribute A named column of a relation.
(c) Domain The set of allowable values for one or more attributes.
4.2 Describe the relationship between mathematical relations and relations in the relational data
model?
4.3 Describe the differences between a relation and a relation schema. What is a relational
database schema?
4.4 Discuss the properties of a relation.
A relation has the following properties:
Databas – Part III
4
each attribute has a distinct name;
4.5 Discuss the differences between the candidate keys and the primary key of a relation. Explain
what is meant by a foreign key. How do foreign keys of relations relate to candidate keys? Give
examples to illustrate your answer.
4.6 Define the two principal integrity rules for the relational model. Discuss why it is desirable to
enforce these rules.
4.7 What is a view? Discuss the difference between a view and a base relation.
Exercises
The following tables form part of a database held in a relational DBMS:-
Hotel (hotelNo, hotelName, city)
5
4.8 Identify the foreign keys in this schema. Explain how the entity and referential integrity rules
apply to these relations.
For each relation, the primary key must not contain any nulls.
4.9 Produce some sample tables for these relations that observe the relational integrity rules.
Suggest some general constraints that would be appropriate for this schema.
Some general constraints may be:
4.10 Analyze the RDBMSs that you are currently using. Determine the support the system provides for
primary keys, alternate keys, foreign keys, relational integrity, and views.
4.11 Implement the above schema in one of the RDBMSs you currently use. Implement, where
possible, the primary, alternate, and foreign keys, and appropriate relational integrity
constraints.