TASK #208 · HardThe falling sales report picked up extra rows
Your brief
The report looks for employees whose sales are falling: their latest deal is
smaller than their very first one.
Each such employee should appear once, but some repeat several times with different last deal amounts. The report also includes employees whose last deal is larger than the first.
Output name (employee name), first_amount (amount of the first deal) and last_amount (amount of the last deal).
Each such employee should appear once, but some repeat several times with different last deal amounts. The report also includes employees whose last deal is larger than the first.
Output name (employee name), first_amount (amount of the first deal) and last_amount (amount of the last deal).
Ctrl / ⌘ + ↵
Result
Write a query and run it to see the results.
Schema
departmentsid, nameemployeesid, name, department_id, manager_id, salary, hired_atcustomersid, name, registered_atordersid, customer_id, employee_id, amount, created_atloginsuser_id, logged_at