0% found this document useful (0 votes)
10 views2 pages

SQL Task Ch5

Chapter 5 Task outlines a series of SQL queries to be executed on an HR schema. The tasks include calculating salary differences, minimum salaries by job, filtering departments by salary sums, counting employees in a specified department, summing salaries based on name criteria, and averaging commissions based on last names. Additionally, it provides a sample SQL command for selecting managers with minimum salaries above a certain threshold.

Uploaded by

engmerna245
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

SQL Task Ch5

Chapter 5 Task outlines a series of SQL queries to be executed on an HR schema. The tasks include calculating salary differences, minimum salaries by job, filtering departments by salary sums, counting employees in a specified department, summing salaries based on name criteria, and averaging commissions based on last names. Additionally, it provides a sample SQL command for selecting managers with minimum salaries above a certain threshold.

Uploaded by

engmerna245
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Chapter 5 Task

:Instructions

Study well and please attach Screen shots from the executable code in addition to -
.sample of queries' results in your Answers

If you want to know any column name in a specific table you have to apply -
.describe command: desc table_name

:HR schema-

Display the difference between the highest and lowest salaries in each .1
."department and rename it "Result

.Display the minimum salary for each job in each department .


Display the departments which their summation of salaries between 15000 and .3
.20000 and display the result in descending order

Display the [Link] employees in the department that you will enter its number .4
.at run-time

Display the summation of salaries for all employees whose their first name not .5
.start with 'S' letter

Display the average of commissions for employees whose last names end with .6
r and divide these employees into groups based on the value of salary and show
only groups with commission average is greater than .125 , display the averages
in descending order

Select manager_id,min(salary)

From employees

Where manager_id is not null

Group by manager_id

Having min(salary) > 6000

Order by min(salary) desc

You might also like