BaşlayınÜcretsiz Başlayın

Division

Compute the average revenue per employee for Fortune 500 companies by sector.

Bu egzersiz

Exploratory Data Analysis in SQL

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Compute revenue per employee by dividing revenues by employees; casting is used here to produce a numeric result.
  • Take the average of revenue per employee with avg(); alias this as avg_rev_employee.
  • Group by sector.
  • Order by the average revenue per employee.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

-- 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 ___;
Kodu Düzenle ve Çalıştır