My group is doing a term project where we have to create a database for an online book store. Currently I am trying to query(sub-Query) the total amount of sales we have in each book category. As of right now, I have it working to a degree. However, the total I am getting is the same for each category. I just need some pointer in the right direction to get me moving again. My groupmates are just as stumped as I am right now
SELECT Category_Description, Sum(Price * Quantity) AS Sales
FROM Book, Order_Items, Book_Category, Categories
WHERE Book.Book_Id = Book_Category.Book_Id
AND Book.Book_id = Order_Items.Book_id
AND Category_Description In (Select Category_Description From Categories, Book_Category Where Book_Category.Category_Id =Categories.Category_Id)
GROUP BY Category_Description;
Above is my current SQL for the query and sub-query.
Thanks all for helping the new guy