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

Mobile Site | Full Site
Copyright 2018 © QuinStreet Inc. All Rights Reserved

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.