SQL Practice Logo

SQLPractice Online

Level 4 - Mid-LevelDebugging Questions

Debug: CTE Missing AS Keyword

Fix the syntax issue. WITH monthly_sales (SELECT DATE_TRUNC('month', order_date) AS month_start, SUM(total_amount) AS revenue FROM orders GROUP BY DATE_TRUNC('month', order_date)) SELECT * FROM monthly_sales;