top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Oracle: What is a CONSTRAINT? What are its various levels?

+1 vote
440 views
Oracle: What is a CONSTRAINT? What are its various levels?
posted Aug 20, 2015 by Viswas Kumar

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote
 
Best answer

CONSTRAINTS are used to check validations before inserting data into Table and also provide relationship between tables.
TABLE LEVEL CONSTRAINTS : 1. UNIQUE CONSTRAINT
2. PRIMARY KEY CONSTRAINT
3. CHECK CONSTRAINT
4. FOREIGN KEY CONSTRAINT
COLUMNLEVEL CONSTRAINTS : 1. UNIQUE CONSTRAINT
2. PRIMARY KEY CONSTRAINT
3. CHECK CONSTRAINT
4. FOREIGN KEY CONSTRAINT
5. NOT NULL CONSTRAINT
6. DEFAULT CONSTRAINT.

NOT NULL Constraint - Disallows NULL values in a table's column.
UNIQUE Constraint - Disallows duplicate values in a column or set of columns.
PRIMARY KEY Constraint - Disallows duplicate values and NULL values in a column or set
of columns.
FOREIGN KEY Constraint - Require each value in a column or set of columns match a
value in a related table's UNIQUE or PRIMARY KEY.
CHECK Constraint - Disallows values that do not satisfy the logical expression of
the constraint.

answer Aug 21, 2015 by Arun Gowda
...