Write a SQL query to find the average salary of employees in each department, sorted in...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a SQL query to find the average salary of employees in each department, sorted in descending order by the average salary. Example: Input: Employee table: name John Jane Bob Alice Tim Output: department IT HR Query: department IT HR IT HR IT average salary 2000 2000 SELECT department, AVG(salary) AS average salary FROM Employee GROUP BY department ORDER BY average salary DESC salary 1000 1500 2000 2500 3000 Copy code Write a SQL query to find the average salary of employees in each department, sorted in descending order by the average salary. Example: Input: Employee table: name John Jane Bob Alice Tim Output: department IT HR Query: department IT HR IT HR IT average salary 2000 2000 SELECT department, AVG(salary) AS average salary FROM Employee GROUP BY department ORDER BY average salary DESC salary 1000 1500 2000 2500 3000 Copy code
Expert Answer:
Related Book For
Fundamentals Of Database Systems
ISBN: 9780133970777
7th Edition
Authors: Ramez Elmasri, Shamkant Navathe
Posted Date:
Students also viewed these databases questions
-
Write a SQL query to identify all students who have been matched in 2018 with a tutor whose status is Temp Stop.
-
A company wants to find the average weight of its products. A large initial sample shows the standard deviation of the weight is 20 g. What sample size would give a 95% confidence interval for the...
-
The average salary of Major League Baseball players on opening day from 2000 to 2012 is stored in BBSalaries and shown in the right column. a. Plot the data. b. Compute a linear trend forecasting...
-
Your friend, Daniel Nat, recently began work as the lead accountant for Asheville Company. Dan prepared the following balance sheet for December 31, 20Y5: Asheville Company Balance Sheet December 31,...
-
A 40-cm-diameter loop is rotated in a uniform electric eld until the position of maximum electric ux is found. The flux in that position is measured to be 5.2 105 N m2/C. Calculate the electric eld...
-
Martin Footwear Co. produces high-quality shoes. To prepare for next year's marketing campaign, the company's controller has prepared the following information for the current year, 2016:...
-
Using the Internet, find descriptions of recent fraud schemes based on SEC releases.
-
Jalapenos! is based in Pleasant Hill, California. The merchandising company has three divisions: Clothing, Food, and Spices. The Clothing division has two main product lines: T-shirts and...
-
ullduct appropriate procedures callt ac 3. Create a finished workpaper: a. Reference the workpaper at A-8. Put the memo as page 1 with the balance sheet and income statement as subsequent pages of...
-
Ramada Company produces one golf cart model. A partially complete table of company costs follows: Required: 1. Complete the table. 2. Ramada sells its carts for $1,200 each. Prepare a contribution...
-
Dans laquelle des situations suivantes y a-t-il plus de chance qu'on utilise un test indpendant ? a) Pour tester le calcul mental chez des enfants entre le premier et le dernier jour de classe b)...
-
Want` a` house` in` 6 `years. `hopes `to` be `able `to` put `down` $25,000 `at `that` time. `Bank `term`deposit` wants` to `invest `in `will` pay` 7.5% annully.` how `much `will` she `need` to `put...
-
Ten -year `bond `has` a `par` value `of` $1,000:` a `7.5% coupon `rate:` and `a` yield` to `maturity `of `8.25%.` Assuming `the` coupons` are` paid `semi-annually,` the `market` price` is `closest`...
-
What `is` the `YTM `of `a `four-year` bond` with `par` value` of `$1,200 `and a `4.2%` coupon `rate `when` the` bond` priced `at` $932.35: `assume `coupons` are `paid` annually
-
The MoMi Corporation's cash flow from operations before interest and taxes was $2.4 million in the year just ended, and it expects that this will grow by 5% per year forever. To make this happen, the...
-
Compare the advantages and disadvantages of using a Dutch Auction to a traditional underwriting method for an IPO. Identify one real-life IPO that occurred in 2020. (Not Airbnb) For this one IPO,...
-
Sandy wants to compare her height and weight to the national average for women in her age bracket. What type of measurement should she be using? Obvious-reference test Pass-fail referenced test...
-
Suppose that a flow network G = (V, E) violates the assumption that the network contains a path s t for all vertices V. Let u be a vertex for which there is no path s u t. Show that there must...
-
What is the function of JobTracker?
-
Consider the COMPANY database described in Figure 5.6. Using the syntax of Oracle triggers, write active rules to do the following: a. Whenever an employees project assignments are changed, check if...
-
What is meant by the concurrent execution of database transactions in a multiuser system? Discuss why concurrency control is needed, and give informal examples.
-
A company maintains its fixed assets at cost. Depreciation provision accounts, one for each type of asset, are in use. Machinery is to be depreciated at the rate of 12% per cent per annum, and...
-
A company starts in business on 1 January 19X3, the financial year end being 31 December. You are to show: (a) The machinery account. (b) The provision for depreciation account. (c) The balance sheet...
-
A company depreciates its plant at the rate of 20 per cent per annum, straight line method, for each month of ownership. From the following details draw up the plant account and the provision for...
Study smarter with the SolutionInn App