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. Use the database to check your answer.
SELECT state, COUNT(*) FROM publishers GROUP BY state;
SELECT phone, COUNT(*) FROM editors GROUP BY phone HAVING COUNT(*) > 1;
SELECT type, AVG(advance) FROM titles WHERE type IS NOT NULL GROUP BY type ORDER BY AVG(advance) DESC;