|
Download tasks/readable/008/task_readable.md from megagonlabs/arcs: direct link, hf CLI and curl.
- Browser
- Download file 847 Bytes
-
https://huggingface.co/datasets/megagonlabs/arcs/resolve/main/tasks/readable/008/task_readable.md
- Command line
-
hf download hf://datasets/megagonlabs/arcs/tasks/readable/008/task_readable.md
-
curl -L -o task_readable.md https://huggingface.co/datasets/megagonlabs/arcs/resolve/main/tasks/readable/008/task_readable.md
847 Bytes
| # Task: 008 | |
| **Database:** retails | |
| ## Question | |
| Identify the manufacturer that contributed the highest profit during the last quarter of 1994. Show the manufacturer and the profit. | |
| ## Gold Query | |
| ```sql | |
| WITH manufacturer_profit AS ( | |
| SELECT p.p_mfgr, | |
| SUM(l.l_extendedprice * (1 - l.l_discount) - ps.ps_supplycost * l.l_quantity) AS profit | |
| FROM lineitem l | |
| JOIN part p ON l.l_partkey = p.p_partkey | |
| JOIN partsupp ps ON l.l_partkey = ps.ps_partkey AND l.l_suppkey = ps.ps_suppkey | |
| WHERE l.l_commitdate >= '1994-10-01' | |
| AND l.l_commitdate < '1995-01-01' | |
| AND l.l_returnflag <> 'R' | |
| GROUP BY p.p_mfgr | |
| ) | |
| SELECT p_mfgr, profit | |
| FROM manufacturer_profit | |
| WHERE profit = (SELECT MAX(profit) FROM manufacturer_profit); | |
| ``` | |
| **Execution Result:** | |
| | p_mfgr | profit | | |
| |----------------|---------------| | |
| | Manufacturer#2 | 5.4341928e+08 | | |
| *1 rows* |