-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbench_dev_full.json
More file actions
6138 lines (6138 loc) · 328 KB
/
Copy pathbench_dev_full.json
File metadata and controls
6138 lines (6138 loc) · 328 KB
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
{
"dataset": "dev",
"total": 681,
"exec_accuracy": 0.7093,
"exact_accuracy": 0.0103,
"errors": 0,
"results": [
{
"db_id": "concert_singer",
"question": "How many singers do we have?",
"gold_sql": "SELECT count(*) FROM singer",
"predicted_sql": "SELECT COUNT(s.Singer_ID) AS total_singers FROM singer s;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "What is the total number of singers?",
"gold_sql": "SELECT count(*) FROM singer",
"predicted_sql": "SELECT COUNT(*) AS total_singers\nFROM singer s;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "Show name, country, age for all singers ordered by age from the oldest to the youngest.",
"gold_sql": "SELECT name , country , age FROM singer ORDER BY age DESC",
"predicted_sql": "SELECT s.Name, s.Country, s.Age\nFROM singer AS s\nORDER BY CASE WHEN s.Age IS NULL THEN 1 ELSE 0 END ASC, s.Age DESC;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "What are the names, countries, and ages for every singer in descending order of age?",
"gold_sql": "SELECT name , country , age FROM singer ORDER BY age DESC",
"predicted_sql": "SELECT s.name, s.country, s.age\nFROM singer AS s\nORDER BY CASE WHEN s.age IS NULL THEN 1 ELSE 0 END, s.age DESC;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "What is the average, minimum, and maximum age of all singers from France?",
"gold_sql": "SELECT avg(age) , min(age) , max(age) FROM singer WHERE country = 'France'",
"predicted_sql": "SELECT AVG(s.Age) AS average_age, MIN(s.Age) AS min_age, MAX(s.Age) AS max_age\nFROM singer s\nWHERE UPPER(COALESCE(s.Country, '')) = 'FRANCE' AND s.Age IS NOT NULL;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "What is the average, minimum, and maximum age for all French singers?",
"gold_sql": "SELECT avg(age) , min(age) , max(age) FROM singer WHERE country = 'France'",
"predicted_sql": "SELECT AVG(s.Age) AS average_age, MIN(s.Age) AS min_age, MAX(s.Age) AS max_age\nFROM singer s\nWHERE lower(COALESCE(s.Country, '')) LIKE '%franc%';",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "Show the name and the release year of the song by the youngest singer.",
"gold_sql": "SELECT song_name , song_release_year FROM singer ORDER BY age LIMIT 1",
"predicted_sql": "SELECT s.Song_Name, s.Song_release_year\nFROM singer AS s\nWHERE s.Age IS NOT NULL\n AND s.Age = (SELECT MIN(s2.Age) FROM singer AS s2 WHERE s2.Age IS NOT NULL);",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "What are the names and release years for all the songs of the youngest singer?",
"gold_sql": "SELECT song_name , song_release_year FROM singer ORDER BY age LIMIT 1",
"predicted_sql": "SELECT s.Song_Name, s.Song_release_year\nFROM singer AS s\nWHERE s.Age = (SELECT MIN(s2.Age) FROM singer AS s2 WHERE s2.Age IS NOT NULL);",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "What are all distinct countries where singers above age 20 are from?",
"gold_sql": "SELECT DISTINCT country FROM singer WHERE age > 20",
"predicted_sql": "SELECT DISTINCT s.Country\nFROM singer AS s\nWHERE s.Age > 20\n AND s.Country IS NOT NULL\n AND TRIM(s.Country) <> '';",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "What are the different countries with singers above age 20?",
"gold_sql": "SELECT DISTINCT country FROM singer WHERE age > 20",
"predicted_sql": "SELECT DISTINCT s.Country\nFROM singer s\nWHERE s.Age > 20\n AND s.Country IS NOT NULL;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "Show all countries and the number of singers in each country.",
"gold_sql": "SELECT country , count(*) FROM singer GROUP BY country",
"predicted_sql": "SELECT COALESCE(s.country, 'Unknown') AS country,\n COUNT(*) AS singer_count\nFROM singer s\nGROUP BY COALESCE(s.country, 'Unknown')\nORDER BY singer_count DESC, country;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "How many singers are from each country?",
"gold_sql": "SELECT country , count(*) FROM singer GROUP BY country",
"predicted_sql": "SELECT COALESCE(s.Country, 'Unknown') AS Country, COUNT(s.Singer_ID) AS singer_count\nFROM singer AS s\nGROUP BY COALESCE(s.Country, 'Unknown')\nORDER BY singer_count DESC, Country;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "List all song names by singers above the average age.",
"gold_sql": "SELECT song_name FROM singer WHERE age > (SELECT avg(age) FROM singer)",
"predicted_sql": "SELECT DISTINCT s.Song_Name\nFROM singer AS s\nWHERE s.Song_Name IS NOT NULL\n AND s.Age IS NOT NULL\n AND s.Age > (\n SELECT AVG(s2.Age)\n FROM singer AS s2\n WHERE s2.Age IS NOT NULL\n );",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "What are all the song names by singers who are older than average?",
"gold_sql": "SELECT song_name FROM singer WHERE age > (SELECT avg(age) FROM singer)",
"predicted_sql": "SELECT DISTINCT s.Song_Name\nFROM singer s\nWHERE s.Song_Name IS NOT NULL\n AND s.Age IS NOT NULL\n AND s.Age > (SELECT AVG(a.Age) FROM singer a WHERE a.Age IS NOT NULL);",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "Show location and name for all stadiums with a capacity between 5000 and 10000.",
"gold_sql": "SELECT LOCATION , name FROM stadium WHERE capacity BETWEEN 5000 AND 10000",
"predicted_sql": "SELECT s.Location, s.Name\nFROM stadium AS s\nWHERE s.Capacity IS NOT NULL\n AND s.Capacity BETWEEN 5000 AND 10000;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "What are the locations and names of all stations with capacity between 5000 and 10000?",
"gold_sql": "SELECT LOCATION , name FROM stadium WHERE capacity BETWEEN 5000 AND 10000",
"predicted_sql": "SELECT s.Location, s.Name\nFROM stadium s\nWHERE s.Capacity IS NOT NULL\n AND s.Capacity BETWEEN 5000 AND 10000;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "What is the average and the maximum capacity of all stadiums?",
"gold_sql": "SELECT avg(capacity) , max(capacity) FROM stadium",
"predicted_sql": "SELECT AVG(CAST(s.Capacity AS DECIMAL(10,2))) AS average_capacity, MAX(s.Capacity) AS max_capacity\nFROM stadium s;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "What is the average and maximum capacities for all stations?",
"gold_sql": "SELECT avg(capacity) , max(capacity) FROM stadium",
"predicted_sql": "SELECT AVG(s.Capacity) AS average_capacity, MAX(s.Capacity) AS maximum_capacity\nFROM stadium s;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "What is the name and capacity for the stadium with highest average attendance?",
"gold_sql": "SELECT name , capacity FROM stadium ORDER BY average DESC LIMIT 1",
"predicted_sql": "SELECT s.Name, s.Capacity\nFROM stadium AS s\nWHERE s.Average IS NOT NULL\n AND s.Average = (\n SELECT MAX(st.Average) FROM stadium AS st WHERE st.Average IS NOT NULL\n );",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "What is the name and capacity for the stadium with the highest average attendance?",
"gold_sql": "SELECT name , capacity FROM stadium ORDER BY average DESC LIMIT 1",
"predicted_sql": "SELECT s.name, s.capacity\nFROM stadium AS s\nWHERE s.average = (SELECT MAX(st.average) FROM stadium AS st WHERE st.average IS NOT NULL);",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "How many concerts are there in year 2014 or 2015?",
"gold_sql": "SELECT count(*) FROM concert WHERE YEAR = 2014 OR YEAR = 2015",
"predicted_sql": "SELECT COUNT(*) AS concert_count\nFROM concert c\nWHERE c.Year IN (2014, 2015);",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "How many concerts occurred in 2014 or 2015?",
"gold_sql": "SELECT count(*) FROM concert WHERE YEAR = 2014 OR YEAR = 2015",
"predicted_sql": "SELECT COUNT(*) AS concerts_count\nFROM concert c\nWHERE c.Year IN (2014, 2015);",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "Show the stadium name and the number of concerts in each stadium.",
"gold_sql": "SELECT T2.name , count(*) FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id GROUP BY T1.stadium_id",
"predicted_sql": "SELECT s.name AS stadium_name,\n COUNT(c.concert_id) AS concert_count\nFROM stadium s\nLEFT JOIN concert c ON s.stadium_id = c.stadium_id\nGROUP BY s.stadium_id, s.name\nORDER BY s.name;",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "For each stadium, how many concerts play there?",
"gold_sql": "SELECT T2.name , count(*) FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id GROUP BY T1.stadium_id",
"predicted_sql": "SELECT s.Stadium_ID, s.Name, s.Location, COUNT(c.concert_ID) AS concerts_count\nFROM stadium s\nLEFT JOIN concert c ON c.Stadium_ID = s.Stadium_ID\nGROUP BY s.Stadium_ID, s.Name, s.Location\nORDER BY s.Stadium_ID;",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "Show the stadium name and capacity with most number of concerts in year 2014 or after.",
"gold_sql": "SELECT T2.name , T2.capacity FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.year >= 2014 GROUP BY T2.stadium_id ORDER BY count(*) DESC LIMIT 1",
"predicted_sql": "SELECT s.Name, s.Capacity\nFROM stadium s\nJOIN (\n SELECT Stadium_ID, COUNT(*) AS concert_count\n FROM concert\n WHERE Year >= 2014\n GROUP BY Stadium_ID\n) c ON s.Stadium_ID = c.Stadium_ID\nWHERE c.concert_count = (\n SELECT MAX(t.cnt)\n FROM (\n SELECT COUNT(*) AS cnt\n FROM concert\n WHERE Year >= 2014\n GROUP BY Stadium_ID\n ) t\n);",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "What is the name and capacity of the stadium with the most concerts after 2013?",
"gold_sql": "SELECT T2.name , T2.capacity FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.year >= 2014 GROUP BY T2.stadium_id ORDER BY count(*) DESC LIMIT 1",
"predicted_sql": "SELECT s.Name, s.Capacity\nFROM stadium s\nJOIN (\n SELECT c.Stadium_ID, COUNT(*) AS cnt\n FROM concert c\n WHERE c.Year > '2013' AND c.Stadium_ID IS NOT NULL\n GROUP BY c.Stadium_ID\n) t ON s.Stadium_ID = t.Stadium_ID\nWHERE t.cnt = (\n SELECT MAX(cnt) FROM (\n SELECT COUNT(*) AS cnt\n FROM concert c2\n WHERE c2.Year > '2013' AND c2.Stadium_ID IS NOT NULL\n GROUP BY c2.Stadium_ID\n ) m\n);",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "Which year has most number of concerts?",
"gold_sql": "SELECT YEAR FROM concert GROUP BY YEAR ORDER BY count(*) DESC LIMIT 1",
"predicted_sql": "WITH counts AS (\n SELECT TRIM(c.Year) AS Year, COUNT(*) AS concert_count\n FROM concert c\n WHERE c.Year IS NOT NULL AND TRIM(c.Year) <> ''\n GROUP BY TRIM(c.Year)\n)\nSELECT Year, concert_count\nFROM counts\nWHERE concert_count = (SELECT MAX(concert_count) FROM counts);",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "What is the year that had the most concerts?",
"gold_sql": "SELECT YEAR FROM concert GROUP BY YEAR ORDER BY count(*) DESC LIMIT 1",
"predicted_sql": "SELECT g.Year\nFROM (\n SELECT c.Year, COUNT(*) AS cnt\n FROM concert AS c\n WHERE c.Year IS NOT NULL\n GROUP BY c.Year\n) AS g\nWHERE g.cnt = (\n SELECT MAX(g2.cnt) FROM (\n SELECT c2.Year, COUNT(*) AS cnt\n FROM concert AS c2\n WHERE c2.Year IS NOT NULL\n GROUP BY c2.Year\n ) AS g2\n);",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "Show the stadium names without any concert.",
"gold_sql": "SELECT name FROM stadium WHERE stadium_id NOT IN (SELECT stadium_id FROM concert)",
"predicted_sql": "SELECT s.Name\nFROM stadium AS s\nLEFT JOIN concert AS c ON s.Stadium_ID = c.Stadium_ID\nWHERE c.concert_ID IS NULL;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "What are the names of the stadiums without any concerts?",
"gold_sql": "SELECT name FROM stadium WHERE stadium_id NOT IN (SELECT stadium_id FROM concert)",
"predicted_sql": "SELECT s.Name \nFROM stadium s \nLEFT JOIN concert c ON s.Stadium_ID = c.Stadium_ID \nWHERE c.concert_ID IS NULL;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "Show countries where a singer above age 40 and a singer below 30 are from.",
"gold_sql": "SELECT country FROM singer WHERE age > 40 INTERSECT SELECT country FROM singer WHERE age < 30",
"predicted_sql": "SELECT DISTINCT s.Country\nFROM singer s\nWHERE s.Age > 40 OR s.Age < 30;",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "Show names for all stadiums except for stadiums having a concert in year 2014.",
"gold_sql": "SELECT name FROM stadium EXCEPT SELECT T2.name FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.year = 2014",
"predicted_sql": "SELECT s.Name\nFROM stadium s\nWHERE s.Stadium_ID NOT IN (\n SELECT DISTINCT c.Stadium_ID\n FROM concert c\n WHERE c.Year = '2014'\n);",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "What are the names of all stadiums that did not have a concert in 2014?",
"gold_sql": "SELECT name FROM stadium EXCEPT SELECT T2.name FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.year = 2014",
"predicted_sql": "SELECT s.Name\nFROM stadium s\nLEFT JOIN concert c ON s.Stadium_ID = c.Stadium_ID AND YEAR(c.concert_Date) = 2014\nWHERE c.concert_ID IS NULL;",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "Show the name and theme for all concerts and the number of singers in each concert.",
"gold_sql": "SELECT T2.concert_name , T2.theme , count(*) FROM singer_in_concert AS T1 JOIN concert AS T2 ON T1.concert_id = T2.concert_id GROUP BY T2.concert_id",
"predicted_sql": "SELECT c.concert_Name, c.Theme, COUNT(sic.Singer_ID) AS number_of_singers\nFROM concert c\nLEFT JOIN singer_in_concert sic ON c.concert_ID = sic.concert_ID\nGROUP BY c.concert_ID, c.concert_Name, c.Theme;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "What are the names, themes, and number of singers for each and every concert?",
"gold_sql": "SELECT T2.concert_name , T2.theme , count(*) FROM singer_in_concert AS T1 JOIN concert AS T2 ON T1.concert_id = T2.concert_id GROUP BY T2.concert_id",
"predicted_sql": "SELECT \n c.concert_Name, \n c.Theme, \n COUNT(sic.Singer_ID) AS number_of_singers\nFROM \n concert c\nLEFT JOIN \n singer_in_concert sic ON c.concert_ID = sic.concert_ID\nGROUP BY \n c.concert_ID, c.concert_Name, c.Theme;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "List singer names and number of concerts for each singer.",
"gold_sql": "SELECT T2.name , count(*) FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id = T2.singer_id GROUP BY T2.singer_id",
"predicted_sql": "SELECT s.Name, COUNT(sic.concert_ID) AS Number_of_Concerts\nFROM singer s\nLEFT JOIN singer_in_concert sic ON s.Singer_ID = sic.Singer_ID\nGROUP BY s.Name;",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "What are the names of the singers and number of concerts for each person?",
"gold_sql": "SELECT T2.name , count(*) FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id = T2.singer_id GROUP BY T2.singer_id",
"predicted_sql": "SELECT s.Name, COUNT(sic.concert_ID) AS Number_of_Concerts\nFROM singer s\nLEFT JOIN singer_in_concert sic ON s.Singer_ID = sic.Singer_ID\nGROUP BY s.Name;",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "List all singer names in concerts in year 2014.",
"gold_sql": "SELECT T2.name FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id = T2.singer_id JOIN concert AS T3 ON T1.concert_id = T3.concert_id WHERE T3.year = 2014",
"predicted_sql": "SELECT DISTINCT s.Name\nFROM singer s\nJOIN singer_in_concert sic ON s.Singer_ID = sic.Singer_ID\nJOIN concert c ON sic.concert_ID = c.concert_ID\nWHERE c.Year = '2014';",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "What are the names of the singers who performed in a concert in 2014?",
"gold_sql": "SELECT T2.name FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id = T2.singer_id JOIN concert AS T3 ON T1.concert_id = T3.concert_id WHERE T3.year = 2014",
"predicted_sql": "SELECT DISTINCT s.Name\nFROM singer s\nJOIN singer_in_concert sic ON s.Singer_ID = sic.Singer_ID\nJOIN concert c ON sic.concert_ID = c.concert_ID\nWHERE c.Year = '2014';",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "what is the name and nation of the singer who have a song having 'Hey' in its name?",
"gold_sql": "SELECT name , country FROM singer WHERE song_name LIKE '%Hey%'",
"predicted_sql": "SELECT s.Name, s.Country\nFROM singer s\nWHERE s.Song_Name LIKE '%Hey%';",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "What is the name and country of origin of every singer who has a song with the word 'Hey' in its title?",
"gold_sql": "SELECT name , country FROM singer WHERE song_name LIKE '%Hey%'",
"predicted_sql": "SELECT DISTINCT s.Name, s.Country\nFROM singer s\nWHERE s.Song_Name LIKE '%Hey%';",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "Find the name and location of the stadiums which some concerts happened in the years of both 2014 and 2015.",
"gold_sql": "SELECT T2.name , T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2014 INTERSECT SELECT T2.name , T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2015",
"predicted_sql": "SELECT DISTINCT s.Name, s.Location\nFROM stadium s\nJOIN concert c ON s.Stadium_ID = c.Stadium_ID\nWHERE c.Year IN ('2014', '2015')\nGROUP BY s.Name, s.Location\nHAVING COUNT(DISTINCT c.Year) = 2;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "What are the names and locations of the stadiums that had concerts that occurred in both 2014 and 2015?",
"gold_sql": "SELECT T2.name , T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2014 INTERSECT SELECT T2.name , T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2015",
"predicted_sql": "SELECT s.Name, s.Location\nFROM stadium s\nJOIN concert c ON s.Stadium_ID = c.Stadium_ID\nWHERE YEAR(c.concert_Date) IN (2014, 2015)\nGROUP BY s.Name, s.Location\nHAVING COUNT(DISTINCT YEAR(c.concert_Date)) = 2;",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "Find the number of concerts happened in the stadium with the highest capacity.",
"gold_sql": "SELECT count(*) FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id ORDER BY T2.Capacity DESC LIMIT 1",
"predicted_sql": "SELECT COUNT(c.concert_ID) AS Number_of_Concerts\nFROM concert c\nJOIN stadium s ON c.Stadium_ID = s.Stadium_ID\nWHERE s.Capacity = (SELECT MAX(Capacity) FROM stadium);",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "concert_singer",
"question": "What are the number of concerts that occurred in the stadium with the largest capacity?",
"gold_sql": "SELECT count(*) FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id ORDER BY T2.Capacity DESC LIMIT 1",
"predicted_sql": "SELECT COUNT(c.concert_ID) AS Number_of_Concerts\nFROM concert c\nJOIN stadium s ON c.Stadium_ID = s.Stadium_ID\nWHERE s.Capacity = (SELECT MAX(Capacity) FROM stadium);",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "Find the number of pets whose weight is heavier than 10.",
"gold_sql": "SELECT count(*) FROM pets WHERE weight > 10",
"predicted_sql": "SELECT COUNT(*) AS NumberOfHeavyPets\nFROM Pets AS p\nWHERE p.weight > 10;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "How many pets have a greater weight than 10?",
"gold_sql": "SELECT count(*) FROM pets WHERE weight > 10",
"predicted_sql": "SELECT COUNT(*) AS PetCount\nFROM Pets AS p\nWHERE p.weight > 10;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "Find the weight of the youngest dog.",
"gold_sql": "SELECT weight FROM pets ORDER BY pet_age LIMIT 1",
"predicted_sql": "SELECT weight \nFROM Pets \nWHERE PetType = 'dog' \nORDER BY pet_age ASC \nLIMIT 1;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "How much does the youngest dog weigh?",
"gold_sql": "SELECT weight FROM pets ORDER BY pet_age LIMIT 1",
"predicted_sql": "SELECT weight \nFROM Pets \nWHERE PetType = 'dog' \nORDER BY pet_age ASC \nLIMIT 1;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "Find the maximum weight for each type of pet. List the maximum weight and pet type.",
"gold_sql": "SELECT max(weight) , petType FROM pets GROUP BY petType",
"predicted_sql": "SELECT PetType, MAX(weight) AS MaxWeight\nFROM Pets\nGROUP BY PetType;",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "List the maximum weight and type for each type of pet.",
"gold_sql": "SELECT max(weight) , petType FROM pets GROUP BY petType",
"predicted_sql": "SELECT PetType, MAX(weight) AS MaxWeight\nFROM Pets\nGROUP BY PetType;",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "Find number of pets owned by students who are older than 20.",
"gold_sql": "SELECT count(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid WHERE T1.age > 20",
"predicted_sql": "SELECT COUNT(h.PetID) AS NumberOfPets\nFROM Has_Pet h\nJOIN Student s ON h.StuID = s.StuID\nWHERE s.Age > 20;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "How many pets are owned by students that have an age greater than 20?",
"gold_sql": "SELECT count(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid WHERE T1.age > 20",
"predicted_sql": "SELECT COUNT(*) AS NumberOfPets\nFROM Has_Pet hp\nJOIN Student s ON hp.StuID = s.StuID\nWHERE s.Age > 20;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "Find the number of dog pets that are raised by female students (with sex F).",
"gold_sql": "SELECT count(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T2.petid = T3.petid WHERE T1.sex = 'F' AND T3.pettype = 'dog'",
"predicted_sql": "SELECT COUNT(*) AS NumberOfDogs\nFROM Has_Pet hp\nJOIN Pets p ON hp.PetID = p.PetID\nJOIN Student s ON hp.StuID = s.StuID\nWHERE p.PetType = 'Dog' AND s.Sex = 'F';",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "How many dog pets are raised by female students?",
"gold_sql": "SELECT count(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T2.petid = T3.petid WHERE T1.sex = 'F' AND T3.pettype = 'dog'",
"predicted_sql": "SELECT COUNT(*) AS DogPetsByFemaleStudents\nFROM Has_Pet hp\nJOIN Student s ON hp.StuID = s.StuID\nJOIN Pets p ON hp.PetID = p.PetID\nWHERE p.PetType = 'dog' AND s.Sex = 'F';",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "Find the number of distinct type of pets.",
"gold_sql": "SELECT count(DISTINCT pettype) FROM pets",
"predicted_sql": "SELECT COUNT(DISTINCT PetType) AS DistinctPetTypes\nFROM Pets;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "How many different types of pet are there?",
"gold_sql": "SELECT count(DISTINCT pettype) FROM pets",
"predicted_sql": "SELECT COUNT(DISTINCT PetType) AS DifferentPetTypes\nFROM Pets;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "Find the first name of students who have cat or dog pet.",
"gold_sql": "SELECT DISTINCT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat' OR T3.pettype = 'dog'",
"predicted_sql": "SELECT DISTINCT s.Fname\nFROM Student s\nJOIN Has_Pet hp ON s.StuID = hp.StuID\nJOIN Pets p ON hp.PetID = p.PetID\nWHERE p.PetType IN ('cat', 'dog');",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "What are the first names of every student who has a cat or dog as a pet?",
"gold_sql": "SELECT DISTINCT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat' OR T3.pettype = 'dog'",
"predicted_sql": "SELECT DISTINCT s.Fname\nFROM Student s\nJOIN Has_Pet hp ON s.StuID = hp.StuID\nJOIN Pets p ON hp.PetID = p.PetID\nWHERE p.PetType IN ('cat', 'dog');",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "Find the name of students who have both cat and dog pets.",
"gold_sql": "SELECT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat' INTERSECT SELECT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'dog'",
"predicted_sql": "SELECT DISTINCT s.Fname, s.LName\nFROM Student s\nJOIN Has_Pet hp1 ON s.StuID = hp1.StuID\nJOIN Pets p1 ON hp1.PetID = p1.PetID AND p1.PetType = 'cat'\nJOIN Has_Pet hp2 ON s.StuID = hp2.StuID\nJOIN Pets p2 ON hp2.PetID = p2.PetID AND p2.PetType = 'dog';",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "What are the students' first names who have both cats and dogs as pets?",
"gold_sql": "SELECT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat' INTERSECT SELECT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'dog'",
"predicted_sql": "SELECT DISTINCT s.Fname\nFROM Student s\nJOIN Has_Pet hp ON s.StuID = hp.StuID\nJOIN Pets p ON hp.PetID = p.PetID\nWHERE p.PetType IN ('cat', 'dog')\nGROUP BY s.StuID, s.Fname\nHAVING COUNT(DISTINCT p.PetType) = 2;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "Find the major and age of students who do not have a cat pet.",
"gold_sql": "SELECT major , age FROM student WHERE stuid NOT IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat')",
"predicted_sql": "SELECT DISTINCT s.Major, s.Age\nFROM Student s\nLEFT JOIN Has_Pet hp ON s.StuID = hp.StuID\nLEFT JOIN Pets p ON hp.PetID = p.PetID AND p.PetType = 'cat'\nWHERE p.PetID IS NULL;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "What major is every student who does not own a cat as a pet, and also how old are they?",
"gold_sql": "SELECT major , age FROM student WHERE stuid NOT IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat')",
"predicted_sql": "SELECT s.Major, s.Age\nFROM Student s\nLEFT JOIN Has_Pet hp ON s.StuID = hp.StuID\nLEFT JOIN Pets p ON hp.PetID = p.PetID AND p.PetType = 'cat'\nWHERE p.PetID IS NULL;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "Find the id of students who do not have a cat pet.",
"gold_sql": "SELECT stuid FROM student EXCEPT SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat'",
"predicted_sql": "SELECT s.StuID\nFROM Student s\nLEFT JOIN Has_Pet hp ON s.StuID = hp.StuID\nLEFT JOIN Pets p ON hp.PetID = p.PetID AND p.PetType = 'cat'\nWHERE p.PetID IS NULL;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "What are the ids of the students who do not own cats as pets?",
"gold_sql": "SELECT stuid FROM student EXCEPT SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat'",
"predicted_sql": "SELECT s.StuID\nFROM Student s\nWHERE s.StuID NOT IN (\n SELECT hp.StuID\n FROM Has_Pet hp\n JOIN Pets p ON hp.PetID = p.PetID\n WHERE p.PetType = 'cat'\n);",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "Find the first name and age of students who have a dog but do not have a cat as a pet.",
"gold_sql": "SELECT T1.fname , T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'dog' AND T1.stuid NOT IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat')",
"predicted_sql": "SELECT s.Fname, s.Age\nFROM Student s\nJOIN Has_Pet hp ON s.StuID = hp.StuID\nJOIN Pets p ON hp.PetID = p.PetID\nWHERE p.PetType = 'dog' AND s.StuID NOT IN (\n SELECT hp2.StuID\n FROM Has_Pet hp2\n JOIN Pets p2 ON hp2.PetID = p2.PetID\n WHERE p2.PetType = 'cat'\n);",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "What is the first name of every student who has a dog but does not have a cat?",
"gold_sql": "SELECT T1.fname , T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'dog' AND T1.stuid NOT IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat')",
"predicted_sql": "SELECT DISTINCT s.Fname\nFROM Student s\nJOIN Has_Pet hp ON s.StuID = hp.StuID\nJOIN Pets p ON hp.PetID = p.PetID\nWHERE p.PetType = 'dog' \nAND s.StuID NOT IN (\n SELECT hp2.StuID\n FROM Has_Pet hp2\n JOIN Pets p2 ON hp2.PetID = p2.PetID\n WHERE p2.PetType = 'cat'\n);",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "Find the type and weight of the youngest pet.",
"gold_sql": "SELECT pettype , weight FROM pets ORDER BY pet_age LIMIT 1",
"predicted_sql": "SELECT PetType, weight \nFROM Pets \nWHERE pet_age = (SELECT MIN(pet_age) FROM Pets);",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "What type of pet is the youngest animal, and how much does it weigh?",
"gold_sql": "SELECT pettype , weight FROM pets ORDER BY pet_age LIMIT 1",
"predicted_sql": "SELECT P.PetType, P.weight\nFROM Pets P\nWHERE P.pet_age = (SELECT MIN(pet_age) FROM Pets);",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "Find the id and weight of all pets whose age is older than 1.",
"gold_sql": "SELECT petid , weight FROM pets WHERE pet_age > 1",
"predicted_sql": "SELECT P.PetID, P.weight\nFROM Pets P\nWHERE P.pet_age > 1;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "What is the id and weight of every pet who is older than 1?",
"gold_sql": "SELECT petid , weight FROM pets WHERE pet_age > 1",
"predicted_sql": "SELECT PetID, weight \nFROM Pets \nWHERE pet_age > 1;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "Find the average and maximum age for each type of pet.",
"gold_sql": "SELECT avg(pet_age) , max(pet_age) , pettype FROM pets GROUP BY pettype",
"predicted_sql": "SELECT PetType, \n AVG(pet_age) AS Average_Age, \n MAX(pet_age) AS Maximum_Age\nFROM Pets\nGROUP BY PetType;",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "What is the average and maximum age for each pet type?",
"gold_sql": "SELECT avg(pet_age) , max(pet_age) , pettype FROM pets GROUP BY pettype",
"predicted_sql": "SELECT PetType, AVG(pet_age) AS Average_Age, MAX(pet_age) AS Maximum_Age\nFROM Pets\nGROUP BY PetType;",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "Find the average weight for each pet type.",
"gold_sql": "SELECT avg(weight) , pettype FROM pets GROUP BY pettype",
"predicted_sql": "SELECT PetType, AVG(weight) AS average_weight\nFROM Pets\nGROUP BY PetType;",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "What is the average weight for each type of pet?",
"gold_sql": "SELECT avg(weight) , pettype FROM pets GROUP BY pettype",
"predicted_sql": "SELECT PetType, AVG(weight) AS AverageWeight\nFROM Pets\nGROUP BY PetType;",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "Find the first name and age of students who have a pet.",
"gold_sql": "SELECT DISTINCT T1.fname , T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid",
"predicted_sql": "SELECT s.Fname, s.Age\nFROM Student s\nJOIN Has_Pet hp ON s.StuID = hp.StuID;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "What are the different first names and ages of the students who do have pets?",
"gold_sql": "SELECT DISTINCT T1.fname , T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid",
"predicted_sql": "SELECT DISTINCT s.Fname, s.Age\nFROM Student s\nJOIN Has_Pet hp ON s.StuID = hp.StuID;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "Find the id of the pet owned by student whose last name is \u2018Smith\u2019.",
"gold_sql": "SELECT T2.petid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid WHERE T1.Lname = 'Smith'",
"predicted_sql": "SELECT hp.PetID\nFROM Student s\nJOIN Has_Pet hp ON s.StuID = hp.StuID\nWHERE s.LName = 'Smith';",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "What is the id of the pet owned by the student whose last name is 'Smith'?",
"gold_sql": "SELECT T2.petid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid WHERE T1.Lname = 'Smith'",
"predicted_sql": "SELECT hp.PetID\nFROM Has_Pet hp\nJOIN Student s ON hp.StuID = s.StuID\nWHERE s.LName = 'Smith';",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "Find the number of pets for each student who has any pet and student id.",
"gold_sql": "SELECT count(*) , T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid GROUP BY T1.stuid",
"predicted_sql": "SELECT h.StuID, COUNT(h.PetID) AS PetCount\nFROM Has_Pet h\nGROUP BY h.StuID;",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "For students who have pets, how many pets does each student have?",
"gold_sql": "SELECT count(*) , T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid GROUP BY T1.stuid",
"predicted_sql": "SELECT h.StuID, COUNT(h.PetID) AS PetCount\nFROM Has_Pet h\nGROUP BY h.StuID;",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "Find the first name and gender of student who have more than one pet.",
"gold_sql": "SELECT T1.fname , T1.sex FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid GROUP BY T1.stuid HAVING count(*) > 1",
"predicted_sql": "SELECT s.Fname, s.Sex\nFROM Student s\nJOIN Has_Pet hp ON s.StuID = hp.StuID\nGROUP BY s.StuID, s.Fname, s.Sex\nHAVING COUNT(hp.PetID) > 1;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "What is the first name and gender of the all the students who have more than one pet?",
"gold_sql": "SELECT T1.fname , T1.sex FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid GROUP BY T1.stuid HAVING count(*) > 1",
"predicted_sql": "SELECT s.Fname, s.Sex\nFROM Student s\nJOIN Has_Pet hp ON s.StuID = hp.StuID\nGROUP BY s.StuID, s.Fname, s.Sex\nHAVING COUNT(hp.PetID) > 1;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "Find the last name of the student who has a cat that is age 3.",
"gold_sql": "SELECT T1.lname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pet_age = 3 AND T3.pettype = 'cat'",
"predicted_sql": "SELECT s.LName\nFROM Student s\nJOIN Has_Pet hp ON s.StuID = hp.StuID\nJOIN Pets p ON hp.PetID = p.PetID\nWHERE p.PetType = 'cat' AND p.pet_age = 3;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "What is the last name of the student who has a cat that is 3 years old?",
"gold_sql": "SELECT T1.lname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pet_age = 3 AND T3.pettype = 'cat'",
"predicted_sql": "SELECT s.LName\nFROM Student s\nJOIN Has_Pet hp ON s.StuID = hp.StuID\nJOIN Pets p ON hp.PetID = p.PetID\nWHERE p.PetType = 'cat' AND p.pet_age = 3;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "Find the average age of students who do not have any pet.",
"gold_sql": "SELECT avg(age) FROM student WHERE stuid NOT IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid)",
"predicted_sql": "SELECT AVG(Age) AS AverageAge\nFROM Student s\nWHERE NOT EXISTS (\n SELECT 1\n FROM Has_Pet hp\n WHERE hp.StuID = s.StuID\n);",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "pets_1",
"question": "What is the average age for all students who do not own any pets?",
"gold_sql": "SELECT avg(age) FROM student WHERE stuid NOT IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid)",
"predicted_sql": "SELECT AVG(s.Age) AS AverageAge\nFROM Student s\nWHERE s.StuID NOT IN (SELECT hp.StuID FROM Has_Pet hp);",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "car_1",
"question": "How many continents are there?",
"gold_sql": "SELECT count(*) FROM CONTINENTS;",
"predicted_sql": "SELECT COUNT(*) AS TotalContinents FROM continents;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "car_1",
"question": "What is the number of continents?",
"gold_sql": "SELECT count(*) FROM CONTINENTS;",
"predicted_sql": "SELECT COUNT(*) AS NumberOfContinents FROM continents;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "car_1",
"question": "How many countries does each continent have? List the continent id, continent name and the number of countries.",
"gold_sql": "SELECT T1.ContId , T1.Continent , count(*) FROM CONTINENTS AS T1 JOIN COUNTRIES AS T2 ON T1.ContId = T2.Continent GROUP BY T1.ContId;",
"predicted_sql": "SELECT c.Continent AS ContinentId, co.Continent AS ContinentName, COUNT(c.CountryId) AS CountryCount\nFROM countries c\nJOIN continents co ON c.Continent = co.ContId\nGROUP BY c.Continent, co.Continent;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "car_1",
"question": "For each continent, list its id, name, and how many countries it has?",
"gold_sql": "SELECT T1.ContId , T1.Continent , count(*) FROM CONTINENTS AS T1 JOIN COUNTRIES AS T2 ON T1.ContId = T2.Continent GROUP BY T1.ContId;",
"predicted_sql": "SELECT c.ContId, c.Continent, COUNT(co.CountryId) AS CountryCount\nFROM continents c\nLEFT JOIN countries co ON c.ContId = co.Continent\nGROUP BY c.ContId, c.Continent;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "car_1",
"question": "How many countries are listed?",
"gold_sql": "SELECT count(*) FROM COUNTRIES;",
"predicted_sql": "SELECT COUNT(*) AS CountryCount FROM countries;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "car_1",
"question": "How many countries exist?",
"gold_sql": "SELECT count(*) FROM COUNTRIES;",
"predicted_sql": "SELECT COUNT(*) AS CountryCount FROM countries;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "car_1",
"question": "How many models does each car maker produce? List maker full name, id and the number.",
"gold_sql": "SELECT T1.FullName , T1.Id , count(*) FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker GROUP BY T1.Id;",
"predicted_sql": "SELECT cm.FullName, cm.Id, COUNT(DISTINCT ml.Model) AS ModelCount\nFROM car_makers cm\nJOIN model_list ml ON cm.Id = ml.Maker\nGROUP BY cm.FullName, cm.Id;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "car_1",
"question": "What is the full name of each car maker, along with its id and how many models it produces?",
"gold_sql": "SELECT T1.FullName , T1.Id , count(*) FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker GROUP BY T1.Id;",
"predicted_sql": "SELECT cm.FullName, cm.Id, COUNT(ml.ModelId) AS ModelCount\nFROM car_makers cm\nLEFT JOIN model_list ml ON cm.Id = ml.Maker\nGROUP BY cm.FullName, cm.Id;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "car_1",
"question": "Which model of the car has the minimum horsepower?",
"gold_sql": "SELECT T1.Model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id ORDER BY T2.horsepower ASC LIMIT 1;",
"predicted_sql": "SELECT ml.Model\nFROM cars_data cd\nJOIN car_names cn ON cd.Id = cn.MakeId\nJOIN model_list ml ON cn.Model = ml.Model\nWHERE cd.Horsepower IS NOT NULL\nORDER BY CAST(cd.Horsepower AS INTEGER) ASC\nLIMIT 1;",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "car_1",
"question": "What is the model of the car with the smallest amount of horsepower?",
"gold_sql": "SELECT T1.Model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id ORDER BY T2.horsepower ASC LIMIT 1;",
"predicted_sql": "SELECT ml.Model\nFROM cars_data cd\nJOIN car_names cn ON cd.Id = cn.MakeId\nJOIN model_list ml ON cn.Model = ml.Model\nWHERE cd.Horsepower IS NOT NULL\nORDER BY CAST(cd.Horsepower AS INTEGER) ASC\nLIMIT 1;",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "car_1",
"question": "Find the model of the car whose weight is below the average weight.",
"gold_sql": "SELECT T1.model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id WHERE T2.Weight < (SELECT avg(Weight) FROM CARS_DATA)",
"predicted_sql": "SELECT cn.Model\nFROM car_names cn\nJOIN cars_data cd ON cn.MakeId = cd.Id\nWHERE cd.Weight < (SELECT AVG(Weight) FROM cars_data);",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "car_1",
"question": "What is the model for the car with a weight smaller than the average?",
"gold_sql": "SELECT T1.model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id WHERE T2.Weight < (SELECT avg(Weight) FROM CARS_DATA)",
"predicted_sql": "SELECT cn.Model\nFROM car_names cn\nJOIN cars_data cd ON cn.MakeId = cd.Id\nWHERE cd.Weight < (SELECT AVG(Weight) FROM cars_data);",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "car_1",
"question": "Find the name of the makers that produced some cars in the year of 1970?",
"gold_sql": "SELECT DISTINCT T1.Maker FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker JOIN CAR_NAMES AS T3 ON T2.model = T3.model JOIN CARS_DATA AS T4 ON T3.MakeId = T4.id WHERE T4.year = '1970';",
"predicted_sql": "SELECT DISTINCT cm.Maker\nFROM car_makers cm\nJOIN model_list ml ON cm.Id = ml.Maker\nJOIN car_names cn ON ml.Model = cn.Model\nJOIN cars_data cd ON cn.MakeId = cd.Id\nWHERE cd.Year = 1970;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "car_1",
"question": "What is the name of the different car makers who produced a car in 1970?",
"gold_sql": "SELECT DISTINCT T1.Maker FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker JOIN CAR_NAMES AS T3 ON T2.model = T3.model JOIN CARS_DATA AS T4 ON T3.MakeId = T4.id WHERE T4.year = '1970';",
"predicted_sql": "SELECT DISTINCT cm.Maker\nFROM car_makers cm\nJOIN car_names cn ON cm.Id = cn.MakeId\nJOIN cars_data cd ON cn.MakeId = cd.Id\nWHERE cd.Year = 1970;",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "car_1",
"question": "Find the make and production time of the cars that were produced in the earliest year?",
"gold_sql": "SELECT T2.Make , T1.Year FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id = T2.MakeId WHERE T1.Year = (SELECT min(YEAR) FROM CARS_DATA);",
"predicted_sql": "SELECT cn.Make, MIN(cd.Year) AS ProductionYear\nFROM cars_data cd\nJOIN car_names cn ON cd.Id = cn.MakeId\nGROUP BY cn.Make\nHAVING MIN(cd.Year) = (SELECT MIN(Year) FROM cars_data);",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "car_1",
"question": "What is the maker of the carr produced in the earliest year and what year was it?",
"gold_sql": "SELECT T2.Make , T1.Year FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id = T2.MakeId WHERE T1.Year = (SELECT min(YEAR) FROM CARS_DATA);",
"predicted_sql": "SELECT cm.Maker, MIN(cd.Year) AS EarliestYear\nFROM cars_data cd\nJOIN car_names cn ON cd.Id = cn.MakeId\nJOIN model_list ml ON cn.Make = ml.Model\nJOIN car_makers cm ON ml.Maker = cm.Id\nGROUP BY cm.Maker\nORDER BY EarliestYear\nLIMIT 1;",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "car_1",
"question": "Which distinct car models are the produced after 1980?",
"gold_sql": "SELECT DISTINCT T1.model FROM MODEL_LIST AS T1 JOIN CAR_NAMES AS T2 ON T1.model = T2.model JOIN CARS_DATA AS T3 ON T2.MakeId = T3.id WHERE T3.year > 1980;",
"predicted_sql": "SELECT DISTINCT ml.Model\nFROM model_list ml\nJOIN car_names cn ON ml.ModelId = cn.Model\nJOIN cars_data cd ON cn.MakeId = cd.Id\nWHERE cd.Year > 1980;",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "car_1",
"question": "What are the different models for the cards produced after 1980?",
"gold_sql": "SELECT DISTINCT T1.model FROM MODEL_LIST AS T1 JOIN CAR_NAMES AS T2 ON T1.model = T2.model JOIN CARS_DATA AS T3 ON T2.MakeId = T3.id WHERE T3.year > 1980;",
"predicted_sql": "SELECT DISTINCT ml.Model\nFROM model_list ml\nJOIN car_names cn ON ml.Model = cn.Model\nJOIN cars_data cd ON cn.MakeId = cd.Id\nWHERE cd.Year > 1980;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "car_1",
"question": "How many car makers are there in each continents? List the continent name and the count.",
"gold_sql": "SELECT T1.Continent , count(*) FROM CONTINENTS AS T1 JOIN COUNTRIES AS T2 ON T1.ContId = T2.continent JOIN car_makers AS T3 ON T2.CountryId = T3.Country GROUP BY T1.Continent;",
"predicted_sql": "SELECT c.Continent, COUNT(cm.Id) AS MakerCount\nFROM continents c\nLEFT JOIN countries co ON c.ContId = co.Continent\nLEFT JOIN car_makers cm ON co.CountryId = cm.Country\nGROUP BY c.Continent;",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "car_1",
"question": "What is the name of each continent and how many car makers are there in each one?",
"gold_sql": "SELECT T1.Continent , count(*) FROM CONTINENTS AS T1 JOIN COUNTRIES AS T2 ON T1.ContId = T2.continent JOIN car_makers AS T3 ON T2.CountryId = T3.Country GROUP BY T1.Continent;",
"predicted_sql": "SELECT co.CountryName AS Continent, COUNT(cm.Id) AS CarMakersCount\nFROM countries co\nLEFT JOIN car_makers cm ON co.CountryId = cm.Country\nGROUP BY co.CountryName;",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "car_1",
"question": "Which of the countries has the most car makers? List the country name.",
"gold_sql": "SELECT T2.CountryName FROM CAR_MAKERS AS T1 JOIN COUNTRIES AS T2 ON T1.Country = T2.CountryId GROUP BY T1.Country ORDER BY Count(*) DESC LIMIT 1;",
"predicted_sql": "SELECT c.CountryName\nFROM countries c\nJOIN car_makers cm ON c.CountryId = cm.Country\nGROUP BY c.CountryName\nORDER BY COUNT(cm.Id) DESC\nLIMIT 1;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "car_1",
"question": "What is the name of the country with the most car makers?",
"gold_sql": "SELECT T2.CountryName FROM CAR_MAKERS AS T1 JOIN COUNTRIES AS T2 ON T1.Country = T2.CountryId GROUP BY T1.Country ORDER BY Count(*) DESC LIMIT 1;",
"predicted_sql": "SELECT c.CountryName\nFROM car_makers cm\nJOIN countries c ON cm.Country = c.CountryId\nGROUP BY c.CountryName\nORDER BY COUNT(cm.Id) DESC\nLIMIT 1;",
"exec_match": true,
"exact_match": false,
"error": null
},
{
"db_id": "car_1",
"question": "How many car models are produced by each maker? List the count and the maker full name.",
"gold_sql": "SELECT Count(*) , T2.FullName , T2.id FROM MODEL_LIST AS T1 JOIN CAR_MAKERS AS T2 ON T1.Maker = T2.Id GROUP BY T2.id;",
"predicted_sql": "SELECT cm.FullName, COUNT(cn.Model) AS ModelCount\nFROM car_makers cm\nJOIN car_names cn ON cm.Id = cn.MakeId\nGROUP BY cm.FullName;",
"exec_match": false,
"exact_match": false,
"error": null
},
{
"db_id": "car_1",
"question": "What is the number of car models that are produced by each maker and what is the id and full name of each maker?",