Question: 1. (8.5 points) Use Oracle SQL to create a script file that declares relation schemas based on the following assumptions, and then inserts data records
1. (8.5 points) Use Oracle SQL to create a script file that declares relation schemas based on the following assumptions, and then inserts data records into the relations. a) Different departments have different names. b) A department may temporarily have no manager. c) Different employees may have the same name. An employee can be uniquely identified by the ID. d) People who work in the HR department always earn at least 20,000 dollars. e) When deleting a record of an employee who is a manager, the manager ID field of the department the person works for should be set to null. f) When deleting a record of a department, the deptName field of all employees who work in that department should be set to null. g) When changing the name of a department in relation Department, values of attribute deptName in table Employee will also be changed accordingly. For example, if 'RD' is changed to 'RESEARCH' in relation Department, all occurrences of ' RD' in in table Employee will also to be automatically changed to 'RESEARCH'. Nenartmant Note: All necessary integrity constraints must be declared before any actual data is inserted into the relations. Hint: - You can add a certain constraint to a relation schema after the schema is defined. - You can insert tuples into relation Department using NULL as values of attribute managerID, and later change NULI to the IDs of assigned managers
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
