Exercises


These exercises are intended to serve as a review of the entire book, not just the present chapter. Some are repeats of exercises from earlier chapters.

Exercise 8-1

What exactly is the relational model? State as many differences as you can think of between SQL and the relational model. Why are SQL's departures from the relational model a bad thing?

Exercise 8-2

What's The Information Principle? How might "row IDs" violate it?

Exercise 8-3

What's a predicate? What's the connection between relations and predicates?

Exercise 8-4

Do you believe relations are "flat" or two-dimensional? Justify your answer.

Exercise 8-5

What's a join dependency? If relvar R satisfies the FD A Exercise 8-6

What's the real difference between a domain and a relation?

Exercise 8-7

What's wrong with deferred integrity checking?

Exercise 8-8

What's The Principle of Interchangeability?

Exercise 8-9

What does first normal form really mean?

Exercise 8-10

What's "the final normal form"? In what sense is it final?

Exercise 8-11

What's the difference between a relation and a relvar?

Exercise 8-12

What's The Principle of Orthogonal Design?

Exercise 8-13

Would it make sense to define a relational comparison operator, "/" say, such that r / s gives TRUE if and only if r and s are disjoint (i.e., have no tuples in common)? Justify your answer.

Exercise 8-14

Why is ORDER BY not a relational operator?

Exercise 8-15

The difference between base relvars and views is that the former are physically stored and the latter aren't: true or false?

Exercise 8-16

Why doesn't the relational model permit nulls? Or duplicates?

Exercise 8-17

The relational model prescribes the data types that must be supported: true or false?

Exercise 8-18

What's the difference between a primary key and a candidate key?

Exercise 8-19

What's nonloss decomposition?

Exercise 8-20

Should it ever be necessary to denormalize?

Exercise 8-21

Product is a special case of join: true or false?

Exercise 8-22

What's a type constraint? When are type constraints checked?

Exercise 8-23

Can a relation have an attribute whose values are sets? Or arrays? Or relations?

Exercise 8-24

Why do SQL's updates through a cursor violate the relational model?

Exercise 8-25

Can a relation have no attributes at all?

Exercise 8-26

What does it mean to say that the relational algebra is closed? Why is such closure important?

Exercise 8-27

Any given relation r is identically equal to a certain restriction of r and a certain projection of r. Explain these observations.

Exercise 8-28

Why is "materialized view" a contradiction in terms?

Exercise 8-29

What's the difference between the relational model and an implementation thereof?

Exercise 8-30

What's the crucial logical difference between a relational database and any other kind of database? (Hint: Remember The Information Principle.)

Exercise 8-31

What's the difference between a true object/relational DBMS and a true relational DBMS?

Exercise 8-32

Does restrict distribute over union? Over minus?

Exercise 8-33

Does project distribute over union? Over minus?

Exercise 8-34

How does XML fit with the relational model?

Exercise 8-35

If you summarize an empty relation, what do you get?

Exercise 8-36

What's the Closed World Assumption?

Exercise 8-37

Define the operators semijoin and semiminus.

Exercise 8-38

Define (a) BCNF, (b) 5NF, and (c) 6NF. Did it ever occur to you that the last two--4NF too, come to that are misnamed?

Exercise 8-39

Is join commutative? Associative? Idempotent?

Exercise 8-40

Every binary relvar is in BCNF: true or false?

Exercise 8-41

What's the identity with respect to join?

Exercise 8-42

What does it mean, formally or informally, to say an FD or JD is trivial?

Exercise 8-43

Does a key that involves no attributes at all make any sense? What about a foreign key?

Exercise 8-44

If a 3NF relvar has no keys that involve two or more attributes, that relvar is in 5NF: true or false?

Exercise 8-45

Give at least three reasons why the result of a SELECT statement in SQL isn't a relation, in general. You can assume we're talking about an interactive environment, meaning we're not limited to "singleton SELECTs" (that is, SELECTs that retrieve at most one row).

Exercise 8-46

Intersect is a special case of join: true or false?

Exercise 8-47

Suppose relation r is of degree three. How many distinct projections does r have?

Exercise 8-48

Suppose relvar R is of degree three. What's the maximum number of keys R can possibly have? What about FDs?

Exercise 8-49

Are (relational) cartesian product and (relational) division inverse operations? Subsidiary question: Why did I say, specifically, relational cartesian product?

Exercise 8-50

What's the join of n relations for n = 3? What about n = 1? And what about n = 0?

Exercise 8-51

How can we do relational comparisons in SQL?

Exercise 8-52

Does it make sense to declare keys for a view?

Exercise 8-53

(a) Let the FD A R. A and B are sets of attributes, of course; so what happens if either of those sets is empty? (b) Let K be a key for some relvar R. K is a set of attributes; so what happens if that set is empty?

Exercise 8-54

Which of the following identities are valid?

     a. r INTERSECT s  r MINUS s )     b. r UNION ( r INTERSECT s )  r INTERSECT ( r UNION s )  r MATCHING r  Exercise 8-55 

What do you understand by the term "semantic optimization"?

Exercise 8-56

Why are relation-valued attributes usually contraindicated (at least in base relvars)?

Exercise 8-57

"TABLE_DEE plays a role in the relational algebra analogous to that played by 0 in ordinary arithmetic." Explain this remark.

Exercise 8-58

(a) Let Op be a monadic relational operator. What happens if the sole operand to Op is either TABLE_DUM or TABLE_DEE? (b) Let Op be a dyadic relational operator. What happens if each of the operands to Op is either TABLE_DUM or TABLE_DEE?

Exercise 8-59

"There's only one relational model." Either justify this claim or state clearly why you disagree.

Exercise 8-60

Why is it important for database professionals to be able to answer questions like these correctly?



Database in Depth
Database in Depth: Relational Theory for Practitioners
ISBN: 0596100124
EAN: 2147483647
Year: 2006
Pages: 127
Authors: C.J. Date

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net