arcs-bench / tasks /readable /020 /task_readable.sql
anon
Upload tasks/ folder for end-to-end loader reproducibility
02edc38
/*
{
"qid": "020",
"task_type": "ambig",
"has_intended_resolution": true,
"language": "SQLite",
"db": "retails",
"question": "List large parts that haven't been shipped to Middle East countries. Only includes parts with ID <= 1000.",
"gold_ambiguity_points": [
{
"id": "A",
"phrase": "large parts",
"type": "finite",
"ambiguity_type": "semantic_column",
"interpretations": [
"p_size is high",
"p_type starts with 'LARGE'"
],
"intended_interpretation_idx": 1
},
{
"id": "B",
"phrase": "large parts",
"type": "infinite",
"ambiguity_type": "semantic_value",
"parameter_name": "size_threshold",
"parameter_dtype": "int",
"parameter_sample_operators": [
">",
">="
],
"parameter_sample_values": [
25
],
"intended_parameter_operator": ">=",
"intended_parameter_value": 25
},
{
"id": "C",
"phrase": "Middle East countries",
"type": "finite",
"ambiguity_type": "semantic_value",
"interpretations": [
"excludes Egypt (only countries whose region is MIDDLE EAST in the database)",
"includes Egypt (Egypt is widely recognized as a Middle East country)"
],
"intended_interpretation_idx": 0
}
],
"gold_intended_query_id": "GQRY-A.1-C.0",
"extra_info": {}
}
*/
----- START OF GOLD QUERY `GQRY-A.0-C.0` -----
/*
{
"id": "GQRY-A.0-C.0",
"parameter_names": [
"size_threshold"
],
"parameter_values": {
"size_threshold": 25
},
"other_exec_results": [],
"required_columns": [
1
],
"required_sorted": false,
"extra_info": {
"ambiguity_resolution": {
"[A] large parts": "p_size is high",
"[B] large parts": ":size_threshold",
"[C] Middle East countries": "excludes Egypt (only countries whose region is MIDDLE EAST in the database)"
}
}
}
*/
SELECT DISTINCT p.p_partkey, p.p_name, p.p_type, p.p_size
FROM part p
WHERE p.p_size >= :size_threshold
AND p.p_partkey <= 1000
AND p.p_partkey NOT IN (
SELECT DISTINCT l.l_partkey
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 = 'MIDDLE EAST'
)
ORDER BY p.p_partkey;
/* EXEC RESULT
p_partkey p_name p_type p_size
72 salmon goldenrod cornflower chartreuse rosy STANDARD BRUSHED COPPER 28
134 medium smoke firebrick green medium SMALL BRUSHED COPPER 42
147 midnight antique lavender royal misty SMALL BRUSHED NICKEL 50
335 burnished mint azure honeydew honeydew ECONOMY BRUSHED NICKEL 32
355 frosted ivory beige orange slate LARGE BURNISHED NICKEL 33
... TRUNCATED ...
824 aquamarine metallic blanched spring purple STANDARD BURNISHED TIN 44
846 spring dodger lemon sienna dim SMALL PLATED STEEL 27
887 cornsilk purple purple lavender seashell LARGE BRUSHED BRASS 50
939 goldenrod mint almond goldenrod slate ECONOMY PLATED TIN 35
960 chocolate seashell beige lemon gainsboro PROMO PLATED STEEL 50
*/
----- END OF GOLD QUERY -----
----- START OF GOLD QUERY `GQRY-A.0-C.1` -----
/*
{
"id": "GQRY-A.0-C.1",
"parameter_names": [
"size_threshold"
],
"parameter_values": {
"size_threshold": 25
},
"other_exec_results": [],
"required_columns": [
1
],
"required_sorted": false,
"extra_info": {
"ambiguity_resolution": {
"[A] large parts": "p_size is high",
"[B] large parts": ":size_threshold",
"[C] Middle East countries": "includes Egypt (Egypt is widely recognized as a Middle East country)"
}
}
}
*/
SELECT DISTINCT p.p_partkey, p.p_name, p.p_type, p.p_size
FROM part p
WHERE p.p_size >= :size_threshold
AND p.p_partkey <= 1000
AND p.p_partkey NOT IN (
SELECT DISTINCT l.l_partkey
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 = 'MIDDLE EAST' OR n.n_name = 'EGYPT'
)
ORDER BY p.p_partkey;
/* EXEC RESULT
p_partkey p_name p_type p_size
147 midnight antique lavender royal misty SMALL BRUSHED NICKEL 50
355 frosted ivory beige orange slate LARGE BURNISHED NICKEL 33
960 chocolate seashell beige lemon gainsboro PROMO PLATED STEEL 50
*/
----- END OF GOLD QUERY -----
----- START OF GOLD QUERY `GQRY-A.1-C.0` -----
/*
{
"id": "GQRY-A.1-C.0",
"parameter_names": [],
"parameter_values": {},
"other_exec_results": [],
"required_columns": [
1
],
"required_sorted": false,
"extra_info": {
"ambiguity_resolution": {
"[A] large parts": "p_type starts with 'LARGE'",
"[B] large parts": ":size_threshold",
"[C] Middle East countries": "excludes Egypt (only countries whose region is MIDDLE EAST in the database)"
}
}
}
*/
SELECT DISTINCT p.p_partkey, p.p_name, p.p_type, p.p_size
FROM part p
WHERE p.p_type LIKE 'LARGE%'
AND p.p_partkey <= 1000
AND p.p_partkey NOT IN (
SELECT DISTINCT l.l_partkey
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 = 'MIDDLE EAST'
)
ORDER BY p.p_partkey;
/* EXEC RESULT
p_partkey p_name p_type p_size
355 frosted ivory beige orange slate LARGE BURNISHED NICKEL 33
887 cornsilk purple purple lavender seashell LARGE BRUSHED BRASS 50
*/
----- END OF GOLD QUERY -----
----- START OF GOLD QUERY `GQRY-A.1-C.1` -----
/*
{
"id": "GQRY-A.1-C.1",
"parameter_names": [],
"parameter_values": {},
"other_exec_results": [],
"required_columns": [
1
],
"required_sorted": false,
"extra_info": {
"ambiguity_resolution": {
"[A] large parts": "p_type starts with 'LARGE'",
"[B] large parts": ":size_threshold",
"[C] Middle East countries": "includes Egypt (Egypt is widely recognized as a Middle East country)"
}
}
}
*/
SELECT DISTINCT p.p_partkey, p.p_name, p.p_type, p.p_size
FROM part p
WHERE p.p_type LIKE 'LARGE%'
AND p.p_partkey <= 1000
AND p.p_partkey NOT IN (
SELECT DISTINCT l.l_partkey
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 = 'MIDDLE EAST' OR n.n_name = 'EGYPT'
)
ORDER BY p.p_partkey;
/* EXEC RESULT
p_partkey p_name p_type p_size
355 frosted ivory beige orange slate LARGE BURNISHED NICKEL 33
*/
----- END OF GOLD QUERY -----