Complete the code to calculate the average salary from the employees table.
SELECT [1](salary) FROM employees;The AVG function calculates the average value of a numeric column.
Complete the code to find the average age of users who are active.
SELECT AVG(age) FROM users WHERE status = [1];The condition filters users with status 'active' to calculate their average age.
Fix the error in the code to correctly calculate the average price from products.
SELECT [1]price) FROM products;The function call is missing a closing parenthesis after AVG(. Adding it fixes the syntax.
Fill both blanks to calculate the average score for students with scores greater than 70.
SELECT [1](score) FROM students WHERE score [2] 70;
Use AVG to get the average, and > to filter scores greater than 70.
Fill all three blanks to calculate the average rating for products with rating above 4 and category 'electronics'.
SELECT [1](rating) FROM products WHERE rating [2] 4 AND category = [3];
Use AVG to calculate average rating, > to filter ratings above 4, and 'electronics' as the category string.