s
Section 5.3 Relations and Databases
377
Exercises 5–28 are all related to the same enterprise.
5. A library maintains a database about its books. Information kept on each author includes the author’s
name and country of origin. Information kept on each book includes the ISBN, title, publisher, and subject. Authors and books are the entities in this enterprise, and “writes” is a relationship between these entities. Sketch an E-R diagram for the enterprise. In the absence of any business rules, what must be assumed
about the binary relation “writes” regarding whether it is one-to-one, one-to-many, and so on?
6. In a relational model of the library database, there is an author relation, a book relation, and a writes relation. Give the table heading for each of the relation tables, underlining the primary key. Business rules
state that authors are uniquely identified by name and books are uniquely identified by ISBN. Explain your
choice of primary key for the Writes relation table.
For Exercises 7–16, use the following relation tables and write the results of the operations. These tables are
sorted by primary key (or in the case of the Writes table, by the first component of the primary key), which is
not required but is useful for Exercise 25. Many database systems maintain data in sorted order by primary key
using a tree structure (see Section 5.1, Exercise 43).
author
Name
country
Chan, Jimmy
China
East, Jane
U. S.
King, Dorothy
England
Kovalsco, Bert
U.S.
Lau, Won
China
Nkoma, Jon
Kenya
Quercos, Tom
Mexico
book
iSBN
Title
publisher Subject
0-115-01214-1
Birds of Africa
Loraine
Nature
0-364-87547-X
Early Tang Paintings
Bellman
Art
0-56-000142-8
Springtime Gardening
Swift-Key
Nature
0-816-35421-9
Springtime Gardening
Harding
Nature
0-816-53705-4
Baskets for Today
Harding
Art
0-816-88506-0
Autumn Annuals
Harding
Nature
Section 5.3 Relations and Databases
377
Exercises 5–28 are all related to the same enterprise.
5. A library maintains a database about its books. Information kept on each author includes the author’s
name and country of origin. Information kept on each book includes the ISBN, title, publisher, and subject. Authors and books are the entities in this enterprise, and “writes” is a relationship between these entities. Sketch an E-R diagram for the enterprise. In the absence of any business rules, what must be assumed
about the binary relation “writes” regarding whether it is one-to-one, one-to-many, and so on?
6. In a relational model of the library database, there is an author relation, a book relation, and a writes relation. Give the table heading for each of the relation tables, underlining the primary key. Business rules
state that authors are uniquely identified by name and books are uniquely identified by ISBN. Explain your
choice of primary key for the Writes relation table.
For Exercises 7–16, use the following relation tables and write the results of the operations. These tables are
sorted by primary key (or in the case of the Writes table, by the first component of the primary key), which is
not required but is useful for Exercise 25. Many database systems maintain data in sorted order by primary key
using a tree structure (see Section 5.1, Exercise 43).
author
Name
country
Chan, Jimmy
China
East, Jane
U. S.
King, Dorothy
England
Kovalsco, Bert
U.S.
Lau, Won
China
Nkoma, Jon
Kenya
Quercos, Tom
Mexico
book
iSBN
Title
publisher Subject
0-115-01214-1
Birds of Africa
Loraine
Nature
0-364-87547-X
Early Tang Paintings
Bellman
Art
0-56-000142-8
Springtime Gardening
Swift-Key
Nature
0-816-35421-9
Springtime Gardening
Harding
Nature
0-816-53705-4
Baskets for Today
Harding
Art
0-816-88506-0
Autumn Annuals
Harding
Nature
