SQL for Data Analytics · Aggregate Functions
Aggregate Functions
Aggregate Functions10 min
A note on this video
The video starts with a small Customer table and then switches to Northwind. The box under the video has both.
The prices in the video are rounded to whole dollars. Yours aren't, so your numbers will be slightly different. Where I get 3 and 264, you'll get 2.50 and 263.50.
Run queries here while you watch. When I tell you in the video to open Workbench and try something, use this box. The Northwind tables are here, and so is the table from the video. This is for your own practice. It isn't recorded or part of your unit submission.
⌘/Ctrl + Enter
Write a query that returns the lowest price, the average price, the highest price, and the number of products, in that order.
⌘/Ctrl + Enter
Write a query that returns the number of customers in North America (Canada, Mexico, and the USA).
⌘/Ctrl + Enter
This one uses the
Customer table from the video. Write a query that returns the total number of customers and the number of customers with no contact age, in that order.⌘/Ctrl + Enter
COUNT(*) counts rows. COUNT(ContactAge) counts rows where ContactAge isn't null. The difference is the ones that are null.