DATA_SOURCE: duckdb - Ecommerce platform — customers, orders, products, inventory, and marketing. DuckDB backend. Run `python seed.py` to initialise.
CONTEXT: sales - Order processing, revenue, and product sales. Joins orders, line items, customers, and products for end-to-end sales analysis. (v1.0)
DATASET: main - Primary ecommerce schema
TABLES:
main.orders|Customer orders. status can be: pending, shipped, delivered, cancelled. total_amount is the final charged amount (after discounts). discount_amount is the absolute value of any discount applied.|id:I[PK]|customer_id:I|status:S|total_amount:N|discount_amount:N|shipping_address:S|created_at:TS|shipped_at:TS|delivered_at:TS
main.order_items|Individual line items within an order. FK: order_id → orders.id, product_id → products.id. unit_price is the price at time of purchase (may differ from current product price).|id:I[PK]|order_id:I|product_id:I|quantity:I|unit_price:N|discount:N
main.customers|Customer accounts.  Join to orders on customer_id = customers.id. Use city/country for geographic segmentation.|id:I[PK]|name:S|email:S|phone:S|city:S|country:S|signup_date:D|active:B|lifetime_value:N
main.products|Product catalogue.  Join to order_items on product_id = products.id. price is the current retail price.  cost is the COGS for margin analysis.|id:I[PK]|sku:S|name:S|description:S|price:N|cost:N|category_id:I|active:B|created_at:D
main.categories|Product categories.  Join to products on category_id = categories.id. Use for category-level revenue breakdowns.|id:I[PK]|name:S|slug:S|description:S