Course Content
Introduction to SQL
Introduction to SQL
The AVG() Function
AVG()
returns the average value of a certain column.
Let's see an example:
SELECT AVG(population) FROM country;
AVG()
can also be used to find the average of a selected set of columns or rows that meet certain conditions. Here’s an example:
SELECT AVG(population) FROM country WHERE population < 4478500;
Here is the country
table we are working with:
Swipe to show code editor
Write an SQL query to retrieve the average value of a surfacearea
column from the country
table.
Thanks for your feedback!
The AVG() Function
AVG()
returns the average value of a certain column.
Let's see an example:
SELECT AVG(population) FROM country;
AVG()
can also be used to find the average of a selected set of columns or rows that meet certain conditions. Here’s an example:
SELECT AVG(population) FROM country WHERE population < 4478500;
Here is the country
table we are working with:
Swipe to show code editor
Write an SQL query to retrieve the average value of a surfacearea
column from the country
table.
Thanks for your feedback!
The AVG() Function
AVG()
returns the average value of a certain column.
Let's see an example:
SELECT AVG(population) FROM country;
AVG()
can also be used to find the average of a selected set of columns or rows that meet certain conditions. Here’s an example:
SELECT AVG(population) FROM country WHERE population < 4478500;
Here is the country
table we are working with:
Swipe to show code editor
Write an SQL query to retrieve the average value of a surfacearea
column from the country
table.
Thanks for your feedback!
AVG()
returns the average value of a certain column.
Let's see an example:
SELECT AVG(population) FROM country;
AVG()
can also be used to find the average of a selected set of columns or rows that meet certain conditions. Here’s an example:
SELECT AVG(population) FROM country WHERE population < 4478500;
Here is the country
table we are working with:
Swipe to show code editor
Write an SQL query to retrieve the average value of a surfacearea
column from the country
table.