From the course: Database Foundations: Data Structures
Unlock the full course today
Join today to access over 25,000 courses taught by industry experts.
Null constraints
From the course: Database Foundations: Data Structures
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
-
-
-
-
-
-
-
-
- (Locked) Validate data with constraints3m 9s
- (Locked) Null constraints5m 34s
- (Locked) Unique constraints3m 46s
- (Locked) Setting default values3m 14s
- (Locked) Check constraints3m 8s
- (Locked) Challenge: Add constraints to a table46s
- (Locked) Solution: Add constraints to a table6m 29s
- (Locked) Solution: Set additional constraints on the data10m
- (Locked)
-