What is the Diff b/w Constraints and Trigeer

Answers were Sorted based on User's Feedback



What is the Diff b/w Constraints and Trigeer..

Answer / saraswathi muthuraman

TO apply business rule we are using Constraints and trigger.

If we have any computation and validation over the
calculated value we have choose "trigger".


Direct validation like the column should not contain null
values then you can choose Constraints.

Constraints : NOT NULL,UNIQUE,PRIMARY KEY,CHECK,REFERENCE

Trigger effected only those row after which trigger applied
but constraint effected all row of table .

Is This Answer Correct ?    24 Yes 0 No

What is the Diff b/w Constraints and Trigeer..

Answer / mohanbabu

Constraints are used to limit the type of data that can go
into a table.
Constraints can be specified when a table is created or
after the table is created.

A trigger is a fragment of code that you tell Oracle to run
before or after table is modified.

Is This Answer Correct ?    13 Yes 3 No

What is the Diff b/w Constraints and Trigeer..

Answer / shekar

Triggers: It checks the condition and Performs some action
eg: it checks and fires before or after insert or update
or delete

Constriants: it checks the condition
eg: suppose NotNull constraint.It jst doesn't allow null
values.

Is This Answer Correct ?    1 Yes 0 No

What is the Diff b/w Constraints and Trigeer..

Answer / manoranan sethy

Constraints are restrict the invalid data before invoke into the database whereas trigger restrict the invalid transaction.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

what is difference between procedure and function, procedure and trigger?

8 Answers   iFlex,


Explain 3 basic parts of a trigger.

0 Answers  


mail-id table contains two columns(email_id,userid) it contains different types of mail-ids,and no of users. here username length is differ na,(ex- tamil@yahoo.com,joshua@hotmail.com like) now i want to fetch the email-ids only starting from '@' (ex-@gmail.com,@yahoo.com,@hotmail.com

5 Answers  


Why left join is used in sql?

0 Answers  


use of IN/ANY/ALL

5 Answers   Ramco,






How do you update sql?

0 Answers  


what are the differences among these table level lock modes - IN SHARE MODE, IN SHARE UPDATE MODE, IN EXCLUSIVE MODE ?

3 Answers   HCL,


How to read/write files from pl/sql?

0 Answers  


what are the types of join and explain each? : Sql dba

0 Answers  


Does a primary key have to be a number?

0 Answers  


what is an execution plan? When would you use it? How would you view the execution plan? : Sql dba

0 Answers  


Explain the difference between sql and mysql.

0 Answers  


Categories