From the course: Database Foundations: Data Structures

Unlock the full course today

Join today to access over 25,000 courses taught by industry experts.

Solution: Set additional constraints on the data

Solution: Set additional constraints on the data

From the course: Database Foundations: Data Structures

Solution: Set additional constraints on the data

(bright music) - [Instructor] In this challenge, we're given a table for job postings and we need to alter its design to add in a number of different constraints that we want enforced before records can be stored in the table. Adding constraints on the data will help ensure that everything is entered in consistently and in a way that aligns with the business rules and formatting expectations that we have. So here is the initial CREATE TABLE statement that we have to work with. And so now we just need to go through and add in all of the different constraints. So the first one is to add in the primary key constraint. I'll just type in a comment there so we can tell where I'm at. And this is going to alter the table called JobPostings. And this is the table that's created right here. You can see the different columns that are involved with that. So we need to alter the table JobPostings, and we're going to add in our primary key constraints. So ADD CONSTRAINT. We can name the constraint…

Contents