Free Newsletters:

SQLCourse
Interactive Online SQL Training

Search Database Journal:

HOME News MS SQL Oracle DB2 Access MySQL PHP SQL Etc Scripts Links Forums DBA Talk
SQL Courses
1
2
3
4
5
6
7
8
9
10
11
12
13
14


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


SQL Course Curriculum
<<previous 1234567891011121314 next>>