SQL - Common Table Expressions (CTEs)
Given these tables:
- sales(year INT, amount INT)
Write a query using two CTEs where the first CTE calculates total sales per year, and the second CTE selects only years with total sales above 1000. Which query is correct?
- sales(year INT, amount INT)
Write a query using two CTEs where the first CTE calculates total sales per year, and the second CTE selects only years with total sales above 1000. Which query is correct?
