The comparison of check, trigger and application code
Recently I am involved with a project where I have to develop a department management tool, to which, I have to apply some constraints.
For instance, some simple rules are
- The parent id has to be chosen only from the existing department IDs.
- If a department ID has been used as a parent ID by some department, then it’s unable to be deleted until the usage has been removed.