How do I find the most popular products (1 Viewer)

DanielD

New member
Local time
Yesterday, 18:11
Joined
Nov 30, 2017
Messages
6
How would I go about finding the most popular and must unpopular product in this database?

Thank you
:)
 

Attachments

  • Database.zip
    450.3 KB · Views: 52

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 02:11
Joined
Jul 9, 2003
Messages
16,352
Have you sold any?

Sent from my SM-G925F using Tapatalk
 

DanielD

New member
Local time
Yesterday, 18:11
Joined
Nov 30, 2017
Messages
6
Its for a college assignment, this is the database we were given.
I've tried to do query for the quantity of products sold but its not grouping them by name (there is sometime multiple orders from different customers)
 

Minty

AWF VIP
Local time
Today, 02:11
Joined
Jul 26, 2013
Messages
10,373
As it's an assignment - you won't learn if you don't try, show show us what you have tried.
 

isladogs

MVP / VIP
Local time
Today, 02:11
Joined
Jan 14, 2017
Messages
18,261
Have you sold any?
:)

Most popular: Camembert Pierrot - 1577 ordered
Least popular: Mishi Kobe Niku - 95 ordered

Query used:

Code:
SELECT Products.ProductID, Products.ProductName, Sum([Order Details].Quantity) AS TotalOrdered
FROM Products INNER JOIN [Order Details] ON Products.ProductID = [Order Details].ProductID
GROUP BY Products.ProductID, Products.ProductName
ORDER BY Sum([Order Details].Quantity) DESC;

EDIT:
Whilst I was answering this, you added it was a college assignment.
If I'd known I would have given a hint & not the answer.
Too late now
In future, PLEASE state that in your first post
 

DanielD

New member
Local time
Yesterday, 18:11
Joined
Nov 30, 2017
Messages
6
All I could see was them all individually, not how to group them together.
We were never taught this in lesson
 

isladogs

MVP / VIP
Local time
Today, 02:11
Joined
Jan 14, 2017
Messages
18,261
So that was your homework ...to find out!
 

DanielD

New member
Local time
Yesterday, 18:11
Joined
Nov 30, 2017
Messages
6
So that was your homework ...to find out!
Nah it wasn't to find that bit out, it was to say what tables would be used to find it. I could've done that bit myself, I'd have add up all of the large groups together. to see what was most common
 

isladogs

MVP / VIP
Local time
Today, 02:11
Joined
Jan 14, 2017
Messages
18,261
Nah it wasn't to find that bit out, it was to say what tables would be used to find it. I could've done that bit myself, I'd have add up all of the large groups together. to see what was most common

If you could have done it yourself, why didn't you?
 

DanielD

New member
Local time
Yesterday, 18:11
Joined
Nov 30, 2017
Messages
6
Nobody in class could do it, we're told to ask eachother so....
 

Users who are viewing this thread

Top Bottom