NULLs and Database Design

As you recall, you specify whether a column allows NULL when you create a table. Setting up columns that can accept NULL means that the database system can gracefully handle these two situations:

  • A user is adding a new row to a table but doesn't have the information to be entered in some of the fields. The database system automatically marks these positions as NULLs.

  • You're restructuring a table by adding a new column to it. What gets entered in that new column in all the existing rows? Again, the database system automatically enters NULLs.

If a piece of information is required (a product name, an ID number), the column that contains it cannot be NULL. For more on this topic, see “Assigning Null Status” in Chapter 3.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.127.68