79554272

Date: 2025-04-04 01:02:51
Score: 0.5
Natty:
Report link

-- Calculate the average price, treating NULL as 0

SELECT AVG(COALESCE(price, 0)) AS average_price FROM products;

When using aggregate functions, NULL values are ignored. However, you can use COALESCE to include them in calculations.

Reasons:
  • Whitelisted phrase (-1.5): you can use
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Archsheena Smith