Question:

Briefly explain about any two column constraints used in SQL.

Show Hint

Column constraints are essential for maintaining data integrity and ensuring that only valid data is inserted into the table.
Hide Solution
collegedunia
Verified By Collegedunia

Solution and Explanation

Step 1: Define Column Constraints.
Column constraints are used to define the properties or rules applied to the columns in a database table to ensure the integrity and accuracy of the data. The constraints are applied at the column level.
Step 2: Explain the constraints.
Two common column constraints used in SQL are: (1) NOT NULL:
This constraint ensures that a column cannot have a NULL value. It is used when we want to ensure that every row in the table must have a value for this column. (2) UNIQUE:
The UNIQUE constraint ensures that all the values in a column are different from each other. It is used when we want to ensure that no duplicate values are entered in that column.
Was this answer helpful?
0
0