what is better constraint or Trigger??
If it is a job of just referential integrity I would use a constraint, where as if more complex logic is to be performed, then trigger.
constraints are proactive - they prevent unwanted actions from happening.
Triggers are reactive - they rollback the damage.
While deleting a record from a table a constraint would tell not to delete a parent record if child records exist.
A trigger rolls back the delete operation if you try to delete a parent record having child records.
Constraints apply to underlying table.
Triggers can access multiple tables(even tables in other databases).
With a trigger you can generate more custom and understandable and user friendly error messages as compared to cryptic messages returned by the constraints.
These are a few points to compare.. more are welcome.