These objects are loaded at the start. Only the query inputs and their required lineage are listed; other tables in a shared seed are not part of this report.
ordersOne row represents one submitted order.
| Field / SQL type | Meaning | Rules |
|---|---|---|
order_id · integer | Order identifier; equal order totals still belong to separate orders. | Primary key; unique. Required; cannot be NULL. |
member_id · integer | Member key used to look up a registered member; no foreign key is declared. | Nullable; NULL means the identifier or reference is unrecorded. |
placed_at · timestamp with time zone | Order occurrence instant, interpreted in UTC unless the query explicitly chooses a local reporting zone. | Required; cannot be NULL. |
status · text | Order status: paid, pending and cancelled occur in the snapshot; paid defines revenue eligibility. | Required; cannot be NULL. |
amount · numeric(10,2) | Whole-order gross amount in USD before refunds, not a unit price or an order-line amount. | Nullable; NULL means the order gross amount is unknown, not zero. |
coupon · text | Optional coupon code recorded on the order. | Nullable; NULL means no coupon code is recorded. |
The status labels are observed values, not a CHECK constraint. Paid amounts are known in this supplied snapshot; the nullable column also contains an unknown pending amount. No nonnegative-amount rule or member foreign key is declared. An orphan member key is a real order, not a member registration. The supplied orphan key is 99.
Inspect the proposed work for a single-order lookup before changing the schema.
Write your query in script.sql. Use Run to inspect it, then Submit.
EXPLAIN describes planned work; ANALYZE would execute it.