What is constraints and its types in DBMS?
Constraints are set of rules used to restrict the type of data that can go into a table, to preserve the accuracy and integrity of the records internal the table.
The different types of constraints in DBMS are as follows:-
- NOT NULL:-it makes sure that column does not hold a NULL value.
- UNIQUE:- It invokes a column to have a UNIQUE value
- DEFAULT:-gives the default value to the column
- CHECK:-specify the range of values for a column
- Key Constraints –
- PRIMARY KEY:-it diagnose each and every record in a table
- FOREIGN KEY:- it points to the primary key of any other table.
BY Best Interview Question ON 18 Mar 2020