5.3. SQL Constraints

• Does something automatically

• Prevents from duplicating information

• Prevents from loss of integrity

5.3.1. NOT NULL

• Ensures that a column cannot have a NULL value

5.3.2. UNIQUE

• Ensures that all values in a column are different

5.3.3. PRIMARY KEY

• Uniquely identifies each row in a table

• A combination of a NOT NULL and UNIQUE

5.3.4. FOREIGN KEY

• Uniquely identifies a row/record in another table

5.3.5. CHECK

• Ensures that all values in a column satisfies a specific condition

5.3.6. DEFAULT

• Sets a default value for a column when no value is specified

5.3.7. INDEX

• Used to create and retrieve data from the database very quickly

• Analog to notebook calendar tabs