nlile commited on
Commit
3b94f13
·
verified ·
1 Parent(s): fb8cdad

Upload 5 files

Browse files
Files changed (5) hide show
  1. dev.json +0 -0
  2. dev.sql +0 -0
  3. dev_databases.zip +3 -0
  4. dev_tables.json +0 -0
  5. dev_tied_append.json +338 -0
dev.json ADDED
The diff for this file is too large to render. See raw diff
 
dev.sql ADDED
The diff for this file is too large to render. See raw diff
 
dev_databases.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8132aacfe61ecec7198a62e93cb8512dac89b1d6b9922fe3c7bb94b13f317d8f
3
+ size 345997266
dev_tables.json ADDED
The diff for this file is too large to render. See raw diff
 
dev_tied_append.json ADDED
@@ -0,0 +1,338 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "question_id": 37,
4
+ "db_id": "california_schools",
5
+ "question": "What is the complete address of the school with the lowest excellence rate? Indicate the Street, City, Zip and State.",
6
+ "evidence": "Execellence Rate = NumGE1500 / NumTstTakr; complete address has Street, City, Zip, State",
7
+ "SQL": "SELECT T2.Street, T2.City, T2.Zip, T2.State FROM schools AS T2 INNER JOIN (SELECT cds, CAST(NumGE1500 AS REAL) / NumTstTakr AS rate FROM satscores WHERE NumGE1500 IS NOT NULL AND NumTstTakr IS NOT NULL AND NumTstTakr != 0) AS T1 ON T2.CDSCode = T1.cds WHERE T1.rate = (SELECT MIN(CAST(NumGE1500 AS REAL) / NumTstTakr) AS min_rate FROM satscores WHERE NumGE1500 IS NOT NULL AND NumTstTakr IS NOT NULL AND NumTstTakr != 0) ORDER BY T2.CDSCode",
8
+ "difficulty": "moderate"
9
+ },
10
+ {
11
+ "question_id": 68,
12
+ "db_id": "california_schools",
13
+ "question": "Which county reported the most number of school closure in the 1980s with school wonership code belonging to Youth Authority Facilities (CEA)?",
14
+ "evidence": "Youth Authority Facilities (CEA) refers to SOC = 11; 1980s = years between 1980 and 1989",
15
+ "SQL": "SELECT County FROM (SELECT County, COUNT(School) AS SchoolCount FROM schools WHERE strftime('%Y', ClosedDate) BETWEEN '1980' AND '1989' AND StatusType = 'Closed' AND SOC = 11 GROUP BY County) WHERE SchoolCount = (SELECT MAX(SchoolCount) FROM (SELECT COUNT(School) AS SchoolCount FROM schools WHERE strftime('%Y', ClosedDate) BETWEEN '1980' AND '1989' AND StatusType = 'Closed' AND SOC = 11 GROUP BY County))",
16
+ "difficulty": "moderate"
17
+ },
18
+ {
19
+ "question_id": 80,
20
+ "db_id": "california_schools",
21
+ "question": "What is the school type of the school with the highest latitude? Indicate the name of the school as well as the latitude coordinates.",
22
+ "evidence": "",
23
+ "SQL": "SELECT T1.`School Type`, T1.`School Name`, T2.Latitude FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.Latitude = (SELECT MAX(Latitude) FROM schools)",
24
+ "difficulty": "simple"
25
+ },
26
+ {
27
+ "question_id": 81,
28
+ "db_id": "california_schools",
29
+ "question": "In which city can you find the school in the state of California with the lowest latitude coordinates and what is its lowest grade? Indicate the school name.",
30
+ "evidence": "State of California refers to state = 'CA'",
31
+ "SQL": "SELECT T2.City, T1.`Low Grade`, T1.`School Name` FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.State = 'CA' AND T2.Latitude IS NOT NULL AND T2.Latitude = (SELECT MIN(Latitude) FROM schools WHERE State = 'CA' AND Latitude IS NOT NULL)",
32
+ "difficulty": "moderate"
33
+ },
34
+ {
35
+ "question_id": 82,
36
+ "db_id": "california_schools",
37
+ "question": "What is the grade span offered in the school with the highest longitude?",
38
+ "evidence": "",
39
+ "SQL": "SELECT GSoffered FROM schools WHERE ABS(longitude) = (SELECT MAX(ABS(longitude)) FROM schools)",
40
+ "difficulty": "simple"
41
+ },
42
+ {
43
+ "question_id": 101,
44
+ "db_id": "financial",
45
+ "question": "List out the accounts who have the earliest trading date in 1995 ?",
46
+ "evidence": "",
47
+ "SQL": "SELECT account_id FROM trans WHERE STRFTIME('%Y', date) = '1995' ORDER BY date ASC LIMIT 1",
48
+ "difficulty": "simple"
49
+ },
50
+ {
51
+ "question_id": 189,
52
+ "db_id": "financial",
53
+ "question": "Name the account numbers of female clients who are oldest and have lowest average salary?",
54
+ "evidence": "Female refers to 'F' in the gender; A11 contains information about average salary",
55
+ "SQL": "SELECT T3.account_id FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN account AS T3 ON T2.district_id = T3.district_id WHERE T1.gender = 'F' AND T1.birth_date = (SELECT MIN(birth_date) FROM client WHERE gender = 'F') AND T2.A11 = (SELECT MIN(T2.A11) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.gender = 'F' AND T1.birth_date = (SELECT MIN(birth_date) FROM client WHERE gender = 'F'))",
56
+ "difficulty": "moderate"
57
+ },
58
+ {
59
+ "question_id": 244,
60
+ "db_id": "toxicology",
61
+ "question": "Is the molecule with the most double bonds carcinogenic?",
62
+ "evidence": "double bond refers to bond_type = ' = '; label = '+' mean molecules are carcinogenic",
63
+ "SQL": "SELECT T1.label FROM molecule AS T1 INNER JOIN (SELECT T.molecule_id, COUNT(T.bond_type) AS bond_count FROM bond AS T WHERE T.bond_type = '=' GROUP BY T.molecule_id HAVING bond_count = (SELECT MAX(bond_count) FROM (SELECT molecule_id, COUNT(bond_type) AS bond_count FROM bond WHERE bond_type = '=' GROUP BY molecule_id) AS subquery) ORDER BY bond_count DESC) AS T2 ON T1.molecule_id = T2.molecule_id",
64
+ "difficulty": "moderate"
65
+ },
66
+ {
67
+ "question_id": 250,
68
+ "db_id": "toxicology",
69
+ "question": "Of all the carcinogenic molecules, which one has the most double bonds?",
70
+ "evidence": "label = '+' mean molecules are carcinogenic; double bond refers to bond_type = ' = ';",
71
+ "SQL": "SELECT T.molecule_id FROM (SELECT T3.molecule_id, COUNT(T1.bond_type) AS bond_count FROM bond AS T1 INNER JOIN molecule AS T3 ON T1.molecule_id = T3.molecule_id WHERE T3.label = '+' AND T1.bond_type = '=' GROUP BY T3.molecule_id HAVING bond_count = (SELECT MAX(bond_count) FROM (SELECT T3.molecule_id, COUNT(T1.bond_type) AS bond_count FROM bond AS T1 INNER JOIN molecule AS T3 ON T1.molecule_id = T3.molecule_id WHERE T3.label = '+' AND T1.bond_type = '=' GROUP BY T3.molecule_id) AS subquery) ORDER BY bond_count DESC) AS T",
72
+ "difficulty": "moderate"
73
+ },
74
+ {
75
+ "question_id": 342,
76
+ "db_id": "card_games",
77
+ "question": "List the card names with value that cost more converted mana for the face.",
78
+ "evidence": "more converted mana for the face refers to Max(faceConvertedManaCost);",
79
+ "SQL": "SELECT name FROM cards WHERE faceConvertedManaCost IS NOT NULL AND faceConvertedManaCost = (SELECT MAX(faceConvertedManaCost) FROM cards WHERE faceConvertedManaCost IS NOT NULL)",
80
+ "difficulty": "simple"
81
+ },
82
+ {
83
+ "question_id": 432,
84
+ "db_id": "card_games",
85
+ "question": "Which Russian set of cards contains the most cards overall?",
86
+ "evidence": "Russian refers to language = 'Russian'; contains the most cards overall refers to MAX(baseSetSize)",
87
+ "SQL": "SELECT T1.id FROM sets AS T1 INNER JOIN set_translations AS T2 ON T1.code = T2.setCode WHERE T2.language = 'Russian' GROUP BY T1.baseSetSize HAVING COUNT(T1.id) = (SELECT MAX(card_count) FROM (SELECT COUNT(T1.id) AS card_count FROM sets AS T1 INNER JOIN set_translations AS T2 ON T1.code = T2.setCode WHERE T2.language = 'Russian' GROUP BY T1.baseSetSize) AS subquery)",
88
+ "difficulty": "moderate"
89
+ },
90
+ {
91
+ "question_id": 476,
92
+ "db_id": "card_games",
93
+ "question": "Please list the name of the cards in the set Coldsnap with the highest converted mana cost.",
94
+ "evidence": "card set Coldsnap refers to name = 'Coldsnap'",
95
+ "SQL": "SELECT T1.name FROM cards AS T1 INNER JOIN sets AS T2 ON T2.code = T1.setCode WHERE T2.name = 'Coldsnap' AND T1.convertedManaCost = (SELECT MAX(convertedManaCost) FROM cards AS T1 INNER JOIN sets AS T2 ON T2.code = T1.setCode WHERE T2.name = 'Coldsnap')",
96
+ "difficulty": "simple"
97
+ },
98
+ {
99
+ "question_id": 484,
100
+ "db_id": "card_games",
101
+ "question": "Please list the Italian names of the cards in the set Coldsnap with the highest converted mana cost.",
102
+ "evidence": "card set Coldsnap refers to name = 'Coldsnap'; Italian refers to language = 'Italian'",
103
+ "SQL": "SELECT T2.name FROM foreign_data AS T1 INNER JOIN cards AS T2 ON T2.uuid = T1.uuid INNER JOIN sets AS T3 ON T3.code = T2.setCode WHERE T3.name = 'Coldsnap' AND T1.language = 'Italian' AND T2.convertedManaCost = (SELECT MAX(convertedManaCost) FROM foreign_data AS T1 INNER JOIN cards AS T2 ON T2.uuid = T1.uuid INNER JOIN sets AS T3 ON T3.code = T2.setCode WHERE T3.name = 'Coldsnap' AND T1.language = 'Italian')",
104
+ "difficulty": "moderate"
105
+ },
106
+ {
107
+ "question_id": 515,
108
+ "db_id": "card_games",
109
+ "question": "When was the oldest mythic card released and what are its legal play formats?",
110
+ "evidence": "the oldest card refers to MIN(originalReleaseDate); mythic card refers to rarity = 'mythic'; legal play refers to status = 'legal'; play format refers to format",
111
+ "SQL": "SELECT T1.originalReleaseDate, T2.format FROM cards AS T1 INNER JOIN legalities AS T2 ON T1.uuid = T2.uuid WHERE T1.rarity = 'mythic' AND T1.originalReleaseDate IS NOT NULL AND T2.status = 'Legal' AND T1.originalReleaseDate = (SELECT MIN(originalReleaseDate) FROM cards AS T1 INNER JOIN legalities AS T2 ON T1.uuid = T2.uuid WHERE T1.rarity = 'mythic' AND T1.originalReleaseDate IS NOT NULL AND T2.status = 'Legal')",
112
+ "difficulty": "moderate"
113
+ },
114
+ {
115
+ "question_id": 610,
116
+ "db_id": "codebase_community",
117
+ "question": "What are the names of badges that users who have the highest reputation obtained?",
118
+ "evidence": "highest reputation refers to Max(Reputation); user refers to UserId",
119
+ "SQL": "SELECT T2.name FROM users AS T1 INNER JOIN badges AS T2 ON T1.Id = T2.UserId WHERE T1.Reputation = (SELECT MAX(Reputation) FROM users)",
120
+ "difficulty": "simple"
121
+ },
122
+ {
123
+ "question_id": 621,
124
+ "db_id": "codebase_community",
125
+ "question": "What are the name of badges that users who have the lowest reputation obtained?",
126
+ "evidence": "lowest reputation refers to Min(Reputation); user refers to UserId",
127
+ "SQL": "SELECT T2.Name, T1.Reputation FROM users AS T1 INNER JOIN badges AS T2 ON T1.Id = T2.UserId WHERE T1.Reputation = (SELECT MIN(Reputation) FROM users)",
128
+ "difficulty": "simple"
129
+ },
130
+ {
131
+ "question_id": 694,
132
+ "db_id": "codebase_community",
133
+ "question": "Provide the text of the latest comment to the post with the title 'Analysing wind data with R' and the display name of the user who left it.",
134
+ "evidence": "the latest comment refers to MAX(CreationDate);",
135
+ "SQL": "SELECT T3.Text, T1.DisplayName FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId INNER JOIN comments AS T3 ON T2.Id = T3.PostId WHERE T2.Title = 'Analysing wind data with R' AND T3.CreationDate = (SELECT MAX(T4.CreationDate) FROM users AS T5 INNER JOIN posts AS T6 ON T5.Id = T6.OwnerUserId INNER JOIN comments AS T4 ON T6.Id = T4.PostId WHERE T6.Title = 'Analysing wind data with R')",
136
+ "difficulty": "moderate"
137
+ },
138
+ {
139
+ "question_id": 736,
140
+ "db_id": "superhero",
141
+ "question": "Who is the dumbest superhero?",
142
+ "evidence": "the dumbest superhero refers to MIN(attribute_value) where attribute_name = 'Intelligence'",
143
+ "SQL": "SELECT T1.superhero_name FROM superhero AS T1 INNER JOIN hero_attribute AS T2 ON T1.id = T2.hero_id INNER JOIN attribute AS T3 ON T2.attribute_id = T3.id WHERE T3.attribute_name = 'Intelligence' AND T2.attribute_value = (SELECT MIN(T4.attribute_value) FROM hero_attribute AS T4 INNER JOIN attribute AS T5 ON T4.attribute_id = T5.id WHERE T5.attribute_name = 'Intelligence')",
144
+ "difficulty": "moderate"
145
+ },
146
+ {
147
+ "question_id": 766,
148
+ "db_id": "superhero",
149
+ "question": "What is the hero's full name with the highest attribute in strength?",
150
+ "evidence": "highest attribute in strength refers to MAX(attribute_value) WHERE attribute_name = 'strength';",
151
+ "SQL": "SELECT T1.full_name FROM superhero AS T1 INNER JOIN hero_attribute AS T2 ON T1.id = T2.hero_id INNER JOIN attribute AS T3 ON T2.attribute_id = T3.id WHERE T3.attribute_name = 'Strength' AND T2.attribute_value = (SELECT MAX(T4.attribute_value) FROM hero_attribute AS T4 INNER JOIN attribute AS T5 ON T4.attribute_id = T5.id WHERE T5.attribute_name = 'Strength')",
152
+ "difficulty": "moderate"
153
+ },
154
+ {
155
+ "question_id": 769,
156
+ "db_id": "superhero",
157
+ "question": "Which superhero has the most durability published by Dark Horse Comics?",
158
+ "evidence": "which superhero refers to superhero_name; most durability refers to MAX(attribute_value) WHERE attribute_name = 'durability'; published by Dark Horse Comics refers to publisher_name = 'Dark Horse Comics';",
159
+ "SQL": "SELECT T1.superhero_name FROM superhero AS T1 INNER JOIN hero_attribute AS T2 ON T1.id = T2.hero_id INNER JOIN attribute AS T3 ON T3.id = T2.attribute_id INNER JOIN publisher AS T4 ON T4.id = T1.publisher_id WHERE T4.publisher_name = 'Dark Horse Comics' AND T2.attribute_value = (SELECT MAX(T5.attribute_value) FROM superhero AS T6 INNER JOIN hero_attribute AS T5 ON T6.id = T5.hero_id INNER JOIN publisher AS T7 ON T7.id = T6.publisher_id WHERE T7.publisher_name = 'Dark Horse Comics')",
160
+ "difficulty": "challenging"
161
+ },
162
+ {
163
+ "question_id": 802,
164
+ "db_id": "superhero",
165
+ "question": "Who is the tallest superhero?",
166
+ "evidence": "who refers to superhero_name; tallest superhero refers to MAX(height_cm);",
167
+ "SQL": "SELECT superhero_name FROM superhero WHERE height_cm = (SELECT MAX(height_cm) FROM superhero)",
168
+ "difficulty": "simple"
169
+ },
170
+ {
171
+ "question_id": 810,
172
+ "db_id": "superhero",
173
+ "question": "What is the race of the superhero with maximum attribute value?",
174
+ "evidence": "maximum attribute value refers to MAX(attribute_value);",
175
+ "SQL": "SELECT T3.race FROM superhero AS T1 INNER JOIN hero_attribute AS T2 ON T1.id = T2.hero_id INNER JOIN race AS T3 ON T1.race_id = T3.id WHERE T2.attribute_value = (SELECT MAX(T4.attribute_value) FROM hero_attribute AS T4)",
176
+ "difficulty": "simple"
177
+ },
178
+ {
179
+ "question_id": 828,
180
+ "db_id": "superhero",
181
+ "question": "Count the fastest superheroes.",
182
+ "evidence": "fastest refers to attribute_value = 100 WHERE attribute_name = 'Speed';",
183
+ "SQL": "SELECT COUNT(T3.superhero_name) FROM hero_attribute AS T1 INNER JOIN attribute AS T2 ON T1.attribute_id = T2.id INNER JOIN superhero AS T3 ON T1.hero_id = T3.id WHERE T2.attribute_name = 'Speed' AND T1.attribute_value = (SELECT MAX(T4.attribute_value) FROM hero_attribute AS T4 INNER JOIN attribute AS T5 ON T4.attribute_id = T5.id WHERE T5.attribute_name = 'Speed')",
184
+ "difficulty": "simple"
185
+ },
186
+ {
187
+ "question_id": 832,
188
+ "db_id": "superhero",
189
+ "question": "Name the tallest superhero.",
190
+ "evidence": "tallest superhero refers to MAX(height_cm);",
191
+ "SQL": "SELECT superhero_name FROM superhero WHERE height_cm = (SELECT MAX(height_cm) FROM superhero)",
192
+ "difficulty": "simple"
193
+ },
194
+ {
195
+ "question_id": 847,
196
+ "db_id": "formula_1",
197
+ "question": "What is the surname of the driver with the best lap time in race number 19 in the second period?",
198
+ "evidence": "race number refers to raceId; second qualifying period refers to q2; best lap time refers to MIN(q2);",
199
+ "SQL": "SELECT T2.surname FROM qualifying AS T1 INNER JOIN drivers AS T2 ON T2.driverId = T1.driverId WHERE T1.raceId = 19 AND T1.q2 IS NOT NULL AND T1.q2 = (SELECT MIN(q2) AS min_q2 FROM qualifying WHERE raceId = 19 AND q2 IS NOT NULL)",
200
+ "difficulty": "simple"
201
+ },
202
+ {
203
+ "question_id": 906,
204
+ "db_id": "formula_1",
205
+ "question": "Which was Lewis Hamilton first race? What was his points recorded for his first race event?",
206
+ "evidence": "first race refers to min(Year)",
207
+ "SQL": "SELECT T1.name, T2.points FROM races AS T1 INNER JOIN driverStandings AS T2 ON T2.raceId = T1.raceId INNER JOIN drivers AS T3 ON T3.driverId = T2.driverId WHERE T3.forename = 'Lewis' AND T3.surname = 'Hamilton' AND T1.year = (SELECT MIN(T4.year) FROM races AS T4 INNER JOIN driverStandings AS T5 ON T5.raceId = T4.raceId INNER JOIN drivers AS T6 ON T6.driverId = T5.driverId WHERE T6.forename = 'Lewis' AND T6.surname = 'Hamilton')",
208
+ "difficulty": "moderate"
209
+ },
210
+ {
211
+ "question_id": 908,
212
+ "db_id": "formula_1",
213
+ "question": "What is the most laps f1 races had? Name the race, year and circuit location where the races with most laps was hosted.",
214
+ "evidence": "",
215
+ "SQL": "SELECT T3.lap, T2.name, T2.year, T1.location FROM circuits AS T1 INNER JOIN races AS T2 ON T1.circuitId = T2.circuitId INNER JOIN lapTimes AS T3 ON T3.raceId = T2.raceId WHERE T3.lap = (SELECT MAX(T4.lap) FROM lapTimes AS T4)",
216
+ "difficulty": "simple"
217
+ },
218
+ {
219
+ "question_id": 1020,
220
+ "db_id": "european_football_2",
221
+ "question": "Which player has the highest overall rating? Indicate the player's api id.",
222
+ "evidence": "highest overall rating refers to MAX(overall_rating);",
223
+ "SQL": "SELECT player_api_id FROM Player_Attributes WHERE overall_rating = (SELECT MAX(overall_rating) FROM Player_Attributes)",
224
+ "difficulty": "simple"
225
+ },
226
+ {
227
+ "question_id": 1022,
228
+ "db_id": "european_football_2",
229
+ "question": "What is the preferred foot when attacking of the player with the lowest potential?",
230
+ "evidence": "preferred foot when attacking refers to preferred_foot; lowest potential refers to MIN(potential);",
231
+ "SQL": "SELECT preferred_foot FROM Player_Attributes WHERE penalties AND potential = (SELECT MIN(potential) FROM Player_Attributes)",
232
+ "difficulty": "simple"
233
+ },
234
+ {
235
+ "question_id": 1026,
236
+ "db_id": "european_football_2",
237
+ "question": "Which home team had lost the fewest matches in the 2016 season?",
238
+ "evidence": "home team lost the matches refers to SUBTRACT(home_team_goal, away_team_goal) < 0; 2016 season refers to season = '2015/2016';",
239
+ "SQL": "SELECT t3.team_long_name FROM Match AS t1 INNER JOIN Team AS t3 ON t1.home_team_api_id = t3.team_api_id WHERE t1.season = '2015/2016' AND t1.home_team_goal - t1.away_team_goal < 0 GROUP BY t1.home_team_api_id HAVING COUNT(*) = (SELECT MIN(lost_matches_count) FROM (SELECT home_team_api_id, COUNT(*) AS lost_matches_count FROM Match WHERE season = '2015/2016' AND home_team_goal - away_team_goal < 0 GROUP BY home_team_api_id))",
240
+ "difficulty": "moderate"
241
+ },
242
+ {
243
+ "question_id": 1028,
244
+ "db_id": "european_football_2",
245
+ "question": "In Scotland Premier League, which away team won the most during the 2010 season?",
246
+ "evidence": "Scotland Premier League refers to League.name = 'Scotland Premier League'; away team refers to away_team_api_id; away team that won the most refers to MAX(SUBTRACT(away_team_goal, home_team_goal) > 0); 2010 season refers to season = '2009/2010';",
247
+ "SQL": "SELECT t3.team_long_name FROM League AS t1 INNER JOIN Match AS t2 ON t1.id = t2.league_id INNER JOIN Team AS t3 ON t2.away_team_api_id = t3.team_api_id WHERE t1.name = 'Scotland Premier League' AND t2.season = '2009/2010' AND t2.away_team_goal - t2.home_team_goal > 0 GROUP BY t2.away_team_api_id HAVING COUNT(*) = (SELECT MAX(won_matches_count) FROM (SELECT away_team_api_id, COUNT(*) AS won_matches_count FROM Match AS m INNER JOIN League AS l ON m.league_id = l.id WHERE l.name = 'Scotland Premier League' AND m.season = '2009/2010' AND m.away_team_goal - m.home_team_goal > 0 GROUP BY m.away_team_api_id))",
248
+ "difficulty": "challenging"
249
+ },
250
+ {
251
+ "question_id": 1034,
252
+ "db_id": "european_football_2",
253
+ "question": "List the players' api id who had the highest above average overall ratings in 2010.",
254
+ "evidence": "highest above average overall ratings refers to MAX(overall_rating); in 2010 refers to substr(date,1,4) = '2010';",
255
+ "SQL": "SELECT p.player_api_id FROM Player_Attributes AS p WHERE SUBSTR(p.date, 1, 4) = '2010' AND p.overall_rating = (SELECT MAX(pa.overall_rating) FROM Player_Attributes AS pa WHERE SUBSTR(pa.date, 1, 4) = '2010')",
256
+ "difficulty": "simple"
257
+ },
258
+ {
259
+ "question_id": 1090,
260
+ "db_id": "european_football_2",
261
+ "question": "What is the long passing score of the oldest player?",
262
+ "evidence": "long passing score refers to long_passing; oldest player refers to oldest birthday;",
263
+ "SQL": "SELECT T2.long_passing FROM Player AS T1 INNER JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T1.birthday = (SELECT MIN(birthday) FROM Player)",
264
+ "difficulty": "simple"
265
+ },
266
+ {
267
+ "question_id": 1123,
268
+ "db_id": "european_football_2",
269
+ "question": "What is the name of players with the highest potential?",
270
+ "evidence": "highest potential refers to MAX(potential)",
271
+ "SQL": "SELECT DISTINCT T1.player_name FROM Player AS T1 INNER JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.potential = (SELECT MAX(potential) FROM Player_Attributes)",
272
+ "difficulty": "simple"
273
+ },
274
+ {
275
+ "question_id": 1253,
276
+ "db_id": "thrombosis_prediction",
277
+ "question": "For the patient who has the highest Ig A within the normal range, what is his or her diagnosis?",
278
+ "evidence": "highest Ig A within the normal range refers to MAX(IGA BETWEEN 80 AND 500);",
279
+ "SQL": "SELECT T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.IGA = (SELECT MAX(IGA) FROM Laboratory WHERE IGA BETWEEN 80 AND 500)",
280
+ "difficulty": "simple"
281
+ },
282
+ {
283
+ "question_id": 1284,
284
+ "db_id": "thrombosis_prediction",
285
+ "question": "For the patient with the highest lactate dehydrogenase in the normal range, when was his or her data first recorded?",
286
+ "evidence": "highest lactate dehydrogenase in the normal range refers to MAX(LDH < 500); when the data first recorded refers to MIN(First Date);",
287
+ "SQL": "SELECT T1.`First Date` FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.LDH = (SELECT MAX(LDH) FROM Laboratory WHERE LDH < 500)",
288
+ "difficulty": "moderate"
289
+ },
290
+ {
291
+ "question_id": 1290,
292
+ "db_id": "thrombosis_prediction",
293
+ "question": "What is the examination date of the patient whose albumin is the highest in the normal range?",
294
+ "evidence": "examination date refers to Date; albumin is the highest in the normal range refers to MAX(ALB > 3.5 and ALB < 5.5);",
295
+ "SQL": "SELECT Date FROM Laboratory WHERE ALB = (SELECT MAX(ALB) FROM Laboratory WHERE ALB BETWEEN 3.5 AND 5.5)",
296
+ "difficulty": "simple"
297
+ },
298
+ {
299
+ "question_id": 1318,
300
+ "db_id": "student_club",
301
+ "question": "What is the event that has the highest attendance of the students from the Student_Club?",
302
+ "evidence": "event with highest attendance refers to MAX(COUNT(link_to_event))",
303
+ "SQL": "SELECT T1.event_name FROM event AS T1 INNER JOIN attendance AS T2 ON T1.event_id = T2.link_to_event GROUP BY T1.event_name HAVING COUNT(T2.link_to_event) = (SELECT MAX(attendance_count) FROM (SELECT COUNT(link_to_event) AS attendance_count FROM attendance GROUP BY link_to_event) AS subquery)",
304
+ "difficulty": "simple"
305
+ },
306
+ {
307
+ "question_id": 1365,
308
+ "db_id": "student_club",
309
+ "question": "What are the expenses of the budget with the lowest remaining?",
310
+ "evidence": "expense of budget refers to expense_description; lowest remaining refers to MIN(remaining)",
311
+ "SQL": "SELECT T2.expense_description FROM budget AS T1 INNER JOIN expense AS T2 ON T1.budget_id = T2.link_to_budget WHERE T1.remaining = (SELECT MIN(remaining) FROM budget)",
312
+ "difficulty": "simple"
313
+ },
314
+ {
315
+ "question_id": 1388,
316
+ "db_id": "student_club",
317
+ "question": "Which students manage to generate the highest income. State his/her full name along with the income source.",
318
+ "evidence": "name of students means the full name; full name refers to first_name, last_name; generate the highest income refers to MAX(income.amount);",
319
+ "SQL": "SELECT T1.first_name, T1.last_name, T2.source FROM member AS T1 INNER JOIN income AS T2 ON T1.member_id = T2.link_to_member WHERE T2.amount = (SELECT MAX(T4.amount) FROM member AS T3 INNER JOIN income AS T4 ON T3.member_id = T4.link_to_member)",
320
+ "difficulty": "moderate"
321
+ },
322
+ {
323
+ "question_id": 1389,
324
+ "db_id": "student_club",
325
+ "question": "Which event has the lowest cost?",
326
+ "evidence": "event refers to event_name where MIN(cost)",
327
+ "SQL": "SELECT T1.event_name FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event INNER JOIN expense AS T3 ON T2.budget_id = T3.link_to_budget WHERE T3.cost = (SELECT MIN(T6.cost) FROM event AS T4 INNER JOIN budget AS T5 ON T4.event_id = T5.link_to_event INNER JOIN expense AS T6 ON T5.budget_id = T6.link_to_budget)",
328
+ "difficulty": "simple"
329
+ },
330
+ {
331
+ "question_id": 1517,
332
+ "db_id": "debit_card_specializing",
333
+ "question": "For the earliest customer, what segment did he/she have?",
334
+ "evidence": "",
335
+ "SQL": "SELECT T2.Segment FROM transactions_1k AS T1 INNER JOIN customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Date = (SELECT MIN(Date) FROM transactions_1k)",
336
+ "difficulty": "simple"
337
+ }
338
+ ]