| You are a database developer in your organization. Users are reporting that they find objects in the organization's customer relationship management (CRM) application whose parent objects have been deleted. One example is employees who work in a department that doesn't exist in the database. They also complain that prices for some products contain negative values, even though this should not be possible according to the documentation of the application. It is very important to find the source of these bugs as soon as possible, as well as to make sure that these issues do not reappear. Design a solution to solve this problem. |
|
Answers
| Implement foreign key constraints between child and parent objects (such as from employee to department) to stop parent objects from being deleted if they contain child objects. Implement a check constraint on the product price to validate that prices cannot be less than zero. After implementing these updates on a test environment, test the application against the test environment, and look for run-time errors caused by these added constraints. |