Get startedGet started for free

MIN, MAX and AVG

Along with summing and counting, you'll frequently need to find the minimum, maximum, and average of column values. Thankfully, T-SQL has functions you can use to make the task easier!

This exercise is part of the course

Introduction to SQL Server

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

-- Find the minimum number of affected customers
SELECT 
  ___(affected_customers) AS ___ 
FROM 
  grid
-- Only retrieve rows where demand_loss_mw has a value
WHERE
  ___ ___ ___ NULL;
Edit and Run Code