Schema
order_items
One row per line item within an order.
student_ro:SELECT
Columns#
| Column | Type | Nullable | Notes |
|---|---|---|---|
id | bigint | No | Primary key. |
order_id | bigint | No | References orders.id. |
product_id | bigint | No | References products.id. |
sale_price | numeric(12,2) | No | Unit price charged at sale time. |
quantity | integer | No | Units purchased. |
amount | numeric(12,2) | No | Line total. |
created_at | timestamptz | No | When the row was created. Indexed. |
updated_at | timestamptz | No | When the row was last modified. Equals created_at until the row changes. May not be indexed. |
Example query#
SQL
SELECT oi.order_id, oi.product_id, oi.quantity, oi.amount
FROM order_items oi
JOIN orders o ON o.id = oi.order_id
WHERE o.updated_at >= '2026-03-01'
ORDER BY oi.id
LIMIT 100;Loading tips#
Filter on updated_at for incremental loads — see Incremental loading.
© 2026 StyleHub · Developer Platform