Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions