SQL - Common Table Expressions (CTEs)
Given the SQL query:
What is the purpose of this query?
WITH TopSellers AS (SELECT salesperson, SUM(amount) AS total_sales FROM sales GROUP BY salesperson) SELECT salesperson FROM TopSellers WHERE total_sales > 5000;What is the purpose of this query?
