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

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 managerID 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'. Denartment 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. 2. (0.5 point) When inserting the following tuple into relation Employee, what would happen? Explain why. 3. (0.5 point) When deleting the "SALES" department from relation Departments, what would happen? Explain why. ( 0.5 point) When deleting the employee whose ID is 666 from relation Employee, what would happen? Explain why

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!