Given the People table:
+-----+--------------+-------+
|Num  |  Name        | Amount|
+-----+--------------+-------+
|  1  | Kate         |  15   |
|  2  | Misha        | NULL  |
|  3  | Nick         |  0    |
|  4  | Larisa       |  20   |
+-----+--------------+-------+
What will be the result of the following query execution?
SELECT COUNT(Amount) FROM People;
Explanation
Aggregate functions (like COUNT() in our case) ignore NULL values (i.e., number of records with not NULL value will be returned).
SQL
SQL Quiz
Start Quiz

or Read more about SQL Quiz

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback