|
Download tasks/readable/022/task_readable.md from megagonlabs/arcs: direct link, hf CLI and curl.
- Browser
- Download file 877 Bytes
-
https://huggingface.co/datasets/megagonlabs/arcs/resolve/main/tasks/readable/022/task_readable.md
- Command line
-
hf download hf://datasets/megagonlabs/arcs/tasks/readable/022/task_readable.md
-
curl -L -o task_readable.md https://huggingface.co/datasets/megagonlabs/arcs/resolve/main/tasks/readable/022/task_readable.md
877 Bytes
| # Task: 022 | |
| **Database:** retails | |
| ## Question | |
| Show the customer with the highest account balance for each area. | |
| ## Gold Query | |
| ```sql | |
| SELECT c_mktsegment, c_custkey, c_name, c_acctbal | |
| FROM ( | |
| SELECT c.c_mktsegment, | |
| c.c_custkey, | |
| c.c_name, | |
| c.c_acctbal, | |
| RANK() OVER (PARTITION BY c.c_mktsegment ORDER BY c.c_acctbal DESC) AS rn | |
| FROM customer c | |
| ) t | |
| WHERE rn = 1; | |
| ``` | |
| **Execution Result:** | |
| | c_mktsegment | c_custkey | c_name | c_acctbal | | |
| |----------------|-------------|--------------------|-------------| | |
| | AUTOMOBILE | 21734 | Customer#000021734 | 9998.72 | | |
| | BUILDING | 330 | Customer#000000330 | 9999.59 | | |
| | FURNITURE | 72823 | Customer#000072823 | 9999.65 | | |
| | HOUSEHOLD | 48616 | Customer#000048616 | 9999.84 | | |
| | MACHINERY | 14740 | Customer#000014740 | 9999.96 | | |
| *5 rows* |