Henry Books Use SQL and the Henry Books database (see Figures 1-4 through 1-7 in
ID: 3543266 • Letter: H
Question
Henry Books
Use SQL and the Henry Books database (see Figures 1-4 through 1-7 in Chapter 1) to complete
the following exercises. If directed to do so by your instructor, use the information provided
with the Chapter 3 Exercises to print your output.
1. For each book, list the book code, book title, publisher code, and publisher name. Order the
results by publisher name.
2. For each book published by Scribner, list the book code, book title, and price.
3. List the book title, book code, and price of each book published by Scribner that has a book
price of at least $14.
4. List the book code, book title, and units on hand for each book in branch number 3.
5. List the book title for each book that has the type PSY and that is published by Berkley
Publishing.
6. Find the book title for each book written by author number 18. Use the IN operator in
your query.
7. Repeat Exercise 6, but this time use the EXISTS operator in your query.
8. Find the book code and book title for each book located in branch number 2 and written by
author 20.
9. List the book codes for each pair of books that have the same price. (For example, one such
pair would be book 0200 and book 7559, because the price of both books is $8.00.) The
first book code listed should be the major sort key, and the second book code should be the
minor sort key.
10. Find the book title, author last name, and units on hand for each book in branch number 4.
11. Repeat Exercise 10, but this time list only paperback books.
12. Find the book code and book title for each book whose price is more than $10 or that was
published in Boston.
13. Find the book code and book title for each book whose price is more than $10 and that was
published in Boston.
14. Find the book code and book title for each book whose price is more than $10 but that was
not published in Boston.
15. Find the book code and book title for each book whose price is greater than the book price
of every book that has the type MYS.
16. Find the book code and book title for each book whose price is greater than the price of at
least one book that has the type MYS.
17. List the book code, book title, and units on hand for each book in branch number 2. Be sure
each book is included, regardless of whether there are any copies of the book currently on
hand in branch 2. Order the output by book code.
Explanation / Answer
List the book code, book title, and units on hand for each book in branch number 2. Be sure each book is included, regardless of whether where are any copies of the book currently on hand in branch 2. Order the output by book code.
Select Title, Book_Code, On_Hand
From Book, Branch, Inventory
Where Book.Book_Code = Inventory.Book_Code
And Branch.Branch_Num = Inventory.Branch_Num
And Branch_Num = 2;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.