How can we find employees earning more than the company average?
A scalar subquery returns a single value that can be used directly in comparison operators (> , < , =).
Benchmarking individual rows against global averages, dynamic threshold comparisons.
SELECT name, salary
FROM employees
WHERE salary > (
SELECT AVG(salary)
FROM employees
);Practice typing production-grade SQL code for Scalar Subquery.