SELECT e.name, COUNT(o.id) AS orders,
SUM(o.total) AS revenue
FROM employees e
LEFT JOIN orders o
ON o.employee_id = e.id
WHERE o.placed_at >= '2025-01-01'
GROUP BY e.name
HAVING revenue > 5000
ORDER BY revenue DESC;Choose the path that gets you job-ready faster.
Elite adds: AI SQL Mentor · Advanced projects · Full 22-level path
Elite Annual
$184.84 due today
That's only $15.40/month
Renews annually — cancel anytime
Try it for 14 days, risk-free.
Your progress
Level 12 of 22
55% complete
Your learning path