Sample Video Frame

Created by Zed A. Shaw Updated 2024-02-17 04:54:36
 

Exercise 18: Aggregate Functions

In this exercise you'll learn the other "aggregate functions". You've already played with count(), so these should be easy as they are used the same.

avg()

The avg() function works exactly like count() does except that it will do a simple average over the column. It is most useful when it's combined with GROUP BY to do summary statistics on different categories of rows. In this exercise I'm going to give you just a simple sample of how avg() works. Then you will study the documentation for avg() and attempt to combine it with what you know so far to produce more interesting queries.

undefined
Previous Lesson Next Lesson

Register for Learn SQL the Hard Way

Register today for the course and get the all currently available videos and lessons, plus all future modules for no extra charge.