From the course: SQL for Testers

Unlock the full course today

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

Field constrains

Field constrains - SQL Tutorial

From the course: SQL for Testers

Start my 1-month free trial

Field constrains

- [Instructor] Let's take a look at field constraints and how they can contribute to quality. So first of all, what are field constraints? They're basically just rules that constrain what you're allowed to do on a given column or sometimes even on the entire table. Now, there's a number of different kinds of constraints that can be applied, so let's kind of take a look at it in SQLite to get a bit of a feeling for how it works. So if we double click on the products table here, it will bring up some of the different kinds of field constraints that can be applied. So, this table here, it's got a primary key constraint applied to the product ID column. And it has a foreign key constraint applied to the category ID column. We can also apply some of these other ones. Unique, check, so on and so forth. But what do these all mean? Well, let's go through them one at a time and see if we can understand them. I'm going to start at the right and work to the left. So the default value here, I…

Contents