Introduction
UNIQUE
NOT NULL
CHECK
DEFAULT
29. DEFAULT - Creating tables
Summary

Instruction

Good. Well, the values have been set to NULL because this is what the user wanted. As you can see, the DEFAULT constraint does not forbid NULL values in the given column. It only provides a value on its own when the user forgets to mention the specific column in the instruction.

Exercise

Again, try to create the table card_game on your own. The template is ready. All you need to do is add DEFAULT constraints:

  • the value 2 for min_players,
  • the value 60 for min_time and
  • FALSE for cooperation.
Have a go!

Console

Code editor

Result

TableConsole