6. Summarising and Grouping

Worksheet Overview

We often want to reduce the volume of data displayed. We can do this by summarising the values in a column and by grouping rows together.

Contents

1. Demo: Count the number of rows in a table.
2. Demo: Average, min and max.
3. Task: Find the employee whose name is first in the alphabet.
4. Demo: Find the employee whose name is first in the alphabet (2).
5. Task: Find the employee whose name is last in the alphabet .
6. Demo: Summarise groups of data.
7. Demo: Restrict the rows displayed
8. Demo: The 'HAVING' clause.
9. Demo: Grouping by attributes.
10. Task: Analyse the employees' salaries by department alone.
11. Task: Analyse the employees' salaries by manager.
12. Task: Do managers have the same number of staff?
13. Read: Compteted

Related worksheets

1. Introduction to the Emp-dept case study
2. Some simple SQL Select statements
3. Using Functions
4. Selecting ROWS to display
5. Multiple tables
7. Handling Dates
8. Inner and Outer Joins