Nulls

When your data is incomplete, you can use a null to represent a missing or unknown value. A null has these characteristics:

  • In SQL statements, the keyword NULL represents a null.

  • A null is used for a value that may never be known, may be determined later, or is inapplicable. (It’s helpful to think of a null as being a marker for a missing value, rather than as a value itself.)

  • A null differs from zero, a string that contains only blanks, or an empty string (''). A null in the column price doesn’t mean that an item has no price or that its price is zero; it means that the price is unknown or has not been set. (Oracle is a special case with respect to empty strings; see the DBMS Tip in this section.)

  • Nulls don’t belong to any data type and ...

Get SQL: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.