Home / SQL / Practice problems / Medium

Products above the average price

Medium

Show the name and price of products that cost more than the average price.

Tables: customers(customer_id, name, city, country, joined) · products(product_id, name, category, price) · orders(order_id, customer_id, order_date, status) · order_items(order_id, product_id, quantity, unit_price)

Your query
Show the expected result
nameprice
27-inch monitor329.0
Noise-cancelling headphones249.0
Standing desk549.0
Ergonomic chair399.0

4 rows

Show a solution
SELECT name, price FROM products WHERE price > (SELECT AVG(price) FROM products);

SQL used

New to SQL? The free SQL course teaches everything these problems use, with a self-checking exercise in every lesson.