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
SQL
SQL Quiz
Start Quiz

or Read more about SQL Quiz

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback