Division
Compute the average revenue per employee for Fortune 500 companies by sector.
Latihan ini adalah bagian dari kursus
Exploratory Data Analysis in SQL
Petunjuk latihan
- Compute revenue per employee by dividing
revenuesbyemployees; casting is used here to produce a numeric result. - Take the average of revenue per employee with
avg(); alias this asavg_rev_employee. - Group by
sector. - Order by the average revenue per employee.
Latihan interaktif praktis
Cobalah latihan ini dengan menyelesaikan kode contoh berikut.
-- Select average revenue per employee by sector
SELECT ___,
___(___/___::numeric) AS avg_rev_employee
FROM fortune500
GROUP BY ___
-- Use the column alias to order the results
ORDER BY ___;