File size: 4,125 Bytes
02edc38 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | /*
{
"qid": "016",
"task_type": "ambig",
"has_intended_resolution": true,
"language": "SQLite",
"db": "retails",
"question": "Show the number of suppliers and customers from America.",
"gold_ambiguity_points": [
{
"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": 1
},
{
"id": "B",
"phrase": "America",
"type": "finite",
"ambiguity_type": "semantic_table",
"interpretations": [
"United States (country)",
"Americas (region)"
],
"intended_interpretation_idx": 0
}
],
"gold_intended_query_id": "GQRY-A.1-B.0",
"extra_info": {}
}
*/
----- START OF GOLD QUERY `GQRY-A.0-B.0` -----
/*
{
"id": "GQRY-A.0-B.0",
"parameter_names": [],
"parameter_values": {},
"other_exec_results": [],
"required_columns": null,
"required_sorted": false,
"extra_info": {
"ambiguity_resolution": {
"[A] suppliers and customers from America": "suppliers AND (customers from America)",
"[B] America": "United States (country)"
}
}
}
*/
SELECT
(SELECT COUNT(*) FROM supplier) AS supplier_count,
(SELECT COUNT(*) FROM customer
WHERE c_nationkey IN (SELECT n_nationkey FROM nation WHERE n_name = 'UNITED STATES')
) AS customer_count;
/* EXEC RESULT
supplier_count customer_count
10000 6100
*/
----- END OF GOLD QUERY -----
----- START OF GOLD QUERY `GQRY-A.0-B.1` -----
/*
{
"id": "GQRY-A.0-B.1",
"parameter_names": [],
"parameter_values": {},
"other_exec_results": [],
"required_columns": null,
"required_sorted": false,
"extra_info": {
"ambiguity_resolution": {
"[A] suppliers and customers from America": "suppliers AND (customers from America)",
"[B] America": "Americas (region)"
}
}
}
*/
SELECT
(SELECT COUNT(*) FROM supplier) AS supplier_count,
(SELECT COUNT(*) FROM customer
WHERE c_nationkey IN (SELECT n_nationkey FROM nation WHERE n_regionkey = (SELECT r_regionkey FROM region WHERE r_name = 'AMERICA'))
) AS customer_count;
/* EXEC RESULT
supplier_count customer_count
10000 29961
*/
----- END OF GOLD QUERY -----
----- START OF GOLD QUERY `GQRY-A.1-B.0` -----
/*
{
"id": "GQRY-A.1-B.0",
"parameter_names": [],
"parameter_values": {},
"other_exec_results": [],
"required_columns": null,
"required_sorted": false,
"extra_info": {
"ambiguity_resolution": {
"[A] suppliers and customers from America": "(suppliers from America) AND (customers from America)",
"[B] America": "United States (country)"
}
}
}
*/
SELECT
(SELECT COUNT(*) FROM supplier
WHERE s_nationkey IN (SELECT n_nationkey FROM nation WHERE n_name = 'UNITED STATES')
) AS supplier_count,
(SELECT COUNT(*) FROM customer
WHERE c_nationkey IN (SELECT n_nationkey FROM nation WHERE n_name = 'UNITED STATES')
) AS customer_count;
/* EXEC RESULT
supplier_count customer_count
391 6100
*/
----- END OF GOLD QUERY -----
----- START OF GOLD QUERY `GQRY-A.1-B.1` -----
/*
{
"id": "GQRY-A.1-B.1",
"parameter_names": [],
"parameter_values": {},
"other_exec_results": [],
"required_columns": null,
"required_sorted": false,
"extra_info": {
"ambiguity_resolution": {
"[A] suppliers and customers from America": "(suppliers from America) AND (customers from America)",
"[B] America": "Americas (region)"
}
}
}
*/
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 region WHERE r_name = 'AMERICA'))
) AS customer_count;
/* EXEC RESULT
supplier_count customer_count
1992 29961
*/
----- END OF GOLD QUERY ----- |