qid stringlengths 5 5 | task_type stringclasses 1
value | has_intended_resolution bool 1
class | db stringclasses 6
values | question stringlengths 33 189 | gold_ambiguity_points listlengths 1 5 | gold_queries listlengths 1 32 | gold_intended_query_id stringlengths 4 20 | gold_intended_query stringlengths 63 1.45k |
|---|---|---|---|---|---|---|---|---|
001-5 | ambig | true | retails | Report the total revenue for each nation in 1995. | [
{
"id": "A",
"phrase": "total revenue",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"before discount (Gross revenue)",
"after discount (Net revenue)"
],
"intended_interpretation_idx": 1
},
{
"id": "B",
"phrase": "total revenue"... | [
{
"id": "GQRY-A.0-B.0-C.0-D.0",
"query": "WITH revenue AS (\nSELECT n.n_nationkey,\nn.n_name,\nCOALESCE(SUM(l.l_extendedprice), 0) AS total_revenue\nFROM lineitem l\nJOIN orders o ON o.o_orderkey = l.l_orderkey\nJOIN customer c ON o.o_custkey = c.c_custkey\nJOIN nation n ON c.c_nationkey = n.n_nationkey\nWH... | GQRY-A.1-B.1-C.0-D.3 | WITH revenue AS (
SELECT n.n_nationkey,
n.n_name,
COALESCE(SUM(l.l_extendedprice * (1 - l.l_discount)), 0) AS total_revenue
FROM lineitem l
JOIN orders o ON o.o_orderkey = l.l_orderkey
JOIN customer c ON o.o_custkey = c.c_custkey
JOIN nation n ON c.c_nationkey = n.n_nationkey
WHERE strftime('%Y', l.l_receiptdate) = '19... |
026-0 | ambig | true | professional_basketball | For each team that Marcus Williams played for, compute his aggregate field goal percentage. | [
{
"id": "A",
"phrase": "Marcus Williams",
"type": "finite",
"ambiguity_type": "semantic_value",
"interpretations": [
"Marcus Williams from University of Connecticut born in 1985",
"Marcus Williams from University of Arizona born in 1986"
],
"intended_interpretation_idx": 0
... | [
{
"id": "GQRY-A.0-B.0-C.0",
"query": "SELECT\nt.tmID,\nt.name,\nCASE\nWHEN SUM(pt.fgAttempted) = 0 THEN 0\nELSE CAST(SUM(pt.fgMade) AS REAL) / SUM(pt.fgAttempted)\nEND as field_goal_percentage\nFROM players_teams pt\nJOIN players p ON pt.playerID = p.playerID\nJOIN teams t ON pt.tmID = t.tmID AND pt.year = ... | GQRY-A.0-B.1-C.0 | WITH season_stats AS (
SELECT t.tmID, t.name, pt.year,
CASE WHEN SUM(pt.fgAttempted) = 0 THEN 0
ELSE CAST(SUM(pt.fgMade) AS REAL) / SUM(pt.fgAttempted)
END as field_goal_percentage
FROM players_teams pt
JOIN players p ON pt.playerID = p.playerID
JOIN teams t ON pt.tmID = t.tmID AND pt.year = t.year
WHERE p.firstName = ... |
036-0 | ambig | true | github_repos | For each repository with a GPL license, count the number of merged PRs created in the period of 2022 and January 2023. | [
{
"id": "A",
"phrase": "GPL license",
"type": "finite",
"ambiguity_type": "semantic_value",
"interpretations": [
"mainline GPL license (gpl-2.0 or gpl-3.0)",
"all GPL variants including AGPL (agpl-3.0) and LGPL (lgpl-2.1 or lgpl-3.0)"
],
"intended_interpretation_idx": 1
},
... | [
{
"id": "GQRY-A.0-B.0",
"query": "WITH gpl_repos AS (\nSELECT grl.repo_name, grl.license\nFROM GITHUB_REPOS_LICENSES grl\nWHERE grl.license IN ('gpl-2.0', 'gpl-3.0')\n),\nall_events AS (\nSELECT * FROM YEAR_2022\nUNION ALL\nSELECT * FROM MONTH_202301\n),\nmerged_prs AS (\nSELECT\njson_extract(ae.repo, '$.na... | GQRY-A.1-B.0 | WITH gpl_repos AS (
SELECT grl.repo_name, grl.license
FROM GITHUB_REPOS_LICENSES grl
WHERE grl.license IN ('agpl-3.0', 'gpl-2.0', 'gpl-3.0', 'lgpl-2.1', 'lgpl-3.0')
),
all_events AS (
SELECT * FROM YEAR_2022
UNION ALL
SELECT * FROM MONTH_202301
),
merged_prs AS (
SELECT
json_extract(ae.repo, '$.name') AS repo_name,
COU... |
058-2 | ambig | true | financial | Compute the amount of deposits from December 1997 to end of 1998. | [
{
"id": "A",
"phrase": "amount",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"the number of deposit transactions",
"the total monetary value of deposits"
],
"intended_interpretation_idx": 0
},
{
"id": "B",
"phrase": "deposits",... | [
{
"id": "GQRY-A.0-B.0",
"query": "SELECT COUNT(*)\nFROM trans\nWHERE operation = 'VKLAD'\nAND (date >= '1997-12-01' AND date < '1999-01-01');",
"parameter_names": [],
"parameter_values": "{}",
"exec_result": "{\"df\":{\"format\":\"parquet_v1\",\"parquet_base64\":\"UEFSMRUEFRAVFEwVAhUAEgAACBzIvQA... | GQRY-A.0-B.1 | SELECT COUNT(*)
FROM trans
WHERE operation IN ('VKLAD', 'PREVOD Z UCTU')
AND (date >= '1997-12-01' AND date < '1999-01-01'); |
072-0 | ambig | true | codebase_community | Find posts with many related posts. | [
{
"id": "A",
"phrase": "many",
"type": "infinite",
"ambiguity_type": "semantic_value",
"parameter_name": "count_threshold",
"parameter_dtype": "int",
"parameter_sample_operators": [
">",
">="
],
"parameter_sample_values": [
"10"
],
"intended_parameter_op... | [
{
"id": "GQRY-B.0",
"query": "SELECT p.Id, p.Title, COUNT(DISTINCT pl.RelatedPostId) AS RelatedCount\nFROM posts p\nJOIN postLinks pl ON p.Id = pl.PostId\nGROUP BY p.Id, p.Title\nHAVING COUNT(DISTINCT pl.RelatedPostId) > :count_threshold\nORDER BY RelatedCount DESC;",
"parameter_names": [
"count_t... | GQRY-B.2 | SELECT p.Id,
p.Title,
COUNT(DISTINCT rel.RelatedRef) AS RelatedCount
FROM posts p
JOIN (
SELECT PostId AS PostRef, RelatedPostId AS RelatedRef
FROM postLinks
UNION ALL
SELECT RelatedPostId AS PostRef, PostId AS RelatedRef
FROM postLinks
) rel ON p.Id = rel.PostRef
GROUP BY p.Id, p.Title
HAVING COUNT(DISTINCT rel.Relate... |
087-0 | ambig | true | student_club | Which events had a low budget remaining or high spending on food or advertisement? | [
{
"id": "A",
"phrase": "low budget remaining",
"type": "infinite",
"ambiguity_type": "semantic_value",
"parameter_name": "budget_remaining_threshold",
"parameter_dtype": "int",
"parameter_sample_operators": [
"<",
"<="
],
"parameter_sample_values": [
"20"
],... | [
{
"id": "GQRY-B.0",
"query": "WITH event_budget AS (\nSELECT\nlink_to_event AS event_id,\nSUM(remaining) AS total_remaining,\nSUM(CASE WHEN category = 'Food' THEN spent ELSE 0 END) AS food_spent,\nSUM(CASE WHEN category = 'Advertisement' THEN spent ELSE 0 END) AS adv_spent\nFROM budget\nGROUP BY link_to_eve... | GQRY-B.0 | WITH event_budget AS (
SELECT
link_to_event AS event_id,
SUM(remaining) AS total_remaining,
SUM(CASE WHEN category = 'Food' THEN spent ELSE 0 END) AS food_spent,
SUM(CASE WHEN category = 'Advertisement' THEN spent ELSE 0 END) AS adv_spent
FROM budget
GROUP BY link_to_event
)
SELECT e.event_id, e.event_name, eb.total_re... |
037-1 | ambig | true | github_repos | List all repository names with many issues opened in 2022, provide the corresponding issue count and the license for each repository. | [
{
"id": "A",
"phrase": "many",
"type": "infinite",
"ambiguity_type": "semantic_value",
"parameter_name": "issue_count_threshold",
"parameter_dtype": "int",
"parameter_sample_operators": [
">",
">="
],
"parameter_sample_values": [
"7"
],
"intended_paramet... | [
{
"id": "GQRY-B.0",
"query": "WITH issue_counts AS (\nSELECT\njson_extract(repo, '$.name') AS repo_name,\nCOUNT(DISTINCT json_extract(payload, '$.issue.id')) AS issues_opened\nFROM YEAR_2022\nWHERE type = 'IssuesEvent'\nAND json_extract(payload, '$.action') = 'opened'\nGROUP BY repo_name\nHAVING issues_open... | GQRY-B.0 | WITH issue_counts AS (
SELECT
json_extract(repo, '$.name') AS repo_name,
COUNT(DISTINCT json_extract(payload, '$.issue.id')) AS issues_opened
FROM YEAR_2022
WHERE type = 'IssuesEvent'
AND json_extract(payload, '$.action') = 'opened'
GROUP BY repo_name
HAVING issues_opened > :issue_count_threshold
)
SELECT
ic.repo_name,... |
002-4 | ambig | true | retails | Count the number of suppliers that offer both air and rail shipping in America. | [
{
"id": "A",
"phrase": "suppliers that offer both air and rail shipping in America",
"type": "finite",
"ambiguity_type": "syntactic_computation",
"interpretations": [
"suppliers that offer air and rail shipping to customers in America",
"suppliers in America that offer air and rail s... | [
{
"id": "GQRY-A.0-B.0-C.0",
"query": "WITH usa_suppliers_with_air AS (\nSELECT DISTINCT l.l_suppkey\nFROM lineitem l\nJOIN orders o ON l.l_orderkey = o.o_orderkey\nJOIN customer c ON o.o_custkey = c.c_custkey\nJOIN nation n ON c.c_nationkey = n.n_nationkey\nWHERE n.n_name = 'UNITED STATES'\nAND l.l_shipmode... | GQRY-A.0-B.0-C.0 | 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
WHERE n.n_name = 'UNITED STATES'
AND l.l_shipmode = 'AIR'
),
usa_suppliers_with_rail AS (
SELECT DISTINCT ... |
048-1 | ambig | true | github_repos | Count the number of repository IDs in YEAR_2023 that have public events and also received a large number of pull requests. | [
{
"id": "A",
"phrase": "public events",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"events with attribute public=1",
"events of type 'PublicEvent'"
],
"intended_interpretation_idx": 1
},
{
"id": "B",
"phrase": "received a larg... | [
{
"id": "GQRY-A.0-B.0",
"query": "WITH repo_public_events AS (\nSELECT DISTINCT json_extract(repo, '$.id') as repo_id\nFROM YEAR_2023\nWHERE public = 1\n),\nrepo_pull_requests AS (\nSELECT\njson_extract(repo, '$.id') as repo_id,\nCOUNT(DISTINCT json_extract(payload, '$.pull_request.id')) as pull_request_cou... | GQRY-A.1-B.0 | WITH repo_public_events AS (
SELECT DISTINCT json_extract(repo, '$.id') as repo_id
FROM YEAR_2023
WHERE type = 'PublicEvent'
),
repo_pull_requests AS (
SELECT
json_extract(repo, '$.id') as repo_id,
COUNT(DISTINCT json_extract(payload, '$.pull_request.id')) as pull_request_count
FROM YEAR_2023
WHERE type = 'PullRequestE... |
005-0 | ambig | true | retails | Which part has the highest price? | [
{
"id": "A",
"phrase": "highest price",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"highest absolute maximum price",
"highest average price (aggregated over suppliers and orders)"
],
"intended_interpretation_idx": 1
},
{
"id": "B"... | [
{
"id": "GQRY-A.0-B.0",
"query": "WITH part_max_supply_cost AS (\nSELECT p.p_partkey, p.p_name, MAX(ps.ps_supplycost) as max_supply_cost\nFROM part p\nJOIN partsupp ps ON p.p_partkey = ps.ps_partkey\nGROUP BY p.p_partkey, p.p_name\n)\nSELECT pasc.p_partkey, pasc.p_name, pasc.max_supply_cost\nFROM part_max_s... | GQRY-A.1-B.1 | SELECT p_partkey, p_name, p_retailprice
FROM part p
WHERE p_retailprice = (SELECT MAX(p_retailprice) FROM part)
ORDER BY p_partkey; |
066-0 | ambig | true | financial | Show the average age and number of male clients by region, assuming the current date is August 1st, 2025. | [
{
"id": "A",
"phrase": "average age and number of male clients",
"type": "finite",
"ambiguity_type": "syntactic_computation",
"interpretations": [
"average age of all clients and number of male clients",
"average age of male clients and number of male clients"
],
"intended_in... | [
{
"id": "GQRY-A.0",
"query": "SELECT d.A3 AS region,\nAVG(CAST((strftime('%Y', '2025-08-01') - strftime('%Y', birth_date)) AS INTEGER)\n- (strftime('%m-%d', '2025-08-01') < strftime('%m-%d', birth_date))) AS avg_age,\nSUM(CASE WHEN c.gender = 'M' THEN 1 ELSE 0 END) AS num_male_clients\nFROM district d\nLEFT... | GQRY-A.0 | SELECT d.A3 AS region,
AVG(CAST((strftime('%Y', '2025-08-01') - strftime('%Y', birth_date)) AS INTEGER)
- (strftime('%m-%d', '2025-08-01') < strftime('%m-%d', birth_date))) AS avg_age,
SUM(CASE WHEN c.gender = 'M' THEN 1 ELSE 0 END) AS num_male_clients
FROM district d
LEFT JOIN client c ON c.district_id = d.district_id... |
096-0 | ambig | true | student_club | List all members from New York who have signed up for events in September or October 1st in 2019 and display their major, phone number and the event name. | [
{
"id": "A",
"phrase": "New York",
"type": "finite",
"ambiguity_type": "semantic_column",
"interpretations": [
"New York City",
"New York County",
"New York State"
],
"intended_interpretation_idx": 0
},
{
"id": "B",
"phrase": "September or October 1st",
... | [
{
"id": "GQRY-A.0-B.0",
"query": "SELECT DISTINCT m.first_name,\nm.last_name,\nmaj.major_name AS major,\nm.phone,\ne.event_name\nFROM member m\nJOIN zip_code z ON m.zip = z.zip_code\nJOIN attendance a ON m.member_id = a.link_to_member\nJOIN event e ON a.link_to_event = e.event_id\nLEFT JOIN major maj ON m.l... | GQRY-A.0-B.0 | SELECT DISTINCT m.first_name,
m.last_name,
maj.major_name AS major,
m.phone,
e.event_name
FROM member m
JOIN zip_code z ON m.zip = z.zip_code
JOIN attendance a ON m.member_id = a.link_to_member
JOIN event e ON a.link_to_event = e.event_id
LEFT JOIN major maj ON m.link_to_major = maj.major_id
WHERE z.city = 'New York'
A... |
042-0 | ambig | true | github_repos | Count the total number of Wiki pages updated in the last month of 2022 and 2023. | [
{
"id": "A",
"phrase": "Wiki pages updated",
"type": "finite",
"ambiguity_type": "semantic_value",
"interpretations": [
"Wiki pages created",
"Wiki pages edited",
"Wiki pages created or edited"
],
"intended_interpretation_idx": 2
},
{
"id": "B",
"phrase": "l... | [
{
"id": "GQRY-A.0-B.0",
"query": "WITH combined_events AS (\nSELECT\njson_extract(g.repo, '$.id') AS repo_id,\njson_extract(g.payload, '$.pages') AS pages\nFROM MONTH_202212 g\nWHERE g.type = 'GollumEvent'\nUNION ALL\nSELECT\njson_extract(g.repo, '$.id') AS repo_id,\njson_extract(g.payload, '$.pages') AS pa... | GQRY-A.2-B.1 | WITH combined_events AS (
SELECT
json_extract(g.repo, '$.id') AS repo_id,
json_extract(g.payload, '$.pages') AS pages
FROM MONTH_202212 g
WHERE g.type = 'GollumEvent'
UNION ALL
SELECT
json_extract(g.repo, '$.id') AS repo_id,
json_extract(g.payload, '$.pages') AS pages
FROM YEAR_2023 g
WHERE g.type = 'GollumEvent'
),
up... |
096-4 | ambig | true | student_club | List all members from New York who have signed up for events in September or October 1st in 2019 and display their major, phone number and the event name. | [
{
"id": "A",
"phrase": "New York",
"type": "finite",
"ambiguity_type": "semantic_column",
"interpretations": [
"New York City",
"New York County",
"New York State"
],
"intended_interpretation_idx": 2
},
{
"id": "B",
"phrase": "September or October 1st",
... | [
{
"id": "GQRY-A.0-B.0",
"query": "SELECT DISTINCT m.first_name,\nm.last_name,\nmaj.major_name AS major,\nm.phone,\ne.event_name\nFROM member m\nJOIN zip_code z ON m.zip = z.zip_code\nJOIN attendance a ON m.member_id = a.link_to_member\nJOIN event e ON a.link_to_event = e.event_id\nLEFT JOIN major maj ON m.l... | GQRY-A.2-B.0 | SELECT DISTINCT m.first_name,
m.last_name,
maj.major_name AS major,
m.phone,
e.event_name
FROM member m
JOIN zip_code z ON m.zip = z.zip_code
JOIN attendance a ON m.member_id = a.link_to_member
JOIN event e ON a.link_to_event = e.event_id
LEFT JOIN major maj ON m.link_to_major = maj.major_id
WHERE z.state = 'New York'
... |
056-0 | ambig | true | github_repos | Count the number of 2022 public events whose actor is also the actor of more than 5 events in 2022. | [
{
"id": "A",
"phrase": "public events",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"events with attribute public=1",
"events of type 'PublicEvent'"
],
"intended_interpretation_idx": 0
}
] | [
{
"id": "GQRY-A.0",
"query": "WITH actor_event_counts AS (\nSELECT json_extract(y.actor, '$.id') actor_id, COUNT(*) AS event_count\nFROM YEAR_2022 y\nGROUP BY json_extract(y.actor, '$.id')\nHAVING event_count > 5\n)\nSELECT COUNT(*)\nFROM YEAR_2022 y2\nWHERE y2.public = 1\nAND json_extract(y2.actor, '$.id')... | GQRY-A.0 | WITH actor_event_counts AS (
SELECT json_extract(y.actor, '$.id') actor_id, COUNT(*) AS event_count
FROM YEAR_2022 y
GROUP BY json_extract(y.actor, '$.id')
HAVING event_count > 5
)
SELECT COUNT(*)
FROM YEAR_2022 y2
WHERE y2.public = 1
AND json_extract(y2.actor, '$.id') IN (SELECT actor_id FROM actor_event_counts); |
090-1 | ambig | true | student_club | List all events attended by members in Albany, including their name and location. | [
{
"id": "A",
"phrase": "Albany",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"Albany city, Vermont",
"Albany city, New York",
"Albany city, Georgia",
"Albany city, Kentucky",
"Albany city, Ohio",
"Albany city, Indiana",
... | [
{
"id": "GQRY-A.0",
"query": "SELECT DISTINCT e.event_id, e.event_name, e.location\nFROM event AS e\nJOIN attendance AS a ON e.event_id = a.link_to_event\nJOIN member AS m ON a.link_to_member = m.member_id\nJOIN zip_code AS z ON m.zip = z.zip_code\nWHERE z.state = 'Vermont' AND z.city = 'Albany';",
"par... | GQRY-A.1 | SELECT DISTINCT e.event_id, e.event_name, e.location
FROM event AS e
JOIN attendance AS a ON e.event_id = a.link_to_event
JOIN member AS m ON a.link_to_member = m.member_id
JOIN zip_code AS z ON m.zip = z.zip_code
WHERE z.state = 'New York' AND z.city = 'Albany'; |
008-4 | ambig | true | retails | Identify the manufacturer that contributed the highest profit during the last quarter of 1994. Show the manufacturer and the profit. | [
{
"id": "A",
"phrase": "highest profit",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"include returned items",
"exclude returned items"
],
"intended_interpretation_idx": 1
},
{
"id": "B",
"phrase": "during the last quarter of 1... | [
{
"id": "GQRY-A.0-B.0",
"query": "WITH manufacturer_profit AS (\nSELECT p.p_mfgr,\nSUM(l.l_extendedprice * (1 - l.l_discount) - ps.ps_supplycost * l.l_quantity) AS profit\nFROM lineitem l\nJOIN part p ON l.l_partkey = p.p_partkey\nJOIN partsupp ps ON l.l_partkey = ps.ps_partkey AND l.l_suppkey = ps.ps_suppk... | GQRY-A.1-B.3 | 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_receiptdate >= '1994-10-01'
AND l.l_re... |
062-1 | ambig | true | financial | For each bank in the database, show the total sum of household or insurance payments in 1997 and 1998, grouped accordingly. | [
{
"id": "A",
"phrase": "grouped accordingly",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"group by bank only",
"group by bank and payment type",
"group by bank and year",
"group by bank, payment type, year"
],
"intended_interp... | [
{
"id": "GQRY-A.0",
"query": "SELECT bank, SUM(amount) AS total_amount\nFROM trans\nWHERE (k_symbol = 'SIPO'\nOR k_symbol = 'POJISTNE')\nAND (date BETWEEN '1997-01-01' AND '1997-12-31'\nOR date BETWEEN '1998-01-01' AND '1998-12-31')\nAND bank IS NOT NULL\nGROUP BY bank;",
"parameter_names": [],
"par... | GQRY-A.3 | SELECT bank, k_symbol, strftime('%Y', date) AS year, SUM(amount) AS total_amount
FROM trans
WHERE (k_symbol = 'SIPO'
OR k_symbol = 'POJISTNE')
AND (date BETWEEN '1997-01-01' AND '1997-12-31'
OR date BETWEEN '1998-01-01' AND '1998-12-31')
AND bank IS NOT NULL
GROUP BY bank, k_symbol, year; |
070-0 | ambig | true | financial | What is the total number of weekly-fee accounts in districts with many large municipalities? | [
{
"id": "A",
"phrase": "many",
"type": "infinite",
"ambiguity_type": "semantic_value",
"parameter_name": "municipality_threshold",
"parameter_dtype": "int",
"parameter_sample_operators": [
">",
">="
],
"parameter_sample_values": [
"8"
],
"intended_parame... | [
{
"id": "GQRY-B.0",
"query": "SELECT COUNT(*)\nFROM account a\nJOIN district d ON a.district_id = d.district_id\nWHERE CAST(d.A6 AS INTEGER) + CAST(d.A7 AS INTEGER) + CAST(d.A8 AS INTEGER) >= :municipality_threshold\nAND a.frequency = 'POPLATEK TYDNE';",
"parameter_names": [
"municipality_threshol... | GQRY-B.1 | SELECT COUNT(*)
FROM account a
JOIN district d ON a.district_id = d.district_id
WHERE CAST(d.A7 AS INTEGER) + CAST(d.A8 AS INTEGER) >= :municipality_threshold
AND a.frequency = 'POPLATEK TYDNE'; |
024-0 | ambig | true | retails | Show large orders placed in February 1996. | [
{
"id": "A",
"phrase": "large orders",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"orders with high total price",
"orders with large number of line items",
"orders with large total quantity of parts"
],
"intended_interpretation_idx"... | [
{
"id": "GQRY-A.0",
"query": "WITH feb_orders AS (\nSELECT o_orderkey, o_orderdate, o_totalprice\nFROM orders\nWHERE o_orderdate >= '1996-02-01'\nAND o_orderdate < '1996-03-01'\n)\nSELECT o_orderkey, o_orderdate, o_totalprice\nFROM feb_orders\nWHERE o_totalprice > :large_threshold\nORDER BY o_totalprice DES... | GQRY-A.0 | WITH feb_orders AS (
SELECT o_orderkey, o_orderdate, o_totalprice
FROM orders
WHERE o_orderdate >= '1996-02-01'
AND o_orderdate < '1996-03-01'
)
SELECT o_orderkey, o_orderdate, o_totalprice
FROM feb_orders
WHERE o_totalprice > :large_threshold
ORDER BY o_totalprice DESC; |
042-2 | ambig | true | github_repos | Count the total number of Wiki pages updated in the last month of 2022 and 2023. | [
{
"id": "A",
"phrase": "Wiki pages updated",
"type": "finite",
"ambiguity_type": "semantic_value",
"interpretations": [
"Wiki pages created",
"Wiki pages edited",
"Wiki pages created or edited"
],
"intended_interpretation_idx": 0
},
{
"id": "B",
"phrase": "l... | [
{
"id": "GQRY-A.0-B.0",
"query": "WITH combined_events AS (\nSELECT\njson_extract(g.repo, '$.id') AS repo_id,\njson_extract(g.payload, '$.pages') AS pages\nFROM MONTH_202212 g\nWHERE g.type = 'GollumEvent'\nUNION ALL\nSELECT\njson_extract(g.repo, '$.id') AS repo_id,\njson_extract(g.payload, '$.pages') AS pa... | GQRY-A.0-B.1 | WITH combined_events AS (
SELECT
json_extract(g.repo, '$.id') AS repo_id,
json_extract(g.payload, '$.pages') AS pages
FROM MONTH_202212 g
WHERE g.type = 'GollumEvent'
UNION ALL
SELECT
json_extract(g.repo, '$.id') AS repo_id,
json_extract(g.payload, '$.pages') AS pages
FROM YEAR_2023 g
WHERE g.type = 'GollumEvent'
),
up... |
064-0 | ambig | true | financial | Find the accounts with high transaction value related to insurance payments and display the corresponding value. | [
{
"id": "A",
"phrase": "high transaction value",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"high single transaction value",
"high total transaction value",
"high average transaction value"
],
"intended_interpretation_idx": 1
},
... | [
{
"id": "GQRY-A.0",
"query": "SELECT account_id, MAX(amount) AS max_insurance_amount\nFROM trans\nWHERE k_symbol = 'POJISTNE'\nGROUP BY account_id\nHAVING max_insurance_amount >= :amount_threshold;",
"parameter_names": [
"amount_threshold"
],
"parameter_values": "{\"amount_threshold\":5000... | GQRY-A.1 | SELECT account_id, SUM(amount) AS total_insurance_amount
FROM trans
WHERE k_symbol = 'POJISTNE'
GROUP BY account_id
HAVING total_insurance_amount >= :amount_threshold; |
079-0 | ambig | true | codebase_community | Identify tags used in many posts in early years. | [
{
"id": "A",
"phrase": "many posts",
"type": "infinite",
"ambiguity_type": "semantic_value",
"parameter_name": "count_threshold",
"parameter_dtype": "int",
"parameter_sample_operators": [
">",
">="
],
"parameter_sample_values": [
"286"
],
"intended_param... | [
{
"id": "GQRY",
"query": "SELECT\nt.TagName,\nCOUNT(*) AS PostCount,\nMAX(p.CreaionDate) AS LatestPostDate\nFROM posts p\nJOIN tags t ON p.Tags LIKE '%<' || t.TagName || '>%'\nWHERE DATE(p.CreaionDate) <= :date_threshold\nGROUP BY t.TagName\nHAVING COUNT(*) >= :count_threshold\nORDER BY COUNT(*) DESC;",
... | GQRY | SELECT
t.TagName,
COUNT(*) AS PostCount,
MAX(p.CreaionDate) AS LatestPostDate
FROM posts p
JOIN tags t ON p.Tags LIKE '%<' || t.TagName || '>%'
WHERE DATE(p.CreaionDate) <= :date_threshold
GROUP BY t.TagName
HAVING COUNT(*) >= :count_threshold
ORDER BY COUNT(*) DESC; |
064-1 | ambig | true | financial | Find the accounts with high transaction value related to insurance payments and display the corresponding value. | [
{
"id": "A",
"phrase": "high transaction value",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"high single transaction value",
"high total transaction value",
"high average transaction value"
],
"intended_interpretation_idx": 2
},
... | [
{
"id": "GQRY-A.0",
"query": "SELECT account_id, MAX(amount) AS max_insurance_amount\nFROM trans\nWHERE k_symbol = 'POJISTNE'\nGROUP BY account_id\nHAVING max_insurance_amount >= :amount_threshold;",
"parameter_names": [
"amount_threshold"
],
"parameter_values": "{\"amount_threshold\":5000... | GQRY-A.2 | SELECT account_id, AVG(amount) AS avg_insurance_amount
FROM trans
WHERE k_symbol = 'POJISTNE'
GROUP BY account_id
HAVING avg_insurance_amount >= :amount_threshold; |
046-0 | ambig | true | github_repos | In the January 2023 table, find all repo names that were forked or had issues opened and have public events. | [
{
"id": "A",
"phrase": "forked or had issues opened and have public events",
"type": "finite",
"ambiguity_type": "syntactic_computation",
"interpretations": [
"(were forked OR had issues opened) AND (have public events in January 2023)",
"(were forked) OR (had issues opened AND have ... | [
{
"id": "GQRY-A.0-B.0-C.0",
"query": "WITH forked_repos AS (\nSELECT DISTINCT json_extract(m.repo, '$.name') AS repo_name\nFROM MONTH_202301 m\nWHERE m.type = 'ForkEvent'\n),\nissues_opened_repos AS (\nSELECT DISTINCT json_extract(m.repo, '$.name') AS repo_name\nFROM MONTH_202301 m\nWHERE m.type = 'IssuesEv... | GQRY-A.1-B.1-C.0 | WITH forked_repos AS (
SELECT DISTINCT json_extract(m.repo, '$.name') AS repo_name
FROM MONTH_202301 m
WHERE m.type = 'ForkEvent'
),
issues_opened_repos AS (
SELECT DISTINCT json_extract(m.repo, '$.name') AS repo_name
FROM MONTH_202301 m
WHERE m.type = 'IssuesEvent'
AND json_extract(m.payload, '$.action') IN ('opened',... |
062-2 | ambig | true | financial | For each bank in the database, show the total sum of household or insurance payments in 1997 and 1998, grouped accordingly. | [
{
"id": "A",
"phrase": "grouped accordingly",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"group by bank only",
"group by bank and payment type",
"group by bank and year",
"group by bank, payment type, year"
],
"intended_interp... | [
{
"id": "GQRY-A.0",
"query": "SELECT bank, SUM(amount) AS total_amount\nFROM trans\nWHERE (k_symbol = 'SIPO'\nOR k_symbol = 'POJISTNE')\nAND (date BETWEEN '1997-01-01' AND '1997-12-31'\nOR date BETWEEN '1998-01-01' AND '1998-12-31')\nAND bank IS NOT NULL\nGROUP BY bank;",
"parameter_names": [],
"par... | GQRY-A.1 | SELECT bank, k_symbol, SUM(amount) AS total_amount
FROM trans
WHERE (k_symbol = 'SIPO'
OR k_symbol = 'POJISTNE')
AND (date BETWEEN '1997-01-01' AND '1997-12-31'
OR date BETWEEN '1998-01-01' AND '1998-12-31')
AND bank IS NOT NULL
GROUP BY bank, k_symbol; |
001-1 | ambig | true | retails | Report the total revenue for each nation in 1995. | [
{
"id": "A",
"phrase": "total revenue",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"before discount (Gross revenue)",
"after discount (Net revenue)"
],
"intended_interpretation_idx": 0
},
{
"id": "B",
"phrase": "total revenue"... | [
{
"id": "GQRY-A.0-B.0-C.0-D.0",
"query": "WITH revenue AS (\nSELECT n.n_nationkey,\nn.n_name,\nCOALESCE(SUM(l.l_extendedprice), 0) AS total_revenue\nFROM lineitem l\nJOIN orders o ON o.o_orderkey = l.l_orderkey\nJOIN customer c ON o.o_custkey = c.c_custkey\nJOIN nation n ON c.c_nationkey = n.n_nationkey\nWH... | GQRY-A.0-B.0-C.0-D.0 | WITH revenue AS (
SELECT n.n_nationkey,
n.n_name,
COALESCE(SUM(l.l_extendedprice), 0) AS total_revenue
FROM lineitem l
JOIN orders o ON o.o_orderkey = l.l_orderkey
JOIN customer c ON o.o_custkey = c.c_custkey
JOIN nation n ON c.c_nationkey = n.n_nationkey
WHERE strftime('%Y', o.o_orderdate) = '1995'
GROUP BY n.n_nation... |
032-0 | ambig | true | professional_basketball | List tall players that have played for NBA teams from Los Angeles. | [
{
"id": "A",
"phrase": "tall players",
"type": "infinite",
"ambiguity_type": "semantic_value",
"parameter_name": "height_threshold",
"parameter_dtype": "int",
"parameter_sample_operators": [
">",
">="
],
"parameter_sample_values": [
"84"
],
"intended_par... | [
{
"id": "GQRY-B.0",
"query": "SELECT DISTINCT\np.playerID,\np.firstName,\np.lastName,\np.height\nFROM players p\nJOIN players_teams pt ON p.playerID = pt.playerID\nJOIN teams t ON pt.tmID = t.tmID AND pt.year = t.year\nWHERE t.name IN ('Los Angeles Lakers', 'Los Angeles Clippers')\nAND pt.lgID = 'NBA'\nAND ... | GQRY-B.1 | SELECT DISTINCT
p.playerID,
p.firstName,
p.lastName,
p.height
FROM players p
JOIN players_teams pt ON p.playerID = pt.playerID
WHERE p.birthCity = 'Los Angeles'
AND p.height >= :height_threshold
AND pt.lgID = 'NBA'
ORDER BY p.lastName, p.firstName; |
064-2 | ambig | true | financial | Find the accounts with high transaction value related to insurance payments and display the corresponding value. | [
{
"id": "A",
"phrase": "high transaction value",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"high single transaction value",
"high total transaction value",
"high average transaction value"
],
"intended_interpretation_idx": 0
},
... | [
{
"id": "GQRY-A.0",
"query": "SELECT account_id, MAX(amount) AS max_insurance_amount\nFROM trans\nWHERE k_symbol = 'POJISTNE'\nGROUP BY account_id\nHAVING max_insurance_amount >= :amount_threshold;",
"parameter_names": [
"amount_threshold"
],
"parameter_values": "{\"amount_threshold\":5000... | GQRY-A.0 | SELECT account_id, MAX(amount) AS max_insurance_amount
FROM trans
WHERE k_symbol = 'POJISTNE'
GROUP BY account_id
HAVING max_insurance_amount >= :amount_threshold; |
093-4 | ambig | true | student_club | Show the number of members for each region in the Morgan County . | [
{
"id": "A",
"phrase": "region",
"type": "finite",
"ambiguity_type": "semantic_column",
"interpretations": [
"zip code",
"city"
],
"intended_interpretation_idx": 1
},
{
"id": "B",
"phrase": "Morgan County",
"type": "finite",
"ambiguity_type": "semantic_val... | [
{
"id": "GQRY-A.0-B.0",
"query": "SELECT z.zip_code, COUNT(DISTINCT m.member_id) as member_count\nFROM zip_code z\nLEFT JOIN member m ON z.zip_code = m.zip\nWHERE z.county = 'Morgan County' AND z.state = 'West Virginia'\nGROUP BY z.zip_code;",
"parameter_names": [],
"parameter_values": "{}",
"ex... | GQRY-A.1-B.9 | SELECT z.city, COUNT(DISTINCT m.member_id) as member_count
FROM zip_code z
LEFT JOIN member m ON z.zip_code = m.zip
WHERE z.county = 'Morgan County' AND z.state = 'Colorado'
GROUP BY z.city; |
009-0 | ambig | true | retails | List the customer who made the highest number of purchases using rail shipping. | [
{
"id": "A",
"phrase": "number of purchases using rail shipping",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"number of orders containing at least one line item shipped by rail",
"number of line items shipped by rail",
"total quantity shipp... | [
{
"id": "GQRY-A.0",
"query": "WITH customer_rail_orders AS (\nSELECT c.c_custkey,\nc.c_name,\nCOUNT(DISTINCT o.o_orderkey) AS rail_orders\nFROM customer c\nJOIN orders o ON c.c_custkey = o.o_custkey\nJOIN lineitem l ON o.o_orderkey = l.l_orderkey\nWHERE l.l_shipmode = 'RAIL'\nGROUP BY c.c_custkey, c.c_name\... | GQRY-A.1 | WITH customer_rail_lineitems AS (
SELECT c.c_custkey,
c.c_name,
COUNT(*) AS rail_ship_count
FROM customer c
JOIN orders o ON c.c_custkey = o.o_custkey
JOIN lineitem l ON o.o_orderkey = l.l_orderkey
WHERE l.l_shipmode = 'RAIL'
GROUP BY c.c_custkey, c.c_name
)
SELECT c.c_custkey, c.c_name, c.rail_ship_count
FROM customer... |
097-4 | ambig | true | student_club | Find the total funds allocated for food and advertisement for all events attended by members in New York. | [
{
"id": "A",
"phrase": "total funds allocated for food and advertisement",
"type": "finite",
"ambiguity_type": "syntactic_computation",
"interpretations": [
"total funds for food and advertisement (single number)",
"total funds for food and total funds for advertisement (two separate... | [
{
"id": "GQRY-A.0-B.0",
"query": "SELECT SUM(b.amount) AS total_funds\nFROM budget b\nJOIN event e ON e.event_id = b.link_to_event\nWHERE b.category IN ('Food', 'Advertisement')\nAND EXISTS (\nSELECT 1\nFROM attendance a\nJOIN member m ON m.member_id = a.link_to_member\nJOIN zip_code z ON z.zip_code = m.zip... | GQRY-A.1-B.0 | SELECT
SUM(CASE WHEN b.category = 'Food' THEN b.amount ELSE 0 END) AS total_food_funds,
SUM(CASE WHEN b.category = 'Advertisement' THEN b.amount ELSE 0 END) AS total_advertisement_funds
FROM budget b
JOIN event e ON e.event_id = b.link_to_event
WHERE b.category IN ('Food', 'Advertisement')
AND EXISTS (
SELECT 1
FROM at... |
084-0 | ambig | true | codebase_community | List the posts with negative comments authored by MYaseen208. | [
{
"id": "A",
"phrase": "authored by MYaseen208",
"type": "finite",
"ambiguity_type": "syntactic_table",
"interpretations": [
"comments authored by MYaseen208",
"posts authored by MYaseen208"
],
"intended_interpretation_idx": 0
}
] | [
{
"id": "GQRY-A.0",
"query": "SELECT DISTINCT p.Id, p.Title\nFROM posts p\nJOIN comments c ON p.Id = c.PostId\nJOIN users u ON c.UserId = u.Id\nWHERE u.DisplayName = 'MYaseen208'\nAND c.Score < 60\nORDER BY p.Id;",
"parameter_names": [],
"parameter_values": "{}",
"exec_result": "{\"df\":{\"forma... | GQRY-A.0 | SELECT DISTINCT p.Id, p.Title
FROM posts p
JOIN comments c ON p.Id = c.PostId
JOIN users u ON c.UserId = u.Id
WHERE u.DisplayName = 'MYaseen208'
AND c.Score < 60
ORDER BY p.Id; |
026-4 | ambig | true | professional_basketball | For each team that Marcus Williams played for, compute his aggregate field goal percentage. | [
{
"id": "A",
"phrase": "Marcus Williams",
"type": "finite",
"ambiguity_type": "semantic_value",
"interpretations": [
"Marcus Williams from University of Connecticut born in 1985",
"Marcus Williams from University of Arizona born in 1986"
],
"intended_interpretation_idx": 1
... | [
{
"id": "GQRY-A.0-B.0-C.0",
"query": "SELECT\nt.tmID,\nt.name,\nCASE\nWHEN SUM(pt.fgAttempted) = 0 THEN 0\nELSE CAST(SUM(pt.fgMade) AS REAL) / SUM(pt.fgAttempted)\nEND as field_goal_percentage\nFROM players_teams pt\nJOIN players p ON pt.playerID = p.playerID\nJOIN teams t ON pt.tmID = t.tmID AND pt.year = ... | GQRY-A.1-B.0-C.1 | SELECT
t.tmID,
t.name,
CASE
WHEN SUM(pt.PostfgAttempted) = 0 THEN 0
ELSE CAST(SUM(pt.PostfgMade) AS REAL) / SUM(pt.PostfgAttempted)
END as field_goal_percentage
FROM players_teams pt
JOIN players p ON pt.playerID = p.playerID
JOIN teams t ON pt.tmID = t.tmID AND pt.year = t.year
WHERE p.firstName = 'Marcus'
AND p.lastN... |
044-1 | ambig | true | github_repos | Find the most active organization in 2023. | [
{
"id": "A",
"phrase": "most active organization",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"organization with the highest total number of events",
"organization with the highest number of repositories that generated events",
"organizatio... | [
{
"id": "GQRY-A.0",
"query": "WITH org_activity AS (\nSELECT\njson_extract(y.org, '$.id') AS org_id,\nCOUNT(*) AS event_count\nFROM YEAR_2023 y\nWHERE y.org IS NOT NULL AND y.org <> 'null' AND org_id IS NOT NULL\nGROUP BY org_id\n)\nSELECT oa.org_id, oa.event_count\nFROM org_activity oa\nWHERE oa.event_coun... | GQRY-A.0 | WITH org_activity AS (
SELECT
json_extract(y.org, '$.id') AS org_id,
COUNT(*) AS event_count
FROM YEAR_2023 y
WHERE y.org IS NOT NULL AND y.org <> 'null' AND org_id IS NOT NULL
GROUP BY org_id
)
SELECT oa.org_id, oa.event_count
FROM org_activity oa
WHERE oa.event_count = (
SELECT MAX(oa2.event_count)
FROM org_activity ... |
076-3 | ambig | true | codebase_community | How many users have received mostly positive scores for posts they contributed? | [
{
"id": "A",
"phrase": "mostly",
"type": "infinite",
"ambiguity_type": "semantic_value",
"parameter_name": "percentage_threshold",
"parameter_dtype": "float",
"parameter_sample_operators": [
">",
">="
],
"parameter_sample_values": [
"0.8"
],
"intended_pa... | [
{
"id": "GQRY-B.0-C.0",
"query": "WITH user_post_rating_counts AS (\nSELECT OwnerUserId,\nSUM(CASE WHEN Score > 0 THEN 1 ELSE 0 END) AS positive_post_count,\nSUM(CASE WHEN Score <= 0 THEN 1 ELSE 0 END) AS negative_post_count\nFROM posts\nGROUP BY OwnerUserId\n)\nSELECT COUNT(DISTINCT OwnerUserId)\nFROM user... | GQRY-B.1-C.0 | WITH user_post_rating_counts AS (
SELECT OwnerUserId,
SUM(CASE WHEN Score >= 0 THEN 1 ELSE 0 END) AS positive_post_count,
SUM(CASE WHEN Score < 0 THEN 1 ELSE 0 END) AS negative_post_count
FROM posts
GROUP BY OwnerUserId
)
SELECT COUNT(DISTINCT OwnerUserId)
FROM user_post_rating_counts
WHERE CAST(positive_post_count AS ... |
071-0 | ambig | true | financial | Show the district name and average salary for each district with the lowest number of urban residents and entrepreneurs. | [
{
"id": "A",
"phrase": "each district with the lowest number of urban residents and entrepreneurs",
"type": "finite",
"ambiguity_type": "syntactic_computation",
"interpretations": [
"(each district with the lowest number of urban residents) and (each district with the lowest number of entr... | [
{
"id": "GQRY-A.0",
"query": "SELECT\nA2 AS district_name,\nA11 AS average_salary,\nCAST(A4 AS INTEGER) * (A10 / 100.0) AS urban_residents,\nCAST(A4 AS INTEGER) * (A14 / 1000.0) AS entrepreneurs\nFROM district\nWHERE (CAST(A4 AS INTEGER) * (A10 / 100.0)) = (SELECT MIN(CAST(A4 AS INTEGER) * (A10 / 100.0)) FR... | GQRY-A.0 | SELECT
A2 AS district_name,
A11 AS average_salary,
CAST(A4 AS INTEGER) * (A10 / 100.0) AS urban_residents,
CAST(A4 AS INTEGER) * (A14 / 1000.0) AS entrepreneurs
FROM district
WHERE (CAST(A4 AS INTEGER) * (A10 / 100.0)) = (SELECT MIN(CAST(A4 AS INTEGER) * (A10 / 100.0)) FROM district)
OR (CAST(A4 AS INTEGER) * (A14 / 10... |
001-6 | ambig | true | retails | Report the total revenue for each nation in 1995. | [
{
"id": "A",
"phrase": "total revenue",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"before discount (Gross revenue)",
"after discount (Net revenue)"
],
"intended_interpretation_idx": 0
},
{
"id": "B",
"phrase": "total revenue"... | [
{
"id": "GQRY-A.0-B.0-C.0-D.0",
"query": "WITH revenue AS (\nSELECT n.n_nationkey,\nn.n_name,\nCOALESCE(SUM(l.l_extendedprice), 0) AS total_revenue\nFROM lineitem l\nJOIN orders o ON o.o_orderkey = l.l_orderkey\nJOIN customer c ON o.o_custkey = c.c_custkey\nJOIN nation n ON c.c_nationkey = n.n_nationkey\nWH... | GQRY-A.0-B.0-C.1-D.0 | WITH revenue AS (
SELECT n.n_nationkey,
n.n_name,
COALESCE(SUM(l.l_extendedprice), 0) AS total_revenue
FROM lineitem AS l
JOIN supplier AS s ON s.s_suppkey = l.l_suppkey
JOIN orders o ON o.o_orderkey = l.l_orderkey
JOIN nation AS n ON s.s_nationkey = n.n_nationkey
WHERE strftime('%Y', o.o_orderdate) = '1995'
GROUP BY n... |
027-0 | ambig | true | professional_basketball | List all teams with low points allowed from the Western conference that have made the playoffs. | [
{
"id": "A",
"phrase": "low points allowed",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"low total points allowed",
"low points allowed per season",
"low points allowed per game"
],
"intended_interpretation_idx": 2
},
{
"id"... | [
{
"id": "GQRY-A.0-C.0",
"query": "SELECT t1.tmID, t1.name, SUM(t1.d_pts) AS total_points_allowed\nFROM teams t1\nWHERE t1.tmID IN (\nSELECT DISTINCT tmID\nFROM teams\nWHERE confID = 'WC' AND playoff IS NOT NULL\n)\nGROUP BY t1.tmID, t1.name\nHAVING SUM(t1.d_pts) < :points_allowed_threshold\nORDER BY SUM(t1.... | GQRY-A.2-C.0 | SELECT t1.tmID, t1.name, SUM(t1.d_pts) * 1.0 / SUM(t1.games) AS avg_points_allowed_per_game
FROM teams t1
WHERE t1.tmID IN (
SELECT DISTINCT tmID
FROM teams
WHERE confID = 'WC' AND playoff IS NOT NULL
)
GROUP BY t1.tmID, t1.name
HAVING SUM(t1.d_pts) * 1.0 / SUM(t1.games) < :points_allowed_threshold
ORDER BY SUM(t1.d_pt... |
082-0 | ambig | true | codebase_community | For each user in Portland, show the number of posts they have created. | [
{
"id": "A",
"phrase": "Portland",
"type": "finite",
"ambiguity_type": "semantic_value",
"interpretations": [
"Portland, Oregon",
"Portland, Maine"
],
"intended_interpretation_idx": 1
}
] | [
{
"id": "GQRY-A.0",
"query": "SELECT\nu.Id AS UserId,\nu.DisplayName,\nCOUNT(DISTINCT p.Id) AS PostCount\nFROM users u\nLEFT JOIN posts p ON u.Id = p.OwnerUserId\nWHERE u.Location IN (\n'Portland, OR',\n'Portland OR',\n'Portland, Oregon',\n'Portland,OR',\n'Portland, Oregon, USA',\n'Portland Oregon',\n'Portl... | GQRY-A.1 | SELECT
u.Id AS UserId,
u.DisplayName,
COUNT(DISTINCT p.Id) AS PostCount
FROM users u
LEFT JOIN posts p ON u.Id = p.OwnerUserId
WHERE u.Location IN (
'Portland, ME'
)
GROUP BY u.Id, u.DisplayName
ORDER BY u.Id; |
092-2 | ambig | true | student_club | Find the total funds allocated for speaker gifts and t-shirts for each event attended by members in Georgetown in South Carolina. | [
{
"id": "A",
"phrase": "total funds allocated for speaker gifts and t-shirts",
"type": "finite",
"ambiguity_type": "syntactic_computation",
"interpretations": [
"total funds for speaker gifts and t-shirts (single number)",
"total funds for speaker gifts and total funds for t-shirts (... | [
{
"id": "GQRY-A.0-B.0",
"query": "WITH georgetown_events AS (\nSELECT DISTINCT e.event_id, e.event_name\nFROM event e\nJOIN attendance a ON e.event_id = a.link_to_event\nJOIN member m ON a.link_to_member = m.member_id\nJOIN zip_code z ON z.zip_code = m.zip\nWHERE z.city = 'Georgetown'\nAND z.state = 'South ... | GQRY-A.1-B.1 | WITH georgetown_events AS (
SELECT DISTINCT e.event_id, e.event_name
FROM event e
JOIN attendance a ON e.event_id = a.link_to_event
JOIN member m ON a.link_to_member = m.member_id
JOIN zip_code z ON z.zip_code = m.zip
WHERE z.county = 'Georgetown County'
AND z.state = 'South Carolina'
)
SELECT
ge.event_id,
ge.event_nam... |
072-1 | ambig | true | codebase_community | Find posts with many related posts. | [
{
"id": "A",
"phrase": "many",
"type": "infinite",
"ambiguity_type": "semantic_value",
"parameter_name": "count_threshold",
"parameter_dtype": "int",
"parameter_sample_operators": [
">",
">="
],
"parameter_sample_values": [
"10"
],
"intended_parameter_op... | [
{
"id": "GQRY-B.0",
"query": "SELECT p.Id, p.Title, COUNT(DISTINCT pl.RelatedPostId) AS RelatedCount\nFROM posts p\nJOIN postLinks pl ON p.Id = pl.PostId\nGROUP BY p.Id, p.Title\nHAVING COUNT(DISTINCT pl.RelatedPostId) > :count_threshold\nORDER BY RelatedCount DESC;",
"parameter_names": [
"count_t... | GQRY-B.0 | SELECT p.Id, p.Title, COUNT(DISTINCT pl.RelatedPostId) AS RelatedCount
FROM posts p
JOIN postLinks pl ON p.Id = pl.PostId
GROUP BY p.Id, p.Title
HAVING COUNT(DISTINCT pl.RelatedPostId) > :count_threshold
ORDER BY RelatedCount DESC; |
099-5 | ambig | true | student_club | For each event label, show the total amount spent by events with food and gifts. Return the result in (label, total_amount) format. | [
{
"id": "A",
"phrase": "event label",
"type": "finite",
"ambiguity_type": "semantic_column",
"interpretations": [
"event type (event.type)",
"event status (event.status)"
],
"intended_interpretation_idx": 0
},
{
"id": "B",
"phrase": "total amount spent",
"type... | [
{
"id": "GQRY-A.0-B.0-C.0",
"query": "WITH qualified_events AS (\nSELECT link_to_event\nFROM budget\nWHERE category IN ('Food', 'Speaker Gifts')\nGROUP BY link_to_event\n)\nSELECT e.status AS event_status,\nCOALESCE(SUM(b.spent), 0) AS total_spent\nFROM event e\nLEFT JOIN budget b ON b.link_to_event = e.eve... | GQRY-A.0-B.1-C.1 | WITH qualified_events AS (
SELECT link_to_event
FROM budget
WHERE category IN ('Food', 'Speaker Gifts')
GROUP BY link_to_event
HAVING COUNT(DISTINCT category) = 2
)
SELECT e.status AS event_status,
COALESCE(SUM(ex.cost), 0) AS total_spent
FROM event e
LEFT JOIN budget b ON b.link_to_event = e.event_id AND e.event_id IN... |
031-0 | ambig | true | professional_basketball | Count the number of people that have coached for Atlanta. | [
{
"id": "A",
"phrase": "Atlanta",
"type": "finite",
"ambiguity_type": "semantic_value",
"interpretations": [
"Atlanta Hawks (tmID = 'ATL')",
"Atlanta Crackers (tmID = 'ATC')"
],
"intended_interpretation_idx": 0
}
] | [
{
"id": "GQRY-A.0",
"query": "SELECT COUNT(DISTINCT coachID) FROM coaches WHERE tmID = 'ATL';",
"parameter_names": [],
"parameter_values": "{}",
"exec_result": "{\"df\":{\"format\":\"parquet_v1\",\"parquet_base64\":\"UEFSMRUEFRAVFEwVAhUAEgAACBwMAAAAAAAAABUAFRIVFiwVAhUQFQYVBhwYCAwAAAAAAAAAGAgMAAA... | GQRY-A.0 | SELECT COUNT(DISTINCT coachID) FROM coaches WHERE tmID = 'ATL'; |
013-1 | ambig | true | retails | Show the total quantity and total final charge of all items shipped by mail or with discount greater than 5% and returned. | [
{
"id": "A",
"phrase": "items shipped by mail or with discount greater than 5% and returned",
"type": "finite",
"ambiguity_type": "syntactic_computation",
"interpretations": [
"items (shipped by mail) OR (with discount greater than 5% AND returned).",
"items (shipped by mail OR with ... | [
{
"id": "GQRY-A.0",
"query": "SELECT\nSUM(l_quantity) AS total_quantity,\nSUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS total_charge\nFROM\nlineitem\nWHERE\nl_shipmode = 'MAIL'\nOR (l_discount > 0.05 AND l_returnflag = 'R');",
"parameter_names": [],
"parameter_values": "{}",
"exec_res... | GQRY-A.0 | SELECT
SUM(l_quantity) AS total_quantity,
SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS total_charge
FROM
lineitem
WHERE
l_shipmode = 'MAIL'
OR (l_discount > 0.05 AND l_returnflag = 'R'); |
042-1 | ambig | true | github_repos | Count the total number of Wiki pages updated in the last month of 2022 and 2023. | [
{
"id": "A",
"phrase": "Wiki pages updated",
"type": "finite",
"ambiguity_type": "semantic_value",
"interpretations": [
"Wiki pages created",
"Wiki pages edited",
"Wiki pages created or edited"
],
"intended_interpretation_idx": 2
},
{
"id": "B",
"phrase": "l... | [
{
"id": "GQRY-A.0-B.0",
"query": "WITH combined_events AS (\nSELECT\njson_extract(g.repo, '$.id') AS repo_id,\njson_extract(g.payload, '$.pages') AS pages\nFROM MONTH_202212 g\nWHERE g.type = 'GollumEvent'\nUNION ALL\nSELECT\njson_extract(g.repo, '$.id') AS repo_id,\njson_extract(g.payload, '$.pages') AS pa... | GQRY-A.2-B.0 | WITH combined_events AS (
SELECT
json_extract(g.repo, '$.id') AS repo_id,
json_extract(g.payload, '$.pages') AS pages
FROM MONTH_202212 g
WHERE g.type = 'GollumEvent'
UNION ALL
SELECT
json_extract(g.repo, '$.id') AS repo_id,
json_extract(g.payload, '$.pages') AS pages
FROM MONTH_202312 g
WHERE g.type = 'GollumEvent'
),... |
047-0 | ambig | true | github_repos | Count the number of forks in public repositories in March. | [
{
"id": "A",
"phrase": "March",
"type": "finite",
"ambiguity_type": "semantic_table",
"interpretations": [
"March 2022",
"March 2023",
"March in both 2022 and 2023"
],
"intended_interpretation_idx": 2
}
] | [
{
"id": "GQRY-A.0",
"query": "SELECT COUNT(*)\nFROM MONTH_202203\nWHERE type = 'ForkEvent'\nAND public = 1;",
"parameter_names": [],
"parameter_values": "{}",
"exec_result": "{\"df\":{\"format\":\"parquet_v1\",\"parquet_base64\":\"UEFSMRUEFRAVFEwVAhUAEgAACBw/AAAAAAAAABUAFRIVFiwVAhUQFQYVBhwYCD8AA... | GQRY-A.2 | SELECT COUNT(*)
FROM (
SELECT *
FROM MONTH_202203
WHERE type = 'ForkEvent'
AND public = 1
UNION ALL
SELECT *
FROM MONTH_202303
WHERE type = 'ForkEvent'
AND public = 1
) AS combined_march; |
002-5 | ambig | true | retails | Count the number of suppliers that offer both air and rail shipping in America. | [
{
"id": "A",
"phrase": "suppliers that offer both air and rail shipping in America",
"type": "finite",
"ambiguity_type": "syntactic_computation",
"interpretations": [
"suppliers that offer air and rail shipping to customers in America",
"suppliers in America that offer air and rail s... | [
{
"id": "GQRY-A.0-B.0-C.0",
"query": "WITH usa_suppliers_with_air AS (\nSELECT DISTINCT l.l_suppkey\nFROM lineitem l\nJOIN orders o ON l.l_orderkey = o.o_orderkey\nJOIN customer c ON o.o_custkey = c.c_custkey\nJOIN nation n ON c.c_nationkey = n.n_nationkey\nWHERE n.n_name = 'UNITED STATES'\nAND l.l_shipmode... | GQRY-A.0-B.1-C.0 | 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
WHERE n.n_name = 'UNITED STATES'
AND l.l_shipmode IN ('AIR', 'REG AIR')
),
usa_suppliers_with_rail AS (
SE... |
058-4 | ambig | true | financial | Compute the amount of deposits from December 1997 to end of 1998. | [
{
"id": "A",
"phrase": "amount",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"the number of deposit transactions",
"the total monetary value of deposits"
],
"intended_interpretation_idx": 0
},
{
"id": "B",
"phrase": "deposits",... | [
{
"id": "GQRY-A.0-B.0",
"query": "SELECT COUNT(*)\nFROM trans\nWHERE operation = 'VKLAD'\nAND (date >= '1997-12-01' AND date < '1999-01-01');",
"parameter_names": [],
"parameter_values": "{}",
"exec_result": "{\"df\":{\"format\":\"parquet_v1\",\"parquet_base64\":\"UEFSMRUEFRAVFEwVAhUAEgAACBzIvQA... | GQRY-A.0-B.2 | SELECT COUNT(*)
FROM trans
WHERE type = 'PRIJEM'
AND (date >= '1997-12-01' AND date < '1999-01-01'); |
044-0 | ambig | true | github_repos | Find the most active organization in 2023. | [
{
"id": "A",
"phrase": "most active organization",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"organization with the highest total number of events",
"organization with the highest number of repositories that generated events",
"organizatio... | [
{
"id": "GQRY-A.0",
"query": "WITH org_activity AS (\nSELECT\njson_extract(y.org, '$.id') AS org_id,\nCOUNT(*) AS event_count\nFROM YEAR_2023 y\nWHERE y.org IS NOT NULL AND y.org <> 'null' AND org_id IS NOT NULL\nGROUP BY org_id\n)\nSELECT oa.org_id, oa.event_count\nFROM org_activity oa\nWHERE oa.event_coun... | GQRY-A.1 | WITH org_activity AS (
SELECT
json_extract(y.org, '$.id') AS org_id,
COUNT(DISTINCT json_extract(y.repo, '$.id')) AS repo_count
FROM YEAR_2023 y
WHERE y.org IS NOT NULL AND y.org <> 'null' AND org_id IS NOT NULL
GROUP BY org_id
)
SELECT oa.org_id, oa.repo_count
FROM org_activity oa
WHERE oa.repo_count = (
SELECT MAX(oa... |
082-1 | ambig | true | codebase_community | For each user in Portland, show the number of posts they have created. | [
{
"id": "A",
"phrase": "Portland",
"type": "finite",
"ambiguity_type": "semantic_value",
"interpretations": [
"Portland, Oregon",
"Portland, Maine"
],
"intended_interpretation_idx": 0
}
] | [
{
"id": "GQRY-A.0",
"query": "SELECT\nu.Id AS UserId,\nu.DisplayName,\nCOUNT(DISTINCT p.Id) AS PostCount\nFROM users u\nLEFT JOIN posts p ON u.Id = p.OwnerUserId\nWHERE u.Location IN (\n'Portland, OR',\n'Portland OR',\n'Portland, Oregon',\n'Portland,OR',\n'Portland, Oregon, USA',\n'Portland Oregon',\n'Portl... | GQRY-A.0 | SELECT
u.Id AS UserId,
u.DisplayName,
COUNT(DISTINCT p.Id) AS PostCount
FROM users u
LEFT JOIN posts p ON u.Id = p.OwnerUserId
WHERE u.Location IN (
'Portland, OR',
'Portland OR',
'Portland, Oregon',
'Portland,OR',
'Portland, Oregon, USA',
'Portland Oregon',
'Portland.'
)
GROUP BY u.Id, u.DisplayName
ORDER BY u.Id; |
008-1 | ambig | true | retails | Identify the manufacturer that contributed the highest profit during the last quarter of 1994. Show the manufacturer and the profit. | [
{
"id": "A",
"phrase": "highest profit",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"include returned items",
"exclude returned items"
],
"intended_interpretation_idx": 0
},
{
"id": "B",
"phrase": "during the last quarter of 1... | [
{
"id": "GQRY-A.0-B.0",
"query": "WITH manufacturer_profit AS (\nSELECT p.p_mfgr,\nSUM(l.l_extendedprice * (1 - l.l_discount) - ps.ps_supplycost * l.l_quantity) AS profit\nFROM lineitem l\nJOIN part p ON l.l_partkey = p.p_partkey\nJOIN partsupp ps ON l.l_partkey = ps.ps_partkey AND l.l_suppkey = ps.ps_suppk... | GQRY-A.0-B.0 | 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
JOIN orders o ON l.l_orderkey = o.o_orderkey
WHE... |
030-3 | ambig | true | professional_basketball | Compute the total post-season offensive rebounds and games played in their career for each player born in Oklahoma. | [
{
"id": "A",
"phrase": "total post-season offensive rebounds and games played",
"type": "finite",
"ambiguity_type": "syntactic_column",
"interpretations": [
"total post-season offensive rebounds and post-season games played",
"total post-season offensive rebounds and all games played... | [
{
"id": "GQRY-A.0-B.0",
"query": "SELECT\np.playerID,\np.firstName,\np.lastName,\nSUM(pt.PostoRebounds) AS total_post_offensive_rebounds,\nCOALESCE(SUM(pt.PostGP), 0) AS total_post_games_played\nFROM players p\nJOIN players_teams pt ON p.playerID = pt.playerID\nWHERE p.birthState = 'OK'\nGROUP BY p.playerID... | GQRY-A.0-B.1 | SELECT
p.playerID,
p.firstName,
p.lastName,
SUM(pt.PostoRebounds) AS total_post_offensive_rebounds,
COALESCE(SUM(pt.PostGP), 0) AS total_post_games_played
FROM players p
JOIN players_teams pt ON p.playerID = pt.playerID
WHERE p.birthCity = 'Oklahoma City'
GROUP BY p.playerID, p.firstName, p.lastName; |
058-3 | ambig | true | financial | Compute the amount of deposits from December 1997 to end of 1998. | [
{
"id": "A",
"phrase": "amount",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"the number of deposit transactions",
"the total monetary value of deposits"
],
"intended_interpretation_idx": 1
},
{
"id": "B",
"phrase": "deposits",... | [
{
"id": "GQRY-A.0-B.0",
"query": "SELECT COUNT(*)\nFROM trans\nWHERE operation = 'VKLAD'\nAND (date >= '1997-12-01' AND date < '1999-01-01');",
"parameter_names": [],
"parameter_values": "{}",
"exec_result": "{\"df\":{\"format\":\"parquet_v1\",\"parquet_base64\":\"UEFSMRUEFRAVFEwVAhUAEgAACBzIvQA... | GQRY-A.1-B.0 | SELECT SUM(amount)
FROM trans
WHERE operation = 'VKLAD'
AND (date >= '1997-12-01' AND date < '1999-01-01'); |
029-4 | ambig | true | professional_basketball | What is Charles Smith's best true shooting percentage in a season in his career? | [
{
"id": "A",
"phrase": "Charles Smith",
"type": "finite",
"ambiguity_type": "semantic_value",
"interpretations": [
"Charles Smith from University of Pittsburgh born on July 16, 1965",
"Charles Smith from Georgetown University born on November 29, 1967",
"Charles Smith from Marq... | [
{
"id": "GQRY-A.0-B.0",
"query": "WITH charles_smith_stats AS (\nSELECT\npt.year,\nSUM(pt.points) + SUM(pt.PostPoints) AS total_points,\nSUM(pt.fgAttempted) + SUM(pt.PostfgAttempted) AS total_fgAttempted,\nSUM(pt.ftAttempted) + SUM(pt.PostftAttempted) AS total_ftAttempted\nFROM players_teams pt\nJOIN player... | GQRY-A.0-B.2 | WITH charles_smith_stats AS (
SELECT
pt.year,
SUM(pt.PostPoints) as total_points,
SUM(pt.PostfgAttempted) as total_fgAttempted,
SUM(pt.PostftAttempted) as total_ftAttempted
FROM players_teams pt
JOIN players p ON pt.playerID = p.playerID
WHERE p.firstName = 'Charles'
AND p.lastName = 'Smith'
AND p.birthDate = '1965-07-... |
060-5 | ambig | true | financial | Count the number of young clients with significant loans and large transactions for each area. | [
{
"id": "A",
"phrase": "Count the number of young clients with significant loans and large transactions",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"count clients with either significant loans or large transactions ('and' means UNION)",
"count c... | [
{
"id": "GQRY-A.0-E.0",
"query": "WITH significant_loans AS (\nSELECT DISTINCT di.client_id\nFROM client c\nJOIN disp di ON c.client_id = di.client_id\nJOIN loan l ON di.account_id = l.account_id\nWHERE l.amount > :loan_amount_threshold\nAND c.birth_date >= :birth_date_threshold\n),\nlarge_transactions AS (... | GQRY-A.1-E.0 | WITH significant_loans AS (
SELECT DISTINCT di.client_id
FROM client c
JOIN disp di ON c.client_id = di.client_id
JOIN loan l ON di.account_id = l.account_id
WHERE l.amount > :loan_amount_threshold
AND c.birth_date >= :birth_date_threshold
),
large_transactions AS (
SELECT DISTINCT di.client_id
FROM client c
JOIN disp ... |
039-0 | ambig | true | github_repos | Show the top 20 user names that contribute most events in January 2023 and 2022. | [
{
"id": "A",
"phrase": "January 2023 and 2022",
"type": "finite",
"ambiguity_type": "syntactic_table",
"interpretations": [
"January 2023 and January 2022",
"January 2023 and the entire 2022"
],
"intended_interpretation_idx": 0
}
] | [
{
"id": "GQRY-A.0",
"query": "WITH stats AS (\nSELECT json_extract(actor, '$.login') AS user, COUNT(*) AS event_count\nFROM (\nSELECT * FROM MONTH_202301\nUNION ALL\nSELECT * FROM MONTH_202201\n) t\nGROUP BY user\n)\nSELECT user, event_count\nFROM stats\nORDER BY event_count DESC\nLIMIT 20;",
"parameter... | GQRY-A.0 | WITH stats AS (
SELECT json_extract(actor, '$.login') AS user, COUNT(*) AS event_count
FROM (
SELECT * FROM MONTH_202301
UNION ALL
SELECT * FROM MONTH_202201
) t
GROUP BY user
)
SELECT user, event_count
FROM stats
ORDER BY event_count DESC
LIMIT 20; |
018-0 | ambig | true | retails | Count the number of customers that have used air shipping. | [
{
"id": "A",
"phrase": "air shipping",
"type": "finite",
"ambiguity_type": "semantic_value",
"interpretations": [
"ship mode is AIR",
"ship mode is AIR or REG AIR"
],
"intended_interpretation_idx": 1
}
] | [
{
"id": "GQRY-A.0",
"query": "SELECT COUNT(DISTINCT c.c_custkey)\nFROM customer c\nJOIN orders o ON c.c_custkey = o.o_custkey\nJOIN lineitem l ON o.o_orderkey = l.l_orderkey\nWHERE l.l_shipmode = 'AIR';",
"parameter_names": [],
"parameter_values": "{}",
"exec_result": "{\"df\":{\"format\":\"parq... | GQRY-A.1 | SELECT COUNT(DISTINCT c.c_custkey)
FROM customer c
JOIN orders o ON c.c_custkey = o.o_custkey
JOIN lineitem l ON o.o_orderkey = l.l_orderkey
WHERE l.l_shipmode IN ('AIR', 'REG AIR'); |
097-1 | ambig | true | student_club | Find the total funds allocated for food and advertisement for all events attended by members in New York. | [
{
"id": "A",
"phrase": "total funds allocated for food and advertisement",
"type": "finite",
"ambiguity_type": "syntactic_computation",
"interpretations": [
"total funds for food and advertisement (single number)",
"total funds for food and total funds for advertisement (two separate... | [
{
"id": "GQRY-A.0-B.0",
"query": "SELECT SUM(b.amount) AS total_funds\nFROM budget b\nJOIN event e ON e.event_id = b.link_to_event\nWHERE b.category IN ('Food', 'Advertisement')\nAND EXISTS (\nSELECT 1\nFROM attendance a\nJOIN member m ON m.member_id = a.link_to_member\nJOIN zip_code z ON z.zip_code = m.zip... | GQRY-A.1-B.1 | SELECT
SUM(CASE WHEN b.category = 'Food' THEN b.amount ELSE 0 END) AS total_food_funds,
SUM(CASE WHEN b.category = 'Advertisement' THEN b.amount ELSE 0 END) AS total_advertisement_funds
FROM budget b
JOIN event e ON e.event_id = b.link_to_event
WHERE b.category IN ('Food', 'Advertisement')
AND EXISTS (
SELECT 1
FROM at... |
069-0 | ambig | true | financial | For each account frequency category, show the most recent activity date. | [
{
"id": "A",
"phrase": "activity date",
"type": "finite",
"ambiguity_type": "semantic_table",
"interpretations": [
"account creation date",
"card issued date",
"loan date",
"transaction date",
"any of account, loan, card, or transaction dates"
],
"intended_i... | [
{
"id": "GQRY-A.0",
"query": "SELECT frequency, MAX(date) AS most_recent_status_update_date\nFROM account\nGROUP BY frequency;",
"parameter_names": [],
"parameter_values": "{}",
"exec_result": "{\"df\":{\"format\":\"parquet_v1\",\"parquet_base64\":\"UEFSMRUEFXgVXEwVBhUAEgAAPFAQAAAAUE9QTEFURUsgTU... | GQRY-A.1 | SELECT account.frequency, MAX(card.issued) AS most_recent_card_issued_date
FROM account
JOIN disp ON account.account_id = disp.account_id
JOIN card ON disp.disp_id = card.disp_id
GROUP BY account.frequency; |
002-0 | ambig | true | retails | Count the number of suppliers that offer both air and rail shipping in America. | [
{
"id": "A",
"phrase": "suppliers that offer both air and rail shipping in America",
"type": "finite",
"ambiguity_type": "syntactic_computation",
"interpretations": [
"suppliers that offer air and rail shipping to customers in America",
"suppliers in America that offer air and rail s... | [
{
"id": "GQRY-A.0-B.0-C.0",
"query": "WITH usa_suppliers_with_air AS (\nSELECT DISTINCT l.l_suppkey\nFROM lineitem l\nJOIN orders o ON l.l_orderkey = o.o_orderkey\nJOIN customer c ON o.o_custkey = c.c_custkey\nJOIN nation n ON c.c_nationkey = n.n_nationkey\nWHERE n.n_name = 'UNITED STATES'\nAND l.l_shipmode... | GQRY-A.0-B.0-C.1 | 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_... |
030-2 | ambig | true | professional_basketball | Compute the total post-season offensive rebounds and games played in their career for each player born in Oklahoma. | [
{
"id": "A",
"phrase": "total post-season offensive rebounds and games played",
"type": "finite",
"ambiguity_type": "syntactic_column",
"interpretations": [
"total post-season offensive rebounds and post-season games played",
"total post-season offensive rebounds and all games played... | [
{
"id": "GQRY-A.0-B.0",
"query": "SELECT\np.playerID,\np.firstName,\np.lastName,\nSUM(pt.PostoRebounds) AS total_post_offensive_rebounds,\nCOALESCE(SUM(pt.PostGP), 0) AS total_post_games_played\nFROM players p\nJOIN players_teams pt ON p.playerID = pt.playerID\nWHERE p.birthState = 'OK'\nGROUP BY p.playerID... | GQRY-A.1-B.0 | SELECT
p.playerID,
p.firstName,
p.lastName,
SUM(pt.PostoRebounds) AS total_post_offensive_rebounds,
SUM(pt.GP) + COALESCE(SUM(pt.PostGP), 0) AS total_games_played
FROM players p
JOIN players_teams pt ON p.playerID = pt.playerID
WHERE p.birthState = 'OK'
GROUP BY p.playerID, p.firstName, p.lastName; |
045-2 | ambig | true | github_repos | What is the highest number of issues opened by a single repository (identified by repo ID) in Q3? Use the YEAR_* tables. | [
{
"id": "A",
"phrase": "issues opened",
"type": "finite",
"ambiguity_type": "semantic_value",
"interpretations": [
"issues created",
"issues created or reopened"
],
"intended_interpretation_idx": 0
},
{
"id": "B",
"phrase": "Q3",
"type": "finite",
"ambigui... | [
{
"id": "GQRY-A.0-B.0",
"query": "WITH issue_counts AS (\nSELECT json_extract(repo, '$.id') AS repo_id,\nCOUNT(DISTINCT json_extract(payload, '$.issue.id')) AS issues_opened\nFROM YEAR_2022\nWHERE type = 'IssuesEvent'\nAND json_extract(payload, '$.action') = 'opened'\nAND strftime('%m', created_at / 1000000... | GQRY-A.0-B.1 | WITH issue_counts AS (
SELECT json_extract(repo, '$.id') AS repo_id,
COUNT(DISTINCT json_extract(payload, '$.issue.id')) AS issues_opened
FROM YEAR_2023
WHERE type = 'IssuesEvent'
AND json_extract(payload, '$.action') = 'opened'
AND strftime('%m', created_at / 1000000, 'unixepoch') IN ('07', '08', '09')
GROUP BY repo_i... |
035-1 | ambig | true | professional_basketball | Count the number of people who played or coached in the NBA finals in the 1990s. | [
{
"id": "A",
"phrase": "played or coached in the NBA finals in the 1990s",
"type": "finite",
"ambiguity_type": "syntactic_computation",
"interpretations": [
"(played in the 1990s) or (coached in the NBA finals in the 1990s)",
"(played or coached) in the NBA finals in the 1990s."
... | [
{
"id": "GQRY-A.0-B.0",
"query": "WITH players_1990s AS (\nSELECT DISTINCT playerID\nFROM players_teams\nWHERE year BETWEEN 1990 AND 1999\n),\ncoaches_finals_1990s AS (\nSELECT DISTINCT c.coachID\nFROM coaches c\nJOIN series_post sp ON c.tmID = sp.tmIDWinner AND c.year = sp.year\nWHERE sp.round = 'F'\nAND s... | GQRY-A.1-B.1 | WITH players_1990s AS (
SELECT DISTINCT pt.playerID
FROM players_teams pt
JOIN teams t ON pt.tmID = t.tmID AND pt.year = t.year
WHERE t.playoff = 'F'
AND t.year BETWEEN 1990 AND 1999
AND t.lgID = 'NBA'
),
coaches_finals_1990s AS (
SELECT DISTINCT c.coachID
FROM coaches c
JOIN teams t ON c.tmID = t.tmID AND c.year = t.y... |
096-1 | ambig | true | student_club | List all members from New York who have signed up for events in September or October 1st in 2019 and display their major, phone number and the event name. | [
{
"id": "A",
"phrase": "New York",
"type": "finite",
"ambiguity_type": "semantic_column",
"interpretations": [
"New York City",
"New York County",
"New York State"
],
"intended_interpretation_idx": 2
},
{
"id": "B",
"phrase": "September or October 1st",
... | [
{
"id": "GQRY-A.0-B.0",
"query": "SELECT DISTINCT m.first_name,\nm.last_name,\nmaj.major_name AS major,\nm.phone,\ne.event_name\nFROM member m\nJOIN zip_code z ON m.zip = z.zip_code\nJOIN attendance a ON m.member_id = a.link_to_member\nJOIN event e ON a.link_to_event = e.event_id\nLEFT JOIN major maj ON m.l... | GQRY-A.2-B.1 | SELECT DISTINCT m.first_name,
m.last_name,
maj.major_name AS major,
m.phone,
e.event_name
FROM member m
JOIN zip_code z ON m.zip = z.zip_code
JOIN attendance a ON m.member_id = a.link_to_member
JOIN event e ON a.link_to_event = e.event_id
LEFT JOIN major maj ON m.link_to_major = maj.major_id
WHERE z.state = 'New York'
... |
012-0 | ambig | true | retails | List all suppliers with a high balance. | [
{
"id": "A",
"phrase": "high balance",
"type": "infinite",
"ambiguity_type": "semantic_value",
"parameter_name": "balance_threshold",
"parameter_dtype": "int",
"parameter_sample_operators": [
">",
">="
],
"parameter_sample_values": [
"8500",
"9000",
... | [
{
"id": "GQRY",
"query": "SELECT s_suppkey, s_name, s_acctbal\nFROM supplier\nWHERE s_acctbal >= :balance_threshold;",
"parameter_names": [
"balance_threshold"
],
"parameter_values": "{\"balance_threshold\":8500}",
"exec_result": "{\"df\":{\"format\":\"parquet_v1\",\"parquet_base64\":\... | GQRY | SELECT s_suppkey, s_name, s_acctbal
FROM supplier
WHERE s_acctbal >= :balance_threshold; |
049-1 | ambig | true | github_repos | List the active PR contributors in 2022. | [
{
"id": "A",
"phrase": "active",
"type": "infinite",
"ambiguity_type": "semantic_value",
"parameter_name": "pr_count_threshold",
"parameter_dtype": "int",
"parameter_sample_operators": [
">",
">="
],
"parameter_sample_values": [
"100"
],
"intended_parame... | [
{
"id": "GQRY-B.0",
"query": "SELECT\njson_extract(payload, '$.pull_request.user.id') AS contributor,\nCOUNT(DISTINCT json_extract(payload, '$.pull_request.id')) AS pr_count\nFROM YEAR_2022\nWHERE type = 'PullRequestEvent'\nAND json_extract(payload, '$.action') = 'opened'\nGROUP BY contributor\nHAVING pr_co... | GQRY-B.0 | SELECT
json_extract(payload, '$.pull_request.user.id') AS contributor,
COUNT(DISTINCT json_extract(payload, '$.pull_request.id')) AS pr_count
FROM YEAR_2022
WHERE type = 'PullRequestEvent'
AND json_extract(payload, '$.action') = 'opened'
GROUP BY contributor
HAVING pr_count >= :pr_count_threshold
ORDER BY pr_count; |
031-1 | ambig | true | professional_basketball | Count the number of people that have coached for Atlanta. | [
{
"id": "A",
"phrase": "Atlanta",
"type": "finite",
"ambiguity_type": "semantic_value",
"interpretations": [
"Atlanta Hawks (tmID = 'ATL')",
"Atlanta Crackers (tmID = 'ATC')"
],
"intended_interpretation_idx": 1
}
] | [
{
"id": "GQRY-A.0",
"query": "SELECT COUNT(DISTINCT coachID) FROM coaches WHERE tmID = 'ATL';",
"parameter_names": [],
"parameter_values": "{}",
"exec_result": "{\"df\":{\"format\":\"parquet_v1\",\"parquet_base64\":\"UEFSMRUEFRAVFEwVAhUAEgAACBwMAAAAAAAAABUAFRIVFiwVAhUQFQYVBhwYCAwAAAAAAAAAGAgMAAA... | GQRY-A.1 | SELECT COUNT(DISTINCT coachID) FROM coaches WHERE tmID = 'ATC'; |
007-0 | ambig | true | retails | Count total number of distinct parts shipped in Q4 1996 and 1997 from orders with high order priority. | [
{
"id": "A",
"phrase": "Count total number of distinct parts shipped in Q4 1996 and 1997",
"type": "finite",
"ambiguity_type": "syntactic_computation",
"interpretations": [
"count all distinct part in the specified period",
"count total parts in Q4 1996 and count total parts in Q4 19... | [
{
"id": "GQRY-A.0-B.0-C.0",
"query": "SELECT COUNT(DISTINCT p.p_partkey) as total_distinct_parts\nFROM lineitem l\nJOIN part p ON l.l_partkey = p.p_partkey\nJOIN orders o ON l.l_orderkey = o.o_orderkey\nWHERE o.o_orderpriority IN ('1-URGENT', '2-HIGH')\nAND (\n(l.l_shipdate >= '1996-10-01' AND l.l_shipdate ... | GQRY-A.0-B.1-C.0 | SELECT COUNT(DISTINCT p.p_partkey) as total_distinct_parts
FROM lineitem l
JOIN part p ON l.l_partkey = p.p_partkey
JOIN orders o ON l.l_orderkey = o.o_orderkey
WHERE o.o_orderpriority IN ('1-URGENT', '2-HIGH')
AND (
(l.l_shipdate >= '1996-10-01' AND l.l_shipdate < '1997-01-01') OR
(l.l_shipdate >= '1997-01-01' AND l.l... |
048-0 | ambig | true | github_repos | Count the number of repository IDs in YEAR_2023 that have public events and also received a large number of pull requests. | [
{
"id": "A",
"phrase": "public events",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"events with attribute public=1",
"events of type 'PublicEvent'"
],
"intended_interpretation_idx": 1
},
{
"id": "B",
"phrase": "received a larg... | [
{
"id": "GQRY-A.0-B.0",
"query": "WITH repo_public_events AS (\nSELECT DISTINCT json_extract(repo, '$.id') as repo_id\nFROM YEAR_2023\nWHERE public = 1\n),\nrepo_pull_requests AS (\nSELECT\njson_extract(repo, '$.id') as repo_id,\nCOUNT(DISTINCT json_extract(payload, '$.pull_request.id')) as pull_request_cou... | GQRY-A.1-B.1 | WITH repo_public_events AS (
SELECT DISTINCT json_extract(repo, '$.id') as repo_id
FROM YEAR_2023
WHERE type = 'PublicEvent'
),
repo_pull_requests AS (
SELECT
json_extract(repo, '$.id') as repo_id,
COUNT(DISTINCT json_extract(payload, '$.pull_request.id')) as pull_request_count
FROM YEAR_2023
WHERE type = 'PullRequestE... |
053-0 | ambig | true | github_repos | List the names of all repositories that contain large Python files or Java files. | [
{
"id": "A",
"phrase": "large",
"type": "infinite",
"ambiguity_type": "semantic_value",
"parameter_name": "file_byte_threshold",
"parameter_dtype": "int",
"parameter_sample_operators": [
">",
">="
],
"parameter_sample_values": [
"10240"
],
"intended_para... | [
{
"id": "GQRY-B.0",
"query": "SELECT DISTINCT sample_repo_name AS repository\nFROM GITHUB_REPOS_SAMPLE_CONTENTS\nWHERE (LOWER(sample_path) LIKE '%.py' AND size > :file_byte_threshold)\nOR (LOWER(sample_path) LIKE '%.java');",
"parameter_names": [
"file_byte_threshold"
],
"parameter_values"... | GQRY-B.0 | SELECT DISTINCT sample_repo_name AS repository
FROM GITHUB_REPOS_SAMPLE_CONTENTS
WHERE (LOWER(sample_path) LIKE '%.py' AND size > :file_byte_threshold)
OR (LOWER(sample_path) LIKE '%.java'); |
016-2 | ambig | true | retails | Show the number of suppliers and customers from America. | [
{
"id": "A",
"phrase": "suppliers and customers from America",
"type": "finite",
"ambiguity_type": "syntactic_computation",
"interpretations": [
"suppliers AND (customers from America)",
"(suppliers from America) AND (customers from America)"
],
"intended_interpretation_idx":... | [
{
"id": "GQRY-A.0-B.0",
"query": "SELECT\n(SELECT COUNT(*) FROM supplier) AS supplier_count,\n(SELECT COUNT(*) FROM customer\nWHERE c_nationkey IN (SELECT n_nationkey FROM nation WHERE n_name = 'UNITED STATES')\n) AS customer_count;",
"parameter_names": [],
"parameter_values": "{}",
"exec_result... | GQRY-A.1-B.1 | SELECT
(SELECT COUNT(*) FROM supplier
WHERE s_nationkey IN (SELECT n_nationkey FROM nation WHERE n_regionkey = (SELECT r_regionkey FROM region WHERE r_name = 'AMERICA'))
) AS supplier_count,
(SELECT COUNT(*) FROM customer
WHERE c_nationkey IN (SELECT n_nationkey FROM nation WHERE n_regionkey = (SELECT r_regionkey FROM ... |
052-1 | ambig | true | github_repos | List all repositories in YEAR_2023, and for each, return its name and the source (identified by name) that contribute most events to it. | [
{
"id": "A",
"phrase": "source",
"type": "finite",
"ambiguity_type": "semantic_column",
"interpretations": [
"user",
"organization"
],
"intended_interpretation_idx": 0
}
] | [
{
"id": "GQRY-A.0",
"query": "WITH max_events AS (\nSELECT json_extract(y.repo, '$.name') AS repo_name, json_extract(y.actor, '$.login') AS source, COUNT(*) AS event_count\nFROM YEAR_2023 y\nWHERE repo_name IS NOT NULL\nGROUP BY repo_name, source\n),\nmax_contributor AS (\nSELECT me.repo_name, me.source, me... | GQRY-A.0 | WITH max_events AS (
SELECT json_extract(y.repo, '$.name') AS repo_name, json_extract(y.actor, '$.login') AS source, COUNT(*) AS event_count
FROM YEAR_2023 y
WHERE repo_name IS NOT NULL
GROUP BY repo_name, source
),
max_contributor AS (
SELECT me.repo_name, me.source, me.event_count
FROM max_events me
WHERE me.event_co... |
055-2 | ambig | true | github_repos | Find emails of all contributors in the sample commits. | [
{
"id": "A",
"phrase": "contributors",
"type": "finite",
"ambiguity_type": "semantic_column",
"interpretations": [
"commit author",
"committer",
"both commit author and committer"
],
"intended_interpretation_idx": 1
}
] | [
{
"id": "GQRY-A.0",
"query": "SELECT DISTINCT json_extract(author, '$.email') AS email\nFROM GITHUB_REPOS_SAMPLE_COMMITS\nWHERE json_extract(author, '$.email') IS NOT NULL;",
"parameter_names": [],
"parameter_values": "{}",
"exec_result": "{\"df\":{\"format\":\"parquet_v1\",\"parquet_base64\":\"... | GQRY-A.1 | SELECT DISTINCT json_extract(committer, '$.email') AS email
FROM GITHUB_REPOS_SAMPLE_COMMITS
WHERE json_extract(committer, '$.email') IS NOT NULL; |
006-0 | ambig | true | retails | Count number of suppliers with negative balance or located in Africa and do not supply Brand#32. | [
{
"id": "A",
"phrase": "with negative balance or located in Africa and do not supply Brand#32",
"type": "finite",
"ambiguity_type": "syntactic_computation",
"interpretations": [
"suppliers (with negative balance) OR (located in Africa AND do not supply Brand#32)",
"suppliers (with ne... | [
{
"id": "GQRY-A.0",
"query": "WITH negative_balance_suppliers AS (\nSELECT s.s_suppkey\nFROM supplier s\nWHERE s.s_acctbal < 0\n)\n, africa_suppliers AS (\nSELECT DISTINCT s.s_suppkey\nFROM supplier s\nJOIN nation n ON s.s_nationkey = n.n_nationkey\nJOIN region r ON n.n_regionkey = r.r_regionkey\nWHERE r.r_... | GQRY-A.1 | WITH negative_balance_suppliers AS (
SELECT s.s_suppkey
FROM supplier s
WHERE s.s_acctbal < 0
)
, africa_suppliers AS (
SELECT DISTINCT s.s_suppkey
FROM supplier s
JOIN nation n ON s.s_nationkey = n.n_nationkey
JOIN region r ON n.n_regionkey = r.r_regionkey
WHERE r.r_name = 'AFRICA'
)
, brand_32_suppliers AS (
SELECT D... |
093-1 | ambig | true | student_club | Show the number of members for each region in the Morgan County . | [
{
"id": "A",
"phrase": "region",
"type": "finite",
"ambiguity_type": "semantic_column",
"interpretations": [
"zip code",
"city"
],
"intended_interpretation_idx": 1
},
{
"id": "B",
"phrase": "Morgan County",
"type": "finite",
"ambiguity_type": "semantic_val... | [
{
"id": "GQRY-A.0-B.0",
"query": "SELECT z.zip_code, COUNT(DISTINCT m.member_id) as member_count\nFROM zip_code z\nLEFT JOIN member m ON z.zip_code = m.zip\nWHERE z.county = 'Morgan County' AND z.state = 'West Virginia'\nGROUP BY z.zip_code;",
"parameter_names": [],
"parameter_values": "{}",
"ex... | GQRY-A.1-B.1 | SELECT z.city, COUNT(DISTINCT m.member_id) as member_count
FROM zip_code z
LEFT JOIN member m ON z.zip_code = m.zip
WHERE z.county = 'Morgan County' AND z.state = 'Georgia'
GROUP BY z.city; |
023-1 | ambig | true | retails | For each supplier with ID from 1 to 100, determine the total amount owed to them. | [
{
"id": "A",
"phrase": "total amount owed",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"balance in the supplier's account",
"value of open line items",
"value of line items in unfinished orders"
],
"intended_interpretation_idx": 2
... | [
{
"id": "GQRY-A.0",
"query": "SELECT s_suppkey,\ns_name,\ns_acctbal AS total_amount_owed\nFROM supplier\nWHERE s_suppkey BETWEEN 1 AND 100;",
"parameter_names": [],
"parameter_values": "{}",
"exec_result": "{\"df\":{\"format\":\"parquet_v1\",\"parquet_base64\":\"UEFSMRUEFcAMFb4GTBXIARUAEgAAoAYEA... | GQRY-A.2 | SELECT s.s_suppkey,
s.s_name,
COALESCE(SUM(l.l_quantity * ps.ps_supplycost), 0) AS total_amount_owed
FROM supplier AS s
LEFT JOIN lineitem AS l ON s.s_suppkey = l.l_suppkey
LEFT JOIN partsupp AS ps ON l.l_partkey = ps.ps_partkey AND l.l_suppkey = ps.ps_suppkey
LEFT JOIN orders AS o ON l.l_orderkey = o.o_orderkey AND o.... |
029-3 | ambig | true | professional_basketball | What is Charles Smith's best true shooting percentage in a season in his career? | [
{
"id": "A",
"phrase": "Charles Smith",
"type": "finite",
"ambiguity_type": "semantic_value",
"interpretations": [
"Charles Smith from University of Pittsburgh born on July 16, 1965",
"Charles Smith from Georgetown University born on November 29, 1967",
"Charles Smith from Marq... | [
{
"id": "GQRY-A.0-B.0",
"query": "WITH charles_smith_stats AS (\nSELECT\npt.year,\nSUM(pt.points) + SUM(pt.PostPoints) AS total_points,\nSUM(pt.fgAttempted) + SUM(pt.PostfgAttempted) AS total_fgAttempted,\nSUM(pt.ftAttempted) + SUM(pt.PostftAttempted) AS total_ftAttempted\nFROM players_teams pt\nJOIN player... | GQRY-A.1-B.0 | WITH charles_smith_stats AS (
SELECT
pt.year,
SUM(pt.points) + SUM(pt.PostPoints) AS total_points,
SUM(pt.fgAttempted) + SUM(pt.PostfgAttempted) AS total_fgAttempted,
SUM(pt.ftAttempted) + SUM(pt.PostftAttempted) AS total_ftAttempted
FROM players_teams pt
JOIN players p ON pt.playerID = p.playerID
WHERE p.firstName = '... |
086-1 | ambig | true | codebase_community | Which post received the most responses? | [
{
"id": "A",
"phrase": "responses",
"type": "finite",
"ambiguity_type": "semantic_column",
"interpretations": [
"answers",
"comments",
"both answers and comments"
],
"intended_interpretation_idx": 2
}
] | [
{
"id": "GQRY-A.0",
"query": "SELECT Id AS post_id, Title AS post_title, COALESCE(AnswerCount, 0) AS answer_count\nFROM posts\nWHERE AnswerCount = (SELECT MAX(AnswerCount) FROM posts);",
"parameter_names": [],
"parameter_values": "{}",
"exec_result": "{\"df\":{\"format\":\"parquet_v1\",\"parquet... | GQRY-A.2 | SELECT
Id AS post_id,
Title AS post_title,
COALESCE(AnswerCount, 0) + COALESCE(CommentCount, 0) AS answer_or_comment_count
FROM posts
WHERE COALESCE(AnswerCount, 0) + COALESCE(CommentCount, 0)
= (SELECT MAX(COALESCE(AnswerCount, 0) + COALESCE(CommentCount, 0)) FROM posts); |
023-2 | ambig | true | retails | For each supplier with ID from 1 to 100, determine the total amount owed to them. | [
{
"id": "A",
"phrase": "total amount owed",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"balance in the supplier's account",
"value of open line items",
"value of line items in unfinished orders"
],
"intended_interpretation_idx": 0
... | [
{
"id": "GQRY-A.0",
"query": "SELECT s_suppkey,\ns_name,\ns_acctbal AS total_amount_owed\nFROM supplier\nWHERE s_suppkey BETWEEN 1 AND 100;",
"parameter_names": [],
"parameter_values": "{}",
"exec_result": "{\"df\":{\"format\":\"parquet_v1\",\"parquet_base64\":\"UEFSMRUEFcAMFb4GTBXIARUAEgAAoAYEA... | GQRY-A.0 | SELECT s_suppkey,
s_name,
s_acctbal AS total_amount_owed
FROM supplier
WHERE s_suppkey BETWEEN 1 AND 100; |
065-2 | ambig | true | financial | List the districts with low unemployment in 1995 - 1996. | [
{
"id": "A",
"phrase": "low unemployment",
"type": "infinite",
"ambiguity_type": "semantic_value",
"parameter_name": "unemployment_rate_threshold",
"parameter_dtype": "float",
"parameter_sample_operators": [
"<",
"<="
],
"parameter_sample_values": [
"1.7"
],... | [
{
"id": "GQRY-B.0",
"query": "SELECT district_id, A2 as district_name, A12 as unemployment_rate_1995, A13 as unemployment_rate_1996\nFROM district\nWHERE (A12 + A13) / 2.0 < :unemployment_rate_threshold;",
"parameter_names": [
"unemployment_rate_threshold"
],
"parameter_values": "{\"unempl... | GQRY-B.1 | SELECT district_id, A2 as district_name, A12 as unemployment_rate_1995, A13 as unemployment_rate_1996
FROM district
WHERE A12 < :unemployment_rate_threshold
AND A13 < :unemployment_rate_threshold; |
035-2 | ambig | true | professional_basketball | Count the number of people who played or coached in the NBA finals in the 1990s. | [
{
"id": "A",
"phrase": "played or coached in the NBA finals in the 1990s",
"type": "finite",
"ambiguity_type": "syntactic_computation",
"interpretations": [
"(played in the 1990s) or (coached in the NBA finals in the 1990s)",
"(played or coached) in the NBA finals in the 1990s."
... | [
{
"id": "GQRY-A.0-B.0",
"query": "WITH players_1990s AS (\nSELECT DISTINCT playerID\nFROM players_teams\nWHERE year BETWEEN 1990 AND 1999\n),\ncoaches_finals_1990s AS (\nSELECT DISTINCT c.coachID\nFROM coaches c\nJOIN series_post sp ON c.tmID = sp.tmIDWinner AND c.year = sp.year\nWHERE sp.round = 'F'\nAND s... | GQRY-A.0-B.0 | WITH players_1990s AS (
SELECT DISTINCT playerID
FROM players_teams
WHERE year BETWEEN 1990 AND 1999
),
coaches_finals_1990s AS (
SELECT DISTINCT c.coachID
FROM coaches c
JOIN series_post sp ON c.tmID = sp.tmIDWinner AND c.year = sp.year
WHERE sp.round = 'F'
AND sp.year BETWEEN 1990 AND 1999
AND c.lgID = 'NBA'
UNION
SE... |
035-3 | ambig | true | professional_basketball | Count the number of people who played or coached in the NBA finals in the 1990s. | [
{
"id": "A",
"phrase": "played or coached in the NBA finals in the 1990s",
"type": "finite",
"ambiguity_type": "syntactic_computation",
"interpretations": [
"(played in the 1990s) or (coached in the NBA finals in the 1990s)",
"(played or coached) in the NBA finals in the 1990s."
... | [
{
"id": "GQRY-A.0-B.0",
"query": "WITH players_1990s AS (\nSELECT DISTINCT playerID\nFROM players_teams\nWHERE year BETWEEN 1990 AND 1999\n),\ncoaches_finals_1990s AS (\nSELECT DISTINCT c.coachID\nFROM coaches c\nJOIN series_post sp ON c.tmID = sp.tmIDWinner AND c.year = sp.year\nWHERE sp.round = 'F'\nAND s... | GQRY-A.0-B.1 | WITH players_1990s AS (
SELECT DISTINCT playerID
FROM players_teams
WHERE year BETWEEN 1990 AND 1999
),
coaches_finals_1990s AS (
SELECT DISTINCT c.coachID
FROM coaches c
JOIN teams t ON c.tmID = t.tmID AND c.year = t.year
WHERE t.playoff = 'F'
AND t.year BETWEEN 1990 AND 1999
AND t.lgID = 'NBA'
),
qualified_people(per... |
075-2 | ambig | true | codebase_community | List all users in Tokyo and show total views for each of them. | [
{
"id": "A",
"phrase": "total views",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"total profile views",
"total views for authored posts",
"total views for authored or edited posts"
],
"intended_interpretation_idx": 2
}
] | [
{
"id": "GQRY-A.0",
"query": "SELECT u.Id AS UserId, u.DisplayName, u.Views AS TotalProfileViews\nFROM users u\nWHERE u.Location LIKE '%Tokyo%'\nORDER BY u.Id;",
"parameter_names": [],
"parameter_values": "{}",
"exec_result": "{\"df\":{\"format\":\"parquet_v1\",\"parquet_base64\":\"UEFSMRUEFdADF... | GQRY-A.2 | WITH user_authored_post_views AS (
SELECT OwnerUserId AS UserId, SUM(ViewCount) AS TotalViews
FROM posts
WHERE OwnerUserId IS NOT NULL
GROUP BY OwnerUserId
),
user_edited_post_views AS (
SELECT ph.UserId, COALESCE(SUM(p.ViewCount), 0) AS TotalViews
FROM postHistory ph
JOIN posts p ON ph.PostId = p.Id
GROUP BY ph.UserId... |
088-2 | ambig | true | student_club | For each region, report the total club funding received by members. | [
{
"id": "A",
"phrase": "region",
"type": "finite",
"ambiguity_type": "semantic_column",
"interpretations": [
"zip code",
"city",
"county",
"state"
],
"intended_interpretation_idx": 0
}
] | [
{
"id": "GQRY-A.0",
"query": "SELECT z.zip_code, COALESCE(SUM(i.amount), 0) AS total_income\nFROM zip_code z\nLEFT JOIN member m ON m.zip = z.zip_code\nLEFT JOIN income i ON i.link_to_member = m.member_id\nGROUP BY z.zip_code\nORDER BY z.zip_code;",
"parameter_names": [],
"parameter_values": "{}",
... | GQRY-A.0 | SELECT z.zip_code, COALESCE(SUM(i.amount), 0) AS total_income
FROM zip_code z
LEFT JOIN member m ON m.zip = z.zip_code
LEFT JOIN income i ON i.link_to_member = m.member_id
GROUP BY z.zip_code
ORDER BY z.zip_code; |
007-4 | ambig | true | retails | Count total number of distinct parts shipped in Q4 1996 and 1997 from orders with high order priority. | [
{
"id": "A",
"phrase": "Count total number of distinct parts shipped in Q4 1996 and 1997",
"type": "finite",
"ambiguity_type": "syntactic_computation",
"interpretations": [
"count all distinct part in the specified period",
"count total parts in Q4 1996 and count total parts in Q4 19... | [
{
"id": "GQRY-A.0-B.0-C.0",
"query": "SELECT COUNT(DISTINCT p.p_partkey) as total_distinct_parts\nFROM lineitem l\nJOIN part p ON l.l_partkey = p.p_partkey\nJOIN orders o ON l.l_orderkey = o.o_orderkey\nWHERE o.o_orderpriority IN ('1-URGENT', '2-HIGH')\nAND (\n(l.l_shipdate >= '1996-10-01' AND l.l_shipdate ... | GQRY-A.1-B.0-C.0 | SELECT
(SELECT COUNT(DISTINCT p.p_partkey)
FROM lineitem l
JOIN part p ON l.l_partkey = p.p_partkey
JOIN orders o ON l.l_orderkey = o.o_orderkey
WHERE o.o_orderpriority IN ('1-URGENT', '2-HIGH')
AND l.l_shipdate >= '1996-10-01'
AND l.l_shipdate < '1997-01-01'
) as q4_1996_count,
(SELECT COUNT(DISTINCT p.p_partkey)
FROM... |
020-2 | ambig | true | retails | List large parts that haven't been shipped to Middle East countries. Only includes parts with ID <= 1000. | [
{
"id": "A",
"phrase": "large parts",
"type": "finite",
"ambiguity_type": "semantic_column",
"interpretations": [
"p_size is high",
"p_type starts with 'LARGE'"
],
"intended_interpretation_idx": 0
},
{
"id": "B",
"phrase": "large parts",
"type": "infinite",
... | [
{
"id": "GQRY-A.0-C.0",
"query": "SELECT DISTINCT p.p_partkey, p.p_name, p.p_type, p.p_size\nFROM part p\nWHERE p.p_size >= :size_threshold\nAND p.p_partkey <= 1000\nAND p.p_partkey NOT IN (\nSELECT DISTINCT l.l_partkey\nFROM lineitem l\nJOIN orders o ON l.l_orderkey = o.o_orderkey\nJOIN customer c ON o.o_c... | GQRY-A.0-C.1 | 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 = ... |
075-0 | ambig | true | codebase_community | List all users in Tokyo and show total views for each of them. | [
{
"id": "A",
"phrase": "total views",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"total profile views",
"total views for authored posts",
"total views for authored or edited posts"
],
"intended_interpretation_idx": 0
}
] | [
{
"id": "GQRY-A.0",
"query": "SELECT u.Id AS UserId, u.DisplayName, u.Views AS TotalProfileViews\nFROM users u\nWHERE u.Location LIKE '%Tokyo%'\nORDER BY u.Id;",
"parameter_names": [],
"parameter_values": "{}",
"exec_result": "{\"df\":{\"format\":\"parquet_v1\",\"parquet_base64\":\"UEFSMRUEFdADF... | GQRY-A.0 | SELECT u.Id AS UserId, u.DisplayName, u.Views AS TotalProfileViews
FROM users u
WHERE u.Location LIKE '%Tokyo%'
ORDER BY u.Id; |
010-1 | ambig | true | retails | Find the regions associated with the highest-value order in the car industry. | [
{
"id": "A",
"phrase": "regions",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"customer regions",
"supplier regions"
],
"intended_interpretation_idx": 1
}
] | [
{
"id": "GQRY-A.0",
"query": "WITH automobile_orders AS (\nSELECT o.o_orderkey, o.o_totalprice, c.c_nationkey\nFROM orders o\nJOIN customer c ON o.o_custkey = c.c_custkey\nWHERE c.c_mktsegment = 'AUTOMOBILE'\n),\nmax_order AS (\nSELECT MAX(o_totalprice) as max_price\nFROM automobile_orders\n)\nSELECT DISTIN... | GQRY-A.1 | WITH automobile_orders AS (
SELECT o.o_orderkey, o.o_totalprice
FROM orders o
JOIN customer c ON o.o_custkey = c.c_custkey
WHERE c.c_mktsegment = 'AUTOMOBILE'
),
max_order AS (
SELECT MAX(o_totalprice) as max_price
FROM automobile_orders
)
SELECT DISTINCT r.r_regionkey, r.r_name as supplier_region
FROM automobile_order... |
060-3 | ambig | true | financial | Count the number of young clients with significant loans and large transactions for each area. | [
{
"id": "A",
"phrase": "Count the number of young clients with significant loans and large transactions",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"count clients with either significant loans or large transactions ('and' means UNION)",
"count c... | [
{
"id": "GQRY-A.0-E.0",
"query": "WITH significant_loans AS (\nSELECT DISTINCT di.client_id\nFROM client c\nJOIN disp di ON c.client_id = di.client_id\nJOIN loan l ON di.account_id = l.account_id\nWHERE l.amount > :loan_amount_threshold\nAND c.birth_date >= :birth_date_threshold\n),\nlarge_transactions AS (... | GQRY-A.0-E.0 | WITH significant_loans AS (
SELECT DISTINCT di.client_id
FROM client c
JOIN disp di ON c.client_id = di.client_id
JOIN loan l ON di.account_id = l.account_id
WHERE l.amount > :loan_amount_threshold
AND c.birth_date >= :birth_date_threshold
),
large_transactions AS (
SELECT DISTINCT di.client_id
FROM client c
JOIN disp ... |
081-1 | ambig | true | codebase_community | Find users who have either Teacher or Student badges in 2011 and 2012. Only includes the users with ID up to 1000. | [
{
"id": "A",
"phrase": "in 2011 and 2012",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"in both 2011 and 2012.",
"in either 2011 or 2012."
],
"intended_interpretation_idx": 0
}
] | [
{
"id": "GQRY-A.0",
"query": "SELECT u.Id AS UserId, u.DisplayName\nFROM users u\nWHERE u.Id IN (\nSELECT UserId\nFROM (\nSELECT UserId\nFROM badges\nWHERE Name in ('Teacher', 'Student') AND strftime('%Y', Date) = '2011'\nINTERSECT\nSELECT UserId\nFROM badges\nWHERE Name in ('Teacher', 'Student') AND strfti... | GQRY-A.0 | SELECT u.Id AS UserId, u.DisplayName
FROM users u
WHERE u.Id IN (
SELECT UserId
FROM (
SELECT UserId
FROM badges
WHERE Name in ('Teacher', 'Student') AND strftime('%Y', Date) = '2011'
INTERSECT
SELECT UserId
FROM badges
WHERE Name in ('Teacher', 'Student') AND strftime('%Y', Date) = '2012'
)
)
AND u.Id <= 1000
ORDER BY... |
090-0 | ambig | true | student_club | List all events attended by members in Albany, including their name and location. | [
{
"id": "A",
"phrase": "Albany",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"Albany city, Vermont",
"Albany city, New York",
"Albany city, Georgia",
"Albany city, Kentucky",
"Albany city, Ohio",
"Albany city, Indiana",
... | [
{
"id": "GQRY-A.0",
"query": "SELECT DISTINCT e.event_id, e.event_name, e.location\nFROM event AS e\nJOIN attendance AS a ON e.event_id = a.link_to_event\nJOIN member AS m ON a.link_to_member = m.member_id\nJOIN zip_code AS z ON m.zip = z.zip_code\nWHERE z.state = 'Vermont' AND z.city = 'Albany';",
"par... | GQRY-A.15 | SELECT DISTINCT e.event_id, e.event_name, e.location
FROM event AS e
JOIN attendance AS a ON e.event_id = a.link_to_event
JOIN member AS m ON a.link_to_member = m.member_id
JOIN zip_code AS z ON m.zip = z.zip_code
WHERE z.state = 'New York' AND z.county = 'Albany County'; |
002-1 | ambig | true | retails | Count the number of suppliers that offer both air and rail shipping in America. | [
{
"id": "A",
"phrase": "suppliers that offer both air and rail shipping in America",
"type": "finite",
"ambiguity_type": "syntactic_computation",
"interpretations": [
"suppliers that offer air and rail shipping to customers in America",
"suppliers in America that offer air and rail s... | [
{
"id": "GQRY-A.0-B.0-C.0",
"query": "WITH usa_suppliers_with_air AS (\nSELECT DISTINCT l.l_suppkey\nFROM lineitem l\nJOIN orders o ON l.l_orderkey = o.o_orderkey\nJOIN customer c ON o.o_custkey = c.c_custkey\nJOIN nation n ON c.c_nationkey = n.n_nationkey\nWHERE n.n_name = 'UNITED STATES'\nAND l.l_shipmode... | GQRY-A.1-B.0-C.1 | WITH usa_suppliers_with_air AS (
SELECT DISTINCT l.l_suppkey
FROM lineitem l
JOIN supplier s ON l.l_suppkey = s.s_suppkey
JOIN nation n ON s.s_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_... |
065-1 | ambig | true | financial | List the districts with low unemployment in 1995 - 1996. | [
{
"id": "A",
"phrase": "low unemployment",
"type": "infinite",
"ambiguity_type": "semantic_value",
"parameter_name": "unemployment_rate_threshold",
"parameter_dtype": "float",
"parameter_sample_operators": [
"<",
"<="
],
"parameter_sample_values": [
"1.7"
],... | [
{
"id": "GQRY-B.0",
"query": "SELECT district_id, A2 as district_name, A12 as unemployment_rate_1995, A13 as unemployment_rate_1996\nFROM district\nWHERE (A12 + A13) / 2.0 < :unemployment_rate_threshold;",
"parameter_names": [
"unemployment_rate_threshold"
],
"parameter_values": "{\"unempl... | GQRY-B.0 | SELECT district_id, A2 as district_name, A12 as unemployment_rate_1995, A13 as unemployment_rate_1996
FROM district
WHERE (A12 + A13) / 2.0 < :unemployment_rate_threshold; |
002-3 | ambig | true | retails | Count the number of suppliers that offer both air and rail shipping in America. | [
{
"id": "A",
"phrase": "suppliers that offer both air and rail shipping in America",
"type": "finite",
"ambiguity_type": "syntactic_computation",
"interpretations": [
"suppliers that offer air and rail shipping to customers in America",
"suppliers in America that offer air and rail s... | [
{
"id": "GQRY-A.0-B.0-C.0",
"query": "WITH usa_suppliers_with_air AS (\nSELECT DISTINCT l.l_suppkey\nFROM lineitem l\nJOIN orders o ON l.l_orderkey = o.o_orderkey\nJOIN customer c ON o.o_custkey = c.c_custkey\nJOIN nation n ON c.c_nationkey = n.n_nationkey\nWHERE n.n_name = 'UNITED STATES'\nAND l.l_shipmode... | GQRY-A.1-B.0-C.0 | WITH usa_suppliers_with_air AS (
SELECT DISTINCT l.l_suppkey
FROM lineitem l
JOIN supplier s ON l.l_suppkey = s.s_suppkey
JOIN nation n ON s.s_nationkey = n.n_nationkey
WHERE n.n_name = 'UNITED STATES'
AND l.l_shipmode = 'AIR'
),
usa_suppliers_with_rail AS (
SELECT DISTINCT l.l_suppkey
FROM lineitem l
JOIN supplier s O... |
051-2 | ambig | true | github_repos | For each sample repo with many watchers, show the number of public events in the first month of 2023 and 2022, return the result in (repo_name, count) pairs. | [
{
"id": "A",
"phrase": "many watchers",
"type": "infinite",
"ambiguity_type": "semantic_value",
"parameter_name": "watcher_threshold",
"parameter_dtype": "int",
"parameter_sample_operators": [
">",
">="
],
"parameter_sample_values": [
"160"
],
"intended_... | [
{
"id": "GQRY-B.0-C.0",
"query": "WITH public_events AS (\nSELECT json_extract(repo, '$.name') AS repo, COUNT(*) AS event_count\nFROM (\nSELECT repo FROM MONTH_202201 WHERE public = 1\nUNION ALL\nSELECT repo FROM MONTH_202301 WHERE public = 1\n) AS combined\nGROUP BY json_extract(repo, '$.name')\n)\nSELECT ... | GQRY-B.0-C.1 | WITH public_events AS (
SELECT json_extract(repo, '$.name') AS repo, COUNT(*) AS event_count
FROM (
SELECT repo FROM YEAR_2022 WHERE public = 1
UNION ALL
SELECT repo FROM MONTH_202301 WHERE public = 1
) AS combined
GROUP BY json_extract(repo, '$.name')
)
SELECT sr.repo_name, COALESCE(event_count, 0)
FROM GITHUB_REPOS_S... |
093-2 | ambig | true | student_club | Show the number of members for each region in the Morgan County . | [
{
"id": "A",
"phrase": "region",
"type": "finite",
"ambiguity_type": "semantic_column",
"interpretations": [
"zip code",
"city"
],
"intended_interpretation_idx": 0
},
{
"id": "B",
"phrase": "Morgan County",
"type": "finite",
"ambiguity_type": "semantic_val... | [
{
"id": "GQRY-A.0-B.0",
"query": "SELECT z.zip_code, COUNT(DISTINCT m.member_id) as member_count\nFROM zip_code z\nLEFT JOIN member m ON z.zip_code = m.zip\nWHERE z.county = 'Morgan County' AND z.state = 'West Virginia'\nGROUP BY z.zip_code;",
"parameter_names": [],
"parameter_values": "{}",
"ex... | GQRY-A.0-B.4 | SELECT z.zip_code, COUNT(DISTINCT m.member_id) as member_count
FROM zip_code z
LEFT JOIN member m ON z.zip_code = m.zip
WHERE z.county = 'Morgan County' AND z.state = 'Kentucky'
GROUP BY z.zip_code; |
083-0 | ambig | true | codebase_community | For each tag with many occurences (tags.Count), find the post with the highest score and its last update timestamp and reply count. | [
{
"id": "A",
"phrase": "many occurences",
"type": "infinite",
"ambiguity_type": "semantic_value",
"parameter_name": "count_threshold",
"parameter_dtype": "int",
"parameter_sample_operators": [
">",
">="
],
"parameter_sample_values": [
"500"
],
"intended_... | [
{
"id": "GQRY-B.0-C.0",
"query": "WITH tag_posts AS (\nSELECT\nt.TagName,\np.Id AS PostId,\np.Title,\np.LasActivityDate,\np.AnswerCount,\np.Score,\nRANK() OVER (PARTITION BY t.TagName ORDER BY p.Score DESC) AS rn\nFROM tags t\nJOIN posts p ON p.Tags LIKE '%<' || t.TagName || '>%'\nWHERE t.Count >= :count_th... | GQRY-B.0-C.1 | WITH tag_posts AS (
SELECT
t.TagName,
p.Id AS PostId,
p.Title,
p.LasActivityDate,
p.CommentCount,
p.Score,
RANK() OVER (PARTITION BY t.TagName ORDER BY p.Score DESC) AS rn
FROM tags t
JOIN posts p ON p.Tags LIKE '%<' || t.TagName || '>%'
WHERE t.Count >= :count_threshold
)
SELECT TagName, PostId, Title, Score, LasActiv... |
063-0 | ambig | true | financial | Identify clients who are considered young adults when they received a sizable loan. Return the client ID, loan amount, and loan date. | [
{
"id": "A",
"phrase": "young",
"type": "infinite",
"ambiguity_type": "semantic_value",
"parameter_name": "age_upper_bound",
"parameter_dtype": "int",
"parameter_sample_operators": [
"<",
"<="
],
"parameter_sample_values": [
"25"
],
"intended_parameter_o... | [
{
"id": "GQRY",
"query": "SELECT DISTINCT c.client_id, l.amount, l.date\nFROM client c\nJOIN disp d ON c.client_id = d.client_id\nJOIN loan l ON d.account_id = l.account_id\nWHERE (CAST((strftime('%Y', l.date) - strftime('%Y', c.birth_date)) AS INTEGER)\n- (strftime('%m-%d', l.date) < strftime('%m-%d', c.bi... | GQRY | SELECT DISTINCT c.client_id, l.amount, l.date
FROM client c
JOIN disp d ON c.client_id = d.client_id
JOIN loan l ON d.account_id = l.account_id
WHERE (CAST((strftime('%Y', l.date) - strftime('%Y', c.birth_date)) AS INTEGER)
- (strftime('%m-%d', l.date) < strftime('%m-%d', c.birth_date))) >= :age_lower_bound
AND (CAST((... |
038-1 | ambig | true | github_repos | Show all programming languages and their total usage in GITHUB_REPOS_LANGUAGES. | [
{
"id": "A",
"phrase": "total usage",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"total number of repositories",
"total number of bytes"
],
"intended_interpretation_idx": 1
}
] | [
{
"id": "GQRY-A.0",
"query": "WITH language_repos AS (\nSELECT repo_name,\njson_extract(j.value, '$.name') AS language,\njson_extract(j.value, '$.bytes') AS bytes\nFROM GITHUB_REPOS_LANGUAGES,\njson_each(GITHUB_REPOS_LANGUAGES.language) j\n)\nSELECT language, COUNT(DISTINCT repo_name) AS repo_count\nFROM la... | GQRY-A.1 | WITH language_repos AS (
SELECT repo_name,
json_extract(j.value, '$.name') AS language,
json_extract(j.value, '$.bytes') AS bytes
FROM GITHUB_REPOS_LANGUAGES,
json_each(GITHUB_REPOS_LANGUAGES.language) j
)
SELECT language, SUM(bytes) AS total_bytes
FROM language_repos
GROUP BY language
ORDER BY total_bytes DESC; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.