Which SQL query can be used to find products with a total quantity in stock higher than the average stock quantity of all products in their respective category?
a) SELECT FROM products WHERE quantity_in_stock > AVG(quantity_in_stock) GROUP BY category;
b) SELECT FROM products WHERE quantity_in_stock > (SELECT AVG(quantity_in_stock) FROM products GROUP BY category);
c) SELECT FROM products WHERE quantity_in_stock > AVG(quantity_in_stock) OVER (PARTITION BY category);
d) SELECT FROM products WHERE quantity_in_stock > (SELECT AVG(quantity_in_stock) FROM products);

Q&A Education