Procurement tradeoffs and award evidence · Original fictional data · Free files and full answers
Calculate approval slack before a quote or delivery deadline
Approval day8 and delivery deadline14. For each A bid return bid_id,expiry_slack=expires-8,delivery_slack=14-8-lead_days,limiting_slack=min. Negative means already infeasible. Sort bid_id.
Use this fixed business case to build a checked CSV and a replayable SQL handoff. No account required. Scenario datasets are shared across related exercises; each exercise has its own decision and output contract.
Your output contract
- Approval day8 and delivery deadline14. For each A bid return bid_id,expiry_slack=expires-8,delivery_slack=14-8-lead_days,limiting_slack=min. Negative means already infeasible. Sort bid_id.
- Return exactly the declared columns and order. Money uses integer cents; time and date units follow the task and field dictionary. NULL is unknown and differs from numeric zero.
- These are original fictional records and exercise policies. Scenario data may be shared with related tasks, whose decisions and output contracts differ.
Return columns exactly as bid_id, expiry_slack, delivery_slack, limiting_slack. Sort order follows the task. Output has 5 rows; an empty CSV field means NULL.
Source data
bids
9 source rows · Download bids CSV
| id INTEGER | supplier TEXT | sku TEXT | unit_cents INTEGER | shipping INTEGER | capacity INTEGER | moq INTEGER | lead_days INTEGER | expires INTEGER | risk_low INTEGER | risk_high INTEGER |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Alpha | A | 100 | 200 | 12 | 2 | 3 | 20 | 0 | 100 |
| 2 | Beta | A | 90 | 350 | 8 | 4 | 5 | 25 | 100 | 400 |
| 3 | Gamma | A | 110 | 0 | 20 | 1 | 2 | 10 | 0 | 0 |
| 4 | Alpha | B | 200 | 200 | 10 | 2 | 4 | 20 | 0 | 100 |
| 5 | Beta | B | 180 | 350 | 6 | 2 | 6 | 25 | 100 | 400 |
| 6 | Gamma | B | 230 | 0 | 12 | 1 | 2 | 10 | 0 | 0 |
| 7 | Delta | A | 80 | 500 | 5 | 5 | 7 | 30 | 300 | 900 |
| 8 | Delta | B | 170 | 500 | 8 | 4 | 7 | 30 | 300 | 900 |
| 9 | Epsilon | A | 50 | 250 | 10 | 1 | 8 | 25 | 100 | 300 |
kit
2 source rows · Download kit CSV
| sku TEXT | units INTEGER |
|---|---|
| A | 6 |
| B | 3 |
amendments
3 source rows · Download amendments CSV
| line TEXT | old_units INTEGER | new_units INTEGER | unit_cents INTEGER |
|---|---|---|---|
| L1 | 5 | 8 | 100 |
| L2 | 4 | 0 | 200 |
| L3 | 0 | 3 | 150 |
Field dictionary and schema
bids: id INTEGER — Stable source record identifier; not a row position. supplier TEXT — Literal business key or category label. Match exactly and retain NULL where present. sku TEXT — Literal business key or category label. Match exactly and retain NULL where present. unit_cents INTEGER — Exact integer monetary cents; no implicit currency conversion. shipping INTEGER — Fixed supplier order freight in cents. capacity INTEGER — Maximum quantity this bid can supply. moq INTEGER — Minimum nonzero order quantity. lead_days INTEGER — Elapsed delivery lead time in days. expires INTEGER — Expiry boundary; the goal declares whether equality is eligible. risk_low INTEGER — Lower supplier-level risk allowance in cents. risk_high INTEGER — Upper supplier-level risk allowance in cents. kit: sku TEXT — Literal business key or category label. Match exactly and retain NULL where present. units INTEGER — Physical unit quantity, not a monetary amount. amendments: line TEXT — Literal business key or category label. Match exactly and retain NULL where present. old_units INTEGER — Exact integer business measurement. Its specific business rule and eligibility are declared in the task. new_units INTEGER — Exact integer business measurement. Its specific business rule and eligibility are declared in the task. unit_cents INTEGER — Exact integer monetary cents; no implicit currency conversion.
A method you can reuse
- Approval day8 and delivery deadline14. For each A bid return bid_id,expiry_slack=expires-8,delivery_slack=14-8-lead_days,limiting_slack=min. Negative means already infeasible. Sort bid_id.
- For the first output record, bid_id = 1; expiry_slack = 12; delivery_slack = 3; limiting_slack = 3.
- Inspect the source grain, keys and ties. Compare each result column with the full worked SQL and expected CSV.
Watch for this wrong turn
Quote validity alone does not show whether enough delivery lead time remains.
Run and check in SQLite
Your SQL runs locally in the existing SQLite worker. The checker compares every column, row, type, value and row order with this fixed output. It accepts equivalent SELECT or WITH queries. Browser storage keeps your SQL on this device when available.
Complete worked SQL and expected output
SELECT id bid_id,expires-8 expiry_slack,14-8-lead_days delivery_slack,MIN(expires-8,14-8-lead_days) limiting_slack FROM bids WHERE sku='A' ORDER BY id;
"bid_id","expiry_slack","delivery_slack","limiting_slack" "1","12","3","3" "2","17","1","1" "3","2","4","2" "7","22","-1","-1" "9","17","-2","-2"Reference SQL · Complete expected CSV · Empty answer CSV
Choose another SQL task · Original data exception cases · Larger workplace projects