Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The problems on the next page require writing SQL scripts for Oracle. You should submit a script for each of these problems in separate text

image text in transcribedimage text in transcribedimage text in transcribed

The problems on the next page require writing SQL scripts for Oracle. You should submit a script for each of these problems in separate text files. Please remember that PDFs and MS Word documents are not text files. The script should be able to be executed with the start command using the version of Oracle provided by IT support. Use two hyphens to begin a single-line comment, or use the C-style syntax (/* ... */) for multi-line comments. 3. Write SQL queries or statements for each of the following queries. Each query should be in its own text file. (45 points) 3.1 List the name and salary of the employees in the HR department. The list should be given sorted by salary starting with highest salaries first. 3.2 For each location, list the number of different projects along with the average budget. 3.3 Give the number of employees that do not have managers. 3.4 Give the name of the employee with the highest salary. 3.5 Give the name of the employee with the 2nd highest salary. 3.6 Give the name of the employee that leads the most projects 3.7 Double (update) the budget of all projects that contain the letters 'SEC'. 3.8 Remove projects that have no employees that work on them. 3.9 List the IDs of the projects that are over-budget, meaning projects whose budget is less than the sum of the salaries of the employees that work on it. Relations Note: Each table's primary key is underlined. Works EmplD 101 101 Hours 5 10 Employee EmplD EmpName Dept Salary Manager 101 Alpha HR 200 202 Beta ENGR 250 303 Gamma IT 300 202 404 Delta ENGR 275 202 505 Epsilon HR 325 101 606 Zeta IT 225 404 707 Omega IT 300 303 101 202 202 303 8 ProjiD Red Orange Yellow Green Blue Indigo Violet Red Orange Yellow Green Blue Indigo Violet 303 303 404 404 505 4 7 17 22 505 2 505 Project ProjiD Red Orange Yellow Green Blue Indigo Violet 606 Loc Budget Lead NW 1000 707 NE 1100 707 SW 950 606 SE 900 606 NW 1200 505 SW 1000 404 NW 1150 303

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

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions