Tables: Book(isbn, title, author, stockQty, price)
Question:Find the title and the price cheapest book for each quantity we have (i.e. for each quantity, what is the cheapest price of a book in that quantity level)?
Writing the query in SQL.
I did:
SELECT B.title B.stockQty, MIN(B.price)
FROM book B
GROUP BY B.stockQty
But it won't show the correct title. (will only show the title of the first book)