|
Download tasks/readable/002/task_readable.md from megagonlabs/arcs: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/datasets/megagonlabs/arcs/resolve/main/tasks/readable/002/task_readable.md
- Command line
-
hf download hf://datasets/megagonlabs/arcs/tasks/readable/002/task_readable.md
-
curl -L -o task_readable.md https://huggingface.co/datasets/megagonlabs/arcs/resolve/main/tasks/readable/002/task_readable.md
1.01 kB
Task: 002
Database: retails
Question
Count the number of suppliers that offer both air and rail shipping in America.
Gold Query
WITH usa_suppliers_with_air AS (
SELECT DISTINCT l.l_suppkey
FROM lineitem l
JOIN orders o ON l.l_orderkey = o.o_orderkey
JOIN customer c ON o.o_custkey = c.c_custkey
JOIN nation n ON c.c_nationkey = n.n_nationkey
JOIN region r ON n.n_regionkey = r.r_regionkey
WHERE r.r_name = 'AMERICA'
AND l.l_shipmode = 'AIR'
),
usa_suppliers_with_rail AS (
SELECT DISTINCT l.l_suppkey
FROM lineitem l
JOIN orders o ON l.l_orderkey = o.o_orderkey
JOIN customer c ON o.o_custkey = c.c_custkey
JOIN nation n ON c.c_nationkey = n.n_nationkey
JOIN region r ON n.n_regionkey = r.r_regionkey
WHERE r.r_name = 'AMERICA'
AND l.l_shipmode = 'RAIL'
)
SELECT COUNT(*) AS supplier_count
FROM usa_suppliers_with_air a
JOIN usa_suppliers_with_rail r ON a.l_suppkey = r.l_suppkey;
Execution Result:
| supplier_count |
|---|
| 10000 |
1 rows