Interview Query

Employee Salaries

71
Have you seen this question before?

Given a employees and departments table, select the top 3 departments with at least ten employees and rank them according to the percentage of their employees making over 100K in salary.

Example:

Input:

employees table

Columns Type
id INTEGER
first_name VARCHAR
last_name VARCHAR
salary INTEGER
department_id INTEGER

departments table

Columns Type
id INTEGER
name VARCHAR

Output:

Column Type
percentage_over_100K FLOAT
department_name VARCHAR
number of employees INTEGER
Next question: Bias Variance Tradeoff
.....
MySQL 8.0.17
Loading editor
Use Shift + Enter to run query