1. Learn
  2. /
  3. Courses
  4. /
  5. Exploratory Data Analysis in SQL

Connected

Exercise

Mean and Median

Compute the mean (avg()) and median assets of Fortune 500 companies by sector.

Use the percentile_disc() function to compute the median:

percentile_disc(0.5) 
WITHIN GROUP (ORDER BY column_name)

Instructions

100 XP
  • Select the mean and median of assets.
  • Group by sector.
  • Order the results by the mean.