Oracle : Table Level and Column Level constraints

We have two type of constraints - Table Level and Column Level. Which is better and why..?

Questions by Sant_parkash   answers by Sant_parkash

Showing Answers 1 - 21 of 21 Answers

gemini burj

  • Oct 31st, 2007
 

Dear,

If the same constraint is used in coloum leve or table leve then there is no difference in functanality, i.e. if you are using primary key ore foreign key for the one column. This kind of constraint could be in table level or column leve and there will be no difference. But if you have to have a primary key and foreign key constraint for the multiple columns then you can not use this constraint in column level thse constraints are to be defined at table level.

  Was this answer useful?  Yes

safdar

  • Feb 14th, 2008
 

hi i am safdar dogar
in oracle there are five constraints
not null,unique,primary key,check,foreign key
not null always use in column level and foreign key always use in table lavel
but remaing three use column level and table level
both are working in same
am i right

gemini burj

  • Feb 25th, 2008
 

Dear,

We have restrictions only for not null constraint that this can be sued at columns level only. even you can use foreign key constraint at colum level by using reference statement.

  Was this answer useful?  Yes

>>We have two type of constraints - Table Level and Column Level. Which is better and why..?

Performance wise there will not be any difference between table level and column level constraints.

Generally we use table level constraint to define composit keys( Constraint on combination of columns). Except  not null constraint ,  remaining constraints cane be defined at table table or column level. Not null constraint must be declared as column level constraint only.

Mohit

  • Oct 3rd, 2015
 

I think Table level contraints are imposed when we have to compare values in multiple columns,suppose delivery_date cannot be less than order_date..

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions