-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmini_train.json
9002 lines (9002 loc) · 545 KB
/
mini_train.json
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
[
{
"question_id": 0,
"prev_question_id": 8194,
"db_id": "sales_in_weather",
"question": "Among the stations with 3 stores, how many stations have a station pressure of no more than 30 on February 18, 2014?",
"evidence": "station with 3 stores refers to station_nbr where Count(store_nbr) = 3; station pressure of no more than 30 refers to stnpressure < 30; On February 18, 2014 refers to date = '2014-02-18'",
"SQL": "SELECT COUNT(station_nbr) FROM weather WHERE `date` = '2014-02-18' AND stnpressure < 30 AND station_nbr IN ( SELECT station_nbr FROM relation GROUP BY station_nbr HAVING COUNT(store_nbr) = 3 )",
"difficulty": "moderate"
},
{
"question_id": 1,
"prev_question_id": 8202,
"db_id": "sales_in_weather",
"question": "How many stations were able to sell item 5 on January 2014?",
"evidence": "item 5 refers to item_nbr = 5; on January 2014 refers to Substring (date, 1, 7) = '2014-01'",
"SQL": "SELECT COUNT(DISTINCT T2.station_nbr) AS number FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr WHERE SUBSTR(`date`, 1, 7) = '2014-01' AND item_nbr = 5",
"difficulty": "moderate"
},
{
"question_id": 2,
"prev_question_id": 8208,
"db_id": "sales_in_weather",
"question": "What is the sea level and average speed for store number 3 and store number 4?",
"evidence": "store number 3 refers to store_nbr = 3; average speed refers to avgspeed; store number 4 refers to store_nbr = 4",
"SQL": "SELECT T1.sealevel, T1.avgspeed FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T2.store_nbr = 3 OR T2.store_nbr = 4",
"difficulty": "simple"
},
{
"question_id": 3,
"prev_question_id": 8252,
"db_id": "mondial_geo",
"question": "The lake with the highest altitude is located in which city?",
"evidence": "",
"SQL": "SELECT T2.City FROM lake AS T1 LEFT JOIN located AS T2 ON T2.Lake = T1.Name ORDER BY T1.Altitude DESC LIMIT 1",
"difficulty": "simple"
},
{
"question_id": 4,
"prev_question_id": 61,
"db_id": "movie_platform",
"question": "How many movie lists with over 100 movies had user 85981819 created when he or she was a paying subscriber?",
"evidence": "the user was a paying subscriber when he created the list refers to user_has_payment_method = 1;\u00a0 movie lists with over 100 refers to list_movie_number >100;\u00a0 user 85981819 refers to user_id = 85981819;",
"SQL": "SELECT COUNT(*) FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.user_id = 85981819 AND T1.list_movie_number > 100 AND T2.user_has_payment_method = 1",
"difficulty": "moderate"
},
{
"question_id": 5,
"prev_question_id": 74,
"db_id": "movie_platform",
"question": "Please list all the links to the ratings on the movie \"A Way of Life\" with a critic.",
"evidence": "A Way of Life' refers to movie_title; with a critic refers to critic is not null, links to the ratings refers to rating_url;",
"SQL": "SELECT T1.rating_url FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life' AND T1.critic IS NOT NULL",
"difficulty": "simple"
},
{
"question_id": 6,
"prev_question_id": 75,
"db_id": "movie_platform",
"question": "How many users have rated the most popular movie?",
"evidence": "most popular refers to Max(movie_popularity);",
"SQL": "SELECT COUNT(rating_id) FROM ratings WHERE movie_id = ( SELECT movie_id FROM movies ORDER BY movie_popularity DESC LIMIT 1 )",
"difficulty": "moderate"
},
{
"question_id": 7,
"prev_question_id": 90,
"db_id": "movie_platform",
"question": "Please list the id of the director of the movie \"It's Winter\".",
"evidence": "It's Winter' is movie_title;",
"SQL": "SELECT director_id FROM movies WHERE movie_title = 'It''s Winter'",
"difficulty": "simple"
},
{
"question_id": 8,
"prev_question_id": 104,
"db_id": "movie_platform",
"question": "What was the title of the first list created by a user 85981819? And please provide the user_avatar_image_url.",
"evidence": "user 85981819 refers to user_id = 85981819;\u00a0 first list created refers to Min (list_creation_date_utc);",
"SQL": "SELECT T2.list_title, T1.user_avatar_image_url FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T1.user_id = 85981819 ORDER BY T2.list_creation_timestamp_utc LIMIT 1",
"difficulty": "moderate"
},
{
"question_id": 9,
"prev_question_id": 8302,
"db_id": "mondial_geo",
"question": "Please list the deserts in the countries whose population is over 100000 and covers an area of under 500000.",
"evidence": "",
"SQL": "SELECT T2.Desert FROM country AS T1 INNER JOIN geo_desert AS T2 ON T1.Code = T2.Country WHERE T1.Area > 100000 AND T1.Population < 500000",
"difficulty": "simple"
},
{
"question_id": 10,
"prev_question_id": 113,
"db_id": "movie_platform",
"question": "Who is the director that made the most movies? Give the director's id.",
"evidence": "director that made the most movies refers to MAX(COUNT(movie_id))",
"SQL": "SELECT director_id FROM movies GROUP BY director_id ORDER BY COUNT(movie_id) DESC LIMIT 1",
"difficulty": "simple"
},
{
"question_id": 11,
"prev_question_id": 114,
"db_id": "movie_platform",
"question": "How many movies did the director of the highest movie popularity make?",
"evidence": "highest movie popularity refers to MAX(movie_popularity)",
"SQL": "SELECT COUNT(movie_id) FROM movies WHERE director_id = ( SELECT director_id FROM movies ORDER BY movie_popularity DESC LIMIT 1 )",
"difficulty": "moderate"
},
{
"question_id": 12,
"prev_question_id": 118,
"db_id": "movie_platform",
"question": "How many followers did the user who posted the list \"Non-American Films about World War II\" have?",
"evidence": "the list \"Non-American Films about World War II\" refers to list_title = 'Non-American Films about World War II'",
"SQL": "SELECT SUM(T2.list_followers) FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_title LIKE 'Non-American Films about World War II'",
"difficulty": "simple"
},
{
"question_id": 13,
"prev_question_id": 8325,
"db_id": "mondial_geo",
"question": "List the all the cities and its city population for provinces with population more than 1000000.",
"evidence": "",
"SQL": "SELECT T1.Name, T1.Population FROM city AS T1 INNER JOIN province AS T2 ON T2.Name = T1.Province WHERE T2.Population > 1000000",
"difficulty": "simple"
},
{
"question_id": 14,
"prev_question_id": 168,
"db_id": "book_publishing_company",
"question": "What is the title with the most ordered quantity in year 1992?",
"evidence": "total quantity refers to qty; most ordered quantity refers to order with the highest quantity where MAX(count(qty)); date refers to ord_date; year 1992 refers to YEAR(ord_date) = 1992",
"SQL": "SELECT T2.title FROM sales AS T1 INNER JOIN titles AS T2 ON T1.title_id = T2.title_id WHERE STRFTIME('%Y', T1.ord_date) = '1992' ORDER BY T1.qty DESC LIMIT 1",
"difficulty": "moderate"
},
{
"question_id": 15,
"prev_question_id": 175,
"db_id": "book_publishing_company",
"question": "List all titles published in year 1991. Also provide notes details of the title and the publisher's name.",
"evidence": "publisher name refers to pub_name; publication date refers to pubdate; published in year 1991 refers to YEAR(pubdate) = 1991",
"SQL": "SELECT T1.title, T1.notes, T2.pub_name FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE STRFTIME('%Y', T1.pubdate) = '1991'",
"difficulty": "moderate"
},
{
"question_id": 16,
"prev_question_id": 180,
"db_id": "book_publishing_company",
"question": "State the publisher name for publisher ID 877? Calculate its average year to date sales.",
"evidence": "publisher id refers to pub_id; publisher name refers to pub_name; average year to date sales = AVG(ytd_sales)",
"SQL": "SELECT T2.pub_name, AVG(T1.ytd_sales) FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T1.pub_id = '0877' GROUP BY T2.pub_name",
"difficulty": "simple"
},
{
"question_id": 17,
"prev_question_id": 185,
"db_id": "book_publishing_company",
"question": "Name the Chief Executive Officer and when he/she was hired.",
"evidence": "Chief Financial Offer is a job description which refers to job_desc",
"SQL": "SELECT T1.fname, T1.lname, T1.hire_date FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T2.job_desc = 'Chief Financial Officier'",
"difficulty": "challenging"
},
{
"question_id": 18,
"prev_question_id": 8379,
"db_id": "mondial_geo",
"question": "Which country was the source of Pjandsh River? Give the full name of the country.",
"evidence": "",
"SQL": "SELECT T1.Name FROM country AS T1 INNER JOIN located AS T2 ON T1.Code = T2.Country WHERE T2.River = 'Pjandsh'",
"difficulty": "simple"
},
{
"question_id": 19,
"prev_question_id": 220,
"db_id": "book_publishing_company",
"question": "What's Pedro S Afonso's job title?",
"evidence": "job title means job description which refers to job_desc",
"SQL": "SELECT T2.job_desc FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T1.fname = 'Pedro' AND T1.minit = 'S' AND T1.lname = 'Afonso'",
"difficulty": "simple"
},
{
"question_id": 20,
"prev_question_id": 8432,
"db_id": "mondial_geo",
"question": "What is the geographic location of Aarhus city? Please provide the answer with the coordinates of the location.",
"evidence": "Longitude, Latitude = coordinates of the location",
"SQL": "SELECT Longitude, Latitude FROM city WHERE Name = 'Aarhus'",
"difficulty": "simple"
},
{
"question_id": 21,
"prev_question_id": 257,
"db_id": "retail_complains",
"question": "What is the percentage of the increase of complaints filed by the clients from New York from the year 2016 to the year 2017?",
"evidence": "percentage of increase = MULTIPLY(DIVIDE(SUBTRACT(SUM(year(\"Date received\") = 2017), SUM(year(\"Date received\") = 2016)), SUM(year(\"Date received\") = 2016)), 1.0); New York refers to city = 'New York'; year(\"Date received\") BETWEEN 2016 AND 2017;",
"SQL": "SELECT 100.0 * (SUM(CASE WHEN strftime('%Y', T2.`Date received`) = '2017' THEN 1 ELSE 0 END) - SUM(CASE WHEN strftime('%Y', T2.`Date received`) = '2016' THEN 1 ELSE 0 END)) / SUM(CASE WHEN strftime('%Y', T2.`Date received`) = '2016' THEN 1 ELSE 0 END) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.city = 'New York City'",
"difficulty": "challenging"
},
{
"question_id": 22,
"prev_question_id": 263,
"db_id": "retail_complains",
"question": "How many days delay for the complaint call from Mr. Brantley Julian Stanley on 2012/5/18?",
"evidence": "days delay for the complaint = SUBTRACT(\"date sent to company\", \"Date received\"); Mr refers to sex = 'Male'; on 2012/5/18 refers to \"Date received\" = '2012-05-18';",
"SQL": "SELECT 365 * (strftime('%Y', T2.`Date sent to company`) - strftime('%Y', T2.`Date received`)) + 30 * (strftime('%M', T2.`Date sent to company`) - strftime('%M', T2.`Date received`)) + (strftime('%d', T2.`Date sent to company`) - strftime('%d', T2.`Date received`)) AS days FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Date received` = '2012-05-18' AND T1.sex = 'Male' AND T1.first = 'Brantley' AND T1.middle = 'Julian' AND T1.last = 'Stanley'",
"difficulty": "challenging"
},
{
"question_id": 23,
"prev_question_id": 277,
"db_id": "retail_complains",
"question": "Calculate the average age of clients from the Midwest region.",
"evidence": "average age = AVG(age);",
"SQL": "SELECT CAST(SUM(T1.age) AS REAL) / COUNT(T3.Region) AS average FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN state AS T3 ON T2.state_abbrev = T3.StateCode WHERE T3.Region = 'Midwest'",
"difficulty": "challenging"
},
{
"question_id": 24,
"prev_question_id": 281,
"db_id": "retail_complains",
"question": "What is the number of complaints related to Credit cards came from female clients?",
"evidence": "Credit cards refers to Product = 'Credit card'; female refers to sex = 'female';",
"SQL": "SELECT COUNT(T1.sex) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.sex = 'Female' AND T2.Product = 'Credit card'",
"difficulty": "simple"
},
{
"question_id": 25,
"prev_question_id": 8494,
"db_id": "mondial_geo",
"question": "What river has the 17th-longest length overall? Specify it's length.",
"evidence": "",
"SQL": "SELECT Name, Length FROM river ORDER BY Length DESC LIMIT 16, 1",
"difficulty": "simple"
},
{
"question_id": 26,
"prev_question_id": 8544,
"db_id": "software_company",
"question": "List the marital status of customers within the age of 40 to 60 that has the highest income among the group.",
"evidence": "age of 40 to 60 refers to age BETWEEN 40 AND 60; the highest income refers to MAX(INCOME_K);",
"SQL": "SELECT T1.MARITAL_STATUS FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.age >= 40 AND T1.age <= 60 ORDER BY T2.INCOME_K DESC LIMIT 1",
"difficulty": "moderate"
},
{
"question_id": 27,
"prev_question_id": 8568,
"db_id": "software_company",
"question": "In male customers ages from 30 to 50, how many of them has an income ranges from 2000 to 2300?",
"evidence": "male customers ages from 30 to 50 refer to SEX = 'Male' where age BETWEEN 30 AND 50; income ranges from 2000 to 2300 refers to INCOME_K BETWEEN 2000 AND 3000;",
"SQL": "SELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.SEX = 'Male' AND T1.age >= 30 AND T1.age <= 50 AND T2.INCOME_K >= 2000 AND T2.INCOME_K <= 2300",
"difficulty": "moderate"
},
{
"question_id": 28,
"prev_question_id": 385,
"db_id": "retail_complains",
"question": "Which state has the most cities?",
"evidence": "state refers to state_abbrev; most cities refers to max(count(city))",
"SQL": "SELECT state_abbrev FROM district GROUP BY state_abbrev ORDER BY COUNT(city) DESC LIMIT 1",
"difficulty": "simple"
},
{
"question_id": 29,
"prev_question_id": 406,
"db_id": "retail_complains",
"question": "List the product and its issues of the complains of clients with age greater than the 60% of average age of all clients.",
"evidence": "age greater than the 60% of average age refers to age > multiply(avg(age) , 0.6)",
"SQL": "SELECT DISTINCT T2.Product, T2.Issue FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.age * 100 > ( SELECT AVG(age) * 60 FROM client )",
"difficulty": "challenging"
},
{
"question_id": 30,
"prev_question_id": 8609,
"db_id": "chicago_crime",
"question": "Give the name of the person who was responsible for case No.JB524952.",
"evidence": "name of the person refers to commander; case No.JB524952 refers to case_number = 'JB524952'",
"SQL": "SELECT T1.commander FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T2.case_number = 'JB524952'",
"difficulty": "simple"
},
{
"question_id": 31,
"prev_question_id": 420,
"db_id": "movies_4",
"question": "Among the movie in which Dariusz Wolski works as the director of photography, what is the percentage of those movie whose vote average is over 5.0?",
"evidence": "director of photography refers to job = 'Director of Photography'; vote average is over 8.0 refers to vote_average > 5; percentage = divide(sum(movie_id) when vote_average > 5, count(movie_id)) as percentage",
"SQL": "SELECT CAST(COUNT(CASE WHEN T1.vote_average > 5 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.vote_average) FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Dariusz Wolski' AND T2.job = 'Director of Photography'",
"difficulty": "challenging"
},
{
"question_id": 32,
"prev_question_id": 421,
"db_id": "movies_4",
"question": "What is the average revenue of the movie in which Dariusz Wolski works as the director of photography?",
"evidence": "director of photography refers to job = 'Director of Photography'; average revenue = divide(sum(revenue), count(movie_id))",
"SQL": "SELECT CAST(SUM(T1.revenue) AS REAL) / COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Dariusz Wolski' AND T2.job = 'Director of Photography'",
"difficulty": "moderate"
},
{
"question_id": 33,
"prev_question_id": 422,
"db_id": "movies_4",
"question": "Give the name of the movie with a revenue of 559852396.",
"evidence": "name of the movie refers to title; revenue of 559852396 refers to revenue = '559852396'",
"SQL": "SELECT title FROM movie WHERE revenue = 559852396",
"difficulty": "simple"
},
{
"question_id": 34,
"prev_question_id": 8622,
"db_id": "chicago_crime",
"question": "What is the name of the community with the highest population?",
"evidence": "name of the community refers to community_area_name; the highest population refers to max(population)",
"SQL": "SELECT community_area_name FROM Community_Area ORDER BY population DESC LIMIT 1",
"difficulty": "simple"
},
{
"question_id": 35,
"prev_question_id": 435,
"db_id": "movies_4",
"question": "Calculate the average budget of the movies directed by Jaume Collet-Serra.",
"evidence": "directed by refers to job = 'Director'; average budget = AVG(budget)",
"SQL": "SELECT CAST(SUM(T1.budget) AS REAL) / COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Jaume Collet-Serra' AND T2.job = 'Director'",
"difficulty": "challenging"
},
{
"question_id": 36,
"prev_question_id": 8632,
"db_id": "chicago_crime",
"question": "In the most populated ward, how many incidents of domestic violence were reported in a bar or tavern?",
"evidence": "the most populated refers to max(population); domestic violence refers to domestic = 'TRUE'; in a bar or tavern refers to location_description = 'BAR OR TAVERN'",
"SQL": "SELECT COUNT(T2.report_no) FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T2.domestic = 'TRUE' AND T2.location_description = 'BAR OR TAVERN' ORDER BY T1.Population DESC LIMIT 1",
"difficulty": "moderate"
},
{
"question_id": 37,
"prev_question_id": 8645,
"db_id": "chicago_crime",
"question": "Describe the specific description and case locations under IUCR 142.",
"evidence": "specific description refers to secondary_description; location refers to latitude, longitude; IUCR 142 refers to iucr_no = 142",
"SQL": "SELECT T1.secondary_description, T2.latitude, T2.longitude FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T1.iucr_no = T2.iucr_no WHERE T2.iucr_no = 142",
"difficulty": "simple"
},
{
"question_id": 38,
"prev_question_id": 466,
"db_id": "movies_4",
"question": "Give the genre and popularity of movies whose revenue is at least 120,000,000 between 2012 and 2015.",
"evidence": "genre refers to genre_name; revenue is at least 120,000,000 refers to revenue > = 120000000; between 2012 and 2015 refers to release_date BETWEEN '2012-01-01' AND '2015-12-31'",
"SQL": "SELECT T3.genre_name, T1.popularity FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id WHERE T1.revenue > 120000000 AND T1.release_date BETWEEN '2012-01-01' AND '2015-12-31'",
"difficulty": "moderate"
},
{
"question_id": 39,
"prev_question_id": 8663,
"db_id": "chicago_crime",
"question": "Who is the alderman in the ward associated with the crime with report number 23769?",
"evidence": "alderman refers to alderman_suffix, alderman_first_name, alderman_last_name; report number 23769 refers to report_no = 23769",
"SQL": "SELECT T2.alderman_first_name, T2.alderman_last_name FROM Crime AS T1 INNER JOIN Ward AS T2 ON T2.ward_no = T1.ward_no WHERE T1.report_no = 23769",
"difficulty": "moderate"
},
{
"question_id": 40,
"prev_question_id": 8677,
"db_id": "chicago_crime",
"question": "Find the commander's name, email address, and phone number of the Ogden district.",
"evidence": "commander's name refers to commander; email address refers to email; phone number refers to phone",
"SQL": "SELECT commander, email, phone FROM District WHERE district_name = 'Ogden'",
"difficulty": "simple"
},
{
"question_id": 41,
"prev_question_id": 489,
"db_id": "movies_4",
"question": "Which keywords belong to the movie titles with the highest popularity?",
"evidence": "Which keywords refers to keyword_name; highest popularity refers to max(popularity)",
"SQL": "SELECT T3.keyword_name FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id INNER JOIN keyword AS T3 ON T2.keyword_id = T3.keyword_id ORDER BY T1.popularity DESC LIMIT 1",
"difficulty": "moderate"
},
{
"question_id": 42,
"prev_question_id": 8693,
"db_id": "chicago_crime",
"question": "How many crimes happened in longitude -8772658001?",
"evidence": "",
"SQL": "SELECT COUNT(*) FROM Crime WHERE longitude = '-87.72658001'",
"difficulty": "simple"
},
{
"question_id": 43,
"prev_question_id": 8694,
"db_id": "chicago_crime",
"question": "List all the crimes of the narcotic type that exist.",
"evidence": "narcotic type refers to primary_description = 'NARCOTICS'; crime refers to secondary_description",
"SQL": "SELECT secondary_description FROM IUCR WHERE primary_description = 'NARCOTICS' GROUP BY secondary_description",
"difficulty": "simple"
},
{
"question_id": 44,
"prev_question_id": 503,
"db_id": "movies_4",
"question": "What is the ID of the production company which produced the movie \"Gladiator\"?",
"evidence": "ID of the production company refers to company_id; movie \"Gladiator\" refers to title = 'Gladiator'",
"SQL": "SELECT T2.company_id FROM movie AS T1 INNER JOIN movie_company AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title = 'Gladiator'",
"difficulty": "simple"
},
{
"question_id": 45,
"prev_question_id": 509,
"db_id": "movies_4",
"question": "Find out the language ID of the movie with the highest popularity.",
"evidence": "highest popularity refers to max(popularity)",
"SQL": "SELECT T2.language_id FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id ORDER BY T1.popularity DESC LIMIT 1",
"difficulty": "simple"
},
{
"question_id": 46,
"prev_question_id": 520,
"db_id": "movies_4",
"question": "What is the longest runtime of all movies?",
"evidence": "longest runtime refers to max(runtime)",
"SQL": "SELECT MAX(runtime) FROM movie",
"difficulty": "simple"
},
{
"question_id": 47,
"prev_question_id": 533,
"db_id": "movies_4",
"question": "What is the title of the movie with the most keywords?",
"evidence": "most keywords refers to max(count(keyword_id))",
"SQL": "SELECT T1.title FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id GROUP BY T1.title ORDER BY COUNT(T2.keyword_id) DESC LIMIT 1",
"difficulty": "moderate"
},
{
"question_id": 48,
"prev_question_id": 540,
"db_id": "movies_4",
"question": "List the movies in the Somali language.",
"evidence": "List the movies refers to title; Somali language refers to language_name = 'Somali'",
"SQL": "SELECT T1.title FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id WHERE T3.language_name = 'Somali'",
"difficulty": "moderate"
},
{
"question_id": 49,
"prev_question_id": 8751,
"db_id": "chicago_crime",
"question": "Name the neighborhood of the community area in crime with report number 23843?",
"evidence": "neighborhood refers to neighborhood_name; '23778' is the report_no",
"SQL": "SELECT T3.neighborhood_name FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no INNER JOIN Neighborhood AS T3 ON T2.community_area_no = T3.community_area_no WHERE T2.report_no = 23778",
"difficulty": "moderate"
},
{
"question_id": 50,
"prev_question_id": 8752,
"db_id": "chicago_crime",
"question": "What is the FBI description of the crime for report number 23778?",
"evidence": "\"23778\" is the report_no; FBI description refers to description",
"SQL": "SELECT T1.description FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE T2.report_no = 23843",
"difficulty": "simple"
},
{
"question_id": 51,
"prev_question_id": 8755,
"db_id": "chicago_crime",
"question": "What is the full name of the alderman of ward no.21?",
"evidence": "full name of alderman refers to alderman_first_name, alderman_last_name, alderman_name_suffix",
"SQL": "SELECT alderman_first_name, alderman_last_name, alderman_name_suffix FROM Ward WHERE ward_no = 21",
"difficulty": "simple"
},
{
"question_id": 52,
"prev_question_id": 584,
"db_id": "codebase_comments",
"question": "How much is the processed time of the method whose tokenized name is \"about box1 dispose\"? Indicate the language of the method.",
"evidence": "language refers to Lang;",
"SQL": "SELECT DISTINCT T1.ProcessedTime, T2.Lang FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.NameTokenized = 'about box1 dispose'",
"difficulty": "moderate"
},
{
"question_id": 53,
"prev_question_id": 8802,
"db_id": "food_inspection",
"question": "What is the average score for \"Chairman Bao\" in all its unscheduled routine inspections?",
"evidence": "DIVIDE(SUM(score where type = 'Routine - Unscheduled' and name = 'Chairman Bao'), COUNT(type = 'Routine - Unscheduled' where name = 'Chairman Bao'));",
"SQL": "SELECT CAST(SUM(CASE WHEN T2.name = 'Chairman Bao' THEN T1.score ELSE 0 END) AS REAL) / COUNT(CASE WHEN T1.type = 'Routine - Unscheduled' THEN T1.score ELSE 0 END) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id",
"difficulty": "challenging"
},
{
"question_id": 54,
"prev_question_id": 616,
"db_id": "codebase_comments",
"question": "Among all the solution of the 'zh-cn' methods, which path is most often used?",
"evidence": "solution refers to SolutionId; zh-cn refers to Lang = 'zh-cn'; path that is most often used refers to MAX(COUNT(Path));",
"SQL": "SELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Lang = 'zh-cn' GROUP BY T1.Path ORDER BY COUNT(T1.Path) DESC LIMIT 1",
"difficulty": "moderate"
},
{
"question_id": 55,
"prev_question_id": 619,
"db_id": "codebase_comments",
"question": "Show the solution path for the method \"Mosa.Platform.x86.Instructions.IMul.EmitLegacy\"?",
"evidence": "solution path refers to Path; method refers to Name; Name = 'Mosa.Platform.x86.Instructions.IMul.EmitLegacy';",
"SQL": "SELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Name = 'Mosa.Platform.x86.Instructions.IMul.EmitLegacy'",
"difficulty": "simple"
},
{
"question_id": 56,
"prev_question_id": 8811,
"db_id": "food_inspection",
"question": "What is the name of the establishment with the lowest inspection score of all time?",
"evidence": "the lowest inspection score refers to MIN(score);",
"SQL": "SELECT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.score = ( SELECT MIN(score) FROM inspections )",
"difficulty": "simple"
},
{
"question_id": 57,
"prev_question_id": 8814,
"db_id": "food_inspection",
"question": "In 2013, what are the names of the establishments with contaminated or adulterated food?",
"evidence": "establishments have the same meaning as businesses; contaminated or adulterated food refers to violations where description = 'Contaminated or adulterated food'; date = '2013';",
"SQL": "SELECT T2.name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE STRFTIME('%Y', T1.`date`) = '2013' AND T1.description = 'Contaminated or adulterated food'",
"difficulty": "moderate"
},
{
"question_id": 58,
"prev_question_id": 628,
"db_id": "codebase_comments",
"question": "List all the methods with a solution with a \"636449700980488000\" processed time.",
"evidence": "methods refers to Name; solution refers to SolutionId;",
"SQL": "SELECT DISTINCT T2.Name FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.ProcessedTime = 636449700980488000",
"difficulty": "simple"
},
{
"question_id": 59,
"prev_question_id": 631,
"db_id": "codebase_comments",
"question": "List all the path of solution from all the \"it\" lang code method.",
"evidence": "path of the solution refers to Path; solution refers to Solution.Id;",
"SQL": "SELECT DISTINCT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Lang = 'it'",
"difficulty": "simple"
},
{
"question_id": 60,
"prev_question_id": 632,
"db_id": "codebase_comments",
"question": "What is the path of solution of \"spinachLexer.mT__55\" method?",
"evidence": "path of the solution refers to Path; solution refers to Solution.Id; method refers to Name; Name = 'spinachLexer.mT__55';",
"SQL": "SELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Name = 'spinachLexer.mT__55'",
"difficulty": "simple"
},
{
"question_id": 61,
"prev_question_id": 8838,
"db_id": "food_inspection",
"question": "How many of the businesses are located at 1825 POST St #223, San Francisco?",
"evidence": "1825 POST St #223 refers to address = '1825 POST St #223', San Francisco is the name of the city;",
"SQL": "SELECT COUNT(business_id) FROM businesses WHERE address = '1825 POST St #223' AND city = 'SAN FRANCISCO'",
"difficulty": "simple"
},
{
"question_id": 62,
"prev_question_id": 8840,
"db_id": "food_inspection",
"question": "What is the total number of businesses with a tax code H25?",
"evidence": "",
"SQL": "SELECT COUNT(tax_code) FROM businesses WHERE tax_code = 'H25'",
"difficulty": "simple"
},
{
"question_id": 63,
"prev_question_id": 8843,
"db_id": "food_inspection",
"question": "List owner's name of businesses with a 100 score.",
"evidence": "owner's name of businesses refers to owner_name;",
"SQL": "SELECT DISTINCT T2.owner_name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.score = 100",
"difficulty": "challenging"
},
{
"question_id": 64,
"prev_question_id": 656,
"db_id": "codebase_comments",
"question": "Among the english methods,please list the tokenized names of methods whose solutions need to be compiled.",
"evidence": "english methods refers to lang = 'en'; tokenized name refers to NameTokenized; methods refers to Name; solution needs to be compiled refers to WasCompiled = 0;",
"SQL": "SELECT NameTokenized FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE Lang = 'en' AND WasCompiled = 0",
"difficulty": "moderate"
},
{
"question_id": 65,
"prev_question_id": 658,
"db_id": "codebase_comments",
"question": "Please provide the path of solution of method whose full comment is Feeds data into the parser.",
"evidence": "path of solution refers to Path; method refers to name; full comment = 'Feeds data into the parser';",
"SQL": "SELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.FullComment = 'Feeds data into the parser'",
"difficulty": "simple"
},
{
"question_id": 66,
"prev_question_id": 8855,
"db_id": "food_inspection",
"question": "In businesses with a score lower than 95 and located around the postal code of 94110, what is the percentage of businesses with a risk category of low risk?",
"evidence": "DIVIDE(COUNT(business_id where risk_category = 'Low Risk', score < 95 and postal_code = 94110), COUNT(business_id where score < 95 and postal_code = 94110)) as percentage;",
"SQL": "SELECT CAST(SUM(CASE WHEN T1.risk_category = 'Low Risk' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.risk_category) FROM violations AS T1 INNER JOIN inspections AS T2 ON T1.business_id = T2.business_id INNER JOIN businesses AS T3 ON T2.business_id = T3.business_id WHERE T2.score < 95 AND T3.postal_code = 94110",
"difficulty": "challenging"
},
{
"question_id": 67,
"prev_question_id": 667,
"db_id": "codebase_comments",
"question": "What is the solution path for method number 3?",
"evidence": "solution path refers to Path; method number refers to Method_100k.Id; Method_100k.Id = 3;",
"SQL": "SELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Id = 3",
"difficulty": "simple"
},
{
"question_id": 68,
"prev_question_id": 687,
"db_id": "codebase_comments",
"question": "How many solution path does the repository with 111 stars, 58 forks, and 111 watchers?",
"evidence": "solution path refers to Path;",
"SQL": "SELECT COUNT(T2.Path) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars = 111 AND T1.Forks = 58 AND T1.Watchers = 111",
"difficulty": "simple"
},
{
"question_id": 69,
"prev_question_id": 691,
"db_id": "trains",
"question": "How many cars are there on train no.1?",
"evidence": "train no.1 refers to train_id = 1",
"SQL": "SELECT COUNT(id) FROM cars WHERE train_id = 1",
"difficulty": "simple"
},
{
"question_id": 70,
"prev_question_id": 695,
"db_id": "trains",
"question": "Please list the IDs of all the cars on train no.1 that have 2 wheels.",
"evidence": "train no.1 refers to train_id = 1; 2 wheels refers to wheels = 2",
"SQL": "SELECT id FROM cars WHERE train_id = 1 AND wheels = 2",
"difficulty": "simple"
},
{
"question_id": 71,
"prev_question_id": 8895,
"db_id": "cookbook",
"question": "Which ingredient appeared the least in recipes?",
"evidence": "ingredient appeared the least in recipes refers to MIN(ingredient_id)",
"SQL": "SELECT T1.name FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id GROUP BY T2.ingredient_id ORDER BY COUNT(T2.ingredient_id) ASC LIMIT 1",
"difficulty": "simple"
},
{
"question_id": 72,
"prev_question_id": 8924,
"db_id": "cookbook",
"question": "Which recipe has the highest calories?",
"evidence": "the highest calories refers to MAX(calories)",
"SQL": "SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id ORDER BY T2.calories DESC LIMIT 1",
"difficulty": "simple"
},
{
"question_id": 73,
"prev_question_id": 8939,
"db_id": "human_resources",
"question": "How many male employees work at the address 450 Peachtree Rd?",
"evidence": "male employees refers to gender = 'M'",
"SQL": "SELECT COUNT(*) FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T2.address = '450 Peachtree Rd' AND T1.gender = 'M'",
"difficulty": "simple"
},
{
"question_id": 74,
"prev_question_id": 8958,
"db_id": "human_resources",
"question": "What is Kenneth Charles's position title?",
"evidence": "Kenneth Charles is the full name of an employee; full name = firstname, lastname",
"SQL": "SELECT T2.positiontitle FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.firstname = 'Kenneth' AND T1.lastname = 'Charles'",
"difficulty": "simple"
},
{
"question_id": 75,
"prev_question_id": 8969,
"db_id": "human_resources",
"question": "How many male Regional Managers are there?",
"evidence": "male refers to gender = 'M'; Regional Managers is a position title",
"SQL": "SELECT COUNT(*) FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T2.positiontitle = 'Regional Manager' AND T1.gender = 'M'",
"difficulty": "moderate"
},
{
"question_id": 76,
"prev_question_id": 782,
"db_id": "social_media",
"question": "How many tweets in total were posted by a user in Argentina?",
"evidence": "\"Argentina\" is the Country",
"SQL": "SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.Country = 'Argentina' LIMIT 1",
"difficulty": "moderate"
},
{
"question_id": 77,
"prev_question_id": 8976,
"db_id": "human_resources",
"question": "List the location cities in the Western states.",
"evidence": "Western states refers to state = 'CO' OR state = 'UT' OR state = 'CA'; location cities refers to locationcity",
"SQL": "SELECT locationcity FROM location WHERE state IN ('CO', 'UT', 'CA')",
"difficulty": "simple"
},
{
"question_id": 78,
"prev_question_id": 791,
"db_id": "social_media",
"question": "What is the gender of the user who has posted the tweet that is seen by the most number of unique users?",
"evidence": "seen by the most number of unique users refers to Max(Reach)",
"SQL": "SELECT T2.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID ORDER BY T1.Reach DESC LIMIT 1",
"difficulty": "moderate"
},
{
"question_id": 79,
"prev_question_id": 809,
"db_id": "social_media",
"question": "For the tweet which got the most likes, state the gender of the user who tweeted it.",
"evidence": "most likes refers to Max(Likes)",
"SQL": "SELECT T2.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID ORDER BY T1.Likes DESC LIMIT 1",
"difficulty": "simple"
},
{
"question_id": 80,
"prev_question_id": 813,
"db_id": "social_media",
"question": "What is the percentage of the tweets from California are positive?",
"evidence": "\"California\" is the State; positive tweet refers to Sentiment > 0; percentage = Divide (Count(TweetID where Sentiment > 0), Count (TweetID)) * 100",
"SQL": "SELECT SUM(CASE WHEN T1.Sentiment > 0 THEN 1.0 ELSE 0 END) / COUNT(T1.TweetID) AS percentage FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE State = 'California'",
"difficulty": "challenging"
},
{
"question_id": 81,
"prev_question_id": 9006,
"db_id": "bike_share_1",
"question": "How long did it take for bike id 426 to reach 2nd at South Park from Market at 4th on 8/29/2013? Indicate the duration in minutes.",
"evidence": "duration in minutes refers to DIVIDE(duration, 60 seconds); 2nd at South Park refers to end_station_name; Market at 4th refers to start_station_name; start_date = '8/29/2013'; end_date = '8/29/2013';",
"SQL": "SELECT CAST(duration AS REAL) / 60 FROM trip WHERE bike_id = 426 AND end_station_name = '2nd at South Park' AND start_station_name = 'Market at 4th' AND start_date LIKE '8/29/2013%' AND end_date LIKE '8/29/2013%'",
"difficulty": "challenging"
},
{
"question_id": 82,
"prev_question_id": 9027,
"db_id": "bike_share_1",
"question": "Among the subscriber, how many of them finished the 2nd at Folsom and Civic Center BART (7th at Market) as their start and end stations respectively for no more than 490 seconds under minimum visibility of 4 miles.",
"evidence": "subscription_type = 'Subscriber'; no more than 490 seconds refers to duration<490; start_station_name = '2nd at Folsom'; end_station_name = 'Civic Center BART (7th at Market)'; min_visibility_miles = 4;",
"SQL": "SELECT COUNT(T1.id) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T1.subscription_type = 'Subscriber' AND T2.min_visibility_miles = 4 AND T1.duration < 490 AND T1.start_station_name = '2nd at Folsom' AND T1.end_station_name = 'Civic Center BART (7th at Market)'",
"difficulty": "moderate"
},
{
"question_id": 83,
"prev_question_id": 845,
"db_id": "social_media",
"question": "How many more tweets with a positive sentiment than the tweets with a neutral sentiment were posted by male users?",
"evidence": "positive sentiment tweet refers to Sentiment > 0; neutral sentiment refers to Sentiment = 0; male user refers to Gender = 'Male'; difference = Subtract (Count (TweetID where Sentiment > 0), Count (TweetID where Sentiment = 0))",
"SQL": "SELECT SUM(CASE WHEN T1.Sentiment > 0 THEN 1 ELSE 0 END) - SUM(CASE WHEN T1.Sentiment = 0 THEN 1 ELSE 0 END) AS diff FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T2.Gender = 'Male'",
"difficulty": "challenging"
},
{
"question_id": 84,
"prev_question_id": 9041,
"db_id": "bike_share_1",
"question": "In 2006, how many trips ended at stations in Mountain View?",
"evidence": "in 2006 refers to start_date LIKE'%2006%'; ended at station refers to end_station_name; Mountain View refers to city = 'Mountain View';",
"SQL": "SELECT COUNT(T2.city) FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.end_station_name WHERE T2.city = 'Mountain View' AND T1.start_date LIKE '%2006%'",
"difficulty": "moderate"
},
{
"question_id": 85,
"prev_question_id": 9044,
"db_id": "bike_share_1",
"question": "How many trips which subscription types were Subscriber and ended in San Jose city?",
"evidence": "ended in refers to end_station_name;",
"SQL": "SELECT COUNT(T1.subscription_type) FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.end_station_name WHERE T1.subscription_type = 'Subscriber' AND T2.city = 'San Jose'",
"difficulty": "simple"
},
{
"question_id": 86,
"prev_question_id": 867,
"db_id": "cs_semester",
"question": "Among the professors who have more than 3 research assistants, how many of them are male?",
"evidence": "research assistant refers to the student who serves for research where the abbreviation is RA; more than 3 research assistant refers to COUNT(student_id) > 3;",
"SQL": "SELECT COUNT(*) FROM ( SELECT T2.prof_id FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.gender = 'Male' GROUP BY T1.prof_id HAVING COUNT(T1.student_id) > 3 )",
"difficulty": "moderate"
},
{
"question_id": 87,
"prev_question_id": 9062,
"db_id": "bike_share_1",
"question": "In which city's station is a bike borrowed on trip ID4069?",
"evidence": "bike is borrowed from refers to start_station_id;",
"SQL": "SELECT T2.city FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T1.id = 4069",
"difficulty": "simple"
},
{
"question_id": 88,
"prev_question_id": 9065,
"db_id": "bike_share_1",
"question": "How many trips made by a subscriber started in August, 2013 from a station that can hold more than 20 bikes?",
"evidence": "subscriber refers to subscription_type = 'Subscriber'; in August 2013 refers to start_date LIKE'8%' AND start_date LIKE'%2013%'; station that can hold more than 20 bikes refers to dock_count>20;",
"SQL": "SELECT COUNT(T2.id) FROM station AS T1 INNER JOIN trip AS T2 ON T1.id = T2.start_station_id WHERE T2.subscription_type = 'Subscriber' AND T2.start_date LIKE '8/%/2013%' AND T1.dock_count > 20",
"difficulty": "simple"
},
{
"question_id": 89,
"prev_question_id": 9080,
"db_id": "bike_share_1",
"question": "Are all stations with zip code 94107 located in San Francisco city?",
"evidence": "station refers to name;",
"SQL": "SELECT DISTINCT T2.city FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T1.zip_code = 94107",
"difficulty": "simple"
},
{
"question_id": 90,
"prev_question_id": 9093,
"db_id": "bike_share_1",
"question": "What is the percentage ration of customers to subscribers that started their trips within the city of San Francisco?",
"evidence": "customer refers to subscription_type = 'customer'; subscriber refers to subscription_type = 'subscriber'; started their trips within refers to start_station_id; percentage ratio = DIVIDE(SUM(subscription_type = 'Customer'), SUM(subscription_type = 'Subscriber')) as percentage;",
"SQL": "SELECT CAST(SUM(CASE WHEN T1.subscription_type = 'Customer' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN T1.subscription_type = 'Subscriber' THEN 1 ELSE 0 END) FROM trip AS T1 LEFT JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T2.city = 'San Francisco'",
"difficulty": "challenging"
},
{
"question_id": 91,
"prev_question_id": 9107,
"db_id": "movie_3",
"question": "Which film has a higher replacement cost, ACE GOLDFINGER or ACADEMY DINOSAUR?",
"evidence": "higher replacement cost refers to Max(replacement_cost); 'ACE GOLDFIINGER' and 'ACADEMY DINOSAUR' are both the title of film",
"SQL": "SELECT title FROM film WHERE title IN ('ACE GOLDFINGER', 'ACADEMY DINOSAUR') ORDER BY replacement_cost DESC LIMIT 1",
"difficulty": "moderate"
},
{
"question_id": 92,
"prev_question_id": 9112,
"db_id": "movie_3",
"question": "Please give the full names of all the active staff.",
"evidence": "full name refers to first_name, last_name; active staff refers to active = 1",
"SQL": "SELECT first_name, last_name FROM staff WHERE active = 1",
"difficulty": "simple"
},
{
"question_id": 93,
"prev_question_id": 9116,
"db_id": "movie_3",
"question": "How many films are in English?",
"evidence": "\"English\" is the name of language",
"SQL": "SELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN language AS T2 ON T1.language_id = T2.language_id WHERE T2.name = 'English'",
"difficulty": "moderate"
},
{
"question_id": 94,
"prev_question_id": 935,
"db_id": "cs_semester",
"question": "Among professors with the highest popularity, how many of their students have research capability of 5?",
"evidence": "highest popularity refers to MAX(popularity); research capability refers to capability; capability = 5;",
"SQL": "SELECT COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T1.capability = 5 ORDER BY T2.popularity DESC LIMIT 1",
"difficulty": "simple"
},
{
"question_id": 95,
"prev_question_id": 9145,
"db_id": "movie_3",
"question": "Give the postal code for the address No.65.",
"evidence": "address no. 65 refers to address_id = 65",
"SQL": "SELECT postal_code FROM address WHERE address_id = 65",
"difficulty": "simple"
},
{
"question_id": 96,
"prev_question_id": 9153,
"db_id": "movie_3",
"question": "How many actors played a role in the 2006 film whose rental duration is 7 days, rental rate is 4.99 and is 98 minutes duration?",
"evidence": "in 2006 refers to release_year = 2006; 98 min duration refers to length = 98; number of actors refers to count(actor_id)",
"SQL": "SELECT COUNT(T1.actor_id) FROM film_actor AS T1 INNER JOIN film AS T2 ON T1.film_id = T2.film_id WHERE T2.release_year = 2006 AND T2.rental_duration = 7 AND T2.rental_duration = 4.99 AND T2.length = 98",
"difficulty": "challenging"
},
{
"question_id": 97,
"prev_question_id": 964,
"db_id": "cs_semester",
"question": "List the student's first and last name that got a C in the course named \"Applied Deep Learning\".",
"evidence": "student's first name refers to f_name; student's last name refers to l_name; got a C refers to grade = 'C';",
"SQL": "SELECT T1.f_name, T1.l_name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.name = 'Applied Deep Learning ' AND T2.grade = 'C'",
"difficulty": "moderate"
},
{
"question_id": 98,
"prev_question_id": 9157,
"db_id": "movie_3",
"question": "Give the name of the manager staff for store No.1.",
"evidence": "store no. 1 refers to store_id = 1; name refers to first_name, last_name",
"SQL": "SELECT T1.first_name, T1.last_name FROM staff AS T1 INNER JOIN store AS T2 ON T1.store_id = T2.store_id WHERE T2.store_id = 1",
"difficulty": "simple"
},
{
"question_id": 99,
"prev_question_id": 966,
"db_id": "cs_semester",
"question": "Among the students with a capability below 3, what is the difference of undergraduate students from research postgraduate students?",
"evidence": "capability < 3; difference = subtract(count(type = 'UG')), (count(type = 'RPG')); undergraduate students refers to type = 'UG'; research postgraduate students refers to type = 'RPG';",
"SQL": "SELECT SUM(CASE WHEN T2.type = 'UG' THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.type = 'RPG' THEN 1 ELSE 0 END) FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T1.capability < 3",
"difficulty": "challenging"
},
{
"question_id": 100,
"prev_question_id": 9164,
"db_id": "movie_3",
"question": "How much money did the customer No.297 pay for the rental which happened at 12:27:27 on 2005/7/28?",
"evidence": "customer no. 297 refers to customer_id = 297; at 12:27:27 on 2005/7/28 refers to rental_date = '2005-07-28 12:27:27'; money pay for rent refers to amount",
"SQL": "SELECT T1.amount FROM payment AS T1 INNER JOIN rental AS T2 ON T1.rental_id = T2.rental_id WHERE T2.rental_date = '2005-07-28 12:27:27' AND T2.customer_id = 297",
"difficulty": "moderate"
},
{
"question_id": 101,
"prev_question_id": 9168,
"db_id": "movie_3",
"question": "Give the name of the film for inventory No.3479.",
"evidence": "inventory no. 3479 refers to inventory_id = '3479'; name of film refers to title",
"SQL": "SELECT T1.title FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id WHERE T2.inventory_id = 3479",
"difficulty": "simple"
},
{
"question_id": 102,
"prev_question_id": 9180,
"db_id": "movie_3",
"question": "How many rentals were returned on 5/27/2005?",
"evidence": "return on 5/27/2005 refers to return_date = '2005-05-27'; rental refers to rental_id",
"SQL": "SELECT COUNT(rental_id) FROM rental WHERE rental_date = '2005-05-27'",
"difficulty": "simple"
},
{
"question_id": 103,
"prev_question_id": 9182,
"db_id": "movie_3",
"question": "List the name of the films that can only be found in store id 2.",
"evidence": "name of film refers to title",
"SQL": "SELECT T1.title FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id WHERE T2.store_id = 2",
"difficulty": "moderate"
},
{
"question_id": 104,
"prev_question_id": 9204,
"db_id": "movie_3",
"question": "Calculate the average payment amount per customer.",
"evidence": "average payment refers to AVG(amount)",
"SQL": "SELECT AVG(amount) FROM payment GROUP BY customer_id",
"difficulty": "challenging"
},
{
"question_id": 105,
"prev_question_id": 9205,
"db_id": "movie_3",
"question": "What is the name and email of the staff in store ID 2?",
"evidence": "name refers to first_name, last_name",
"SQL": "SELECT first_name, last_name, email FROM staff WHERE store_id = 2",
"difficulty": "simple"
},
{
"question_id": 106,
"prev_question_id": 9226,
"db_id": "movie_3",
"question": "Provide the full names and emails of customers whose payments were greater than 70% of the average.",
"evidence": "full name refers to first_name, last_name; average payment refers to AVG(amount); payments were greater than 70% of the average refers to amount > (AVG(amount) MULTIPLY 0.7)",
"SQL": "SELECT DISTINCT T2.first_name, T2.last_name, T2.email FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id INNER JOIN address AS T3 ON T2.address_id = T3.address_id WHERE T1.amount > ( SELECT AVG(amount) FROM payment ) * 0.7",
"difficulty": "challenging"
},
{
"question_id": 107,
"prev_question_id": 1035,
"db_id": "computer_student",
"question": "How many courses were taught by a professor who is currently the member of faculty?",
"evidence": "professor refers to professor = 1;\u00a0 member of faculty refers to hasPosition <> 0",
"SQL": "SELECT COUNT(*) FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T1.professor = 1 AND T1.hasPosition <> 0",
"difficulty": "simple"
},
{
"question_id": 108,
"prev_question_id": 9241,
"db_id": "movie_3",
"question": "List the store ID of the films with a rental rate greater than the 60% of average rental rate of all listed films.",
"evidence": "average rental rate of all listed films refers to AVG(rental_rate); rental rate greater than the 60% of average rental rate refers to rental_rate > (AVG(rental_rate)) MULTIPLY 0.6",
"SQL": "SELECT T2.store_id FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id WHERE T1.rental_rate > ( SELECT AVG(T1.rental_rate) * 0.6 FROM film AS T1 )",
"difficulty": "challenging"
},
{
"question_id": 109,
"prev_question_id": 1052,
"db_id": "talkingdata",
"question": "What are the categories of the top 2 oldest events?",
"evidence": "oldest event refers to MIN(timestamp);",
"SQL": "SELECT T4.category FROM events_relevant AS T1 INNER JOIN app_events_relevant AS T2 ON T1.event_id = T2.event_id INNER JOIN app_labels AS T3 ON T3.app_id = T2.app_id INNER JOIN label_categories AS T4 ON T3.label_id = T4.label_id ORDER BY T1.timestamp LIMIT 2",
"difficulty": "simple"
},
{
"question_id": 110,
"prev_question_id": 1059,
"db_id": "talkingdata",
"question": "How many events were there on 30th April, 2016?",
"evidence": "on 30th April, 2016 refers to `timestamp` LIKE '2016-04-30%';",
"SQL": "SELECT COUNT(event_id) FROM events WHERE SUBSTR(`timestamp`, 1, 10) = '2016-04-30'",
"difficulty": "simple"
},