Build a pipeline report showing each order's journey. Use CTEs to gather: (1) order info with customer name, (2) payment status, (3) shipping status. Combine them to show order id, customer name, order status, payment status (or 'unpaid'), shipping status (or 'not shipped'), and delivery_date. Sort by order_date descending.
Schema
🔑idINT
first_nameTEXT
last_nameTEXT
emailTEXT
phoneTEXTNULL
cityTEXT
stateTEXT
countryTEXT
created_atTIMESTAMP
postgresql
Run your query to see results
Press Ctrl + Enter to execute