RE: What is the diffrence between and constraints and triggers?
Constraints are used to maintain the integrity and atomicity of database .in other words it can be said they are used to prevent invalid data entry . the main 5 constraints are NOT NULL PRIMARY KEY FOREIGN KEY UNIQUE KEY and CHECK
Triggers are bascically stored procedures which automaticallly fired when any insert update or delete is issued on table
RE: what is the diffrence between and constraints and ...
Triggers are used to carry out tasks which cant be done using constraints.
For eg:-A change in the sal column of a table should change the tax column in another table.This cant be done using constraints.It has to be done using triggers.Thats where the importance of triggers lie.
RE: what is the diffrence between and constraints and ...
Constraints are the conditions it can set while creating the table. To eliminate duplicates not null values and also check the conditions.. Triggers are used when the event occurs.