The IS NOT NULL Operator
Now if we find the Count of number of Employees having SSNs.
Query:
SELECT COUNT(*) AS Count FROM Employee WHERE SSN IS NOT NULL;
Output:
NULL values in SQL
In SQL there may be some records in a table that do not have values or data for every field and those fields are termed as a NULL value.
NULL values could be possible because at the time of data entry information is not available. So SQL supports a special value known as NULL which is used to represent the values of attributes that may be unknown or not apply to a tuple. SQL places a NULL value in the field in the absence of a user-defined value. For example, the Apartment_number attribute of an address applies only to addresses that are in apartment buildings and not to other types of residences.
So, NULL values are those values in which there is no data value in the particular field in the table.