Knowledge

NULL

Subject: .../SQL

Null is the special value in databases, which is the equivalent of english nothing, that given row in database has nothing in this column.

Since null is not a value (it is absence of value), usual functions that works with values (concatenation, comparison function etc) will not work on null. Even comparison for null is usually performed via special operator "is" instead of usual "=": "where my_column is null" or "where my_column is not null"

In most databases, comparison with null will always return false (i.e., true=null => false, false=null => false, null=null => false), whereas concatenation would depent on database engine. In some cases you will have string "null" added, in other you will have just null (i.e. in MySQL "abc"+null => null), sometimes null will be converted to empty string (e.g. in Oracle 'abc' || null -> 'abc')

Special useful scenario of null is in aggregation functions. For example, count() function does not count null, which is useful when used together will outer joins. 

Check yourself
Q:

SELECT null = false

Q:

SELECT null + 12

Skillsets
Skillset PostgreSQL DBA preview
image descriptionPostgreSQL DBA
by Artem Naumenko (fb)
1630 users
Skillset Skyeng PostgreSQL DBA preview
image descriptionSkyeng PostgreSQL DBA
by Artem Naumenko (slack2)
Materials
If you know useful resource, that helps to get this skill, please, spare a minute and add the link
Do you know that ...?
Any useful or interesting facts about the skill. Any peace of information would be useful