1.7 Null Values Flashcards
NULL
NULL is a special value that represents either unknown or inapplicable data.
NULL is not the same as zero for numeric data types or blanks for character data types. Ex: A zero bonus indicates an employee can, but has not, earned a bonus. A zero bonus is known and applicable, and should not be represented as NULL.
NOT NULL constraint
The NOT NULL constraint prevents a column from having a NULL value. Statements that insert NULL, or update a value to NULL, are automatically rejected.
Name VARCHAR(60) NOT NULL
Logical operators to check for NULL values
IS NULL and IS NOT NULL logical operators must be used to select NULL values.
truth tables
The value of logical expressions containing NULL operands is defined in truth tables.
Why can’t you use = NULL to check for a NULL value?
Because = is an arithmetic operator and this needs a comparison operator