You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Twenty-one questions answered against the amazon_db schema, grouped by the stakeholder who
would ask them. Each row links to the SQL that answers it and states the headline result.
All figures are anchored to the end of the data, 2024-07-30. "Value" means gross ordered
value across all statuses; "revenue" means completed orders only. The distinction is defined
in the data dictionary.
Can a sale be recorded and stock reduced in one operation that cannot half-complete?
Yes. add_sales() validates input, locks the inventory row, writes order, payment and line item, then decrements stock. Five tests cover one success and four failure modes; each failure rolls back cleanly
Questions the data cannot answer
Four questions returned no answer. Each is reported with its evidence rather than dropped,
because a null result that is proven is a finding.
Question
Why it fails
What was reported instead
Average delivery time
No delivery date exists in the schema
Dispatch lag, mean 3.0 days
Cross-sell affinity (Q15)
Every order contains exactly one product
Basket size distribution, proving the ceiling is one
Orders dispatched late (Q9)
The maximum lag in the data is five days
The full lag distribution behind the zero
Time since registration (Q5)
No registration date exists in the schema
The never-purchased list, without the tenure half
Q14 also returns zero rows, but that zero is a genuine clean bill of health rather than a
schema limitation: no paid order is stuck unshipped.