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-1What 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-2What's The Information Principle? How might "row IDs" violate it? Exercise 8-3What's a predicate? What's the connection between relations and predicates? Exercise 8-4Do you believe relations are "flat" or two-dimensional? Justify your answer. Exercise 8-5What'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? What's wrong with deferred integrity checking? What's The Principle of Interchangeability? What does first normal form really mean? What's "the final normal form"? In what sense is it final? What's the difference between a relation and a relvar? What's The Principle of Orthogonal Design? 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. Why is ORDER BY not a relational operator? The difference between base relvars and views is that the former are physically stored and the latter aren't: true or false? Why doesn't the relational model permit nulls? Or duplicates? The relational model prescribes the data types that must be supported: true or false? What's the difference between a primary key and a candidate key? What's nonloss decomposition? Should it ever be necessary to denormalize? Product is a special case of join: true or false? What's a type constraint? When are type constraints checked? Can a relation have an attribute whose values are sets? Or arrays? Or relations? Why do SQL's updates through a cursor violate the relational model? Can a relation have no attributes at all? What does it mean to say that the relational algebra is closed? Why is such closure important? Any given relation r is identically equal to a certain restriction of r and a certain projection of r. Explain these observations. Why is "materialized view" a contradiction in terms? What's the difference between the relational model and an implementation thereof? What's the crucial logical difference between a relational database and any other kind of database? (Hint: Remember The Information Principle.) What's the difference between a true object/relational DBMS and a true relational DBMS? Does restrict distribute over union? Over minus? Does project distribute over union? Over minus? How does XML fit with the relational model? If you summarize an empty relation, what do you get? What's the Closed World Assumption? Define the operators semijoin and semiminus. 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? Is join commutative? Associative? Idempotent? Every binary relvar is in BCNF: true or false? What's the identity with respect to join? What does it mean, formally or informally, to say an FD or JD is trivial? Does a key that involves no attributes at all make any sense? What about a foreign key? If a 3NF relvar has no keys that involve two or more attributes, that relvar is in 5NF: true or false? 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). Intersect is a special case of join: true or false? Suppose relation r is of degree three. How many distinct projections does r have? Suppose relvar R is of degree three. What's the maximum number of keys R can possibly have? What about FDs? Are (relational) cartesian product and (relational) division inverse operations? Subsidiary question: Why did I say, specifically, relational cartesian product? What's the join of n relations for n = 3? What about n = 1? And what about n = 0? How can we do relational comparisons in SQL? Does it make sense to declare keys for a view? (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? Which of the following identities are valid? What do you understand by the term "semantic optimization"? Why are relation-valued attributes usually contraindicated (at least in base relvars)? "TABLE_DEE plays a role in the relational algebra analogous to that played by 0 in ordinary arithmetic." Explain this remark. (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? "There's only one relational model." Either justify this claim or state clearly why you disagree. Why is it important for database professionals to be able to answer questions like these correctly? |