unique constraint in sql
Answers
Answered by
0
The answer is unique constraint in Shankar quarrelling lining
Answered by
0
- In SQL The UNIQUE constraint ensures the executed values in a column .In other words , no two rows can hold the same values for a common with UNIQUE constraint.
Let us take an example:—
CREATE TABLE statements:-
Column SID has a unique constraint, and hence cannot include duplicate values .Such constraint does not hold columns Last_Name and First_Name.So,it the table already contains the following rows:
Excuting the following SQL commands
It will result in an error because the value 3 already exist in SID column , thus trying to insert another row with that value violates the UNIQUE constraint.
Similar questions