Explain different constraints to maintain data integrity in sql
Answers
Answered by
2
Different constraints in mysql are as follows :-
1) primary key : it uniquely identify the records in a table. It can be applied to only one column of the table.
2) foreign key: it is the key applied on column of child table which is referenced to the primary key of parent table.
3) check constraints : it is applied to column or to table to keep check on the records inserted in the table.
4) default constraints : it is applied to table so that if there is any value inserted in table as null, it can replace the value with default value.
Hope it helps you
1) primary key : it uniquely identify the records in a table. It can be applied to only one column of the table.
2) foreign key: it is the key applied on column of child table which is referenced to the primary key of parent table.
3) check constraints : it is applied to column or to table to keep check on the records inserted in the table.
4) default constraints : it is applied to table so that if there is any value inserted in table as null, it can replace the value with default value.
Hope it helps you
Similar questions
Social Sciences,
7 months ago
Hindi,
7 months ago
Hindi,
7 months ago
Science,
1 year ago
Physics,
1 year ago