A data analyst needs to find all products that have a list price higher than the average list price of all products. Which of the following queries correctly accomplishes this task?
-
A
SELECT ProductName FROM Products WHERE ListPrice > AVG(ListPrice);
-
B
SELECT ProductName, AVG(ListPrice) FROM Products HAVING ListPrice > AVG(ListPrice);
-
C
SELECT ProductName FROM Products WHERE ListPrice > (SELECT AVG(ListPrice) FROM Products);
-
D
SELECT P1.ProductName FROM Products P1 JOIN Products P2 ON P1.ListPrice > AVG(P2.ListPrice);