SQL: Null Functions

In SQL Null is both a value as well as a keyword. Let’s look into NULL value first –

null.png

Null as a Value

In simple terms, NULL is simply a place holder for data that does not exist. When performing insert operations on tables, they will be times when some  field values will not be available. 

In order to meet the requirements of true relational database management systems, MySQL uses NULL as the place holder for the values that have not been submitted. The screenshot below shows how NULL values look in database.

Query.png

Let’s now look at some of the basics for NULL before we go further into the discussion.

  • NULL is not a data type – this means it is not recognized as an “int”, “date” or any other defined data type.
  • Arithmetic operations involving NULL always return NULL for example, 69 + NULL = NULL.
  • All aggregate functions affect only rows that do not have NULL values.

One thought on “SQL: Null Functions

Leave a Reply

error: Content is protected !!
%d