Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi I need help with mysql questions, please thank you Link to sql file on google drive: https://drive.google.com/file/d/1nBXFuujXudCjzyvQ282NWB3qZhXplvmr/view?usp=drivesdk 7. Write a query to show the

Hi I need help with mysql questions, please thank you

Link to sql file on google drive: https://drive.google.com/file/d/1nBXFuujXudCjzyvQ282NWB3qZhXplvmr/view?usp=drivesdk

image text in transcribed

7. Write a query to show the total number of employees for each territory. Show the number of employees first and then the territory description. Sort the results by the number of employees per territory with the highest number of employees first. If there are territories with the same number of employees, then sort the results by territory description within number of employees. Below is a sample of the expected output. New York danta Columbia Dalas 8. Now show the number of employees by region. Below is the expected result including sort order and column names Number of Employees RegionDescription 19 15 Eastem Westem Northem 9. Show the supervisor(s) that have 4 or more employees. It is okay to hard code the 4 this time. You must use the appropriate HAVING clause. Here is the expected result. Notice the column headers. Supervisor Number of employees Fuller, Andrew 5 10. Show only the territory with the most employees. You must use aggregate functions in the query to only show the correct territory. Your query must use a HAVING clause with a subquery. Hint: Use your solution to #7 as a derived table for the subquery in the HAVING clause. Here is the entire expected result. Number of EmployeesTetoryDesorption New York

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

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions

Question

Explain the steps involved in training programmes.

Answered: 1 week ago

Question

What are the need and importance of training ?

Answered: 1 week ago