A data scientist is performing exploratory data analysis on a table named 'CUSTOMER TRANSACTIONS. They need to calculate the standard deviation of transaction amounts C TRANSACTION AMOUNT) for different customer segments CCUSTOMER SEGMENT). The 'CUSTOMER SEGMENT column can contain NULL values. Which of the following SQL statements will correctly compute the standard deviation, excluding NULL transaction amounts, and handling NULL customer segments by treating them as a separate segment called 'Unknown'? Consider using Snowflake-specific functions where appropriate.

Correct Answer: B,C
Options B and C correctly calculates the standard deviation. Option B utilizes 'NVL' , which is the equivalent of 'COALESCE or ' IFNULL', to handle NULL Customer Segment values, and 'STDDEV_SAMP' for sample standard deviation, which is generally the correct function to use when dealing with a sample of the entire population. Option C also uses 'COALESCE and utilizes the 'STDDEV POP function, which returns the population standard deviation, assuming the data represents the whole population. Option A uses IFNULL, which works, and STDDEV, which is an alias for either STDDEV SAMP or STDDEV POP. The exact behavior will depend on session variable setting. Option D also uses 'CASE WHEN' construct which works to identify Unknown segments. STDDEV is again aliased. Option E calculates the variance and not Standard deviation.