Iris software wants to identify employees whose completed sales exceed the £1,000,000 performance threshold. Write a PostgreSQL query that aggregates qualifying sales by employee and returns every employee above the threshold.
Requirements
- Include only sales with
status = 'Completed'.
- Calculate each employee's total completed sales, ignoring NULL sale amounts through PostgreSQL aggregation behavior.
- Return the employee ID, employee name, and total sales for employees whose total exceeds
1000000.
- Sort the results from highest total sales to lowest.