EXERCISES

4.1 How many FDs hold in relvar SP? Which ones are trivial? Which are irreducible?

4.2 Is it true that the concept of FD relies on the notion of tuple equality?

4.3 Give examples from your own work environment of (a) a relvar not in 2NF; (b) a relvar in 3NF but not 2NF; (c) a relvar in BCNF but not 3NF.

4.4 Prove the two definitions of 2NF given in the body of the chapter are logically equivalent.

4.5 Is it true that if a relvar isn’t in 2NF, then it must have a composite key?

4.6 Is it true that every binary relvar is in BCNF?

4.7 (Same as Exercise 1.4.) Is it true that every “all key” relvar is in BCNF?

4.8 Write Tutorial D CONSTRAINT statements to express the FDs {SNO} → {SNAME} and {SNAME} → {SNO} that hold in relvar SNP (see the section BOYCE/CODD NORMAL FORM). Note: This is the first exercise in any chapter that asks you to give an answer in Tutorial D. Of course, I realize you might not be completely conversant with that language; in all such exercises, therefore—for example, Exercises 4.14 and 4.15 below—please just do the best you can. I do think it worth your while at least to attempt the exercises in question.

4.9 Let R be a relvar of degree n. What’s the maximum number of FDs that can possibly hold in R (trivial as well as nontrivial)? What’s the maximum number of keys it can have?

4.10 Given that X and Y in the FD XY are both sets of attributes, what happens if either is the empty set?

4.11 Can you think of a situation in which it really would be reasonable to have a base relvar with an RVA?

4.12 There’s a lot of discussion in the industry at the time of writing of XML databases. But XML documents are inherently hierarchic in nature; so do you think the criticisms of hierarchies in the body of the chapter apply to XML databases? (Well, yes, they do, as I indicated in a footnote earlier in the chapter. So what do you conclude?)

4.13 In Chapter 1, I said I’d be indicating primary key attributes, in tabular pictures of relations, by double underlining. At that point, however, I hadn’t properly discussed the difference between relations and relvars; and now we know that keys in general apply to relvars, not relations. Yet we’ve seen several tabular pictures since then that represent relations as such (I mean, relations that aren’t just a sample value for some relvar)—see, e.g., Figure 4-1 for three examples[44]—and I’ve certainly been using the double underlining convention in those pictures. So what can we say about that convention now?

4.14 (Repeated from the body of the chapter.) Give Tutorial D formulations of the following queries against the relation shown in Figure 4-1:

  1. Get part numbers for parts supplied by supplier S2.

  2. Get supplier numbers for suppliers who supply part P2.

4.15 Suppose we need to update the database to show that supplier S2 supplies part P5 in a quantity of 500. Give Tutorial D formulations of the required update against (a) the non RVA design of Figure 1-1, (b) the RVA design of Figure 4-1.

4.16 Here are some definitions of 1NF from the technical literature. In view of the explanations given in the body of the present chapter, do you have any comments on them?

  • First normal form (1NF) ... states that the domain of an attribute must include only atomic (simple, indivisible) values and that the value of any attribute in a tuple must be a single value from the domain of that attribute ... 1NF disallows having a set of values, a tuple of values, or a combination of both as an attribute value for a single tuple ... 1NF disallows “relations within relations” or “relations as attribute values within tuples” ... the only attribute values permitted by 1NF are single atomic (or indivisible) values (Ramez Elmasri and Shamkant B. Navathe, Fundamentals of Database Systems, 4th edition, Addison-Wesley, 2004)

  • A relation is in first normal form if every field contains only atomic values, that is, no lists or sets (Raghu Ramakrishnan and Johannes Gehrke, Database Management Systems, 3rd edition, McGraw-Hill, 2003)

  • First normal form is simply the condition that every component of every tuple is an atomic value (Hector Garcia-Molina, Jeffrey D. Ullman, and Jennifer Widom, Database Systems: The Complete Book, Prentice Hall, 2002)

  • A domain is atomic if elements of the domain are considered to be indivisible units ... we say that a relation schema R is in first normal form (1NF) if the domains of all attributes of R are atomic (Abraham Silberschatz, Henry F. Korth, and S. Sudarshan, Database System Concepts, 4th edition, McGraw-Hill, 2002)

  • A relation is said to be in first normal form (abbreviated 1NF) if and only if it satisfies the condition that it contains scalar values only (C. J. Date, An Introduction to Database Systems, 6th edition, Addison-Wesley, 1995)



[44] Yes, I do mean three.

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

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