Database: Bookbiz Query Exercises - Ch 4-5

Name: _________________________________

The following queries apply to the Bookbiz database that comes with the Practical SQL Handbook. The relationship diagram can be found on page 47 of the book. Run the database to check your answer.

  1. List all publishers (pub_name), but label the resulting column Publisher instead of pub_name.
  2. Show all publishers (pub_name) who are in either California (CA), Indiana (IN), or Maryland (MD).
  3. Show all titles (title) and their prices, which have a price greater than $25.00.
  4. Show all titles (title) that have a type of NULL.
  5. Show all titles (title) which have an advance of less than $5000 or no advance indicated (NULL).
  6. Show all authors (au_lname, au_fname) who are in the 415 area code. Show them in alphabetical order.
  7. Find all business books, as well as any books with a price higher than $10, and include all books with an advance of less than $20,000.
  8. Give me a list of all the business and psychology books over $25.
  9. How many titles are there?
  10. List all the types of titles (each one only once). Put them in reverse alphabetical order.
  11. What is the cheapest price for any title?