From the course: Database Foundations: Data Structures

Unlock the full course today

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

Null constraints

Null constraints

From the course: Database Foundations: Data Structures

Start my 1-month free trial

Null constraints

- [Instructor] The absence of data is in itself a special kind of information that's commonly found in a database. You can determine whether a column will allow or not allow these empty cells called null values. I've opened up the script called NullConstraints.sql and connected it to my SQL server container. Let's review the customer's table. I currently have two rows of data and every column is filled in for each customer. If I go over to the connection sidebar and open up the tables folder and find the customer's table and then expand the columns folder, I can find the description of each of these columns. Currently, all of the columns will allow cells to be left empty in a row, except for the primary key column. You can see that by the presence of the null keyword here in each of these descriptions. The primary key column is the only one that will not allow empty cells and it's specifying not null. What this means is…

Contents