問題文
A daily sensor table has a temperature column in which about 3 percent of the rows are NULL because the device failed to report. The analyst must publish the average temperature per site. Which handling keeps the published average faithful to what was actually measured?
選択肢
- Replace the NULLs with the overall average of the whole table so that each site's average is pulled toward the global mean.
- Replace the NULLs with 0 using COALESCE so that every row contributes a value and the average is computed over the full row count.
- Leave the NULLs in place and use AVG, which ignores NULL inputs, then report the count of contributing rows for each site alongside the average.
- Delete every row that has a NULL temperature from the source table so that later queries do not have to think about missing values at all.