Given Clients table
+------+--------------+----------+
| ID   |  Name        |  Summa   |
+------+--------------+----------+
| 1    |  Sasha       |  4000    |
| 2    |  Marina      |  2000    |
| 3    |  Stepan      |   0      |
| 4    |  Klara       |  NULL    |
+------+--------------+----------+
After it is updated using:
UPDATE Clients SET Summa = Summa + 700
What will be the result of the following query execution?
SELECT AVG(Summa) FROM Clients;
Explanation
If binary arithmetic operator (+ in our case) accepts NULL as one of its arguments, the result will always be NULL.
Aggregate functions (like AVG() in our case) ignore NULL values.

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести