Skip to content
SQLSimplified
Data AnalystQuestion 37 of 57

Calculating the Median

Problem

A standard average salary can be distorted by a few very high earners. To get a better picture of mid-level pay, find the median salary of the company. Write a query that outputs concept with the value: "Median can be calculated using PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY salary) in databases that support it."

Database Schema

This problem acts as a scratchpad. You will write your own DDL/DML or conceptual queries, so there is no predefined schema.

Try It

Loading playground environment...

Hint

Solution