task INSERT / UPDATE / DELETE · hard
A replay-safe ledger load
partner_feed contains payroll references, some delivered twice. Load it into partner_ledger (external_ref is the primary key) so that running the same load again adds nothing. Return accounts (distinct account_id), entries and total_cents from partner_ledger.
what to return
- Columns
accountsentriestotal_centsin this order- Rows
- 1 row · any order
- Skill
- Load a feed so replays change nothing. Refresher: Idempotent incremental UPSERT & stale updates →
expected result
Your query should return exactly these columns and values. Run it and compare.
| accounts | entries | total_cents |
|---|---|---|
| 28 | 239 | 98569567 |
all 1 rows
data you can query
Finance / Payments dataset: the first 6 rows of each table. Under each column name: the kind of value it holds, and which table it links to. Your queries run on all rows.
partner_feed4 columns · 271 rows
| external_reftext | account_idnumber | amount_centsnumber | posted_atdate & time |
|---|---|---|---|
| EXT-1503 | 24 | 79424 | 2025-01-03 09:00:00 |
| EXT-1504 | 31 | 240513 | 2025-01-03 09:00:00 |
| EXT-1505 | 38 | 1195096 | 2025-01-03 09:00:00 |
| EXT-1506 | 47 | 231079 | 2025-01-03 09:00:00 |
| EXT-1507 | 59 | 152577 | 2025-01-03 09:00:00 |
| EXT-3597 | 1 | 150999 | 2025-01-10 09:00:00 |
- external_reftext
- EXT-1503
- account_idnumber
- 24
- amount_centsnumber
- 79424
- posted_atdate & time
- 2025-01-03 09:00:00
- external_reftext
- EXT-1504
- account_idnumber
- 31
- amount_centsnumber
- 240513
- posted_atdate & time
- 2025-01-03 09:00:00
- external_reftext
- EXT-1505
- account_idnumber
- 38
- amount_centsnumber
- 1195096
- posted_atdate & time
- 2025-01-03 09:00:00
- external_reftext
- EXT-1506
- account_idnumber
- 47
- amount_centsnumber
- 231079
- posted_atdate & time
- 2025-01-03 09:00:00
- external_reftext
- EXT-1507
- account_idnumber
- 59
- amount_centsnumber
- 152577
- posted_atdate & time
- 2025-01-03 09:00:00
- external_reftext
- EXT-3597
- account_idnumber
- 1
- amount_centsnumber
- 150999
- posted_atdate & time
- 2025-01-10 09:00:00
first 6 of 271 rows · your queries use all of them
partner_ledger4 columns · 0 rows
| external_reftext · unique id | account_idnumber · links to accounts | amount_centsnumber | posted_attext |
|---|
all 0 rows
Hints and the answer are always available. Using them counts the question as solved with help.