Procurement tradeoffs and award evidence · Original fictional data · Free files and full answers
Reconcile added reduced and cancelled purchase quantities
Return line,old_value,new_value,delta_value,change_type from amendments. Type is added if old_units=0, cancelled if new_units=0, otherwise increased/decreased/unchanged by quantity. Sort line.
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
- Return line,old_value,new_value,delta_value,change_type from amendments. Type is added if old_units=0, cancelled if new_units=0, otherwise increased/decreased/unchanged by quantity. Sort line.
- 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 line, old_value, new_value, delta_value, change_type. Sort order follows the task. Output has 3 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
- Return line,old_value,new_value,delta_value,change_type from amendments. Type is added if old_units=0, cancelled if new_units=0, otherwise increased/decreased/unchanged by quantity. Sort line.
- For the first output record, line = L1; old_value = 500; new_value = 800; delta_value = 300; change_type = increased.
- Inspect the source grain, keys and ties. Compare each result column with the full worked SQL and expected CSV.
Watch for this wrong turn
Summing new line values alone cannot explain the value change from the previous purchase authorization.
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 line,old_units*unit_cents old_value,new_units*unit_cents new_value,(new_units-old_units)*unit_cents delta_value,CASE WHEN old_units=0 THEN 'added' WHEN new_units=0 THEN 'cancelled' WHEN new_units>old_units THEN 'increased' WHEN new_units<old_units THEN 'decreased' ELSE 'unchanged' END change_type FROM amendments ORDER BY line;
"line","old_value","new_value","delta_value","change_type" "L1","500","800","300","increased" "L2","800","0","-800","cancelled" "L3","0","450","450","added"Reference SQL · Complete expected CSV · Empty answer CSV
Choose another SQL task · Original data exception cases · Larger workplace projects