Homework #3 FAQ


Question: I already declared keys. Is that OK?
Answer: Sure. In PDA-5, you will be required to select keys, but you can do it now if you like.

Question: I'm having trouble selecting keys for relations that came from weak entity sets. Don't they include attributes from some other relation?
Answer: The key for a relation is a matter to be decided within that relation alone. If you converted from weak entity sets correctly, then you will have among the attributes of that relation a set that serves as a key for the relation, in the sense that two tuples of the relation would not agree in all those attributes. What you may be concerned about is a foreign-key declaration, which we have not yet covered. That allows you to say that the attributes from some entity set E that you ``borrowed'' to help form the key for your weak entity set's relation must have a value that also appears as the key for the relation derived from E.

Question: Do I have to populate all my relations with tuples?
Answer: Yes, we expect at least a few tuples in every relation.

Question 1

Question: What are the keys of the relations?
Answer: For some reason, the underlining in the document disappeared when we printed it. You can see the keys if you go to the Web copy of HW3.

Question: If title and year are the key for books, then using only the book title in the key for other relations causes some strange restrictions.
Answer: Right. We have changed the problem to assume that book titles are unique (a bad assumption, but it will simplify life here).

Question 2

Question: If we change the key for BookPublish to be just book, then how can we do question 2(c)?
Answer: For this question, you still have to assume the key for BookPublish is {book, year}.