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.

Solution: Add constraints to a table

Solution: Add constraints to a table

From the course: Database Foundations: Data Structures

Start my 1-month free trial

Solution: Add constraints to a table

(upbeat music) - [Instructor] I hope you were able to add in the requested constraints to your employees table. Let's walk through the different commands that we need to execute. First. I'm going to find the two trees database in my SQL server instance, which is where I've been working on the employees table. Going to right click on that and choose new query. And then as always, I'm just going to select everything from the table, and this will just allow me to quickly see where or what the state of the table is that we're starting with. Okay, so I've got two rows in here and I got a whole bunch of different columns that we're going to work with. I'm just going to type in some notes here for the different things that we're trying to accomplish. So I want to have the first and last name columns be not null. We also want to have a default value for the phone number, and the last thing that I asked for was that salaries are…

Contents