On January 21th at 14:15 UTC , progression through exercises will be unavailable for 10 minutes due to a planned maintenance break.
Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close


Yes, that's right! Now, let's take a closer look at various constraints.


A forex agency needs a simple table to keep track of the currency exchanges they perform.

Create a table called exchange with the following columns:

  • id - an integer which is the primary key,
  • currency_from - exactly three characters,
  • currency_to - exactly three characters,
  • quantity - a decimal field of 10 digits, 2 out of which are after the decimal point,
  • rate - a decimal field of 6 digits, 2 out of which are after the decimal point,
  • time - a field with date and time.

Mind the following requirements:

  • No column can be a NULL.
  • The columns quantity and rate must be greater than zero.
  • If no value is provided, the default quantity is 100.00.

Stuck? Here's a hint!

We discussed constraints in Part 5. Take a look back to refresh your memory.