Exercise: Filtered Average
Find average of distinct ages between 8 and 13.
Solution
sql
1SELECT AVG(DISTINCT age) FROM students
2WHERE age BETWEEN 8 AND 13;
Find average of distinct ages between 8 and 13.
1SELECT AVG(DISTINCT age) FROM students
2WHERE age BETWEEN 8 AND 13;