From the course: SQL Server 2014: Developing Databases

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Using constraints to enforce integrity

Using constraints to enforce integrity - SQL Server Tutorial

From the course: SQL Server 2014: Developing Databases

Start my 1-month free trial

Using constraints to enforce integrity

- Using constraints to enforce integrity. Now, before I get into that, I'm going to do a quick word about NULL on the off chance that you don't really understand the concept of NULL. Now, NULL can be in two states, that is, any single NULL can be, as I just said, in two states, that being unknown or not applicable. So, if we think, for example, we send out a survey to building owners and we want to know how many elevators or, are there elevators in their buildings. Some of the building owners, and we know which ones, do not respond. So, therefore, when we said how many elevators are in that building, we would insert NULL. By the way, don't get into these tricks where people think they understand NULL and they'll start putting in little text strings, et cetera. You really want to limit the amount of NULLs that you have within your database but sometimes you have to have NULLs. OK, so it can be in two states: the unknown I just described, and other business, people that own these…

Contents