Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Questions are to be implemented in the Oracle SQL-Plus environment Create an SQL file that contains the answers to the following questions: 0. set linesize

Questions are to be implemented in the Oracle SQL-Plus environment

Create an SQL file that contains the answers to the following questions:

image text in transcribed

0. set linesize 120; set echo on and set serveroutput on.

1. Create a duplicate table for Employee, call it Employee2 without inserting any tuples. (Hint: use an insert into command with a query see the SQL tutorial in the Data drive). To test: Show the table description, and the table content.

2. Write a PL/SQL procedure updateSupervisorAll for the COMPANY database that will take both old and new values of the supervisor ssn for the Employee table and change the old supervisor ssn to the new one (i.e., suppose that the supervisor with old superssn is no longer a supervisor and a new one, which must be from the existing employees, is assigned to all of the employees who have been supervised by the old supervisor.

To test: First, display employee last names and their old supervisor last name. Apply the stored procedure updateSupervisorAll to update supervisor. Then display employee last names and their new supervisor last name. Then rollback.

3. Write a PL/SQL procedure for the COMPANY database that will find the highest salaried employee (his/her last, first name, ssn#, dno) and his/her department name. Display the result by calling this procedure appropriately.

EMPLOYEE Fname Minit Lname Ssn BdateAddress Sex Salary Super_ssn Dno DEPARTMENT Dname Dnumber Mgr_ssn Mgr_start_date DEPT LOCATIONS numberDlocation PROJECT Pname Pnumbe Plocaion Dnum WORKS_ON Essn Pno Hours DEPENDENT Essn Dependent_name SexBdate Relationship

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

Recommended Textbook for

Professional Microsoft SQL Server 2014 Integration Services

Authors: Brian Knight, Devin Knight

1st Edition

1118850904, 9781118850909

More Books

Students also viewed these Databases questions

Question

What is Accounting?

Answered: 1 week ago

Question

Define organisation chart

Answered: 1 week ago

Question

What are the advantages of planning ?

Answered: 1 week ago

Question

Explain the factors that determine the degree of decentralisation

Answered: 1 week ago

Question

5. Develop the succession planning review.

Answered: 1 week ago