CHAPTER 7

image

NULLs and Table Constraints

You’ve done brilliantly. You’ve created an entire database with a normalized table structure. You’ve even created specialized scripts so you can build or drop the database easily. Now we’re going to look at how we can help to ensure—as far as we can—that only good data is entered into our tables. As you might imagine, SQL Server provides a few tools that can help. We’re going to look at the following:

  • NULLS: what they are, and how we can specify whether a column supports them or not
  • Default Constraints: why and how to use them
  • Table Constraints: You’ve actually already met some of these, when we created ...

Get Introducing SQL Server 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.