Question: 1. (7 pts) Use Oracle SQL to create a script file that declares table schema based on the following assumptions, and then inserts data records

 1. (7 pts) Use Oracle SQL to create a script file

1. (7 pts) Use Oracle SQL to create a script file that declares table schema based on the following assumptions, and then inserts data records into the tables (a) Different departments have different names. (b) A department may temporarily have no manager (c) Different employees may have the same name (d) An employee can work as a manager for at most one department (e) People who work in the HR department should earn at least 20,000 dollars. (f) When deleting a record of an employee who is a manager, the managerID field of the department she/he works for should be set to null. (g) When deleting a record of a department, the deptName field of all employees who work in that department should be set to null. All constraints must be declared before any actual data is inserted into tables Departments Name HR RD SALES manager Name ohn Robert enny Christ Bill Susan Salary 56000 37500 46000 39000 50000 67500 deptName RD HR HR SALES RD RD ID 123 578 101 2. (1 pt) Insert the following record into table Employees, what would happen? Name Mike Salary 18000 deptName HR ID 3. (1 pt) Delete the SALES department from table Departments, what would happen? 4. (1 pt) Delete the employee whose ID is 666 from table Employees, what would happen? 1. (7 pts) Use Oracle SQL to create a script file that declares table schema based on the following assumptions, and then inserts data records into the tables (a) Different departments have different names. (b) A department may temporarily have no manager (c) Different employees may have the same name (d) An employee can work as a manager for at most one department (e) People who work in the HR department should earn at least 20,000 dollars. (f) When deleting a record of an employee who is a manager, the managerID field of the department she/he works for should be set to null. (g) When deleting a record of a department, the deptName field of all employees who work in that department should be set to null. All constraints must be declared before any actual data is inserted into tables Departments Name HR RD SALES manager Name ohn Robert enny Christ Bill Susan Salary 56000 37500 46000 39000 50000 67500 deptName RD HR HR SALES RD RD ID 123 578 101 2. (1 pt) Insert the following record into table Employees, what would happen? Name Mike Salary 18000 deptName HR ID 3. (1 pt) Delete the SALES department from table Departments, what would happen? 4. (1 pt) Delete the employee whose ID is 666 from table Employees, what would happen

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!