full query

PHOTO EMBED

Wed Aug 10 2022 06:41:54 GMT+0000 (UTC)

Saved by @vnmshenoy

SELECT last_name,first_name,
avg(salary) as average_salary,count(distinct year) as years_worked 
from employees
group by last_name,first_name
having years_worked >2
order by average_salary desc
content_copyCOPY

https://learnsql.com/track/sql-from-a-to-z/course/sql-queries/order-by-group-by/practise/practise