Constraints in SQL and it's 6 types | MySQL | Oracle | Sql server

preview_player
Показать описание
Constraints in SQL :-

Constraints are the rules enforced on data columns on a table.
These are used to limit the type of data that can go into a table.
1. NOT NULL – This constraint ensures that the field doesn’t contain NULL values.
2. Default – This constraint set it’s default value in the field if no other value has been provided during record creation.

3. UNIQUE - This constraint ensures that the field doesn’t contain any duplicate values.

4. CHECK – It ensures that all values in a column satisfy certain conditions.

5. PRIMARY KEY - This constraint is used to set a column as the primary key of the table.
6. FOREIGN KEY - This constraint is used to uniquely identifies a row/record in any other database table.
Рекомендации по теме
join shbcf.ru