O'Reilly logo

SQL: Visual QuickStart Guide by Chris Fehily

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Forbidding Nulls with NOT NULL

A column’s nullability determines whether its rows can contain nulls—that is, whether values are required or optional in the column. I described nulls and their effects in “Nulls” in Chapter 3, but I’ll review the basics here:

  • A null is not a value but a marker that means no value has been entered.

  • A null represents a missing, unknown, or inapplicable value. 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.

  • A null isn’t the same as zero (0), a blank, or an empty string (" ").

  • Nulls belong to no data type and can be inserted into any column that permits nulls.

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

When ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required