Instruction
You may not be aware of it, but you already know a few constraint types. Primary keys, foreign keys, and NOT NULL are all constraints.
Before we get to know new constraint types, let's do a recap of what we already know about primary and foreign keys.
A primary key uniquely identifies a given row in a table. It may consist of one or more columns. When creating a table, we can specify a single-column primary key in the following way:
CREATE TABLE swimming_pool ( id integer PRIMARY KEY, address text, rating integer );
Look a the definition of the first column. After the data type, we added the keywords PRIMARY KEY. This way, the id column becomes the single-column primary key for the swimming_pool table.
Exercise
An international accounting company needs to create a simple database to keep track of their employees. For now, create a table named employee with the following fields:
id– An integer value.first_name– Up to 32 characters.last_name– Up to 32 characters.department– Up to 32 characters.
The id column should be the primary key.



