What is the output of the following query? SELECT COALESCE(NULL, NULL, 3, NULL, 5)

SQL Fundamentals Hard

SQL Fundamentals — Hard

What is the output of the following query? SELECT COALESCE(NULL, NULL, 3, NULL, 5)

Key points

  • COALESCE returns the first non-NULL value
  • The order of values in the COALESCE function matters
  • NULL values are skipped until a non-NULL value is found

Ready to go further?

Related questions