O'Reilly logo

SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL, Second Edition by Michael J. Hernandez, John L. Viescas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Aggregate Functions

The requests you’ve been working with so far have required answers involving individual column values from the rows returned by the FROM and WHERE clauses. However, you’ll often encounter requests, such as the following, that require only calculated values across multiple rows for an answer.

“How many of our customers live in Seattle?”

“What is the lowest price and highest price we’ve assigned to any item in our inventory?”

“How many classes is Mike Hernandez teaching?”

“What time does our earliest class begin?”

“What is the average length of a class?”

“What is the total amount for order number 12?”

The SQL Standard provides a set of aggregate functions that allow you to calculate a single value from the rows in a result ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required