Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
CHECK constraints with a simple condition
CHECK constraints with complex conditions
6. CHECK – complex conditions
Adding CHECK constraints to existing tables
Summary

Instruction

Great! Now it's good to understand that the logical conditions after CHECK can be complex. Take a look at the example below:

price decimal(5, 2) CHECK (price > 0.00 AND price < 800.00)

As you can see, we can join more than one condition to create precise logical statements.

Exercise

Fill the template we prepared for you so that the hours column has a constraint: greater than 0 and lower than 999.

Stuck? Here's a hint!

Make sure that hours > 0 AND hours < 999.