Given the cars table:
color
-----
blue
red
null
blue
what will be the result of the following query:

SELECT COUNT(DISTINCT color) FROM cars
Explanation
Even though DISTINCT allows for null values, COUNT function does not consider them

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
SQL quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes