Skip to main content
SQL Code Completion Medium +20 XP

Subquery Pattern

Complete the subquery.

SQLFill in the blank
SELECT name FROM employees
WHERE salary > (
    SELECT ___(salary) FROM employees
);

Type the missing code

Show answer and explanation

Answer: AVG

AVG() calculates the average salary. The outer query finds employees earning above average.

Hint: Which function calculates the average?

What this challenge tests

Code Completion in SQL: subqueries, aggregate.

Related challenges