Aggregating Data

A critical part of working with databases is creating useful reports from stored data. In this chapter, we will examine aggregate functions to help us create those reports.

Updated

Common SQL Functions

  1. Common SQL Functions (Apprentice): How to use MySQL's CONCAT() to join text from several columns and COALESCE() to replace NULL with a default value.
  2. More MySQL Functions (Apprentice): The MySQL functions a developer reaches for every week, grouped by job. Clean up and take apart text, round numbers, work with dates, and handle NULL and empty text.

Aggregate Functions

  1. Calculations vs Aggregations (Apprentice): The difference between a calculation, which works on the values in one row, and an aggregate function, which turns many rows into one value.
  2. Common Aggregate Functions (Apprentice): What COUNT, SUM, AVG, MIN and MAX return, and how each one treats NULL values.
  3. Grouping Aggregations (Journeyman): How GROUP BY returns one aggregate row per group, and how HAVING filters those groups where WHERE filters rows.