EXERCISES

The purpose of these exercises is to test your knowledge of relational theory. Most of them can’t be answered from material in the present chapter alone. However, everything mentioned here, and in the answers to these exercises in Appendix D, is discussed in detail in SQL and Relational Theory.

2.1 What’s The Information Principle?

2.2 Which of the following statements are true?

  1. Relations (and hence relvars) have no ordering to their tuples.

  2. Relations (and hence relvars) have no ordering to their attributes.

  3. Relations (and hence relvars) never have any unnamed attributes.

  4. Relations (and hence relvars) never have two or more attributes with the same name.

  5. Relations (and hence relvars) never contain duplicate tuples.

  6. Relations (and hence relvars) never contain nulls.

  7. Relations (and hence relvars) are always in 1NF.

  8. The types over which relational attributes are defined can be arbitrarily complex.

  9. Relations (and hence relvars) themselves have types.

2.3 Which of the following statements are true?

  1. Every subset of a heading is a heading.

  2. Every subset of a body is a body.

  3. Every subset of a tuple is a tuple.

2.4 The term domain is usually found in texts on relational theory, but it wasn’t mentioned in the body of the chapter. What do you make of this fact?

2.5 Define the terms proposition and predicate. Give examples.

2.6 State the predicates for relvars S, P, and SP from the suppliers-and-parts database.

2.7 Let DB be any database you happen to be familiar with and let R be any relvar in DB. What’s the predicate for R? Note: The point of this exercise is to get you to apply some of the ideas discussed in the body of this chapter to your own data, in an attempt to get you thinking about data in general in such terms. Obviously the exercise has no unique right answer.

2.8 Explain The Closed World Assumption in your own terms. Could there be such a thing as The Open World Assumption?

2.9 Give definitions, as precise as you can make them, of the terms tuple and relation.

2.10 State as precisely as you can what it means for (a) two tuples to be equal; (b) two relations to be equal.

2.11 A tuple is a set (a set of components); so do you think it might make sense to define versions of the usual set operators (union, intersection, etc.) that apply to tuples?

2.12 To repeat, a tuple is a set of components. But the empty set is a legitimate set; thus, we could define an empty tuple to be a tuple where the pertinent set of components is empty. What are the implications? Can you think of any uses for such a tuple?

2.13 A key is a set of attributes and the empty set is a legitimate set; thus, we could define an empty key to be a key where the pertinent set of attributes is empty. What are the implications? Can you think of any uses for such a key?

2.14 A predicate has a set of parameters and the empty set is a legitimate set; thus, a predicate could have an empty set of parameters. What are the implications?

2.15 The normalization discipline makes heavy use of the relational operators projection and join. Give definitions, as precise as you can make them, of these two operators. Also, have a go at defining the attribute renaming operator (RENAME in Tutorial D).

2.16 The operators of the relational algebra form a closed system. What do you understand by this remark?

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset