Search⌘ K
AI Features

Solution: Do Math with Your Data

Explore how to perform mathematical calculations on data using SQL aggregate functions like COUNT and AVG. Understand how to summarize information by counting rows and finding averages, and learn to label results clearly with aliases for better readability.

We'll cover the following...

Query

SELECT COUNT(*) AS total_pets, AVG(age) AS average_age
FROM pets;

Explanation

This SQL query calculates two things from the pets ...