Column constraints - DEFAULT and CHECK
55.2
Exercise

DEFAULT Constraint

Write a set of SQL statements together to:

  1. create a new table teachers with the following columns, data types and constraints.

    column data type constraint
    id INTEGER UNIQUE
    name TEXT NOT NULL
    department TEXT DEFAULT 'Ruby'
  2. add these record rows to the created table teachers

    id (INTEGER) name (TEXT) department (TEXT)
    1 Jofra SQL
    2 Kagiso Not Specified
    3 Marcus NULL