Workspace
Siarhei Palatnikau/

Project: Analyzing Motorcycle Part Sales

0
Beta
Spinner
Unknown integration
DataFrameavailable as
revenue_by_product_line
variable
SELECT product_line, 
       CASE WHEN EXTRACT(month FROM date) = 6 THEN 'June'
            WHEN EXTRACT(month FROM date) = 7 THEN 'July'
            WHEN EXTRACT(month FROM date) = 8 THEN 'August'
       END AS month,
       warehouse,
       ROUND(SUM(total::numeric)*(1 - AVG(payment_fee)::numeric), 2) AS net_revenue
FROM sales
WHERE client_type = 'Wholesale'
GROUP BY product_line, warehouse, EXTRACT(month FROM date)
ORDER BY product_line, month, net_revenue DESC
This query is taking long to finish...Consider adding a LIMIT clause or switching to Query mode to preview the result.
  • AI Chat
  • Code