Google News
logo
SQL Server - Interview Questions
What are the different types of Columns Types Constraints in the SQL Server?
SQL Server provides 6 types of Constraints. These are as follows :
 
* Not Null Constraint : This puts a constraint that the value of a column cannot be null.

* Check Constraint : This puts a constraint by checking some particular condition before inserting data in the table.

* Default Constraint : This constraint provides some default value that can be inserted in the column if no value is specified for that column.

* Unique Constraint : This puts a constraint that each row of a particular column must have a unique value. More than one unique constraint can be applied to a single table.

* Primary Key Constraint : This puts a constraint to have a primary key in the table to identify each row of a table uniquely. This cannot be null or duplicate data.

* Foreign Key Constraint : This puts a constraint that the foreign key should be there. A Primary key in one table is the foreign key of another table. Foreign Key is used to create a relation between 2 or more tables.
Advertisement