I'm studying for an exam that's in a couple of weeks and came across an SQL querying problem I still can't figure out. I was wondering if anyone could advise me.
Relational Database:
Books(**ISBN**, Title, Genre, Price, Publisher, PublicationYear)
Author(**AuthorNum**, Name)
Write(**ISBN**, AuthorNum)
Problem: Find the most expensive book from each publisher, along with the name of the author, arranged alphabetically by book title.
I've tried many things, with this one being the one I think is closest to the solution but it's not correct:
SELECT Title, Name
FROM Author AS a, Books AS b, Write AS w
WHERE a.AuthorNum = w.AuthorNum AND b.ISBN = w.ISBN
GROUP BY Publisher
HAVING MAX(Price)
ORDER BY Title