Category Archives: comp science

SQL Constraints

Good to remember

In SQL, we have the following constraints:NOT NULL – Indicates that a column cannot store NULL valueUNIQUE – Ensures that each row for a column must have a unique valuePRIMARY KEY – A combination of a NOT NULL and UNIQUE. Ensures that a column or combination of two or more columns have an unique identity which helps to find a particular record in a table more easily and quicklyFOREIGN KEY – Ensure the referential integrity of the data in one table to match values in another tableCHECK – Ensures that the value in a column meets a specific conditionDEFAULT – Specifies a default value when specified none for this column

via SQL Constraints.