You've now learned about NOT NULL
, DEFAULT
, UNIQUE
, and CHECK
constraints. Real-world tables often use several of these together on different columns to ensure maximum data integrity. Let's practice combining them.
Engagement Message
Ready to build some complex tables?
Type
Fill In The Blanks
Markdown With Blanks
Fill in the blanks to create an employees
table with the following rules:
employee_id
is auto-generated and required.email
must be unique.salary
must be a positive number.department
defaults to 'General' if not provided.
Suggested Answers
- IDENTITY
- UNIQUE
- CHECK
- DEFAULT
