GROUP BY Exercise Answers

Exercise #1

SELECT state, count(state)
FROM customers
GROUP BY state;

Exercise #2

SELECT item, max(price), min(price)
FROM items_ordered
GROUP BY item;

Exercise #3

SELECT customerid, count(customerid), sum(price)
FROM items_ordered
GROUP BY customerid;

 

Go Back to previous GROUP BY clause page

Share:
Home
Mobile Site | Full Site
Copyright 2017 © QuinStreet Inc. All Rights Reserved