Examine the description of the PRODUCT_INFORMATION table:
Which query retrieves the number of products with a null list price?
Examine the description of the PRODUCT_INFORMATION table:
Which query retrieves the number of products with a null list price?
To retrieve the number of products with a null list price, we need to use the COUNT function in a manner that handles NULL values appropriately. The query 'SELECT COUNT(list_price) FROM product_information WHERE list_price IS NULL;' would not work as COUNT(list_price) does not include NULL values in its count. Instead, by using 'SELECT COUNT(NVL(list_price, 0)) FROM product_information WHERE list_price IS NULL;', the NVL function replaces NULL values with 0, and the WHERE clause ensures we are counting only those records where list_price is originally NULL. This way, we get the correct count of all rows where list_price is NULL.
B is correct. COUNT function can calculate NULL only it use asterik. COUNT(*) : can count NULL COUNT(Column Name) : cannot count NULL
I agree B
A – false; function COUNT does not cover NULL values in its output B – true; NULLs become zeros and COUNT counts up all zero values, which is the same as the number of NULL values C – false; DISTINCT NULL is still NULL, see A D – false, NULL value is examined with WHERE IS NOT NULL and also see feature mentioned in A
B ! :)
Correct Answer is B. Count function can't calculate NULL