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 |
|---|---|---|---|---|---|---|---|---|
086-0 | 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": 0
}
] | [
{
"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.0 | SELECT Id AS post_id, Title AS post_title, COALESCE(AnswerCount, 0) AS answer_count
FROM posts
WHERE AnswerCount = (SELECT MAX(AnswerCount) FROM posts); |
037-0 | 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.1 | 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') IN ('opened', 'reopened')
GROUP BY repo_name
HAVING issues_opened > :issue_count_threshold
)
SELEC... |
034-0 | ambig | true | professional_basketball | List short Black players who have played in the frontcourt positions. | [
{
"id": "A",
"phrase": "short",
"type": "infinite",
"ambiguity_type": "semantic_value",
"parameter_name": "height_threshold",
"parameter_dtype": "int",
"parameter_sample_operators": [
"<",
"<="
],
"parameter_sample_values": [
"76"
],
"intended_parameter_... | [
{
"id": "GQRY",
"query": "SELECT p.firstName, p.lastName, p.pos, p.race, p.height\nFROM players p\nWHERE (p.pos LIKE '%F%' OR p.pos LIKE '%C%')\nAND p.race = 'B'\nAND p.height < :height_threshold;",
"parameter_names": [
"height_threshold"
],
"parameter_values": "{\"height_threshold\":76}",... | GQRY | SELECT p.firstName, p.lastName, p.pos, p.race, p.height
FROM players p
WHERE (p.pos LIKE '%F%' OR p.pos LIKE '%C%')
AND p.race = 'B'
AND p.height < :height_threshold; |
013-0 | 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.1 | SELECT
SUM(l_quantity) AS total_quantity,
SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS total_charge
FROM lineitem
WHERE l_returnflag = 'R'
AND (l_shipmode = 'MAIL' OR l_discount > 0.05); |
004-0 | ambig | true | retails | Find all customers with high account balances and list their number of priority orders. | [
{
"id": "A",
"phrase": "high account balances",
"type": "infinite",
"ambiguity_type": "semantic_value",
"parameter_name": "account_balance_threshold",
"parameter_dtype": "int",
"parameter_sample_operators": [
">",
">="
],
"parameter_sample_values": [
"9990"
... | [
{
"id": "GQRY-B.0",
"query": "WITH high_balance_customers AS (\nSELECT c_custkey, c_name, c_acctbal\nFROM customer\nWHERE c_acctbal > :account_balance_threshold\n)\nSELECT c.c_custkey,\nc.c_name,\nc.c_acctbal,\nCOUNT(CASE WHEN o.o_orderpriority IN ('1-URGENT') THEN o.o_orderkey END) AS num_priority_order\nF... | GQRY-B.0 | WITH high_balance_customers AS (
SELECT c_custkey, c_name, c_acctbal
FROM customer
WHERE c_acctbal > :account_balance_threshold
)
SELECT c.c_custkey,
c.c_name,
c.c_acctbal,
COUNT(CASE WHEN o.o_orderpriority IN ('1-URGENT') THEN o.o_orderkey END) AS num_priority_order
FROM high_balance_customers c
LEFT JOIN orders o ON ... |
004-1 | ambig | true | retails | Find all customers with high account balances and list their number of priority orders. | [
{
"id": "A",
"phrase": "high account balances",
"type": "infinite",
"ambiguity_type": "semantic_value",
"parameter_name": "account_balance_threshold",
"parameter_dtype": "int",
"parameter_sample_operators": [
">",
">="
],
"parameter_sample_values": [
"9990"
... | [
{
"id": "GQRY-B.0",
"query": "WITH high_balance_customers AS (\nSELECT c_custkey, c_name, c_acctbal\nFROM customer\nWHERE c_acctbal > :account_balance_threshold\n)\nSELECT c.c_custkey,\nc.c_name,\nc.c_acctbal,\nCOUNT(CASE WHEN o.o_orderpriority IN ('1-URGENT') THEN o.o_orderkey END) AS num_priority_order\nF... | GQRY-B.3 | WITH high_balance_customers AS (
SELECT c_custkey, c_name, c_acctbal
FROM customer
WHERE c_acctbal > :account_balance_threshold
)
SELECT c.c_custkey,
c.c_name,
c.c_acctbal,
COUNT(CASE WHEN o.o_shippriority > 0 THEN o.o_orderkey END) AS num_priority_order
FROM high_balance_customers c
LEFT JOIN orders o ON c.c_custkey =... |
068-0 | ambig | true | financial | Find the total value sent to each bank. | [
{
"id": "A",
"phrase": "total value sent to each bank",
"type": "finite",
"ambiguity_type": "semantic_table",
"interpretations": [
"computed using order table",
"computed using trans table"
],
"intended_interpretation_idx": 0
}
] | [
{
"id": "GQRY-A.0",
"query": "SELECT\nbank_to,\nSUM(amount) AS total_value_sent\nFROM \"order\"\nGROUP BY bank_to\nORDER BY bank_to;",
"parameter_names": [],
"parameter_values": "{}",
"exec_result": "{\"df\":{\"format\":\"parquet_v1\",\"parquet_base64\":\"UEFSMRUEFZwBFYwBTBUaFQASAABOFAIAAABBQgEG... | GQRY-A.0 | SELECT
bank_to,
SUM(amount) AS total_value_sent
FROM "order"
GROUP BY bank_to
ORDER BY bank_to; |
011-1 | ambig | true | retails | Find the lowest unit price for each part that has suppliers from Arab countries. Only include parts with ID from 1 to 20. | [
{
"id": "A",
"phrase": "unit price",
"type": "finite",
"ambiguity_type": "semantic_computation",
"interpretations": [
"unit supply cost",
"listed retail unit price",
"final transaction unit price"
],
"intended_interpretation_idx": 0
}
] | [
{
"id": "GQRY-A.0",
"query": "WITH parts_with_arab_suppliers AS (\nSELECT DISTINCT p.p_partkey, p.p_name\nFROM part p\nJOIN partsupp ps ON p.p_partkey = ps.ps_partkey\nJOIN supplier s ON s.s_suppkey = ps.ps_suppkey\nJOIN nation n ON n.n_nationkey = s.s_nationkey\nWHERE n.n_name IN ('ALGERIA','EGYPT','IRAQ'... | GQRY-A.0 | WITH parts_with_arab_suppliers AS (
SELECT DISTINCT p.p_partkey, p.p_name
FROM part p
JOIN partsupp ps ON p.p_partkey = ps.ps_partkey
JOIN supplier s ON s.s_suppkey = ps.ps_suppkey
JOIN nation n ON n.n_nationkey = s.s_nationkey
WHERE n.n_name IN ('ALGERIA','EGYPT','IRAQ','JORDAN','MOROCCO','SAUDI ARABIA')
AND p.p_part... |
093-3 | 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.10 | 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 = 'Utah'
GROUP BY z.city; |
015-1 | ambig | true | retails | For each industry, show the number of customers that bought part 309 from China. | [
{
"id": "A",
"phrase": "customers that bought part 309 from China",
"type": "finite",
"ambiguity_type": "syntactic_computation",
"interpretations": [
"customers that bought part 309 from suppliers in China",
"customers in China that bought part 309"
],
"intended_interpretatio... | [
{
"id": "GQRY-A.0",
"query": "WITH industries AS (\nSELECT DISTINCT c.c_mktsegment AS industry FROM customer c\n),\nchina_customers AS (\nSELECT\nc.c_mktsegment AS industry,\nCOUNT(DISTINCT c.c_custkey) AS customer_count\nFROM customer c\nJOIN orders o ON c.c_custkey = o.o_custkey\nJOIN lineitem l ON o.o_or... | GQRY-A.1 | WITH industries AS (
SELECT DISTINCT c.c_mktsegment AS industry FROM customer c
),
china_customers AS (
SELECT
c.c_mktsegment AS industry,
COUNT(DISTINCT c.c_custkey) AS customer_count
FROM customer c
JOIN nation n ON c.c_nationkey = n.n_nationkey
JOIN orders o ON c.c_custkey = o.o_custkey
JOIN lineitem l ON o.o_orderk... |
023-0 | 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": 1
... | [
{
"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.1 | SELECT s.s_suppkey,
s.s_name,
COALESCE(SUM(l.l_quantity * ps.ps_supplycost), 0) AS total_amount_owed
FROM supplier s
LEFT JOIN lineitem l ON s.s_suppkey = l.l_suppkey AND l.l_linestatus = 'O'
LEFT JOIN partsupp ps ON l.l_partkey = ps.ps_partkey AND l.l_suppkey = ps.ps_suppkey
WHERE s.s_suppkey BETWEEN 1 AND 100
GROUP B... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.