Column constraints allow you to provide rules for the content of columns at the time they are defined.
- [Instructor] As you're defining you're schema you … may want to define specific rules and behaviors for … some of your columns. … This is done by using constraints. … Here again we're using the test database. … And I'm going to create this table. … I'm just dropping the table of exists just as a precaution … in case you still have it from previous lessons. … And we're going to create this test table again, … this time just with three text columns. … And we'll insert some values into it … and take a look at it and so here I'm going to execute … all of this. … And you notice that we have our one row with … data in two of the columns … and not in the third column because we only … added data to A and B for this inserted row. … And so the C column has this null state here … because no data was added to that column. … If you want to disallow this behavior you can … add a not null constraint … to the C column. … You can do this, not null. … And now when I execute all of this again … we'll drop the table because now it exists. …
This course was created by Bill Weinman. We are pleased to offer this training in our library.
- How databases are organized
- Selecting rows and columns
- Creating new tables
- Inserting and updating data
- Sorting and filtering
- Accessing related tables with JOIN
- Working with strings
- Understanding numeric types
- Using aggregate functions and transactions
- Automating data with triggers
- Creating views
- Using CRUD functions
Skill Level Beginner
2. SQL Overview
3. Fundamental Concepts
7. Dates and Times
Dates and times2m 6s
11. Views and Subselects
12. A Simple CRUD Application
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.