Welcome Back

Google icon Sign in with Google
OR
I agree to abide by Pharmadaily Terms of Service and its Privacy Policy

Create Account

Google icon Sign up with Google
OR
By signing up, you agree to our Terms of Service and Privacy Policy
Instagram
youtube
Facebook

List Products with Prices Higher Than Average

List Products with Prices Higher Than Average
Products Table:


Query Explanation:

  • SELECT AVG(UnitPrice) FROM Products: Gets the average product price.

  • UnitPrice > (...): Filters only products priced above that average.

  • ORDER BY UnitPrice DESC: Sorts from highest to lowest price.

SQL Query:

SELECT 
    ProductID,
    ProductName,
    UnitPrice
FROM 
    Products
WHERE 
    UnitPrice > (SELECT AVG(UnitPrice) FROM Products)
ORDER BY 
    UnitPrice DESC;

Output: