db_id
stringclasses 69
values | question
stringlengths 24
325
| evidence
stringlengths 0
673
| SQL
stringlengths 23
804
| db_schema_T
stringlengths 79
5k
| db_schema
stringclasses 69
values | difficulty
stringclasses 1
value | question_id
int64 0
9.43k
| __index_level_0__
int64 0
9.43k
| db_schema_TC
stringlengths 41
1.68k
| sql_constructs
listlengths 2
17
| sql_complexity
int64 2
46
| sql_complexity_buckets
stringclasses 3
values | few_shots
dict |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
soccer_2016
|
In the matches where the winning margin is less than fifty, how many teams won by wicket?
|
winning margin is less than fifty refers to Win_Margin < 50; won by wicket refers to Win_Type = 'wickets'
|
SELECT COUNT(T2.Win_Id) FROM `Match` AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id WHERE T2.Win_Type = 'wickets' AND T1.Win_Margin < 50
|
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,901 | 1,901 |
CREATE TABLE `Win_By`
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE `Match`
(
Win_Type INTEGER,
Win_Margin INTEGER,
foreign key Win_Type references Win_ByWin_Id
)
|
[
"AS",
"AND",
"SELECT",
"INNER JOIN",
"ON",
"COUNT",
"FROM"
] | 8 |
simple
|
{
"case_1": [
518,
577
],
"case_2": [
518,
564,
577
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
32,
33,
34,
35,
36,
37,
39,
40,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
67,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
109,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
230,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
259,
260,
261,
262,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
294,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
399,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
421,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
507,
509,
510,
511,
512,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
554,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
591,
592,
593,
594,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
618,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
656,
657,
658,
659,
660,
661,
662,
663,
665,
666,
667,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
680,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
692,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
707,
710,
711,
712,
714,
715,
717,
718,
719,
720,
721,
722,
723,
724,
725,
726,
727,
728,
730,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
817,
818,
819,
820,
822,
823,
824,
825,
827,
828,
829,
830,
831,
832,
833,
834,
835,
837,
838,
839,
841,
843,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
903,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
945,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
965,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1014,
1015,
1016,
1017,
1019,
1020,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1059,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1078,
1079,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1126,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
In how many venues did team 2 win the toss and lose the match?
|
team 2 win the toss refers to Toss_Winner = Team_2 ; lose the match refers to Match_Winner = Team_1
|
SELECT SUM(CASE WHEN T1.Team_2 = T1.Match_Winner THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE T1.Team_1 = T1.Toss_Winner
|
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,902 | 1,902 |
CREATE TABLE `Venue`
(
Venue_Id INTEGER
primary key
)
CREATE TABLE `Match`
(
Team_1 INTEGER,
Team_2 INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Match_Winner INTEGER,
foreign key Team_1 references TeamTeam_Id,
foreign key Team_2 references TeamTeam_Id,
foreign key Venue_Id references VenueVenue_Id,
foreign key Toss_Winner references TeamTeam_Id,
foreign key Match_Winner references TeamTeam_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"CASE",
"INNER JOIN",
"ON",
"FROM"
] | 9 |
simple
|
{
"case_1": [
-1
],
"case_2": [
688,
1092
],
"case_3": [
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1110,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
54,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
122,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
173,
175,
176,
177,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
205,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
245,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
507,
508,
509,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
709,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
872,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
939,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
979,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1093,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1110,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Which player became the man of the series in the year 2012? Give the name and country of this player.
|
year 2012 refers to Season_Year = 2012; name of player refers to Player_Name.; country of this player refers to Country_Name
|
SELECT T2.Player_Name, T3.Country_Name FROM Season AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Series = T2.Player_Id INNER JOIN Country AS T3 ON T2.Country_Name = T3.Country_Id WHERE T1.Season_Year = 2012
|
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,903 | 1,903 |
CREATE TABLE `Country`
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key Country_Id references CountryCountry_Id
)
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
Country_Name INTEGER,
foreign key Country_Name references CountryCountry_Id
)
CREATE TABLE `Season`
(
Man_of_the_Series INTEGER,
Season_Year INTEGER
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 9 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
506,
507,
508,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
653,
654,
655,
657,
658,
659,
660,
661,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
978,
980,
981,
982,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1075,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Give the name of the venue where the most number of matches are held.
|
name of the venue refers to Venue_Name; most number of matches refers to max(count(Venue_Id))
|
SELECT T2.Venue_Name FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id GROUP BY T2.Venue_Name ORDER BY COUNT(T2.Venue_Id) DESC LIMIT 1
|
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,904 | 1,904 |
CREATE TABLE `Venue`
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT
)
CREATE TABLE `Match`
(
Venue_Id INTEGER,
foreign key Venue_Id references VenueVenue_Id
)
|
[
"GROUP BY",
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"COUNT",
"FROM"
] | 11 |
medium
|
{
"case_1": [
688
],
"case_2": [
688
],
"case_3": [
150,
212,
225,
229,
252,
314,
349,
383,
509,
547,
548,
564,
592,
654,
688,
714,
743,
778,
787,
943,
951,
1037,
1064,
1065,
1078,
1087,
1091,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
4,
6,
10,
11,
13,
15,
16,
20,
22,
27,
28,
29,
30,
36,
37,
47,
49,
51,
53,
55,
59,
62,
63,
68,
69,
73,
74,
75,
77,
78,
82,
86,
88,
89,
91,
93,
96,
98,
106,
108,
113,
115,
117,
118,
119,
121,
125,
126,
131,
138,
140,
142,
143,
146,
148,
150,
152,
159,
160,
162,
163,
164,
167,
169,
170,
173,
175,
179,
183,
184,
185,
187,
188,
189,
190,
191,
196,
197,
199,
200,
202,
206,
212,
213,
214,
225,
226,
227,
229,
233,
234,
239,
243,
244,
247,
252,
254,
256,
261,
262,
267,
268,
269,
275,
276,
277,
278,
281,
285,
286,
291,
299,
301,
309,
311,
313,
314,
316,
317,
319,
320,
323,
324,
325,
329,
330,
334,
335,
336,
338,
339,
341,
342,
344,
345,
348,
349,
352,
353,
354,
356,
358,
359,
360,
364,
365,
370,
371,
373,
374,
375,
378,
379,
381,
382,
383,
384,
385,
391,
392,
394,
395,
401,
403,
406,
409,
411,
412,
416,
417,
424,
426,
428,
429,
434,
435,
436,
444,
445,
448,
451,
454,
460,
462,
464,
465,
467,
469,
471,
473,
476,
477,
478,
482,
484,
487,
488,
490,
493,
495,
497,
500,
505,
509,
515,
516,
519,
520,
526,
530,
532,
535,
536,
537,
538,
542,
544,
547,
548,
552,
558,
559,
560,
563,
564,
566,
567,
573,
578,
579,
580,
581,
582,
584,
586,
590,
592,
595,
596,
597,
606,
608,
611,
613,
620,
621,
625,
626,
627,
630,
632,
633,
634,
637,
638,
641,
645,
646,
649,
651,
654,
657,
658,
659,
662,
663,
664,
665,
668,
669,
671,
681,
687,
688,
690,
691,
694,
696,
698,
701,
703,
705,
712,
714,
719,
720,
721,
727,
733,
734,
735,
736,
739,
740,
743,
748,
749,
750,
751,
752,
753,
756,
759,
760,
762,
768,
769,
772,
778,
779,
787,
790,
796,
797,
799,
800,
802,
803,
804,
810,
812,
813,
814,
818,
819,
823,
824,
827,
830,
838,
839,
841,
849,
850,
851,
853,
857,
861,
866,
867,
869,
870,
874,
876,
877,
882,
886,
888,
889,
891,
893,
896,
897,
898,
901,
902,
909,
911,
912,
915,
917,
918,
922,
923,
924,
926,
927,
929,
930,
932,
934,
935,
943,
950,
951,
953,
954,
956,
958,
961,
962,
963,
966,
967,
969,
970,
972,
973,
975,
977,
981,
983,
985,
986,
987,
993,
994,
996,
1004,
1005,
1006,
1010,
1013,
1015,
1017,
1022,
1023,
1025,
1030,
1034,
1037,
1038,
1042,
1043,
1047,
1049,
1050,
1051,
1056,
1057,
1058,
1062,
1064,
1065,
1067,
1068,
1071,
1072,
1076,
1077,
1078,
1082,
1084,
1086,
1087,
1091,
1094,
1100,
1101,
1103,
1104,
1106,
1112,
1119,
1123,
1124,
1128,
1131,
1133,
1134,
1135,
1137
]
}
|
soccer_2016
|
Which city hosted the least number of no-result matches?
|
city refers to City_Name; no-result matches refers to Win_type = 'NoResult'; least number refers to min(count(Win_type = 'NoResult'))
|
SELECT T4.City_Name FROM `Match` AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id INNER JOIN Venue AS T3 ON T1.Venue_Id = T3.Venue_Id INNER JOIN City AS T4 ON T3.City_Id = T4.City_Id WHERE T2.Win_Type = 'NO Result' GROUP BY T4.City_Id ORDER BY COUNT(T2.Win_Type) ASC LIMIT 1
|
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,905 | 1,905 |
CREATE TABLE `City`
(
City_Id INTEGER
primary key,
City_Name TEXT
)
CREATE TABLE `Venue`
(
Venue_Id INTEGER
primary key,
City_Id INTEGER,
foreign key City_Id references CityCity_Id
)
CREATE TABLE `Win_By`
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE `Match`
(
Venue_Id INTEGER,
Win_Type INTEGER,
foreign key Venue_Id references VenueVenue_Id,
foreign key Win_Type references Win_ByWin_Id
)
|
[
"GROUP BY",
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"ASC",
"COUNT",
"FROM"
] | 17 |
challenging
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
150,
212,
225,
229,
252,
314,
349,
383,
509,
547,
548,
564,
592,
654,
688,
714,
743,
778,
787,
943,
951,
1037,
1064,
1065,
1078,
1087,
1091,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
4,
6,
11,
13,
15,
16,
20,
22,
27,
28,
29,
30,
36,
37,
47,
49,
51,
53,
55,
59,
62,
63,
68,
69,
73,
74,
75,
77,
78,
82,
86,
88,
89,
91,
93,
96,
98,
106,
108,
113,
115,
117,
118,
119,
121,
125,
126,
131,
138,
140,
142,
143,
146,
148,
150,
152,
159,
160,
162,
163,
164,
167,
169,
170,
173,
175,
179,
183,
184,
187,
188,
189,
190,
191,
196,
197,
199,
200,
202,
206,
212,
213,
214,
225,
226,
227,
229,
233,
234,
239,
243,
244,
247,
252,
254,
256,
261,
262,
267,
268,
269,
275,
276,
277,
278,
281,
286,
299,
301,
309,
311,
313,
314,
316,
317,
319,
320,
323,
324,
325,
329,
330,
334,
335,
336,
338,
339,
341,
342,
344,
345,
348,
349,
352,
353,
354,
356,
358,
359,
360,
364,
365,
370,
371,
373,
374,
375,
378,
379,
381,
382,
383,
384,
385,
391,
392,
394,
395,
401,
403,
406,
409,
411,
412,
416,
417,
424,
426,
428,
429,
434,
435,
436,
444,
445,
448,
451,
454,
460,
462,
464,
465,
467,
469,
471,
473,
476,
477,
478,
482,
484,
487,
488,
490,
493,
495,
497,
500,
505,
509,
515,
516,
519,
520,
526,
530,
532,
535,
536,
537,
538,
542,
544,
547,
548,
552,
558,
559,
560,
563,
564,
566,
567,
573,
578,
579,
580,
581,
582,
584,
586,
590,
592,
595,
596,
597,
606,
608,
611,
613,
620,
621,
625,
626,
627,
630,
632,
633,
634,
637,
638,
641,
645,
646,
649,
651,
654,
657,
658,
659,
662,
663,
664,
665,
668,
669,
671,
681,
687,
688,
690,
691,
694,
696,
698,
701,
703,
705,
712,
714,
719,
720,
721,
727,
733,
734,
735,
736,
739,
740,
743,
748,
749,
750,
751,
752,
753,
756,
759,
760,
762,
768,
769,
772,
778,
779,
787,
790,
796,
797,
799,
800,
802,
803,
804,
810,
812,
813,
814,
818,
819,
823,
824,
827,
830,
838,
839,
841,
849,
850,
851,
853,
857,
861,
866,
867,
869,
870,
874,
876,
877,
882,
886,
888,
889,
891,
893,
896,
897,
898,
901,
902,
909,
911,
912,
915,
917,
918,
922,
923,
924,
926,
927,
929,
930,
932,
934,
935,
943,
950,
951,
953,
954,
956,
958,
961,
962,
963,
966,
967,
969,
970,
972,
973,
975,
977,
981,
985,
986,
993,
994,
996,
1005,
1006,
1010,
1013,
1015,
1017,
1022,
1023,
1025,
1030,
1034,
1037,
1038,
1042,
1043,
1047,
1049,
1050,
1051,
1056,
1057,
1058,
1062,
1064,
1065,
1067,
1068,
1071,
1072,
1076,
1077,
1078,
1082,
1084,
1086,
1087,
1091,
1094,
1100,
1101,
1103,
1104,
1106,
1112,
1119,
1123,
1124,
1128,
1131,
1133,
1134,
1135,
1137
]
}
|
soccer_2016
|
Write the name of the player who was the man of the series more than one time.
|
name of the player refers to Player_Name; man of the series more than one time refers to count(Man_of_the_Series) > 1
|
SELECT T2.Player_Name FROM Season AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Series = T2.Player_Id WHERE T1.Man_of_the_Series > 1
|
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,906 | 1,906 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Season`
(
Man_of_the_Series INTEGER
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
506,
507,
508,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
653,
654,
655,
657,
658,
659,
660,
661,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
978,
980,
981,
982,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1075,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
List the name and country of the players who got more than average catches in ascending order of the number of catches.
|
name and country of the players refers to Player_Name and Country_Name; catches refers to Out_name = 'caught'; average catches refers to divide(count(Player_ID) when Out_name = 'caught', sum(Player_ID))
|
SELECT T1.Player_Name, T4.Country_Name FROM Player AS T1 INNER JOIN Wicket_Taken AS T2 ON T1.Player_Id = T2.Fielders INNER JOIN Out_Type AS T3 ON T2.Kind_Out = T3.Out_Id INNER JOIN Country AS T4 ON T1.Country_Name = T4.Country_Id GROUP BY T1.Player_Name ORDER BY COUNT(T3.Out_Name) ASC
|
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,907 | 1,907 |
CREATE TABLE `Country`
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key Country_Id references CountryCountry_Id
)
CREATE TABLE `Out_Type`
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
Country_Name INTEGER,
foreign key Country_Name references CountryCountry_Id
)
CREATE TABLE `Wicket_Taken`
(
Kind_Out INTEGER,
Fielders INTEGER,
foreign key Kind_Out references Out_TypeOut_Id,
foreign key Fielders references PlayerPlayer_Id
)
|
[
"GROUP BY",
"AS",
"SELECT",
"ORDER BY",
"INNER JOIN",
"ON",
"ASC",
"COUNT",
"FROM"
] | 16 |
challenging
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
134,
150,
201,
212,
225,
229,
232,
252,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
13,
14,
15,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
28,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
78,
80,
81,
82,
83,
84,
85,
86,
88,
89,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
108,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
173,
175,
176,
177,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
252,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
348,
349,
352,
353,
354,
356,
357,
358,
359,
360,
361,
363,
364,
365,
368,
369,
370,
371,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
664,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
698,
699,
700,
701,
702,
703,
704,
705,
706,
710,
711,
712,
714,
715,
717,
719,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
748,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
869,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
972,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1005,
1006,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1030,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1057,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1070,
1071,
1072,
1074,
1076,
1077,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Of the matches that were won by runs by team 1, what percentage have team 1 won the toss and decided to field?
|
won by runs refers to Win_Type = 'runs'; won the toss and decided to field refers to Toss_Winner and Toss_Name = 'field'; percentage = divide(count(Team_1) when Match_Winner = Team_1 and Toss_Winner = Team_1, count(Team_1)) as percentage
|
SELECT CAST(COUNT(CASE WHEN T1.Team_1 = T1.Match_Winner = T1.Toss_Winner THEN 1 ELSE 0 END) AS REAL) * 100 / TOTAL(T1.Team_1) FROM `Match` AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id INNER JOIN Toss_Decision AS T3 ON T1.Toss_Decide = T3.Toss_Id WHERE T3.Toss_Name = 'field' AND T2.Win_Type = 'runs'
|
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,908 | 1,908 |
CREATE TABLE `Toss_Decision`
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE `Win_By`
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE `Match`
(
Team_1 INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Match_Winner INTEGER,
foreign key Team_1 references TeamTeam_Id,
foreign key Toss_Winner references TeamTeam_Id,
foreign key Toss_Decide references Toss_DecisionToss_Id,
foreign key Win_Type references Win_ByWin_Id,
foreign key Match_Winner references TeamTeam_Id
)
|
[
"CASE WHEN",
"AS",
"AND",
"SELECT",
"CASE",
"INNER JOIN",
"ON",
"CAST",
"COUNT",
"FROM"
] | 15 |
medium
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
201,
212,
225,
229,
314,
349,
383,
509,
518,
547,
548,
550,
564,
640,
654,
688,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1078,
1087,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
4,
5,
6,
8,
11,
12,
16,
19,
20,
21,
22,
24,
26,
27,
30,
33,
36,
37,
39,
42,
44,
45,
47,
51,
52,
53,
55,
57,
61,
62,
63,
64,
66,
68,
69,
71,
73,
74,
75,
76,
77,
81,
82,
85,
86,
88,
90,
91,
93,
95,
96,
98,
99,
106,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
131,
138,
140,
141,
142,
143,
144,
146,
148,
152,
153,
154,
155,
158,
159,
160,
163,
164,
167,
169,
170,
171,
172,
175,
176,
177,
179,
180,
183,
184,
187,
188,
189,
190,
191,
192,
195,
196,
197,
199,
200,
201,
202,
206,
207,
212,
214,
215,
219,
223,
225,
226,
227,
229,
233,
234,
236,
239,
240,
243,
244,
247,
248,
254,
256,
258,
261,
262,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
282,
296,
298,
299,
300,
301,
304,
311,
314,
315,
316,
317,
319,
320,
322,
323,
325,
330,
334,
335,
336,
338,
339,
341,
344,
345,
347,
349,
354,
356,
358,
360,
361,
364,
368,
370,
373,
374,
375,
376,
382,
383,
384,
385,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
423,
424,
425,
426,
427,
428,
433,
436,
437,
438,
440,
444,
445,
446,
448,
451,
452,
453,
454,
455,
458,
460,
462,
463,
464,
465,
467,
469,
470,
471,
473,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
490,
493,
494,
496,
497,
498,
500,
504,
505,
507,
509,
510,
514,
515,
516,
517,
518,
519,
520,
522,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
557,
558,
559,
560,
561,
562,
563,
564,
566,
571,
573,
575,
580,
581,
582,
584,
586,
588,
589,
595,
596,
597,
605,
606,
608,
610,
611,
612,
613,
615,
620,
623,
624,
625,
626,
627,
628,
630,
632,
633,
634,
637,
640,
641,
643,
645,
646,
648,
649,
651,
654,
658,
659,
662,
663,
665,
666,
668,
669,
671,
672,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
693,
694,
696,
697,
699,
702,
705,
706,
710,
712,
714,
715,
721,
723,
726,
727,
733,
734,
735,
736,
739,
740,
741,
743,
744,
746,
747,
749,
750,
752,
753,
754,
756,
758,
760,
762,
763,
765,
767,
768,
769,
772,
773,
775,
776,
777,
778,
779,
780,
783,
787,
788,
790,
793,
795,
796,
797,
798,
799,
800,
802,
804,
805,
806,
807,
808,
810,
812,
813,
814,
818,
819,
824,
825,
827,
829,
830,
832,
835,
838,
839,
841,
844,
848,
849,
851,
853,
857,
858,
859,
860,
861,
866,
867,
868,
870,
871,
873,
874,
876,
877,
878,
879,
880,
886,
888,
892,
893,
894,
895,
896,
897,
898,
901,
902,
905,
907,
909,
911,
912,
915,
917,
918,
922,
923,
924,
926,
927,
928,
930,
931,
932,
934,
935,
941,
943,
944,
949,
950,
951,
953,
954,
956,
958,
959,
961,
963,
969,
974,
975,
977,
981,
985,
986,
991,
993,
996,
998,
1000,
1001,
1005,
1006,
1008,
1010,
1012,
1013,
1015,
1017,
1019,
1022,
1023,
1027,
1031,
1037,
1039,
1042,
1043,
1044,
1046,
1047,
1050,
1051,
1058,
1061,
1062,
1063,
1064,
1066,
1067,
1068,
1069,
1071,
1072,
1078,
1080,
1082,
1084,
1086,
1087,
1092,
1094,
1098,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1112,
1115,
1119,
1121,
1123,
1124,
1128,
1131,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
What is the difference in the average number of players out by lbw and runout in the matches?
|
out by lbw refers to Out_Id = 4; runout refers to Out_Id = 3; average out by lbw refers to avg(Player_Out when Out_Id = 4); average out by runout refers to avg(Player_Out when Out_Id = 3)
|
SELECT AVG(T1.Player_Out) FROM Wicket_Taken AS T1 INNER JOIN Out_Type AS T2 ON T1.Kind_Out = T2.Out_Id WHERE T2.Out_Name = 'lbw'
|
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,909 | 1,909 |
CREATE TABLE `Out_Type`
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE `Wicket_Taken`
(
Player_Out INTEGER,
Kind_Out INTEGER,
foreign key Player_Out references PlayerPlayer_Id,
foreign key Kind_Out references Out_TypeOut_Id
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"AVG",
"FROM"
] | 7 |
simple
|
{
"case_1": [
640
],
"case_2": [
640
],
"case_3": [
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1005,
1006,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Identify by their ID all the overs in which the player with ID 7 was on strike.
|
Identify by their ID all the overs refers to Over_Id; player with ID 7 was on strike refers to Striker = 7
|
SELECT DISTINCT Over_Id FROM Ball_by_Ball WHERE Striker = 7
|
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,910 | 1,910 |
CREATE TABLE `Ball_by_Ball`
(
Over_Id INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER, Over_Id
)
|
[
"SELECT",
"FROM"
] | 2 |
simple
|
{
"case_1": [
1102
],
"case_2": [
1102
],
"case_3": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
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,
1001,
1002,
1003,
1004,
1005,
1006,
1007,
1008,
1009,
1010,
1011,
1012,
1013,
1014,
1015,
1016,
1017,
1018,
1019,
1020,
1021,
1022,
1023,
1024,
1025,
1026,
1027,
1028,
1029,
1030,
1031,
1032,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1040,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1053,
1054,
1055,
1056,
1057,
1058,
1059,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1073,
1074,
1075,
1076,
1077,
1078,
1079,
1080,
1081,
1082,
1083,
1084,
1085,
1086,
1087,
1088,
1089,
1090,
1091,
1092,
1093,
1094,
1095,
1096,
1097,
1098,
1099,
1100,
1101,
1102,
1103,
1104,
1105,
1106,
1107,
1108,
1109,
1110,
1111,
1112,
1113,
1114,
1115,
1116,
1117,
1118,
1119,
1120,
1121,
1122,
1123,
1124,
1125,
1126,
1127,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137,
1138,
1139,
1140,
1141
]
}
|
soccer_2016
|
How many first teams chose to bat after winning the toss?
|
first teams refers to Team_1; chose to bat after winning the toss refers to Toss_Winner and Toss_Decide = 2
|
SELECT COUNT(Team_1) FROM `Match` WHERE Team_1 = Toss_Winner AND Toss_Decide = 2
|
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,911 | 1,911 |
CREATE TABLE `Match`
(
Team_1 INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
foreign key Team_1 references TeamTeam_Id,
foreign key Toss_Winner references TeamTeam_Id,
foreign key Toss_Decide references Toss_DecisionToss_Id
)
|
[
"COUNT",
"AND",
"SELECT",
"FROM"
] | 4 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
2,
43,
212,
225,
229,
252,
259,
314,
349,
383,
509,
547,
548,
564,
654,
688,
714,
743,
778,
787,
829,
943,
951,
1037,
1064,
1078,
1087,
1092,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
4,
5,
6,
8,
9,
10,
11,
12,
13,
15,
16,
19,
20,
21,
22,
24,
25,
26,
27,
28,
30,
32,
33,
35,
36,
37,
38,
39,
40,
43,
44,
45,
47,
50,
51,
52,
53,
55,
56,
57,
61,
62,
63,
66,
67,
68,
69,
71,
73,
74,
75,
76,
77,
78,
79,
82,
85,
86,
87,
88,
89,
90,
91,
93,
95,
96,
98,
99,
100,
106,
108,
109,
111,
112,
113,
115,
116,
117,
118,
119,
121,
124,
125,
126,
127,
128,
129,
131,
138,
140,
141,
142,
143,
144,
146,
147,
148,
152,
154,
157,
158,
159,
160,
163,
164,
167,
168,
169,
170,
172,
173,
175,
176,
177,
179,
180,
182,
183,
184,
185,
187,
188,
189,
190,
191,
192,
196,
197,
198,
199,
200,
202,
203,
206,
210,
212,
214,
216,
219,
223,
224,
225,
226,
227,
229,
230,
233,
234,
239,
240,
243,
244,
247,
252,
254,
255,
256,
258,
259,
261,
262,
265,
266,
267,
268,
269,
270,
271,
272,
273,
275,
276,
277,
278,
282,
286,
291,
293,
294,
296,
299,
301,
303,
305,
311,
314,
315,
316,
317,
319,
320,
323,
325,
330,
334,
335,
336,
338,
339,
341,
344,
345,
348,
349,
350,
352,
354,
356,
358,
359,
360,
361,
362,
364,
367,
368,
370,
371,
373,
374,
375,
376,
380,
382,
383,
384,
385,
391,
392,
393,
394,
395,
398,
399,
401,
402,
403,
405,
406,
408,
409,
410,
411,
412,
413,
414,
416,
417,
418,
419,
420,
421,
423,
424,
425,
426,
427,
428,
433,
436,
437,
438,
439,
440,
443,
444,
445,
446,
447,
448,
451,
452,
453,
454,
455,
458,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
473,
475,
476,
477,
478,
480,
481,
482,
484,
485,
487,
488,
490,
492,
493,
494,
496,
497,
498,
500,
504,
505,
507,
509,
510,
512,
514,
515,
516,
517,
519,
520,
522,
524,
526,
528,
529,
530,
531,
532,
533,
535,
536,
537,
538,
539,
541,
542,
543,
544,
545,
547,
548,
551,
552,
554,
557,
558,
559,
560,
561,
562,
563,
564,
566,
573,
580,
581,
582,
584,
585,
586,
588,
589,
591,
594,
595,
596,
597,
598,
599,
601,
603,
605,
606,
608,
610,
611,
612,
613,
615,
618,
620,
622,
624,
625,
626,
627,
629,
630,
632,
633,
634,
637,
641,
643,
645,
646,
648,
649,
651,
654,
656,
658,
659,
661,
662,
663,
664,
665,
666,
667,
668,
669,
671,
673,
675,
677,
678,
679,
680,
681,
683,
684,
685,
686,
687,
688,
689,
690,
692,
693,
694,
696,
697,
698,
699,
702,
703,
705,
707,
712,
714,
715,
716,
718,
719,
721,
726,
727,
730,
733,
734,
735,
736,
737,
739,
740,
741,
743,
746,
747,
748,
749,
750,
752,
753,
754,
756,
757,
758,
760,
762,
763,
765,
767,
768,
769,
770,
772,
773,
775,
776,
777,
778,
779,
780,
783,
785,
787,
788,
790,
793,
794,
795,
796,
797,
798,
799,
800,
802,
804,
806,
807,
808,
810,
811,
812,
813,
814,
817,
818,
819,
820,
821,
824,
825,
827,
829,
830,
831,
832,
835,
838,
839,
840,
841,
843,
844,
848,
849,
851,
853,
855,
857,
858,
859,
860,
861,
864,
865,
866,
867,
869,
870,
873,
874,
876,
877,
878,
879,
886,
888,
890,
892,
893,
894,
895,
896,
897,
898,
899,
901,
902,
903,
905,
907,
909,
911,
912,
913,
915,
917,
918,
920,
922,
923,
924,
926,
927,
928,
930,
931,
932,
934,
935,
941,
942,
943,
944,
945,
949,
950,
951,
953,
954,
956,
958,
960,
961,
963,
965,
968,
969,
972,
974,
975,
976,
977,
981,
983,
985,
986,
991,
993,
996,
998,
1000,
1001,
1005,
1006,
1008,
1009,
1010,
1011,
1013,
1014,
1015,
1017,
1018,
1019,
1020,
1022,
1023,
1027,
1030,
1031,
1037,
1039,
1042,
1043,
1044,
1046,
1047,
1050,
1051,
1053,
1055,
1057,
1058,
1059,
1061,
1062,
1063,
1064,
1067,
1068,
1069,
1070,
1071,
1072,
1073,
1076,
1077,
1078,
1079,
1080,
1081,
1082,
1084,
1086,
1087,
1090,
1092,
1094,
1096,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1112,
1113,
1115,
1117,
1119,
1121,
1123,
1124,
1126,
1127,
1128,
1131,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
How many games were played in March 2010?
|
were played in March 2010 refers to Match_Date = '2010-03%'
|
SELECT SUM(CASE WHEN Match_Date LIKE '2010-03%' THEN 1 ELSE 0 END) FROM `Match`
|
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,912 | 1,912 |
CREATE TABLE `Match`
(
Match_Date DATE
)
|
[
"CASE WHEN",
"SELECT",
"SUM",
"LIKE",
"CASE",
"-",
"FROM"
] | 7 |
simple
|
{
"case_1": [
122,
979
],
"case_2": [
122,
979
],
"case_3": [
54,
122,
201,
205,
212,
225,
245,
383,
518,
547,
550,
564,
640,
787,
943,
959,
979,
1064,
1078,
1087,
1092,
1093,
1098,
1110
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
3,
6,
16,
24,
39,
42,
54,
61,
64,
71,
77,
81,
104,
106,
112,
113,
120,
122,
127,
129,
141,
148,
152,
153,
155,
158,
173,
184,
189,
191,
192,
195,
201,
205,
207,
212,
215,
219,
223,
225,
226,
228,
234,
236,
240,
245,
248,
258,
261,
263,
264,
267,
271,
279,
299,
300,
304,
322,
335,
347,
356,
360,
362,
375,
383,
393,
402,
406,
409,
412,
415,
423,
427,
438,
448,
452,
453,
458,
476,
478,
485,
486,
500,
504,
508,
510,
514,
517,
518,
535,
540,
547,
550,
563,
564,
571,
573,
575,
580,
581,
601,
620,
623,
624,
628,
640,
646,
662,
666,
675,
676,
682,
686,
695,
709,
710,
723,
740,
744,
747,
753,
754,
756,
762,
772,
776,
777,
787,
788,
795,
796,
798,
800,
805,
808,
827,
832,
841,
844,
848,
858,
868,
870,
871,
872,
874,
896,
909,
912,
922,
924,
926,
930,
939,
943,
944,
959,
979,
980,
985,
998,
1008,
1012,
1031,
1036,
1048,
1057,
1062,
1064,
1068,
1069,
1070,
1078,
1082,
1087,
1092,
1093,
1098,
1101,
1110,
1111,
1129,
1131,
1133,
1134,
1135
]
}
|
soccer_2016
|
How many players are older than Gurkeerat Singh player?
|
older than Gurkeerat Singh player refers to DOB ! = 'Gurkeerat Singh' and DOB < '1990-06-29'
|
SELECT SUM(CASE WHEN DOB < '1990-06-29' THEN 1 ELSE 0 END) FROM Player WHERE Player_Name != 'Gurkeerat Singh'
|
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,913 | 1,913 |
CREATE TABLE `Player`
(
Player_Name TEXT,
DOB DATE
)
|
[
"CASE WHEN",
"SELECT",
"SUM",
"CASE",
"-",
"FROM"
] | 7 |
simple
|
{
"case_1": [
1093
],
"case_2": [
1093
],
"case_3": [
54,
122,
201,
205,
212,
225,
245,
383,
518,
547,
550,
564,
640,
787,
943,
959,
979,
1064,
1078,
1087,
1092,
1093,
1098,
1110
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
6,
16,
24,
39,
42,
54,
61,
64,
71,
77,
81,
104,
106,
112,
113,
120,
122,
127,
129,
141,
148,
152,
153,
155,
158,
173,
184,
189,
191,
192,
195,
201,
205,
207,
212,
215,
219,
223,
225,
226,
228,
234,
236,
245,
248,
261,
264,
267,
271,
279,
299,
300,
304,
322,
335,
347,
356,
360,
362,
375,
383,
393,
402,
406,
409,
412,
415,
423,
427,
438,
448,
452,
453,
458,
476,
478,
485,
486,
500,
504,
508,
510,
514,
517,
518,
535,
540,
547,
550,
563,
564,
571,
573,
575,
580,
581,
601,
620,
623,
628,
640,
646,
662,
666,
676,
682,
686,
695,
709,
710,
723,
740,
744,
747,
753,
762,
772,
776,
777,
787,
788,
795,
796,
798,
800,
805,
808,
827,
841,
848,
868,
870,
871,
872,
874,
896,
909,
912,
922,
924,
926,
939,
943,
944,
959,
979,
985,
998,
1008,
1012,
1031,
1036,
1048,
1062,
1064,
1068,
1069,
1078,
1082,
1087,
1092,
1093,
1098,
1110,
1129,
1131,
1133,
1134,
1135
]
}
|
soccer_2016
|
How many times has SR Watson been named 'Man of the Match'?
|
SELECT SUM(CASE WHEN T2.Player_Name = 'SR Watson' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Match = T2.Player_Id
|
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,914 | 1,914 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Match`
(
Man_of_the_Match INTEGER,
foreign key Man_of_the_Match references PlayerPlayer_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"CASE",
"INNER JOIN",
"ON",
"FROM"
] | 9 |
simple
|
{
"case_1": [
-1
],
"case_2": [
1124
],
"case_3": [
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1110,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
54,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
122,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
173,
175,
176,
177,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
205,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
245,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
507,
508,
509,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
709,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
872,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
939,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
979,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1093,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1110,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
|
soccer_2016
|
Indicate the name of the most versatile players of the Delhi Daredevils.
|
if a player has multiple roles in a match, it means this player is versatile; name refers to Player_Name; most versatile player refers to MAX(COUNT(Role_id)); Delhi Daredevils refers to Team_Name = 'Delhi Daredevils'
|
SELECT T3.Player_Name FROM Player_Match AS T1 INNER JOIN Team AS T2 ON T1.Team_Id = T2.Team_Id INNER JOIN Player AS T3 ON T1.Player_Id = T3.Player_Id WHERE T2.Team_Name = 'Delhi Daredevils' GROUP BY T3.Player_Name ORDER BY COUNT(T1.Role_Id) DESC LIMIT 1
|
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,915 | 1,915 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Player_Match`
(
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER, Player_Id, Role_Id,
foreign key Player_Id references PlayerPlayer_Id,
foreign key Team_Id references TeamTeam_Id,
foreign key Role_Id references RoleeRole_Id
)
|
[
"GROUP BY",
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"COUNT",
"FROM"
] | 14 |
medium
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
150,
212,
225,
229,
252,
314,
349,
383,
509,
547,
548,
564,
592,
654,
688,
714,
743,
778,
787,
943,
951,
1037,
1064,
1065,
1078,
1087,
1091,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
4,
6,
10,
11,
13,
15,
16,
20,
22,
27,
28,
29,
30,
36,
37,
47,
49,
51,
53,
55,
59,
62,
63,
68,
69,
73,
74,
75,
77,
78,
82,
86,
88,
89,
91,
93,
96,
98,
106,
108,
113,
115,
117,
118,
119,
121,
125,
126,
131,
138,
140,
142,
143,
146,
148,
150,
152,
159,
160,
162,
163,
164,
167,
169,
170,
173,
175,
179,
183,
184,
185,
187,
188,
189,
190,
191,
196,
197,
199,
200,
202,
206,
212,
213,
214,
225,
226,
227,
229,
233,
234,
239,
243,
244,
247,
252,
254,
256,
261,
262,
267,
268,
269,
275,
276,
277,
278,
281,
285,
286,
291,
299,
301,
309,
311,
313,
314,
316,
317,
319,
320,
323,
324,
325,
329,
330,
334,
335,
336,
338,
339,
341,
342,
344,
345,
348,
349,
352,
353,
354,
356,
358,
359,
360,
364,
365,
370,
371,
373,
374,
375,
378,
379,
381,
382,
383,
384,
385,
391,
392,
394,
395,
401,
403,
406,
409,
411,
412,
416,
417,
424,
426,
428,
429,
434,
435,
436,
444,
445,
448,
451,
454,
460,
462,
464,
465,
467,
469,
471,
473,
476,
477,
478,
482,
484,
487,
488,
490,
493,
495,
497,
500,
505,
509,
515,
516,
519,
520,
526,
530,
532,
535,
536,
537,
538,
542,
544,
547,
548,
552,
558,
559,
560,
563,
564,
566,
567,
573,
578,
579,
580,
581,
582,
584,
586,
590,
592,
595,
596,
597,
606,
608,
611,
613,
620,
621,
625,
626,
627,
630,
632,
633,
634,
637,
638,
641,
645,
646,
649,
651,
654,
657,
658,
659,
662,
663,
664,
665,
668,
669,
671,
681,
687,
688,
690,
691,
694,
696,
698,
701,
703,
705,
712,
714,
719,
720,
721,
727,
733,
734,
735,
736,
739,
740,
743,
748,
749,
750,
751,
752,
753,
756,
759,
760,
762,
768,
769,
772,
778,
779,
787,
790,
796,
797,
799,
800,
802,
803,
804,
810,
812,
813,
814,
818,
819,
823,
824,
827,
830,
838,
839,
841,
849,
850,
851,
853,
857,
861,
866,
867,
869,
870,
874,
876,
877,
882,
886,
888,
889,
891,
893,
896,
897,
898,
901,
902,
909,
911,
912,
915,
917,
918,
922,
923,
924,
926,
927,
929,
930,
932,
934,
935,
943,
950,
951,
953,
954,
956,
958,
961,
962,
963,
966,
967,
969,
970,
972,
973,
975,
977,
981,
983,
985,
986,
987,
993,
994,
996,
1004,
1005,
1006,
1010,
1013,
1015,
1017,
1022,
1023,
1025,
1030,
1034,
1037,
1038,
1042,
1043,
1047,
1049,
1050,
1051,
1056,
1057,
1058,
1062,
1064,
1065,
1067,
1068,
1071,
1072,
1076,
1077,
1078,
1082,
1084,
1086,
1087,
1091,
1094,
1100,
1101,
1103,
1104,
1106,
1112,
1119,
1123,
1124,
1128,
1131,
1133,
1134,
1135,
1137
]
}
|
soccer_2016
|
What is the name of the player who has been chosen the most times for 'Man of the Series'?
|
name of the player refers to Player_Name; most times for 'Man of the Series' refers to max(count(Man_of_the_Match))
|
SELECT T3.Player_Name FROM Season AS T1 INNER JOIN Match AS T2 ON T1.Man_of_the_Series = T2.Man_of_the_Match INNER JOIN Player AS T3 ON T2.Man_of_the_Match = T3.Player_Id GROUP BY T3.Player_Name ORDER BY COUNT(T1.Man_of_the_Series) DESC LIMIT 1
|
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,916 | 1,916 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Season`
(
Man_of_the_Series INTEGER
)
CREATE TABLE `Match`
(
Man_of_the_Match INTEGER,
foreign key Man_of_the_Match references PlayerPlayer_Id
)
|
[
"GROUP BY",
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"COUNT",
"FROM"
] | 14 |
medium
|
{
"case_1": [
229
],
"case_2": [
229
],
"case_3": [
150,
212,
225,
229,
252,
314,
349,
383,
509,
547,
548,
564,
592,
654,
688,
714,
743,
778,
787,
943,
951,
1037,
1064,
1065,
1078,
1087,
1091,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
4,
6,
10,
11,
13,
15,
16,
20,
22,
27,
28,
29,
30,
36,
37,
47,
49,
51,
53,
55,
59,
62,
63,
68,
69,
73,
74,
75,
77,
78,
82,
86,
88,
89,
91,
93,
96,
98,
106,
108,
113,
115,
117,
118,
119,
121,
125,
126,
131,
138,
140,
142,
143,
146,
148,
150,
152,
159,
160,
162,
163,
164,
167,
169,
170,
173,
175,
179,
183,
184,
185,
187,
188,
189,
190,
191,
196,
197,
199,
200,
202,
206,
212,
213,
214,
225,
226,
227,
229,
233,
234,
239,
243,
244,
247,
252,
254,
256,
261,
262,
267,
268,
269,
275,
276,
277,
278,
281,
285,
286,
291,
299,
301,
309,
311,
313,
314,
316,
317,
319,
320,
323,
324,
325,
329,
330,
334,
335,
336,
338,
339,
341,
342,
344,
345,
348,
349,
352,
353,
354,
356,
358,
359,
360,
364,
365,
370,
371,
373,
374,
375,
378,
379,
381,
382,
383,
384,
385,
391,
392,
394,
395,
401,
403,
406,
409,
411,
412,
416,
417,
424,
426,
428,
429,
434,
435,
436,
444,
445,
448,
451,
454,
460,
462,
464,
465,
467,
469,
471,
473,
476,
477,
478,
482,
484,
487,
488,
490,
493,
495,
497,
500,
505,
509,
515,
516,
519,
520,
526,
530,
532,
535,
536,
537,
538,
542,
544,
547,
548,
552,
558,
559,
560,
563,
564,
566,
567,
573,
578,
579,
580,
581,
582,
584,
586,
590,
592,
595,
596,
597,
606,
608,
611,
613,
620,
621,
625,
626,
627,
630,
632,
633,
634,
637,
638,
641,
645,
646,
649,
651,
654,
657,
658,
659,
662,
663,
664,
665,
668,
669,
671,
681,
687,
688,
690,
691,
694,
696,
698,
701,
703,
705,
712,
714,
719,
720,
721,
727,
733,
734,
735,
736,
739,
740,
743,
748,
749,
750,
751,
752,
753,
756,
759,
760,
762,
768,
769,
772,
778,
779,
787,
790,
796,
797,
799,
800,
802,
803,
804,
810,
812,
813,
814,
818,
819,
823,
824,
827,
830,
838,
839,
841,
849,
850,
851,
853,
857,
861,
866,
867,
869,
870,
874,
876,
877,
882,
886,
888,
889,
891,
893,
896,
897,
898,
901,
902,
909,
911,
912,
915,
917,
918,
922,
923,
924,
926,
927,
929,
930,
932,
934,
935,
943,
950,
951,
953,
954,
956,
958,
961,
962,
963,
966,
967,
969,
970,
972,
973,
975,
977,
981,
983,
985,
986,
987,
993,
994,
996,
1004,
1005,
1006,
1010,
1013,
1015,
1017,
1022,
1023,
1025,
1030,
1034,
1037,
1038,
1042,
1043,
1047,
1049,
1050,
1051,
1056,
1057,
1058,
1062,
1064,
1065,
1067,
1068,
1071,
1072,
1076,
1077,
1078,
1082,
1084,
1086,
1087,
1091,
1094,
1100,
1101,
1103,
1104,
1106,
1112,
1119,
1123,
1124,
1128,
1131,
1133,
1134,
1135,
1137
]
}
|
soccer_2016
|
In what year did SP Narine win the Orange Cap?
|
year refers to Season_Year
|
SELECT T4.Season_Year, T4.Orange_Cap FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Match AS T3 ON T2.Match_Id = T3.Match_Id INNER JOIN Season AS T4 ON T3.Season_Id = T4.Season_Id WHERE T1.Player_Name = 'SP Narine' GROUP BY T4.Season_Year, T4.Orange_Cap
|
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,917 | 1,917 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Season`
(
Season_Id INTEGER
primary key,
Orange_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Season_Id INTEGER,
foreign key Season_Id references SeasonSeason_Id
)
CREATE TABLE `Player_Match`
(
Match_Id INTEGER,
Player_Id INTEGER,
primary key Match_Id, Player_Id,
foreign key Match_Id references MatchMatch_Id,
foreign key Player_Id references PlayerPlayer_Id
)
|
[
"GROUP BY",
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 13 |
medium
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
89,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1005,
1006,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1070,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Which teams have had a player awarded the Purple Cap and another with the Orange Cap in the same season?
|
SELECT T5.Team_Name, T1.Orange_Cap, T1.Purple_Cap FROM Season AS T1 INNER JOIN Match AS T2 ON T1.Season_Id = T2.Season_Id INNER JOIN Player_Match AS T3 ON T2.Match_Id = T3.Match_Id INNER JOIN Player AS T4 ON T3.Player_Id = T4.Player_Id INNER JOIN Team AS T5 ON T3.Team_Id = T5.Team_Id GROUP BY T5.Team_Name, T1.Orange_Cap, T1.Purple_Cap
|
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,918 | 1,918 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key
)
CREATE TABLE `Season`
(
Season_Id INTEGER
primary key,
Orange_Cap INTEGER,
Purple_Cap INTEGER
)
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Season_Id INTEGER,
foreign key Season_Id references SeasonSeason_Id
)
CREATE TABLE `Player_Match`
(
Match_Id INTEGER,
Player_Id INTEGER,
Team_Id INTEGER,
primary key Match_Id, Player_Id,
foreign key Match_Id references MatchMatch_Id,
foreign key Player_Id references PlayerPlayer_Id,
foreign key Team_Id references TeamTeam_Id
)
|
[
"GROUP BY",
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 16 |
challenging
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
89,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1005,
1006,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1070,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
|
soccer_2016
|
List all Zimbabwean players.
|
Zimbabwean refers to Country_Name = 'Zimbabwea'; players refers to Player_Name
|
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_Id WHERE T2.Country_Name = 'Zimbabwea'
|
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,919 | 1,919 |
CREATE TABLE `Country`
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key Country_Id references CountryCountry_Id
)
CREATE TABLE `Player`
(
Player_Name TEXT,
Country_Name INTEGER,
foreign key Country_Name references CountryCountry_Id
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
150,
349
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
506,
507,
508,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
653,
654,
655,
657,
658,
659,
660,
661,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
978,
980,
981,
982,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1075,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
How many players bat with their left hands?
|
bat with their left hands refers to Batting_hand = 'Left-hand bat'
|
SELECT SUM(CASE WHEN T2.Batting_hand = 'Left-hand bat' THEN 1 ELSE 0 END) FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,920 | 1,920 |
CREATE TABLE `Batting_Style`
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE `Player`
(
Batting_hand INTEGER,
foreign key Batting_hand references Batting_StyleBatting_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"CASE",
"-",
"INNER JOIN",
"ON",
"FROM"
] | 10 |
simple
|
{
"case_1": [
550
],
"case_2": [
550,
943,
959,
1078
],
"case_3": [
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1110,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
54,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
122,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
173,
175,
176,
177,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
205,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
245,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
362,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
507,
508,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
709,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
872,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
939,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
979,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1093,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1110,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
How many games were not won by runs?
|
not won by runs refers to Win_Type ! = 'runs'
|
SELECT SUM(CASE WHEN T2.Win_Type != 'runs' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id
|
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,921 | 1,921 |
CREATE TABLE `Win_By`
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE `Match`
(
Win_Type INTEGER,
foreign key Win_Type references Win_ByWin_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"CASE",
"INNER JOIN",
"ON",
"FROM"
] | 9 |
simple
|
{
"case_1": [
518,
577
],
"case_2": [
518,
564,
577
],
"case_3": [
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1110,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
54,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
122,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
173,
175,
176,
177,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
205,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
245,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
507,
508,
509,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
709,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
872,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
939,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
979,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1093,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1110,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
List the name of all New Zealand umpires.
|
New Zealand umpires refers to Country_Name = 'New Zealand'; name of umpires refers to Umpire_Name
|
SELECT T1.Umpire_Name FROM Umpire AS T1 INNER JOIN Country AS T2 ON T1.Umpire_Country = T2.Country_Id WHERE T2.Country_Name = 'New Zealand'
|
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,922 | 1,922 |
CREATE TABLE `Country`
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key Country_Id references CountryCountry_Id
)
CREATE TABLE `Umpire`
(
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key Umpire_Country references CountryCountry_Id
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
506,
507,
508,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
653,
654,
655,
657,
658,
659,
660,
661,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
978,
980,
981,
982,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1075,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
In which country do most players have the 'slow left-arm chinaman' bowling style?
|
'slow left-arm chinaman' bowling style refers to Bowling_skill = 'Slow left-arm chinaman'; most players refers to max(count(Country_Id))
|
SELECT T3.Country_Name FROM Bowling_Style AS T1 INNER JOIN Player AS T2 ON T1.Bowling_Id = T2.Bowling_skill INNER JOIN Country AS T3 ON T2.Country_Name = T3.Country_Id WHERE T1.Bowling_skill = 'Slow left-arm chinaman'
|
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,923 | 1,923 |
CREATE TABLE `Bowling_Style`
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE `Country`
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key Country_Id references CountryCountry_Id
)
CREATE TABLE `Player`
(
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key Bowling_skill references Bowling_StyleBowling_Id,
foreign key Country_Name references CountryCountry_Id
)
|
[
"AS",
"SELECT",
"-",
"INNER JOIN",
"ON",
"FROM"
] | 10 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
510,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1005,
1006,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1070,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
In which venue did Kochi Tuskers Kerala play most of their matches?
|
Kochi Tuskers Kerala refers to Team_Name = 'Kochi Tuskers Kerala'; most of their matches refers to max(Venue_Id)
|
SELECT T1.Venue_Name FROM Venue AS T1 INNER JOIN Match AS T2 ON T1.Venue_Id = T2.Venue_Id INNER JOIN Team AS T3 ON T2.Team_1 = T3.Team_Id WHERE T3.Team_Name = 'Kochi Tuskers Kerala' GROUP BY T1.Venue_Name
|
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,924 | 1,924 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Venue`
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT
)
CREATE TABLE `Match`
(
Team_1 INTEGER,
Venue_Id INTEGER,
foreign key Team_1 references TeamTeam_Id,
foreign key Venue_Id references VenueVenue_Id
)
|
[
"GROUP BY",
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 10 |
simple
|
{
"case_1": [
-1
],
"case_2": [
778
],
"case_3": [
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
89,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1005,
1006,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1070,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
In how many games in which the batting team was the Delhi Daredevils were no runs scored?
|
batting team was the Delhi Daredevils refers to Team_Name = 'Delhi Daredevils' and Team_1 = Team_Id where Team_Batting = 1 or Team_2 = Team_Id where Team_Batting = 2; no runs scored refers to Runs_Scored = 0
|
SELECT COUNT(T1.Runs_Scored) FROM Batsman_Scored AS T1 INNER JOIN Ball_by_Ball AS T2 ON T1.Match_Id = T2.Match_Id INNER JOIN Match AS T3 ON T2.Match_Id = T3.Match_Id INNER JOIN Team AS T4 ON T3.Team_1 = T4.Team_Id WHERE T2.Team_Batting = 1 OR T2.Team_Batting = 2 AND T4.Team_Name = 'Delhi Daredevils'
|
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,925 | 1,925 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
foreign key Team_1 references TeamTeam_Id
)
CREATE TABLE `Ball_by_Ball`
(
Match_Id INTEGER,
Team_Batting INTEGER,
primary key Match_Id,
foreign key Match_Id references MatchMatch_Id
)
CREATE TABLE `Batsman_Scored`
(
Match_Id INTEGER,
Runs_Scored INTEGER,
primary key Match_Id,
foreign key Match_Id references MatchMatch_Id
)
|
[
"OR",
"AND",
"SELECT",
"AS",
"INNER JOIN",
"ON",
"COUNT",
"FROM"
] | 15 |
medium
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
510,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
In what percentage of games played at the Dr DY Patil Sports Academy venue did the winning team win by a margin of less than 10?
|
Dr DY Patil Sports Academy venue refers to Venue_Name = 'Dr DY Patil Sports Academy'; win by a margin of less than 10 refers to Win_Margin < 10; percentage = divide(count(Venue_Id) when Win_Margin < 10, sum(Venue_Id)) as percentage
|
SELECT CAST(COUNT(CASE WHEN T2.Win_Margin < 10 THEN 1 ELSE 0 END) AS REAL) * 100 / TOTAL(T1.Venue_Id) FROM Venue AS T1 INNER JOIN Match AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE T1.Venue_Name = 'Dr DY Patil Sports Academy'
|
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,926 | 1,926 |
CREATE TABLE `Venue`
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT
)
CREATE TABLE `Match`
(
Venue_Id INTEGER,
Win_Margin INTEGER,
foreign key Venue_Id references VenueVenue_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"CASE",
"INNER JOIN",
"ON",
"CAST",
"COUNT",
"FROM"
] | 11 |
medium
|
{
"case_1": [
688,
1092
],
"case_2": [
688,
1092
],
"case_3": [
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
173,
175,
176,
177,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
507,
508,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
661,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
What is the average number of extra runs made as noballs?
|
noballs refers to Extra_Name = 'noballs' ; average number = divide(sum(Extra_Runs), count(Extra_Runs))
|
SELECT AVG(T1.Extra_Runs) FROM Extra_Runs AS T1 INNER JOIN Extra_Type AS T2 ON T1.Extra_Type_Id = T2.Extra_Id WHERE T2.Extra_Name = 'noballs'
|
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,927 | 1,927 |
CREATE TABLE `Extra_Type`
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE `Extra_Runs`
(
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
foreign key Extra_Type_Id references Extra_TypeExtra_Id
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"AVG",
"FROM"
] | 7 |
simple
|
{
"case_1": [
232
],
"case_2": [
232
],
"case_3": [
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1005,
1006,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
List the player's ID of the top five players, by descending order, in terms of bowling skill.
|
player's ID refers to Player_Id
|
SELECT Player_Id FROM Player ORDER BY Bowling_skill DESC LIMIT 5
|
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,928 | 1,928 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Bowling_skill INTEGER,
foreign key Bowling_skill references Bowling_StyleBowling_Id
)
|
[
"SELECT",
"ORDER BY",
"LIMIT",
"FROM",
"DESC"
] | 5 |
simple
|
{
"case_1": [
43
],
"case_2": [
43
],
"case_3": [
43,
150,
229,
252,
314,
349,
548,
592,
654,
688,
713,
778,
951,
1024,
1037,
1065,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
1,
10,
11,
13,
15,
17,
20,
28,
29,
36,
38,
43,
49,
55,
59,
62,
69,
73,
75,
78,
86,
89,
108,
110,
121,
125,
133,
138,
150,
159,
162,
163,
167,
173,
174,
179,
181,
185,
187,
188,
199,
200,
202,
206,
208,
213,
229,
233,
239,
247,
252,
262,
263,
275,
278,
281,
285,
286,
291,
309,
311,
313,
314,
319,
320,
324,
328,
329,
334,
336,
337,
341,
342,
345,
348,
349,
352,
353,
356,
359,
364,
365,
371,
373,
378,
379,
381,
385,
394,
395,
400,
403,
404,
409,
411,
428,
429,
434,
435,
444,
445,
451,
454,
460,
462,
469,
482,
495,
497,
505,
530,
532,
534,
536,
538,
542,
548,
552,
555,
560,
566,
567,
576,
578,
579,
583,
584,
586,
590,
592,
595,
611,
619,
621,
625,
626,
634,
637,
638,
645,
654,
657,
659,
664,
665,
669,
681,
688,
690,
691,
698,
701,
703,
708,
713,
719,
732,
733,
735,
748,
752,
759,
760,
768,
778,
790,
803,
810,
815,
818,
823,
827,
830,
836,
850,
851,
861,
866,
869,
876,
886,
889,
891,
893,
901,
911,
918,
927,
929,
934,
946,
950,
951,
953,
954,
956,
962,
963,
966,
967,
970,
972,
973,
975,
977,
981,
983,
987,
989,
994,
1004,
1005,
1006,
1010,
1013,
1017,
1024,
1025,
1030,
1034,
1037,
1038,
1047,
1049,
1050,
1051,
1056,
1057,
1065,
1067,
1068,
1075,
1076,
1077,
1083,
1094,
1124,
1137,
1139,
1141
]
}
|
soccer_2016
|
How many players were born before 10/16/1975, and have a bowling skill of less than 3?
|
born before 10/16/1975 refers to DOB < 1975-10-16; bowling skill of less than 3 refers to Bowling_skill < 3
|
SELECT COUNT(*) FROM Player WHERE DOB < '1975-10-16' AND Bowling_skill < 3
|
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,929 | 1,929 |
CREATE TABLE `Player`
(
DOB DATE,
Bowling_skill INTEGER,
foreign key Bowling_skill references Bowling_StyleBowling_Id
)
|
[
"AND",
"SELECT",
"-",
"COUNT",
"FROM"
] | 6 |
simple
|
{
"case_1": [
2,
43,
259,
617,
1093
],
"case_2": [
2,
43,
259,
617,
1093
],
"case_3": [
2,
43,
212,
225,
229,
252,
259,
314,
349,
383,
509,
547,
548,
550,
564,
617,
654,
688,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1037,
1064,
1078,
1087,
1092,
1093,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
8,
9,
10,
11,
12,
13,
15,
16,
19,
20,
21,
22,
24,
25,
26,
27,
28,
30,
32,
33,
34,
35,
36,
37,
38,
39,
40,
42,
43,
44,
45,
47,
50,
51,
52,
53,
55,
56,
57,
61,
62,
63,
66,
67,
68,
69,
71,
73,
74,
75,
76,
77,
78,
79,
82,
85,
86,
87,
88,
89,
90,
91,
93,
95,
96,
97,
98,
99,
100,
105,
106,
108,
109,
111,
112,
113,
115,
116,
117,
118,
119,
121,
124,
125,
126,
127,
128,
129,
131,
135,
138,
140,
141,
142,
143,
144,
146,
147,
148,
152,
154,
157,
158,
159,
160,
163,
164,
167,
168,
169,
170,
172,
173,
175,
176,
177,
179,
180,
182,
183,
184,
185,
187,
188,
189,
190,
191,
192,
196,
197,
198,
199,
200,
202,
203,
206,
210,
212,
214,
216,
219,
223,
224,
225,
226,
227,
228,
229,
230,
233,
234,
239,
240,
243,
244,
247,
252,
253,
254,
255,
256,
258,
259,
261,
262,
265,
266,
267,
268,
269,
270,
271,
272,
273,
275,
276,
277,
278,
282,
286,
291,
293,
294,
296,
299,
300,
301,
303,
305,
311,
314,
315,
316,
317,
319,
320,
323,
325,
330,
334,
335,
336,
338,
339,
341,
344,
345,
348,
349,
350,
352,
354,
356,
358,
359,
360,
361,
362,
364,
367,
368,
370,
371,
373,
374,
375,
376,
380,
382,
383,
384,
385,
391,
392,
393,
394,
395,
396,
398,
399,
401,
402,
403,
405,
406,
408,
409,
410,
411,
412,
413,
414,
416,
417,
418,
419,
420,
421,
423,
424,
425,
426,
427,
428,
433,
436,
437,
438,
439,
440,
443,
444,
445,
446,
447,
448,
451,
452,
453,
454,
455,
458,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
473,
475,
476,
477,
478,
480,
481,
482,
484,
485,
487,
488,
489,
490,
492,
493,
494,
496,
497,
498,
500,
503,
504,
505,
507,
509,
510,
512,
514,
515,
516,
517,
519,
520,
522,
524,
526,
528,
529,
530,
531,
532,
533,
535,
536,
537,
538,
539,
541,
542,
543,
544,
545,
547,
548,
550,
551,
552,
554,
557,
558,
559,
560,
561,
562,
563,
564,
566,
573,
580,
581,
582,
584,
585,
586,
588,
589,
591,
594,
595,
596,
597,
598,
599,
601,
603,
605,
606,
608,
610,
611,
612,
613,
615,
617,
618,
620,
622,
624,
625,
626,
627,
629,
630,
632,
633,
634,
637,
641,
643,
645,
646,
647,
648,
649,
651,
654,
656,
658,
659,
660,
661,
662,
663,
664,
665,
666,
667,
668,
669,
671,
673,
675,
677,
678,
679,
680,
681,
683,
684,
685,
686,
687,
688,
689,
690,
692,
693,
694,
695,
696,
697,
698,
699,
702,
703,
705,
707,
709,
712,
714,
715,
716,
718,
719,
721,
726,
727,
729,
730,
733,
734,
735,
736,
737,
739,
740,
741,
743,
746,
747,
748,
749,
750,
752,
753,
754,
756,
757,
758,
760,
762,
763,
765,
767,
768,
769,
770,
772,
773,
775,
776,
777,
778,
779,
780,
783,
785,
787,
788,
790,
793,
794,
795,
796,
797,
798,
799,
800,
802,
804,
805,
806,
807,
808,
810,
811,
812,
813,
814,
817,
818,
819,
820,
821,
824,
825,
826,
827,
829,
830,
831,
832,
835,
838,
839,
840,
841,
843,
844,
848,
849,
851,
853,
855,
857,
858,
859,
860,
861,
864,
865,
866,
867,
869,
870,
873,
874,
876,
877,
878,
879,
882,
886,
888,
890,
892,
893,
894,
895,
896,
897,
898,
899,
901,
902,
903,
905,
907,
909,
911,
912,
913,
915,
917,
918,
920,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
941,
942,
943,
944,
945,
949,
950,
951,
953,
954,
955,
956,
958,
959,
960,
961,
963,
965,
968,
969,
972,
974,
975,
976,
977,
979,
980,
981,
983,
985,
986,
991,
993,
996,
998,
1000,
1001,
1005,
1006,
1008,
1009,
1010,
1011,
1013,
1014,
1015,
1017,
1018,
1019,
1020,
1022,
1023,
1027,
1030,
1031,
1037,
1039,
1042,
1043,
1044,
1046,
1047,
1050,
1051,
1052,
1053,
1055,
1057,
1058,
1059,
1061,
1062,
1063,
1064,
1067,
1068,
1069,
1070,
1071,
1072,
1073,
1074,
1076,
1077,
1078,
1079,
1080,
1081,
1082,
1084,
1086,
1087,
1090,
1092,
1093,
1094,
1096,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1115,
1117,
1119,
1121,
1123,
1124,
1126,
1127,
1128,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
What is the name of the youngest player?
|
name refers to Player_Name; youngest player refers to max(DOB)
|
SELECT Player_Name FROM Player ORDER BY DOB DESC LIMIT 1
|
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,930 | 1,930 |
CREATE TABLE `Player`
(
Player_Name TEXT,
DOB DATE
)
|
[
"SELECT",
"ORDER BY",
"LIMIT",
"FROM",
"DESC"
] | 5 |
simple
|
{
"case_1": [
43
],
"case_2": [
43
],
"case_3": [
43,
150,
229,
252,
314,
349,
548,
592,
654,
688,
713,
778,
951,
1024,
1037,
1065,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
1,
10,
11,
13,
15,
17,
20,
28,
29,
36,
38,
43,
49,
55,
59,
62,
69,
73,
75,
78,
86,
89,
108,
110,
121,
125,
133,
138,
150,
159,
162,
163,
167,
173,
174,
179,
181,
185,
187,
188,
199,
200,
202,
206,
208,
213,
229,
233,
239,
247,
252,
262,
263,
275,
278,
281,
285,
286,
291,
309,
311,
313,
314,
319,
320,
324,
328,
329,
334,
336,
337,
341,
342,
345,
348,
349,
352,
353,
356,
359,
364,
365,
371,
373,
378,
379,
381,
385,
394,
395,
400,
403,
404,
409,
411,
428,
429,
434,
435,
444,
445,
451,
454,
460,
462,
469,
482,
495,
497,
505,
530,
532,
534,
536,
538,
542,
548,
552,
555,
560,
566,
567,
576,
578,
579,
583,
584,
586,
590,
592,
595,
611,
619,
621,
625,
626,
634,
637,
638,
645,
654,
657,
659,
664,
665,
669,
681,
688,
690,
691,
698,
701,
703,
708,
713,
719,
732,
733,
735,
748,
752,
759,
760,
768,
778,
790,
803,
810,
815,
818,
823,
827,
830,
836,
850,
851,
861,
866,
869,
876,
886,
889,
891,
893,
901,
911,
918,
927,
929,
934,
946,
950,
951,
953,
954,
956,
962,
963,
966,
967,
970,
972,
973,
975,
977,
981,
983,
987,
989,
994,
1004,
1005,
1006,
1010,
1013,
1017,
1024,
1025,
1030,
1034,
1037,
1038,
1047,
1049,
1050,
1051,
1056,
1057,
1065,
1067,
1068,
1075,
1076,
1077,
1083,
1094,
1124,
1137,
1139,
1141
]
}
|
soccer_2016
|
Tally the player IDs of "Man of the Series" awardees for the seasons from 2011 to 2015.
|
seasons from 2011 to 2015 refers to 2011 < Season_Year < 2015
|
SELECT Man_of_the_Series FROM Season WHERE 2011 < Season_Year < 2015
|
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,931 | 1,931 |
CREATE TABLE `Season`
(
Man_of_the_Series INTEGER,
Season_Year INTEGER
)
|
[
"SELECT",
"FROM"
] | 2 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
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,
1001,
1002,
1003,
1004,
1005,
1006,
1007,
1008,
1009,
1010,
1011,
1012,
1013,
1014,
1015,
1016,
1017,
1018,
1019,
1020,
1021,
1022,
1023,
1024,
1025,
1026,
1027,
1028,
1029,
1030,
1031,
1032,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1040,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1053,
1054,
1055,
1056,
1057,
1058,
1059,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1073,
1074,
1075,
1076,
1077,
1078,
1079,
1080,
1081,
1082,
1083,
1084,
1085,
1086,
1087,
1088,
1089,
1090,
1091,
1092,
1093,
1094,
1095,
1096,
1097,
1098,
1099,
1100,
1101,
1102,
1103,
1104,
1105,
1106,
1107,
1108,
1109,
1110,
1111,
1112,
1113,
1114,
1115,
1116,
1117,
1118,
1119,
1120,
1121,
1122,
1123,
1124,
1125,
1126,
1127,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137,
1138,
1139,
1140,
1141
]
}
|
soccer_2016
|
What is the total number of runs scored by the batsmen during the 2nd inning of the match ID 335988?
|
number of runs refers to Runs_Scored; 2nd inning refers to Innings_No = 2
|
SELECT SUM(Runs_Scored) FROM Batsman_Scored WHERE Match_Id = 335988 AND Innings_No = 2
|
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,932 | 1,932 |
CREATE TABLE `Batsman_Scored`
(
Match_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key Match_Id, Innings_No,
foreign key Match_Id references MatchMatch_Id
)
|
[
"AND",
"SELECT",
"FROM",
"SUM"
] | 4 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
2,
43,
54,
122,
201,
205,
212,
225,
245,
259,
314,
383,
518,
547,
550,
564,
640,
714,
743,
787,
829,
943,
959,
979,
1064,
1078,
1087,
1092,
1093,
1098,
1110
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
2,
4,
5,
6,
8,
10,
12,
19,
20,
21,
22,
24,
26,
30,
32,
33,
35,
37,
38,
39,
40,
42,
43,
44,
45,
47,
50,
51,
52,
53,
54,
56,
57,
61,
63,
64,
66,
67,
68,
69,
71,
73,
74,
75,
76,
77,
79,
81,
83,
85,
87,
88,
90,
93,
94,
95,
96,
98,
99,
100,
104,
109,
111,
112,
113,
115,
116,
117,
118,
119,
120,
122,
125,
127,
128,
129,
131,
138,
141,
142,
143,
144,
146,
148,
152,
153,
154,
155,
158,
160,
163,
164,
168,
169,
170,
172,
173,
175,
176,
177,
180,
183,
184,
186,
187,
189,
191,
192,
195,
197,
200,
201,
205,
207,
212,
213,
214,
215,
219,
223,
225,
226,
227,
228,
230,
234,
236,
239,
240,
244,
245,
248,
254,
255,
256,
258,
259,
261,
262,
264,
265,
266,
267,
268,
270,
271,
272,
275,
276,
277,
278,
279,
282,
285,
294,
296,
300,
301,
304,
305,
313,
314,
315,
316,
317,
319,
323,
325,
330,
335,
339,
341,
347,
350,
356,
360,
361,
362,
363,
365,
367,
368,
370,
374,
376,
378,
379,
381,
382,
383,
385,
391,
393,
395,
398,
399,
402,
403,
405,
406,
408,
409,
412,
413,
414,
415,
416,
417,
418,
419,
421,
424,
425,
426,
427,
428,
433,
436,
437,
438,
439,
440,
444,
446,
448,
450,
451,
452,
453,
455,
463,
464,
469,
470,
475,
476,
477,
480,
482,
483,
486,
487,
488,
490,
492,
493,
494,
496,
497,
498,
500,
504,
506,
507,
510,
512,
514,
515,
516,
517,
518,
519,
520,
522,
524,
526,
527,
528,
529,
530,
533,
535,
537,
539,
540,
541,
544,
547,
550,
551,
554,
557,
558,
559,
561,
562,
563,
564,
571,
575,
579,
580,
581,
582,
584,
586,
588,
589,
591,
594,
595,
597,
599,
601,
605,
608,
609,
610,
612,
613,
615,
618,
622,
623,
624,
625,
626,
627,
628,
630,
632,
633,
637,
638,
640,
641,
643,
648,
650,
651,
656,
658,
662,
663,
666,
667,
668,
671,
675,
676,
677,
678,
679,
680,
682,
683,
684,
685,
686,
687,
690,
692,
693,
695,
697,
699,
701,
702,
707,
709,
710,
712,
714,
715,
716,
717,
718,
719,
723,
726,
727,
730,
734,
735,
739,
740,
741,
743,
744,
745,
746,
747,
749,
750,
753,
754,
756,
758,
760,
762,
763,
765,
767,
768,
773,
775,
776,
777,
780,
783,
785,
787,
788,
793,
794,
795,
796,
797,
798,
799,
800,
802,
804,
806,
807,
808,
810,
813,
814,
817,
819,
820,
823,
824,
825,
827,
829,
830,
831,
832,
835,
838,
840,
841,
843,
844,
848,
849,
851,
853,
855,
858,
859,
860,
861,
864,
867,
868,
870,
871,
872,
873,
874,
877,
878,
879,
886,
888,
892,
894,
895,
896,
902,
903,
905,
907,
909,
912,
913,
917,
920,
922,
923,
924,
928,
929,
930,
931,
932,
935,
939,
943,
944,
945,
949,
953,
954,
956,
958,
959,
961,
962,
965,
969,
973,
974,
979,
985,
986,
987,
991,
996,
998,
1000,
1001,
1008,
1009,
1012,
1014,
1017,
1018,
1019,
1020,
1022,
1023,
1027,
1031,
1038,
1039,
1042,
1044,
1046,
1058,
1059,
1061,
1063,
1064,
1067,
1068,
1069,
1071,
1072,
1073,
1078,
1079,
1080,
1081,
1082,
1084,
1086,
1087,
1092,
1093,
1098,
1100,
1101,
1103,
1104,
1105,
1109,
1110,
1115,
1117,
1119,
1121,
1123,
1126,
1128,
1131,
1135,
1136
]
}
|
soccer_2016
|
Between match nos. 335989 and 337000, how many times did a batsman score more than 3 runs during over no. 1, ball no. 1, and inning no. 1 of the matches?
|
Between match no. 335989 and 337000 refers to 335989 < Match_Id < 337000; batsman score more than 3 runs during over no. 1, ball no. 1, and inning no. 1 of the matches refers to Runs_Scored > 3 and Over_Id = 1 and Ball_Id = 1 and Innings_No = 1
|
SELECT SUM(CASE WHEN Runs_Scored > 3 THEN 1 ELSE 0 END) FROM Batsman_Scored WHERE 335989 < Match_Id < 337000 AND Innings_No = 1 AND Over_Id = 1 AND Ball_Id = 1
|
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,933 | 1,933 |
CREATE TABLE `Batsman_Scored`
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key Match_Id, Over_Id, Ball_Id, Innings_No,
foreign key Match_Id references MatchMatch_Id
)
|
[
"CASE WHEN",
"AND",
"SELECT",
"SUM",
"CASE",
"FROM"
] | 8 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
54,
122,
201,
205,
212,
225,
245,
383,
518,
547,
550,
564,
640,
787,
943,
959,
979,
1064,
1078,
1087,
1092,
1093,
1098,
1110
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
6,
16,
24,
39,
42,
54,
61,
64,
71,
77,
81,
93,
104,
106,
112,
113,
120,
122,
127,
129,
141,
148,
152,
153,
155,
158,
169,
173,
184,
191,
192,
195,
201,
205,
207,
212,
215,
219,
223,
225,
226,
234,
236,
245,
248,
258,
261,
264,
267,
271,
279,
299,
300,
304,
305,
317,
322,
335,
347,
350,
356,
360,
362,
375,
383,
393,
398,
402,
406,
412,
415,
423,
427,
438,
448,
452,
453,
458,
470,
476,
478,
485,
486,
500,
504,
508,
510,
514,
517,
518,
528,
535,
537,
540,
547,
550,
563,
564,
571,
573,
575,
580,
581,
601,
612,
620,
623,
628,
640,
646,
662,
666,
676,
682,
686,
690,
709,
710,
723,
740,
744,
747,
753,
762,
772,
776,
777,
787,
788,
795,
796,
798,
800,
808,
810,
825,
827,
832,
841,
844,
848,
868,
870,
871,
872,
874,
896,
909,
912,
922,
924,
926,
939,
943,
944,
958,
959,
979,
985,
998,
1008,
1012,
1023,
1027,
1031,
1036,
1048,
1062,
1064,
1068,
1069,
1078,
1082,
1087,
1092,
1093,
1098,
1100,
1110,
1121,
1129,
1131,
1133,
1134,
1135
]
}
|
soccer_2016
|
Give me the match ID and date of the matches that were held in Kingsmead for three consecutive days.
|
date of the matches refers to Match_Date; held in Kingsmead refers to Venue_Name = 'Kingsmead'
|
SELECT T1.Match_Id, T1.Match_Date FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE T2.Venue_Name = 'Kingsmead'
|
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,934 | 1,934 |
CREATE TABLE `Venue`
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT
)
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Match_Date DATE,
Venue_Id INTEGER,
foreign key Venue_Id references VenueVenue_Id
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
688,
1092
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
506,
507,
508,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
653,
654,
655,
657,
658,
659,
660,
661,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
978,
980,
981,
982,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1075,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
How many times did the matches were held in MA Chidambaram Stadium from 5/9/2009 to 8/8/2011?
|
MA Chidambaram Stadium refers to Venue_Name = 'MA Chidambaram Stadium' ; from 5/9/2009 to 8/8/2011 refers to Match_Date between '2009-05-09' and '2011-08-08'
|
SELECT SUM(CASE WHEN Venue_Name = 'MA Chidambaram Stadium' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE Match_Date BETWEEN '2009-05-09' AND '2011-08-08'
|
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,935 | 1,935 |
CREATE TABLE `Venue`
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT
)
CREATE TABLE `Match`
(
Match_Date DATE,
Venue_Id INTEGER,
foreign key Venue_Id references VenueVenue_Id
)
|
[
"CASE WHEN",
"AS",
"AND",
"SELECT",
"SUM",
"CASE",
"-",
"INNER JOIN",
"ON",
"BETWEEN",
"FROM"
] | 15 |
medium
|
{
"case_1": [
1092
],
"case_2": [
1092
],
"case_3": [
2,
201,
212,
225,
314,
383,
509,
518,
547,
550,
564,
640,
714,
743,
787,
829,
943,
959,
979,
1064,
1078,
1087,
1092,
1093,
1098
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
2,
3,
4,
5,
6,
8,
12,
16,
19,
20,
21,
22,
24,
26,
30,
33,
34,
37,
39,
42,
44,
45,
47,
51,
52,
53,
57,
61,
63,
64,
66,
68,
69,
71,
73,
74,
75,
76,
77,
81,
83,
85,
88,
90,
93,
94,
95,
96,
97,
98,
99,
104,
105,
106,
111,
112,
113,
115,
116,
117,
118,
119,
120,
125,
127,
128,
129,
131,
135,
138,
141,
142,
143,
144,
146,
148,
152,
153,
154,
155,
158,
160,
163,
164,
169,
170,
171,
172,
173,
175,
176,
177,
180,
183,
184,
186,
187,
189,
191,
192,
195,
197,
199,
200,
201,
207,
212,
213,
214,
215,
219,
223,
225,
226,
227,
228,
234,
236,
239,
240,
244,
248,
254,
256,
258,
261,
262,
264,
265,
266,
267,
268,
271,
272,
275,
276,
277,
278,
279,
282,
296,
298,
299,
300,
301,
304,
305,
313,
314,
315,
316,
317,
319,
322,
323,
325,
330,
335,
339,
341,
347,
356,
360,
361,
362,
363,
365,
368,
370,
374,
375,
376,
378,
379,
381,
382,
383,
385,
391,
392,
393,
394,
395,
398,
402,
403,
405,
406,
408,
409,
412,
413,
414,
415,
416,
417,
419,
424,
425,
426,
427,
428,
433,
436,
437,
438,
440,
444,
445,
446,
448,
450,
451,
452,
453,
455,
463,
464,
469,
470,
475,
476,
477,
478,
479,
480,
482,
483,
486,
487,
488,
489,
490,
493,
494,
496,
497,
498,
500,
503,
504,
507,
509,
510,
514,
515,
516,
517,
518,
519,
520,
522,
524,
526,
528,
529,
530,
533,
535,
537,
539,
540,
541,
544,
547,
550,
557,
558,
559,
561,
562,
563,
564,
571,
573,
575,
579,
580,
581,
582,
584,
586,
588,
589,
595,
597,
601,
605,
608,
609,
610,
612,
613,
615,
620,
623,
624,
625,
626,
627,
628,
630,
632,
633,
637,
638,
640,
641,
643,
646,
647,
648,
649,
650,
651,
658,
660,
662,
663,
666,
668,
671,
672,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
690,
693,
695,
697,
699,
701,
702,
706,
709,
710,
712,
714,
715,
717,
723,
726,
727,
734,
735,
739,
740,
741,
743,
744,
745,
746,
747,
749,
750,
753,
754,
756,
758,
760,
762,
763,
765,
767,
768,
772,
773,
775,
776,
777,
780,
783,
787,
788,
793,
795,
796,
797,
798,
799,
800,
802,
804,
805,
806,
807,
808,
810,
813,
814,
819,
823,
824,
825,
827,
829,
830,
832,
835,
838,
841,
844,
848,
849,
851,
853,
858,
859,
860,
861,
867,
868,
870,
871,
873,
874,
877,
878,
879,
880,
882,
886,
888,
892,
895,
896,
902,
905,
907,
909,
912,
917,
922,
923,
924,
925,
926,
928,
930,
931,
932,
935,
943,
944,
949,
953,
954,
956,
958,
959,
961,
962,
969,
973,
974,
979,
980,
985,
986,
991,
993,
996,
998,
1000,
1001,
1008,
1012,
1017,
1019,
1022,
1023,
1027,
1031,
1038,
1039,
1042,
1044,
1046,
1052,
1058,
1061,
1062,
1063,
1064,
1066,
1067,
1068,
1069,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1086,
1087,
1092,
1093,
1098,
1100,
1101,
1103,
1104,
1105,
1109,
1111,
1115,
1119,
1123,
1128,
1131,
1132,
1133,
1134,
1135,
1136
]
}
|
soccer_2016
|
Where was the ID 336005 match held? Please give me the venue and the city.
|
ID 336005 match refers to Match_Id = '336005'; venue refers to Venue_Name; city refers to City_Name
|
SELECT T2.Venue_Name, T3.City_Name FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id INNER JOIN City AS T3 ON T2.City_Id = T3.City_Id WHERE T1.Match_Id = '336005'
|
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,936 | 1,936 |
CREATE TABLE `City`
(
City_Id INTEGER
primary key,
City_Name TEXT
)
CREATE TABLE `Venue`
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key City_Id references CityCity_Id
)
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Venue_Id INTEGER,
foreign key Venue_Id references VenueVenue_Id
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 9 |
simple
|
{
"case_1": [
134
],
"case_2": [
134,
225
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
506,
507,
508,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
653,
654,
655,
657,
658,
659,
660,
661,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
978,
980,
981,
982,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1075,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Which team wins the toss during the match ID 336011, and can you tell me whether they decided to bat or field?
|
wins the toss refers to Toss_Winner; whether they decided to bat or field refers to Toss_Name
|
SELECT T2.Toss_Name, T1.Toss_Decide, T1.Toss_Winner FROM `Match` AS T1 INNER JOIN Toss_Decision AS T2 ON T1.Toss_Decide = T2.Toss_Id WHERE T1.Match_Id = '336011'
|
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,937 | 1,937 |
CREATE TABLE `Toss_Decision`
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
foreign key Toss_Winner references TeamTeam_Id,
foreign key Toss_Decide references Toss_DecisionToss_Id
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
383
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
506,
507,
508,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
653,
654,
655,
657,
658,
659,
660,
661,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
978,
980,
981,
982,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1075,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Among the South African players, how many were born before 4/11/1980?
|
South African players refers to Country_Name = 'South Africa'; born before 4/11/1980 refers to DOB < '1980-4-11'
|
SELECT SUM(CASE WHEN T1.DOB < '1980-4-11' THEN 1 ELSE 0 END) FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_Id WHERE T2.Country_Name = 'South Africa'
|
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,938 | 1,938 |
CREATE TABLE `Country`
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key Country_Id references CountryCountry_Id
)
CREATE TABLE `Player`
(
DOB DATE,
Country_Name INTEGER,
foreign key Country_Name references CountryCountry_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"CASE",
"-",
"INNER JOIN",
"ON",
"FROM"
] | 11 |
medium
|
{
"case_1": [
150,
349
],
"case_2": [
150,
349
],
"case_3": [
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1110,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
54,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
122,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
173,
175,
176,
177,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
205,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
245,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
362,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
507,
508,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
709,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
872,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
939,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
979,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1093,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1110,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Write down the name of players whose bowling skill is Legbreak.
|
name of players refers to Player_Name
|
SELECT T2.Player_Name FROM Bowling_Style AS T1 INNER JOIN Player AS T2 ON T1.Bowling_Id = T2.Bowling_skill WHERE T1.Bowling_skill = 'Legbreak'
|
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,939 | 1,939 |
CREATE TABLE `Bowling_Style`
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE `Player`
(
Player_Name TEXT,
Bowling_skill INTEGER,
foreign key Bowling_skill references Bowling_StyleBowling_Id
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
509,
644
],
"case_2": [
509,
644,
1037
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
506,
507,
508,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
653,
654,
655,
657,
658,
659,
660,
661,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
978,
980,
981,
982,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1075,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
When and for what role did the youngest player appear in his first match?
|
When refers to Match_Date; youngest player refers to max(DOB); first match refers to min(Match_Date)
|
SELECT T1.Match_Date, T4.Role_Desc FROM `Match` AS T1 INNER JOIN Player_Match AS T2 ON T1.Match_Id = T2.Match_Id INNER JOIN Player AS T3 ON T2.Player_Id = T3.Player_Id INNER JOIN Rolee AS T4 ON T2.Role_Id = T4.Role_Id ORDER BY T3.DOB DESC LIMIT 1
|
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,940 | 1,940 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
DOB DATE
)
CREATE TABLE `Rolee`
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Match_Date DATE
)
CREATE TABLE `Player_Match`
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
primary key Match_Id, Player_Id, Role_Id,
foreign key Match_Id references MatchMatch_Id,
foreign key Player_Id references PlayerPlayer_Id,
foreign key Role_Id references RoleeRole_Id
)
|
[
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"FROM"
] | 15 |
medium
|
{
"case_1": [
-1
],
"case_2": [
787
],
"case_3": [
134,
150,
201,
212,
225,
229,
232,
252,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
26,
27,
28,
29,
30,
33,
34,
36,
37,
38,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
78,
80,
81,
82,
83,
84,
85,
86,
88,
89,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
108,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
133,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
173,
174,
175,
176,
177,
179,
180,
181,
183,
184,
185,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
208,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
252,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
285,
286,
287,
289,
290,
291,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
337,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
348,
349,
352,
353,
354,
356,
357,
358,
359,
360,
361,
363,
364,
365,
368,
369,
370,
371,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
400,
401,
402,
403,
404,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
534,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
576,
577,
578,
579,
580,
581,
582,
583,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
619,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
664,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
698,
699,
700,
701,
702,
703,
704,
705,
706,
708,
710,
711,
712,
714,
715,
717,
719,
720,
721,
722,
723,
724,
725,
726,
727,
728,
732,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
748,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
815,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
836,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
869,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
943,
944,
946,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
972,
973,
974,
975,
977,
980,
981,
983,
985,
986,
987,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1010,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1030,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1057,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1071,
1072,
1074,
1076,
1077,
1078,
1080,
1082,
1083,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137,
1139,
1141
]
}
|
soccer_2016
|
Tally the match IDs in which V Kohli is the "Man of the Match".
|
SELECT T1.Match_Id FROM `Match` AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Match = T2.Player_Id WHERE T2.Player_Name = 'V Kohli'
|
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,941 | 1,941 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Man_of_the_Match INTEGER,
foreign key Man_of_the_Match references PlayerPlayer_Id
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
1124
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
506,
507,
508,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
653,
654,
655,
657,
658,
659,
660,
661,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
978,
980,
981,
982,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1075,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
|
soccer_2016
|
From 2011 to 2012, how many Australian players became the "Man of the Match"?
|
From 2011 to 2012 refers to Match_Date between '2011%' and '2012%'; Australian players refers to Country_Name = 'Australia'
|
SELECT SUM(CASE WHEN T1.Match_Date BETWEEN '2011%' AND '2012%' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Player AS T2 ON T2.Player_Id = T1.Man_of_the_Match INNER JOIN Country AS T3 ON T3.Country_Id = T2.Country_Name WHERE T3.Country_Name = 'Australia'
|
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,942 | 1,942 |
CREATE TABLE `Country`
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key Country_Id references CountryCountry_Id
)
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Country_Name INTEGER,
foreign key Country_Name references CountryCountry_Id
)
CREATE TABLE `Match`
(
Match_Date DATE,
Man_of_the_Match INTEGER,
foreign key Man_of_the_Match references PlayerPlayer_Id
)
|
[
"CASE WHEN",
"AS",
"AND",
"SELECT",
"SUM",
"CASE",
"INNER JOIN",
"ON",
"BETWEEN",
"FROM"
] | 14 |
medium
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
201,
212,
225,
314,
383,
518,
547,
550,
564,
640,
714,
743,
787,
829,
943,
959,
1064,
1078,
1087,
1092,
1098
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
4,
5,
6,
8,
12,
16,
19,
20,
21,
22,
24,
26,
30,
33,
37,
39,
42,
44,
45,
47,
51,
52,
53,
57,
61,
63,
64,
66,
68,
69,
71,
73,
74,
75,
76,
77,
81,
83,
85,
88,
90,
93,
94,
95,
96,
98,
99,
104,
106,
111,
112,
113,
115,
116,
117,
118,
119,
120,
125,
127,
128,
129,
131,
138,
141,
142,
143,
144,
146,
148,
152,
153,
154,
155,
158,
160,
163,
164,
169,
170,
171,
172,
173,
175,
176,
177,
180,
183,
184,
186,
187,
189,
191,
192,
195,
197,
200,
201,
207,
212,
213,
214,
215,
219,
223,
225,
226,
227,
228,
234,
236,
239,
240,
244,
248,
254,
256,
258,
261,
262,
264,
265,
266,
267,
268,
271,
272,
275,
276,
277,
278,
279,
282,
296,
298,
299,
300,
301,
304,
305,
313,
314,
315,
316,
317,
319,
322,
323,
325,
330,
335,
339,
341,
347,
356,
360,
361,
363,
365,
368,
370,
374,
375,
376,
378,
379,
381,
382,
383,
385,
391,
393,
395,
398,
402,
403,
405,
406,
408,
409,
412,
413,
414,
415,
416,
417,
419,
424,
425,
426,
427,
428,
433,
436,
437,
438,
440,
444,
446,
448,
450,
451,
452,
453,
455,
463,
464,
469,
470,
475,
476,
477,
478,
479,
480,
482,
483,
486,
487,
488,
490,
493,
494,
496,
497,
498,
500,
504,
507,
514,
515,
516,
517,
518,
519,
520,
522,
524,
526,
528,
529,
530,
533,
535,
537,
539,
540,
541,
544,
547,
550,
557,
558,
559,
561,
562,
563,
564,
571,
573,
575,
579,
580,
581,
582,
584,
586,
588,
589,
595,
597,
605,
608,
609,
610,
612,
613,
615,
620,
623,
624,
625,
626,
627,
628,
630,
632,
633,
637,
638,
640,
641,
643,
646,
648,
650,
651,
658,
662,
663,
666,
668,
671,
672,
675,
676,
677,
678,
682,
683,
684,
685,
686,
687,
690,
693,
695,
697,
699,
701,
702,
706,
710,
712,
714,
715,
717,
723,
726,
727,
734,
735,
739,
740,
741,
743,
744,
745,
746,
747,
749,
750,
753,
754,
756,
758,
760,
762,
763,
765,
767,
768,
772,
773,
775,
776,
777,
780,
783,
787,
788,
793,
795,
796,
797,
798,
799,
800,
802,
804,
805,
806,
807,
808,
810,
813,
814,
819,
823,
824,
825,
827,
829,
830,
832,
835,
838,
841,
844,
848,
849,
851,
853,
858,
859,
860,
861,
867,
868,
870,
871,
873,
874,
877,
878,
879,
880,
886,
888,
892,
895,
896,
902,
905,
907,
909,
912,
917,
922,
923,
924,
926,
928,
930,
931,
932,
935,
943,
944,
949,
953,
954,
956,
958,
959,
961,
962,
969,
973,
974,
985,
986,
991,
996,
998,
1000,
1001,
1008,
1012,
1017,
1019,
1022,
1023,
1027,
1031,
1038,
1039,
1042,
1044,
1046,
1058,
1061,
1062,
1063,
1064,
1066,
1067,
1068,
1069,
1071,
1072,
1078,
1080,
1082,
1084,
1086,
1087,
1092,
1098,
1100,
1101,
1103,
1104,
1105,
1109,
1115,
1119,
1123,
1128,
1131,
1133,
1134,
1135,
1136
]
}
|
soccer_2016
|
Who among the players won both "Man of the Series" and "Orange Cap" in the same season?
|
Who refers to Player_Name;
|
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Season AS T2 ON T1.Player_Id = T2.Man_of_the_Series = T2.Orange_Cap
|
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,943 | 1,943 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Season`
(
Man_of_the_Series INTEGER,
Orange_Cap INTEGER
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
506,
507,
508,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
653,
654,
655,
657,
658,
659,
660,
661,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
978,
980,
981,
982,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1075,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
When did the Sunrisers Hyderabad win their first match?
|
Sunrisers Hyderabad refers to Team_Name = 'Sunrisers Hyderabad'; win their first match refers to Match_Winner and min(Match_Date)
|
SELECT T1.Match_Date FROM `Match` AS T1 INNER JOIN Team AS T2 ON T1.Match_Winner = T2.Team_Id WHERE T2.Team_Name = 'Sunrisers Hyderabad'
|
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,944 | 1,944 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Match_Date DATE,
Match_Winner INTEGER,
foreign key Match_Winner references TeamTeam_Id
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
592,
1098
],
"case_2": [
212,
592,
829,
1064,
1087,
1098
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
506,
507,
508,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
653,
654,
655,
657,
658,
659,
660,
661,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
978,
980,
981,
982,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1075,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Write down the player names and IDs of the English umpires.
|
English umpires refers to Country_Name = 'England'
|
SELECT T1.Umpire_Name, T1.Umpire_Id FROM Umpire AS T1 INNER JOIN Country AS T2 ON T1.Umpire_Country = T2.Country_Id WHERE T2.Country_Name = 'England'
|
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,945 | 1,945 |
CREATE TABLE `Country`
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key Country_Id references CountryCountry_Id
)
CREATE TABLE `Umpire`
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key Umpire_Country references CountryCountry_Id
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
506,
507,
508,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
653,
654,
655,
657,
658,
659,
660,
661,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
978,
980,
981,
982,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1075,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Calculate the run rate at the end of 17 overs of the match ID 335987 on 4/18/2008.
|
4/18/2008 refers to Match_Date = 4/18/2008; end of 17 overs refers to count(Toss_Name = 'field' ) = 17; run rate = divide(sum(Runs_Scored) when Toss_Name = 'bat', sum(Over_Id) when Toss_Name = 'field')
|
SELECT CAST(COUNT(CASE WHEN T1.Toss_Name = 'bat' THEN T3.Runs_Scored ELSE NULL END) AS REAL) / SUM(CASE WHEN T1.Toss_Name = 'field' THEN 1 ELSE 0 END) FROM Toss_Decision AS T1 INNER JOIN Match AS T2 ON T1.Toss_Id = T2.Toss_Decide INNER JOIN Batsman_Scored AS T3 ON T2.Match_Id = T3.Match_Id WHERE T2.Match_Id = 335987 AND T2.Match_Date = '2008-04-18' GROUP BY T3.Over_Id HAVING COUNT(T1.Toss_Name = 'field') = 17
|
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,946 | 1,946 |
CREATE TABLE `Toss_Decision`
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Match_Date DATE,
Toss_Decide INTEGER,
foreign key Toss_Decide references Toss_DecisionToss_Id
)
CREATE TABLE `Batsman_Scored`
(
Match_Id INTEGER,
Over_Id INTEGER,
Runs_Scored INTEGER,
primary key Match_Id, Over_Id,
foreign key Match_Id references MatchMatch_Id
)
|
[
"GROUP BY",
"CASE WHEN",
"AS",
"AND",
"SELECT",
"HAVING",
"SUM",
"CASE",
"-",
"NULL",
"INNER JOIN",
"ON",
"CAST",
"COUNT",
"FROM"
] | 24 |
challenging
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
201,
212,
225,
314,
383,
518,
547,
550,
564,
640,
743,
787,
943,
959,
1064,
1078,
1087,
1092,
1098
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
6,
16,
22,
24,
39,
42,
53,
61,
64,
69,
71,
73,
74,
75,
77,
81,
93,
98,
106,
112,
113,
115,
119,
120,
125,
126,
127,
129,
140,
141,
142,
143,
148,
152,
153,
155,
158,
169,
173,
183,
184,
187,
189,
191,
192,
195,
197,
199,
201,
207,
212,
214,
219,
223,
225,
226,
234,
236,
244,
248,
254,
258,
261,
264,
267,
271,
279,
299,
300,
304,
314,
316,
317,
319,
322,
323,
325,
335,
339,
341,
344,
347,
356,
360,
375,
382,
383,
391,
393,
394,
398,
402,
403,
406,
409,
412,
415,
416,
423,
424,
427,
436,
438,
444,
445,
448,
452,
453,
458,
473,
476,
478,
485,
486,
487,
493,
500,
504,
510,
514,
516,
517,
518,
520,
522,
528,
535,
537,
540,
544,
547,
550,
559,
560,
563,
564,
571,
573,
575,
580,
581,
595,
597,
620,
623,
628,
630,
640,
646,
658,
662,
666,
676,
681,
682,
686,
690,
696,
710,
712,
721,
723,
735,
740,
743,
744,
747,
750,
753,
756,
760,
762,
768,
772,
776,
777,
787,
788,
795,
796,
798,
800,
802,
805,
808,
810,
813,
827,
830,
832,
838,
841,
844,
848,
851,
868,
870,
871,
874,
886,
894,
896,
909,
912,
922,
924,
926,
927,
930,
935,
943,
944,
954,
956,
958,
959,
985,
993,
998,
1008,
1012,
1023,
1031,
1043,
1062,
1064,
1067,
1068,
1069,
1072,
1078,
1082,
1087,
1092,
1098,
1100,
1101,
1106,
1123,
1128,
1131,
1133,
1134,
1135
]
}
|
soccer_2016
|
Compute the run rate at the end of 16 overs of the match ID 335999. Please include the name of the "Man of_the Match".
|
end of 16 overs refers to count(Toss_Name = 'field' ) = 16; run rate = divide(count(Runs_Scored) when Toss_Name = 'bat', sum(Over_Id)when Toss_Name = 'field'); name refers to Player_Name
|
SELECT CAST(COUNT(CASE WHEN T1.Toss_Name = 'bat' THEN T3.Runs_Scored ELSE NULL END) AS REAL) / SUM(CASE WHEN T1.Toss_Name = 'field' THEN 1 ELSE 0 END) FROM Toss_Decision AS T1 INNER JOIN Match AS T2 ON T1.Toss_Id = T2.Toss_Decide INNER JOIN Batsman_Scored AS T3 ON T2.Match_Id = T3.Match_Id WHERE T2.Match_Id = 335987 AND T2.Match_Date = '2008-04-18' GROUP BY T3.Over_Id HAVING COUNT(T1.Toss_Name = 'field') = 16
|
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,947 | 1,947 |
CREATE TABLE `Toss_Decision`
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Match_Date DATE,
Toss_Decide INTEGER,
foreign key Toss_Decide references Toss_DecisionToss_Id
)
CREATE TABLE `Batsman_Scored`
(
Match_Id INTEGER,
Over_Id INTEGER,
Runs_Scored INTEGER,
primary key Match_Id, Over_Id,
foreign key Match_Id references MatchMatch_Id
)
|
[
"GROUP BY",
"CASE WHEN",
"AS",
"AND",
"SELECT",
"HAVING",
"SUM",
"CASE",
"-",
"NULL",
"INNER JOIN",
"ON",
"CAST",
"COUNT",
"FROM"
] | 24 |
challenging
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
201,
212,
225,
314,
383,
518,
547,
550,
564,
640,
743,
787,
943,
959,
1064,
1078,
1087,
1092,
1098
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
6,
16,
22,
24,
39,
42,
53,
61,
64,
69,
71,
73,
74,
75,
77,
81,
93,
98,
106,
112,
113,
115,
119,
120,
125,
126,
127,
129,
140,
141,
142,
143,
148,
152,
153,
155,
158,
169,
173,
183,
184,
187,
189,
191,
192,
195,
197,
199,
201,
207,
212,
214,
219,
223,
225,
226,
234,
236,
244,
248,
254,
258,
261,
264,
267,
271,
279,
299,
300,
304,
314,
316,
317,
319,
322,
323,
325,
335,
339,
341,
344,
347,
356,
360,
375,
382,
383,
391,
393,
394,
398,
402,
403,
406,
409,
412,
415,
416,
423,
424,
427,
436,
438,
444,
445,
448,
452,
453,
458,
473,
476,
478,
485,
486,
487,
493,
500,
504,
510,
514,
516,
517,
518,
520,
522,
528,
535,
537,
540,
544,
547,
550,
559,
560,
563,
564,
571,
573,
575,
580,
581,
595,
597,
620,
623,
628,
630,
640,
646,
658,
662,
666,
676,
681,
682,
686,
690,
696,
710,
712,
721,
723,
735,
740,
743,
744,
747,
750,
753,
756,
760,
762,
768,
772,
776,
777,
787,
788,
795,
796,
798,
800,
802,
805,
808,
810,
813,
827,
830,
832,
838,
841,
844,
848,
851,
868,
870,
871,
874,
886,
894,
896,
909,
912,
922,
924,
926,
927,
930,
935,
943,
944,
954,
956,
958,
959,
985,
993,
998,
1008,
1012,
1023,
1031,
1043,
1062,
1064,
1067,
1068,
1069,
1072,
1078,
1082,
1087,
1092,
1098,
1100,
1101,
1106,
1123,
1128,
1131,
1133,
1134,
1135
]
}
|
soccer_2016
|
What is the id of the team with the highest number of matches won?
|
id of the team refers to Team_Id; highest number of matches won refers to max(count(Match_Winner))
|
SELECT Match_Id FROM `Match` ORDER BY Match_Winner DESC LIMIT 1
|
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,948 | 1,948 |
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Match_Winner INTEGER,
foreign key Match_Winner references TeamTeam_Id
)
|
[
"SELECT",
"ORDER BY",
"LIMIT",
"FROM",
"DESC"
] | 5 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
43,
150,
229,
252,
314,
349,
548,
592,
654,
688,
713,
778,
951,
1024,
1037,
1065,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
1,
10,
11,
13,
15,
17,
20,
28,
29,
36,
38,
43,
49,
55,
59,
62,
69,
73,
75,
78,
86,
89,
108,
110,
121,
125,
133,
138,
150,
159,
162,
163,
167,
173,
174,
179,
181,
185,
187,
188,
199,
200,
202,
206,
208,
213,
229,
233,
239,
247,
252,
262,
263,
275,
278,
281,
285,
286,
291,
309,
311,
313,
314,
319,
320,
324,
328,
329,
334,
336,
337,
341,
342,
345,
348,
349,
352,
353,
356,
359,
364,
365,
371,
373,
378,
379,
381,
385,
394,
395,
400,
403,
404,
409,
411,
428,
429,
434,
435,
444,
445,
451,
454,
460,
462,
469,
482,
495,
497,
505,
530,
532,
534,
536,
538,
542,
548,
552,
555,
560,
566,
567,
576,
578,
579,
583,
584,
586,
590,
592,
595,
611,
619,
621,
625,
626,
634,
637,
638,
645,
654,
657,
659,
664,
665,
669,
681,
688,
690,
691,
698,
701,
703,
708,
713,
719,
732,
733,
735,
748,
752,
759,
760,
768,
778,
790,
803,
810,
815,
818,
823,
827,
830,
836,
850,
851,
861,
866,
869,
876,
886,
889,
891,
893,
901,
911,
918,
927,
929,
934,
946,
950,
951,
953,
954,
956,
962,
963,
966,
967,
970,
972,
973,
975,
977,
981,
983,
987,
989,
994,
1004,
1005,
1006,
1010,
1013,
1017,
1024,
1025,
1030,
1034,
1037,
1038,
1047,
1049,
1050,
1051,
1056,
1057,
1065,
1067,
1068,
1075,
1076,
1077,
1083,
1094,
1124,
1137,
1139,
1141
]
}
|
soccer_2016
|
Which year do the majority of the players were born?
|
year refers to DOB; majority of the players refers to max(count(Player_Id))
|
SELECT DOB FROM Player GROUP BY DOB ORDER BY COUNT(DOB) DESC LIMIT 1
|
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,949 | 1,949 |
CREATE TABLE `Player`
(
DOB DATE
)
|
[
"GROUP BY",
"SELECT",
"ORDER BY",
"LIMIT",
"COUNT",
"FROM",
"DESC"
] | 7 |
simple
|
{
"case_1": [
43
],
"case_2": [
43
],
"case_3": [
43,
150,
229,
252,
314,
349,
548,
592,
654,
688,
713,
743,
778,
951,
1024,
1037,
1065,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
1,
10,
11,
13,
15,
17,
20,
22,
28,
29,
36,
38,
43,
49,
55,
59,
62,
69,
73,
75,
78,
86,
89,
108,
115,
121,
125,
126,
133,
138,
140,
142,
143,
150,
159,
162,
163,
167,
169,
173,
174,
179,
181,
182,
185,
187,
188,
191,
199,
202,
206,
208,
213,
214,
229,
233,
247,
252,
262,
263,
275,
278,
281,
285,
286,
291,
309,
311,
313,
314,
319,
320,
324,
329,
334,
336,
337,
341,
342,
344,
345,
348,
349,
352,
353,
356,
359,
364,
365,
371,
373,
378,
379,
381,
385,
394,
395,
400,
403,
404,
409,
411,
424,
428,
429,
434,
435,
444,
445,
451,
454,
460,
462,
466,
469,
473,
481,
482,
495,
497,
505,
530,
532,
534,
536,
538,
542,
548,
552,
555,
560,
566,
567,
576,
578,
579,
583,
584,
586,
590,
592,
595,
611,
619,
621,
625,
626,
630,
634,
637,
638,
645,
654,
657,
659,
664,
665,
669,
681,
688,
690,
691,
696,
698,
701,
703,
708,
713,
718,
719,
721,
732,
733,
735,
743,
748,
752,
759,
760,
768,
778,
779,
790,
803,
810,
815,
817,
818,
823,
827,
830,
836,
850,
851,
861,
866,
869,
876,
886,
889,
891,
893,
901,
911,
918,
927,
929,
934,
946,
950,
951,
954,
956,
962,
963,
966,
967,
970,
972,
973,
975,
977,
981,
983,
987,
989,
993,
994,
1004,
1005,
1006,
1010,
1013,
1017,
1024,
1025,
1030,
1034,
1037,
1038,
1043,
1047,
1049,
1050,
1051,
1056,
1057,
1065,
1067,
1068,
1070,
1076,
1077,
1083,
1094,
1106,
1124,
1135,
1137,
1139,
1141
]
}
|
soccer_2016
|
What is the date of the match that has the highest wager on the final result of a game?
|
date of the match refers to Match_Date; highest wager refers to max(Win_Margin)
|
SELECT Match_Date FROM `Match` ORDER BY Win_Margin DESC LIMIT 1
|
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,950 | 1,950 |
CREATE TABLE `Match`
(
Match_Date DATE,
Win_Margin INTEGER
)
|
[
"SELECT",
"ORDER BY",
"LIMIT",
"FROM",
"DESC"
] | 5 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
43,
150,
229,
252,
314,
349,
548,
592,
654,
688,
713,
778,
951,
1024,
1037,
1065,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
1,
10,
11,
13,
15,
17,
20,
28,
29,
36,
38,
43,
49,
55,
59,
62,
69,
73,
75,
78,
86,
89,
108,
110,
121,
125,
133,
138,
150,
159,
162,
163,
167,
173,
174,
179,
181,
185,
187,
188,
199,
200,
202,
206,
208,
213,
229,
233,
239,
247,
252,
262,
263,
275,
278,
281,
285,
286,
291,
309,
311,
313,
314,
319,
320,
324,
328,
329,
334,
336,
337,
341,
342,
345,
348,
349,
352,
353,
356,
359,
364,
365,
371,
373,
378,
379,
381,
385,
394,
395,
400,
403,
404,
409,
411,
428,
429,
434,
435,
444,
445,
451,
454,
460,
462,
469,
482,
495,
497,
505,
530,
532,
534,
536,
538,
542,
548,
552,
555,
560,
566,
567,
576,
578,
579,
583,
584,
586,
590,
592,
595,
611,
619,
621,
625,
626,
634,
637,
638,
645,
654,
657,
659,
664,
665,
669,
681,
688,
690,
691,
698,
701,
703,
708,
713,
719,
732,
733,
735,
748,
752,
759,
760,
768,
778,
790,
803,
810,
815,
818,
823,
827,
830,
836,
850,
851,
861,
866,
869,
876,
886,
889,
891,
893,
901,
911,
918,
927,
929,
934,
946,
950,
951,
953,
954,
956,
962,
963,
966,
967,
970,
972,
973,
975,
977,
981,
983,
987,
989,
994,
1004,
1005,
1006,
1010,
1013,
1017,
1024,
1025,
1030,
1034,
1037,
1038,
1047,
1049,
1050,
1051,
1056,
1057,
1065,
1067,
1068,
1075,
1076,
1077,
1083,
1094,
1124,
1137,
1139,
1141
]
}
|
soccer_2016
|
Which season has the fewest number of matches?
|
fewest number of matches refers to min(count(Match_Id))
|
SELECT Season_Id FROM `Match` GROUP BY Season_Id ORDER BY COUNT(Match_Id) LIMIT 1
|
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,951 | 1,951 |
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Season_Id INTEGER,
foreign key Season_Id references SeasonSeason_Id
)
|
[
"GROUP BY",
"SELECT",
"ORDER BY",
"LIMIT",
"COUNT",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
150,
229,
252,
314,
349,
548,
592,
654,
688,
713,
743,
778,
951,
1024,
1037,
1065,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
1,
10,
11,
13,
15,
17,
20,
22,
28,
29,
36,
38,
49,
55,
59,
62,
69,
73,
75,
78,
86,
89,
108,
115,
121,
125,
126,
133,
138,
140,
142,
143,
150,
159,
162,
163,
167,
169,
173,
174,
179,
181,
182,
185,
187,
188,
191,
199,
202,
206,
208,
213,
214,
229,
233,
247,
252,
262,
275,
278,
281,
285,
286,
291,
309,
311,
313,
314,
319,
320,
324,
329,
334,
336,
337,
341,
342,
344,
345,
348,
349,
352,
353,
356,
359,
364,
365,
371,
373,
378,
379,
381,
385,
394,
395,
400,
403,
404,
409,
411,
424,
428,
429,
434,
435,
444,
445,
451,
454,
460,
462,
466,
469,
473,
481,
482,
495,
497,
505,
530,
532,
534,
536,
538,
542,
548,
552,
555,
560,
566,
567,
576,
578,
579,
583,
584,
586,
590,
592,
595,
611,
619,
621,
625,
626,
630,
634,
637,
638,
645,
654,
657,
659,
664,
665,
669,
681,
688,
690,
691,
696,
698,
701,
703,
708,
713,
718,
719,
721,
732,
733,
735,
743,
748,
752,
759,
760,
768,
778,
779,
790,
803,
810,
815,
817,
818,
823,
827,
830,
836,
850,
851,
861,
866,
869,
876,
886,
889,
891,
893,
901,
911,
918,
927,
929,
934,
946,
950,
951,
954,
956,
962,
963,
966,
967,
970,
972,
973,
975,
977,
981,
983,
987,
989,
993,
994,
1004,
1005,
1006,
1010,
1013,
1017,
1024,
1025,
1030,
1034,
1037,
1038,
1043,
1047,
1049,
1050,
1051,
1056,
1057,
1065,
1067,
1068,
1070,
1076,
1077,
1083,
1094,
1106,
1124,
1135,
1137,
1139,
1141
]
}
|
soccer_2016
|
How many players have won at least 5 man of the match awards?
|
won at least 5 man of the match awards refers to COUNT(Match_Id) > = 5
|
SELECT COUNT(Match_Id) FROM `Match` GROUP BY Man_of_the_Match HAVING COUNT(Match_Id) >= 5
|
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,952 | 1,952 |
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Man_of_the_Match INTEGER,
foreign key Man_of_the_Match references PlayerPlayer_Id
)
|
[
"GROUP BY",
"SELECT",
"HAVING",
"COUNT",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
2,
212,
225,
229,
252,
259,
314,
349,
383,
509,
547,
548,
564,
654,
688,
714,
743,
778,
787,
943,
951,
1037,
1064,
1078,
1087,
1091,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
4,
6,
9,
11,
13,
15,
16,
20,
22,
25,
27,
28,
30,
32,
35,
36,
37,
40,
47,
51,
53,
55,
61,
62,
63,
67,
68,
69,
73,
74,
75,
77,
78,
82,
86,
87,
88,
89,
91,
93,
96,
98,
106,
108,
109,
113,
115,
117,
118,
119,
121,
124,
125,
126,
131,
140,
142,
143,
146,
147,
148,
152,
157,
159,
160,
164,
167,
169,
170,
173,
175,
179,
182,
183,
184,
185,
187,
188,
189,
190,
191,
192,
196,
197,
198,
199,
202,
203,
206,
210,
212,
213,
214,
216,
224,
225,
226,
227,
229,
230,
233,
234,
243,
244,
247,
252,
254,
256,
259,
261,
267,
268,
269,
271,
273,
276,
277,
285,
286,
291,
293,
294,
299,
301,
303,
311,
313,
314,
316,
317,
319,
320,
323,
325,
330,
334,
335,
336,
338,
339,
341,
344,
345,
348,
349,
352,
354,
356,
358,
359,
360,
364,
365,
370,
371,
373,
374,
375,
377,
378,
379,
380,
381,
382,
383,
384,
391,
392,
394,
399,
401,
403,
406,
409,
410,
411,
412,
416,
417,
420,
421,
423,
424,
426,
436,
443,
444,
445,
447,
448,
453,
454,
458,
460,
462,
464,
465,
466,
467,
469,
471,
473,
476,
477,
478,
481,
484,
485,
487,
488,
490,
493,
500,
504,
505,
509,
510,
512,
515,
516,
517,
519,
520,
526,
531,
532,
535,
536,
537,
538,
542,
543,
544,
545,
547,
548,
551,
552,
554,
558,
559,
560,
563,
564,
566,
573,
579,
580,
581,
582,
585,
586,
591,
594,
595,
596,
597,
598,
603,
606,
608,
611,
613,
618,
620,
627,
629,
630,
632,
633,
634,
638,
641,
645,
646,
649,
651,
654,
656,
658,
659,
661,
662,
663,
664,
665,
667,
668,
669,
671,
673,
680,
681,
687,
688,
689,
690,
692,
694,
696,
698,
701,
703,
705,
707,
712,
714,
718,
719,
720,
721,
727,
730,
733,
734,
735,
736,
737,
739,
740,
743,
748,
749,
750,
751,
752,
753,
756,
757,
760,
762,
768,
769,
770,
772,
778,
779,
787,
790,
795,
796,
797,
798,
799,
800,
802,
804,
810,
811,
812,
813,
814,
817,
818,
819,
820,
821,
823,
824,
827,
830,
831,
838,
839,
841,
843,
849,
851,
853,
857,
865,
866,
867,
869,
870,
874,
876,
877,
882,
886,
888,
889,
890,
893,
894,
896,
897,
898,
899,
901,
902,
903,
909,
911,
912,
913,
915,
917,
918,
922,
923,
924,
926,
927,
929,
930,
932,
934,
935,
941,
942,
943,
945,
950,
951,
954,
956,
958,
960,
961,
962,
963,
965,
968,
969,
972,
973,
975,
976,
977,
981,
983,
985,
986,
987,
993,
996,
1005,
1006,
1008,
1010,
1011,
1013,
1014,
1015,
1020,
1022,
1023,
1025,
1030,
1037,
1042,
1043,
1047,
1050,
1051,
1053,
1055,
1057,
1058,
1059,
1062,
1064,
1067,
1069,
1070,
1071,
1072,
1076,
1077,
1078,
1079,
1082,
1084,
1086,
1087,
1090,
1091,
1094,
1096,
1100,
1101,
1103,
1104,
1106,
1108,
1112,
1113,
1119,
1121,
1123,
1124,
1126,
1127,
1128,
1131,
1133,
1134,
1135,
1137
]
}
|
soccer_2016
|
Who is the player who received the man of the match award during the last match of Season 9?
|
Who refers to Player_Name; last match of Season 9 refers to max(Match_Date) where Season_Id = 9
|
SELECT T1.Player_name FROM Player AS T1 INNER JOIN Match AS T2 ON T1.Player_Id = T2.Man_of_the_Match WHERE T2.Season_Id = 9 ORDER BY T2.Match_Date DESC LIMIT 1
|
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,953 | 1,953 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Match`
(
Match_Date DATE,
Season_Id INTEGER,
Man_of_the_Match INTEGER,
foreign key Season_Id references SeasonSeason_Id,
foreign key Man_of_the_Match references PlayerPlayer_Id
)
|
[
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"FROM"
] | 9 |
simple
|
{
"case_1": [
-1
],
"case_2": [
1124
],
"case_3": [
134,
150,
201,
212,
225,
229,
232,
252,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
26,
27,
28,
29,
30,
33,
34,
36,
37,
38,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
78,
80,
81,
82,
83,
84,
85,
86,
88,
89,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
108,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
133,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
173,
174,
175,
176,
177,
179,
180,
181,
183,
184,
185,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
208,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
252,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
285,
286,
287,
289,
290,
291,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
337,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
348,
349,
352,
353,
354,
356,
357,
358,
359,
360,
361,
363,
364,
365,
368,
369,
370,
371,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
400,
401,
402,
403,
404,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
534,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
576,
577,
578,
579,
580,
581,
582,
583,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
619,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
664,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
698,
699,
700,
701,
702,
703,
704,
705,
706,
708,
710,
711,
712,
714,
715,
717,
719,
720,
721,
722,
723,
724,
725,
726,
727,
728,
732,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
748,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
815,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
836,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
869,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
943,
944,
946,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
972,
973,
974,
975,
977,
980,
981,
983,
985,
986,
987,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1010,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1030,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1057,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1071,
1072,
1074,
1076,
1077,
1078,
1080,
1082,
1083,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137,
1139,
1141
]
}
|
soccer_2016
|
What is the name of the team that won the first ever match?
|
name of the team refers to Team_Name; won the first ever match refers to Match_Winner where max(Match_Date)
|
SELECT T1.Team_Name FROM team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Match_Winner WHERE T2.Season_Id = 1 ORDER BY T2.Match_Date LIMIT 1
|
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,954 | 1,954 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Match_Date DATE,
Season_Id INTEGER,
Match_Winner INTEGER,
foreign key Season_Id references SeasonSeason_Id,
foreign key Match_Winner references TeamTeam_Id
)
|
[
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"FROM"
] | 8 |
simple
|
{
"case_1": [
592,
713,
1098
],
"case_2": [
212,
592,
713,
829,
1064,
1087,
1098
],
"case_3": [
134,
150,
201,
212,
225,
229,
232,
252,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
26,
27,
28,
29,
30,
33,
34,
36,
37,
38,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
78,
80,
81,
82,
83,
84,
85,
86,
88,
89,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
108,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
133,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
173,
174,
175,
176,
177,
178,
179,
180,
181,
183,
184,
185,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
208,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
252,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
285,
286,
287,
289,
290,
291,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
337,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
348,
349,
352,
353,
354,
356,
357,
358,
359,
360,
361,
363,
364,
365,
368,
369,
370,
371,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
400,
401,
402,
403,
404,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
534,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
576,
577,
578,
579,
580,
581,
582,
583,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
619,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
664,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
698,
699,
700,
701,
702,
703,
704,
705,
706,
708,
710,
711,
712,
713,
714,
715,
717,
719,
720,
721,
722,
723,
724,
725,
726,
727,
728,
732,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
748,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
815,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
836,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
869,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
946,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
972,
973,
974,
975,
977,
980,
981,
983,
985,
986,
987,
988,
989,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1024,
1025,
1027,
1029,
1030,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1057,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1071,
1072,
1074,
1075,
1076,
1077,
1078,
1080,
1082,
1083,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137,
1139,
1141
]
}
|
soccer_2016
|
How many cities are in U.A.E?
|
U.A.E refers to Country_Name = 'U.A.E'
|
SELECT SUM(CASE WHEN T2.Country_Name = 'U.A.E' THEN 1 ELSE 0 END) FROM City AS T1 INNER JOIN country AS T2 ON T1.Country_id = T2.Country_id
|
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,955 | 1,955 |
CREATE TABLE `City`
(
Country_id INTEGER
)
CREATE TABLE `Country`
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key Country_Id references CountryCountry_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"CASE",
"INNER JOIN",
"ON",
"FROM"
] | 9 |
simple
|
{
"case_1": [
-1
],
"case_2": [
201
],
"case_3": [
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1110,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
54,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
122,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
173,
175,
176,
177,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
205,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
245,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
507,
508,
509,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
709,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
872,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
939,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
979,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1093,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1110,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
List the names of all the umpires from England.
|
from England refers to Country_Name = 'England'
|
SELECT T1.Umpire_Name FROM Umpire AS T1 INNER JOIN country AS T2 ON T2.Country_Id = T1.Umpire_Country WHERE T2.Country_Name = 'England'
|
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,956 | 1,956 |
CREATE TABLE `Country`
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key Country_Id references CountryCountry_Id
)
CREATE TABLE `Umpire`
(
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key Umpire_Country references CountryCountry_Id
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
506,
507,
508,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
653,
654,
655,
657,
658,
659,
660,
661,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
978,
980,
981,
982,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1075,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
How many players bowl in the legbreak style?
|
legbreak style refers to Bowling_skill = 'Legbreak'
|
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Bowling_Style AS T2 ON T1.Bowling_skill = T2.Bowling_Id WHERE T2.Bowling_skill = 'Legbreak'
|
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,957 | 1,957 |
CREATE TABLE `Bowling_Style`
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE `Player`
(
Player_Name TEXT,
Bowling_skill INTEGER,
foreign key Bowling_skill references Bowling_StyleBowling_Id
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
509,
644
],
"case_2": [
509,
644,
1037
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
506,
507,
508,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
653,
654,
655,
657,
658,
659,
660,
661,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
978,
980,
981,
982,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1075,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
How many matches did Rajasthan Royals play in Season 8?
|
Season 8 refers to Season_Id = 8
|
SELECT SUM(CASE WHEN T1.Season_Id = 8 THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Team AS T2 ON T1.Team_1 = T2.Team_Id OR T1.Team_2 = T2.Team_Id WHERE T2.Team_Name = 'Rajasthan Royals'
|
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,958 | 1,958 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Team_1 INTEGER,
Team_2 INTEGER,
Season_Id INTEGER,
foreign key Team_1 references TeamTeam_Id,
foreign key Team_2 references TeamTeam_Id,
foreign key Season_Id references SeasonSeason_Id
)
|
[
"CASE WHEN",
"OR",
"AS",
"SELECT",
"SUM",
"CASE",
"INNER JOIN",
"ON",
"FROM"
] | 10 |
simple
|
{
"case_1": [
54,
592,
1098,
1110
],
"case_2": [
54,
212,
592,
829,
1064,
1087,
1098,
1110
],
"case_3": [
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1110,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
54,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
122,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
173,
175,
176,
177,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
205,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
245,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
507,
508,
509,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
709,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
872,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
939,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
979,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1093,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1110,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Which country is umpire TH Wijewardene from?
|
country refers to Country_Name
|
SELECT T2.Country_Name FROM Umpire AS T1 INNER JOIN country AS T2 ON T2.Country_Id = T1.Umpire_Country WHERE T1.Umpire_Name = 'TH Wijewardene'
|
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,959 | 1,959 |
CREATE TABLE `Country`
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key Country_Id references CountryCountry_Id
)
CREATE TABLE `Umpire`
(
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key Umpire_Country references CountryCountry_Id
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
506,
507,
508,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
653,
654,
655,
657,
658,
659,
660,
661,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
978,
980,
981,
982,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1075,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
What are the names of the venues in Abu Dhabi?
|
names of the venues refers to Venue_Name; Abu Dhabi refers to City_Name = 'Abu Dhabi'
|
SELECT T1.Venue_Name FROM Venue AS T1 INNER JOIN City AS T2 ON T1.City_Id = T2.City_Id WHERE T2.City_Name = 'Abu Dhabi'
|
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,960 | 1,960 |
CREATE TABLE `City`
(
City_Id INTEGER
primary key,
City_Name TEXT
)
CREATE TABLE `Venue`
(
Venue_Name TEXT,
City_Id INTEGER,
foreign key City_Id references CityCity_Id
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
700
],
"case_2": [
548,
700
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
506,
507,
508,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
653,
654,
655,
657,
658,
659,
660,
661,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
978,
980,
981,
982,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1075,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Which country is the youngest player from?
|
country refers to Country_Name; youngest player refers to max(DOB)
|
SELECT T1.Country_Name FROM Country AS T1 INNER JOIN Player AS T2 ON T1.Country_Id = T2.Country_Name ORDER BY T2.DOB DESC LIMIT 1
|
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,961 | 1,961 |
CREATE TABLE `Country`
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key Country_Id references CountryCountry_Id
)
CREATE TABLE `Player`
(
DOB DATE,
Country_Name INTEGER,
foreign key Country_Name references CountryCountry_Id
)
|
[
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"FROM"
] | 9 |
simple
|
{
"case_1": [
-1
],
"case_2": [
150,
349
],
"case_3": [
134,
150,
201,
212,
225,
229,
232,
252,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
26,
27,
28,
29,
30,
33,
34,
36,
37,
38,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
78,
80,
81,
82,
83,
84,
85,
86,
88,
89,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
108,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
133,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
173,
174,
175,
176,
177,
179,
180,
181,
183,
184,
185,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
208,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
252,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
285,
286,
287,
289,
290,
291,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
337,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
348,
349,
352,
353,
354,
356,
357,
358,
359,
360,
361,
363,
364,
365,
368,
369,
370,
371,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
400,
401,
402,
403,
404,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
534,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
576,
577,
578,
579,
580,
581,
582,
583,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
619,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
664,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
698,
699,
700,
701,
702,
703,
704,
705,
706,
708,
710,
711,
712,
714,
715,
717,
719,
720,
721,
722,
723,
724,
725,
726,
727,
728,
732,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
748,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
815,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
836,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
869,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
943,
944,
946,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
972,
973,
974,
975,
977,
980,
981,
983,
985,
986,
987,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1010,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1030,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1057,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1071,
1072,
1074,
1076,
1077,
1078,
1080,
1082,
1083,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137,
1139,
1141
]
}
|
soccer_2016
|
List all the names of the winning team's players in the first match of season 1.
|
names refers to Player_Name; winning team's refers to Match_Winner; first match of season 1 refers to Season_Id = 1 and min(Match_Date)
|
SELECT T3.Player_Name FROM `Match` AS T1 INNER JOIN Player_Match AS T2 ON T1.Match_Winner = T2.Team_Id INNER JOIN Player AS T3 ON T2.Player_Id = T3.Player_Id WHERE T1.Season_Id = 1 ORDER BY T1.Match_Date LIMIT 1
|
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,962 | 1,962 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Match`
(
Match_Date DATE,
Season_Id INTEGER,
Match_Winner INTEGER,
foreign key Season_Id references SeasonSeason_Id,
foreign key Match_Winner references TeamTeam_Id
)
CREATE TABLE `Player_Match`
(
Player_Id INTEGER,
Team_Id INTEGER, Player_Id,
foreign key Player_Id references PlayerPlayer_Id,
foreign key Team_Id references TeamTeam_Id
)
|
[
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"FROM"
] | 11 |
medium
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
134,
150,
201,
212,
225,
229,
232,
252,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
26,
27,
28,
29,
30,
33,
34,
36,
37,
38,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
78,
80,
81,
82,
83,
84,
85,
86,
88,
89,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
108,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
133,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
173,
174,
175,
176,
177,
178,
179,
180,
181,
183,
184,
185,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
208,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
252,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
285,
286,
287,
289,
290,
291,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
337,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
348,
349,
352,
353,
354,
356,
357,
358,
359,
360,
361,
363,
364,
365,
368,
369,
370,
371,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
400,
401,
402,
403,
404,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
534,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
576,
577,
578,
579,
580,
581,
582,
583,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
619,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
664,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
698,
699,
700,
701,
702,
703,
704,
705,
706,
708,
710,
711,
712,
713,
714,
715,
717,
719,
720,
721,
722,
723,
724,
725,
726,
727,
728,
732,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
748,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
815,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
836,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
869,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
946,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
972,
973,
974,
975,
977,
980,
981,
983,
985,
986,
987,
988,
989,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1024,
1025,
1027,
1029,
1030,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1057,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1071,
1072,
1074,
1075,
1076,
1077,
1078,
1080,
1082,
1083,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137,
1139,
1141
]
}
|
soccer_2016
|
Who is the youngest player to have won the Purple Cap?
|
Who refers to Player_Name; youngest player to have won the Purple Cap refers to min(subtract(Season_Year, DOB))
|
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Season AS T2 ON T1.Player_Id = T2.Purple_Cap ORDER BY T2.Season_Year - SUBSTR(T1.DOB, 1, 4) LIMIT 1
|
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,963 | 1,963 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE
)
CREATE TABLE `Season`
(
Purple_Cap INTEGER,
Season_Year INTEGER
)
|
[
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"SUBSTR",
"FROM"
] | 9 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
89,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1010,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Provide the complete name of the venue, city and country where the last match was held.
|
name of the venue, city and country refers to Venue_Name and City_Name and Country_Name; last match refers to max(Match_Date)
|
SELECT T1.Venue_Name, T2.City_Name, T3.Country_Name FROM Venue AS T1 INNER JOIN City AS T2 ON T1.City_Id = T2.City_Id INNER JOIN Country AS T3 ON T2.Country_Id = T3.Country_Id INNER JOIN Match AS T4 ON T1.Venue_Id = T4.Venue_Id ORDER BY T4.Match_Date DESC LIMIT 1
|
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,964 | 1,964 |
CREATE TABLE `City`
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE `Country`
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key Country_Id references CountryCountry_Id
)
CREATE TABLE `Venue`
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key City_Id references CityCity_Id
)
CREATE TABLE `Match`
(
Match_Date DATE,
Venue_Id INTEGER,
foreign key Venue_Id references VenueVenue_Id
)
|
[
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"FROM"
] | 15 |
medium
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
134,
150,
201,
212,
225,
229,
232,
252,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
26,
27,
28,
29,
30,
33,
34,
36,
37,
38,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
78,
80,
81,
82,
83,
84,
85,
86,
88,
89,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
108,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
133,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
173,
174,
175,
176,
177,
179,
180,
181,
183,
184,
185,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
208,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
252,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
285,
286,
287,
289,
290,
291,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
337,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
348,
349,
352,
353,
354,
356,
357,
358,
359,
360,
361,
363,
364,
365,
368,
369,
370,
371,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
400,
401,
402,
403,
404,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
534,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
576,
577,
578,
579,
580,
581,
582,
583,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
619,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
664,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
698,
699,
700,
701,
702,
703,
704,
705,
706,
708,
710,
711,
712,
714,
715,
717,
719,
720,
721,
722,
723,
724,
725,
726,
727,
728,
732,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
748,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
815,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
836,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
869,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
943,
944,
946,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
972,
973,
974,
975,
977,
980,
981,
983,
985,
986,
987,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1010,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1030,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1057,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1071,
1072,
1074,
1076,
1077,
1078,
1080,
1082,
1083,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137,
1139,
1141
]
}
|
soccer_2016
|
How many overs were there in each innings of match ID "336011"?
|
SELECT SUM(CASE WHEN Innings_No = 1 THEN 1 ELSE 0 END) AS IN1 , SUM(CASE WHEN Innings_No = 2 THEN 1 ELSE 0 END) AS IN2 FROM Ball_by_Ball WHERE Match_Id = 336011
|
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,965 | 1,965 |
CREATE TABLE `Ball_by_Ball`
(
Match_Id INTEGER,
Innings_No INTEGER,
primary key Match_Id, Innings_No,
foreign key Match_Id references MatchMatch_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"CASE",
"FROM"
] | 10 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
54,
122,
201,
205,
212,
225,
245,
383,
518,
547,
550,
564,
640,
787,
943,
959,
979,
1064,
1078,
1087,
1092,
1093,
1098,
1110
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
6,
16,
24,
35,
39,
42,
54,
61,
64,
71,
77,
81,
83,
87,
93,
94,
104,
106,
112,
113,
120,
122,
127,
129,
141,
148,
152,
153,
155,
158,
169,
171,
173,
184,
186,
189,
191,
192,
195,
201,
205,
207,
212,
213,
215,
219,
223,
225,
226,
228,
234,
236,
245,
248,
254,
258,
261,
263,
264,
267,
271,
279,
298,
299,
300,
303,
304,
305,
313,
316,
317,
322,
323,
335,
347,
356,
360,
362,
363,
365,
375,
378,
379,
381,
383,
393,
398,
402,
406,
409,
412,
415,
423,
427,
438,
443,
448,
450,
452,
453,
458,
470,
476,
478,
479,
483,
485,
486,
487,
488,
500,
504,
506,
508,
510,
514,
517,
518,
527,
528,
535,
537,
540,
547,
550,
563,
564,
571,
573,
575,
579,
580,
581,
597,
601,
609,
612,
620,
623,
628,
630,
638,
640,
646,
650,
658,
662,
666,
672,
676,
682,
686,
690,
695,
701,
706,
709,
710,
717,
723,
740,
744,
745,
747,
750,
753,
762,
772,
776,
777,
787,
788,
795,
796,
798,
800,
802,
805,
808,
810,
813,
823,
825,
827,
832,
841,
844,
848,
868,
870,
871,
872,
874,
880,
894,
896,
909,
912,
913,
922,
924,
926,
929,
939,
941,
943,
944,
958,
959,
962,
973,
978,
979,
985,
998,
1008,
1012,
1023,
1027,
1031,
1036,
1038,
1048,
1062,
1064,
1066,
1068,
1069,
1078,
1082,
1087,
1092,
1093,
1098,
1100,
1110,
1121,
1129,
1131,
1133,
1134,
1135
]
}
|
|
soccer_2016
|
List the ball IDs, scores, and innings numbers in the over ID 20 of match ID "335988".
|
innings numbers refers to Innings_No
|
SELECT Ball_Id, Runs_Scored, Innings_No FROM Batsman_Scored WHERE Match_Id = 335988 AND Over_Id = 20
|
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,966 | 1,966 |
CREATE TABLE `Batsman_Scored`
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key Match_Id, Over_Id, Ball_Id, Innings_No,
foreign key Match_Id references MatchMatch_Id
)
|
[
"AND",
"SELECT",
"FROM"
] | 3 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
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,
1001,
1002,
1003,
1004,
1005,
1006,
1007,
1008,
1009,
1010,
1011,
1012,
1013,
1014,
1015,
1016,
1017,
1018,
1019,
1020,
1021,
1022,
1023,
1024,
1025,
1026,
1027,
1028,
1029,
1030,
1031,
1032,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1040,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1053,
1054,
1055,
1056,
1057,
1058,
1059,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1073,
1074,
1075,
1076,
1077,
1078,
1079,
1080,
1081,
1082,
1083,
1084,
1085,
1086,
1087,
1088,
1089,
1090,
1091,
1092,
1093,
1094,
1095,
1096,
1097,
1098,
1099,
1100,
1101,
1102,
1103,
1104,
1105,
1106,
1107,
1108,
1109,
1110,
1111,
1112,
1113,
1114,
1115,
1116,
1117,
1118,
1119,
1120,
1121,
1122,
1123,
1124,
1125,
1126,
1127,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137,
1138,
1139,
1140,
1141
]
}
|
soccer_2016
|
How many matches were held in 2011?
|
held in 2011 refers to Match_Date like '2011%';
|
SELECT COUNT(Match_Id) FROM `Match` WHERE Match_Date LIKE '2011%'
|
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,967 | 1,967 |
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Match_Date DATE
)
|
[
"COUNT",
"LIKE",
"SELECT",
"FROM"
] | 4 |
simple
|
{
"case_1": [
979
],
"case_2": [
979
],
"case_3": [
2,
212,
225,
229,
252,
259,
314,
349,
383,
509,
547,
548,
564,
654,
688,
714,
743,
778,
787,
943,
951,
979,
1037,
1064,
1078,
1087,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
6,
9,
11,
13,
15,
16,
20,
22,
25,
26,
27,
28,
30,
32,
35,
36,
37,
38,
40,
47,
51,
53,
55,
57,
59,
61,
62,
63,
67,
68,
69,
73,
74,
75,
77,
78,
81,
82,
86,
87,
88,
89,
90,
91,
93,
96,
98,
106,
108,
109,
113,
114,
115,
117,
118,
119,
121,
124,
125,
126,
127,
131,
136,
140,
142,
143,
146,
147,
148,
152,
157,
159,
160,
164,
167,
168,
169,
170,
173,
175,
179,
182,
183,
184,
185,
187,
188,
189,
190,
191,
192,
196,
197,
198,
199,
202,
203,
204,
206,
210,
212,
214,
216,
224,
225,
226,
227,
229,
230,
233,
234,
240,
243,
244,
247,
252,
254,
256,
258,
259,
261,
263,
264,
267,
268,
269,
271,
273,
276,
277,
286,
291,
293,
294,
299,
301,
303,
311,
314,
315,
316,
317,
319,
320,
323,
325,
330,
334,
335,
336,
338,
339,
341,
344,
345,
348,
349,
352,
354,
356,
358,
359,
360,
364,
370,
371,
373,
374,
375,
377,
380,
382,
383,
384,
391,
392,
394,
397,
399,
401,
402,
403,
406,
407,
409,
410,
411,
412,
415,
416,
417,
420,
421,
423,
424,
426,
430,
433,
436,
438,
443,
444,
445,
447,
448,
452,
453,
454,
458,
460,
462,
464,
465,
466,
467,
469,
471,
473,
476,
477,
478,
481,
484,
485,
487,
488,
490,
493,
500,
504,
505,
509,
510,
512,
515,
516,
517,
519,
520,
525,
526,
531,
532,
535,
536,
537,
538,
542,
543,
544,
545,
546,
547,
548,
552,
554,
557,
558,
559,
560,
563,
564,
566,
573,
580,
581,
582,
585,
591,
594,
595,
596,
597,
598,
603,
606,
608,
611,
613,
618,
620,
624,
627,
629,
630,
632,
633,
634,
641,
645,
646,
649,
654,
656,
658,
659,
661,
662,
663,
664,
665,
666,
667,
668,
669,
671,
673,
675,
680,
681,
687,
688,
689,
692,
694,
696,
698,
703,
705,
707,
712,
714,
718,
719,
721,
727,
730,
733,
734,
735,
736,
737,
738,
739,
740,
743,
747,
748,
749,
750,
752,
753,
754,
756,
757,
760,
762,
768,
769,
770,
772,
774,
778,
779,
787,
790,
795,
796,
797,
798,
799,
800,
802,
804,
811,
812,
813,
814,
817,
818,
819,
820,
821,
824,
827,
828,
830,
831,
832,
838,
839,
841,
843,
844,
849,
850,
851,
853,
857,
858,
865,
866,
867,
869,
870,
874,
875,
876,
877,
879,
886,
888,
890,
893,
894,
896,
897,
898,
899,
901,
902,
903,
907,
909,
911,
912,
913,
915,
917,
918,
922,
923,
924,
926,
927,
930,
934,
935,
941,
942,
943,
944,
945,
948,
950,
951,
954,
956,
958,
960,
961,
963,
965,
968,
969,
972,
975,
976,
977,
979,
980,
981,
983,
985,
986,
993,
996,
1000,
1005,
1006,
1008,
1010,
1011,
1013,
1014,
1015,
1018,
1019,
1020,
1022,
1023,
1030,
1037,
1042,
1043,
1047,
1050,
1051,
1053,
1054,
1055,
1057,
1058,
1059,
1062,
1064,
1067,
1069,
1070,
1071,
1072,
1076,
1077,
1078,
1079,
1082,
1084,
1086,
1087,
1090,
1094,
1096,
1098,
1100,
1101,
1103,
1104,
1106,
1111,
1112,
1113,
1117,
1119,
1121,
1123,
1124,
1126,
1127,
1128,
1131,
1133,
1134,
1135,
1137
]
}
|
soccer_2016
|
How old is Ishan Kishan in 2022?
|
old refers to SUBTRACT(2022, SUBSTR(DOB, 1, 4)); Ishan Kishan refers to Player_Name = 'Ishan Kishan';
|
SELECT 2022 - SUBSTR(DOB, 1, 4) FROM Player WHERE Player_Name = 'Ishan Kishan'
|
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,968 | 1,968 |
CREATE TABLE `Player`
(
Player_Name TEXT,
DOB DATE
)
|
[
"SUBSTR",
"SELECT",
"FROM"
] | 3 |
simple
|
{
"case_1": [
2,
43,
259,
617,
1093
],
"case_2": [
2,
43,
259,
617,
1093
],
"case_3": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
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,
1001,
1002,
1003,
1004,
1005,
1006,
1007,
1008,
1009,
1010,
1011,
1012,
1013,
1014,
1015,
1016,
1017,
1018,
1019,
1020,
1021,
1022,
1023,
1024,
1025,
1026,
1027,
1028,
1029,
1030,
1031,
1032,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1040,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1053,
1054,
1055,
1056,
1057,
1058,
1059,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1073,
1074,
1075,
1076,
1077,
1078,
1079,
1080,
1081,
1082,
1083,
1084,
1085,
1086,
1087,
1088,
1089,
1090,
1091,
1092,
1093,
1094,
1095,
1096,
1097,
1098,
1099,
1100,
1101,
1102,
1103,
1104,
1105,
1106,
1107,
1108,
1109,
1110,
1111,
1112,
1113,
1114,
1115,
1116,
1117,
1118,
1119,
1120,
1121,
1122,
1123,
1124,
1125,
1126,
1127,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137,
1138,
1139,
1140,
1141
]
}
|
soccer_2016
|
Calculate the win rate of the toss-winners in 2012.
|
in 2012 refers to Match_Date like '2012%'; win rate refers to DIVIDE(COUNT(Toss_Winner = Match_Winner), COUNT(Match_Date like '2012%'))
|
SELECT CAST(SUM(CASE WHEN Toss_Winner = Match_Winner THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN Match_Date LIKE '2012%' THEN 1 ELSE 0 END) FROM `Match`
|
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,969 | 1,969 |
CREATE TABLE `Match`
(
Match_Date DATE,
Toss_Winner INTEGER,
Match_Winner INTEGER,
foreign key Toss_Winner references TeamTeam_Id,
foreign key Match_Winner references TeamTeam_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"LIKE",
"CASE",
"CAST",
"FROM"
] | 11 |
medium
|
{
"case_1": [
-1
],
"case_2": [
122,
979
],
"case_3": [
54,
122,
201,
205,
212,
225,
245,
383,
518,
547,
550,
564,
640,
787,
943,
959,
979,
1064,
1078,
1087,
1092,
1093,
1098,
1110
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
6,
16,
24,
35,
42,
54,
61,
64,
71,
77,
81,
87,
93,
104,
106,
113,
120,
122,
127,
129,
148,
152,
153,
155,
173,
184,
191,
192,
195,
201,
205,
207,
212,
215,
219,
223,
225,
226,
234,
236,
245,
248,
254,
258,
261,
263,
264,
267,
271,
279,
299,
300,
304,
316,
317,
322,
323,
335,
347,
356,
360,
375,
383,
393,
402,
406,
409,
412,
415,
423,
427,
438,
448,
452,
453,
458,
476,
478,
483,
485,
486,
487,
500,
504,
508,
510,
514,
517,
518,
527,
535,
537,
540,
547,
550,
563,
564,
571,
573,
575,
580,
581,
597,
620,
623,
628,
640,
646,
658,
662,
666,
676,
682,
686,
690,
709,
710,
723,
740,
744,
747,
750,
753,
762,
772,
776,
787,
788,
795,
796,
798,
800,
802,
808,
810,
813,
827,
832,
841,
844,
848,
868,
870,
871,
872,
874,
894,
896,
909,
912,
913,
922,
924,
926,
939,
943,
944,
958,
959,
979,
985,
998,
1008,
1012,
1023,
1036,
1048,
1062,
1064,
1069,
1070,
1078,
1082,
1087,
1092,
1093,
1098,
1110,
1121,
1128,
1129,
1131,
1133,
1134,
1135
]
}
|
soccer_2016
|
How many matches in 2009 had win margins of less than 10?
|
in 2009 refers to Match_Date like '2009%'; win margins of less than 10 refers to Win_Margin < 10;
|
SELECT COUNT(Match_Id) FROM `Match` WHERE Match_Date LIKE '2009%' AND Win_Margin < 10
|
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,970 | 1,970 |
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Match_Date DATE,
Win_Margin INTEGER
)
|
[
"AND",
"SELECT",
"LIKE",
"COUNT",
"FROM"
] | 5 |
simple
|
{
"case_1": [
979
],
"case_2": [
979
],
"case_3": [
2,
43,
212,
225,
229,
252,
259,
314,
349,
383,
509,
547,
548,
564,
654,
688,
714,
743,
778,
787,
829,
943,
951,
979,
1037,
1064,
1078,
1087,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
8,
9,
10,
11,
12,
13,
15,
16,
19,
20,
21,
22,
24,
25,
26,
27,
28,
30,
32,
33,
35,
36,
37,
38,
39,
40,
43,
44,
45,
47,
50,
51,
52,
53,
55,
56,
57,
59,
61,
62,
63,
66,
67,
68,
69,
71,
73,
74,
75,
76,
77,
78,
79,
81,
82,
85,
86,
87,
88,
89,
90,
91,
93,
95,
96,
98,
99,
100,
106,
108,
109,
111,
112,
113,
114,
115,
116,
117,
118,
119,
121,
124,
125,
126,
127,
128,
129,
131,
136,
138,
140,
141,
142,
143,
144,
146,
147,
148,
152,
154,
157,
158,
159,
160,
163,
164,
167,
168,
169,
170,
172,
173,
175,
176,
177,
179,
180,
182,
183,
184,
185,
187,
188,
189,
190,
191,
192,
196,
197,
198,
199,
200,
202,
203,
204,
206,
210,
212,
214,
216,
219,
223,
224,
225,
226,
227,
229,
230,
233,
234,
239,
240,
243,
244,
247,
252,
254,
255,
256,
258,
259,
261,
262,
263,
264,
265,
266,
267,
268,
269,
270,
271,
272,
273,
275,
276,
277,
278,
282,
286,
291,
293,
294,
296,
299,
301,
303,
305,
311,
314,
315,
316,
317,
319,
320,
323,
325,
330,
334,
335,
336,
338,
339,
341,
344,
345,
348,
349,
350,
352,
354,
356,
358,
359,
360,
361,
362,
364,
367,
368,
370,
371,
373,
374,
375,
376,
377,
380,
382,
383,
384,
385,
391,
392,
393,
394,
395,
397,
398,
399,
401,
402,
403,
405,
406,
407,
408,
409,
410,
411,
412,
413,
414,
415,
416,
417,
418,
419,
420,
421,
423,
424,
425,
426,
427,
428,
430,
433,
436,
437,
438,
439,
440,
443,
444,
445,
446,
447,
448,
451,
452,
453,
454,
455,
458,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
473,
475,
476,
477,
478,
480,
481,
482,
484,
485,
487,
488,
490,
492,
493,
494,
496,
497,
498,
500,
504,
505,
507,
509,
510,
512,
514,
515,
516,
517,
519,
520,
522,
524,
525,
526,
528,
529,
530,
531,
532,
533,
535,
536,
537,
538,
539,
541,
542,
543,
544,
545,
546,
547,
548,
551,
552,
554,
557,
558,
559,
560,
561,
562,
563,
564,
566,
573,
580,
581,
582,
584,
585,
586,
588,
589,
591,
594,
595,
596,
597,
598,
599,
601,
603,
605,
606,
608,
610,
611,
612,
613,
615,
618,
620,
622,
624,
625,
626,
627,
629,
630,
632,
633,
634,
637,
641,
643,
645,
646,
648,
649,
651,
654,
656,
658,
659,
661,
662,
663,
664,
665,
666,
667,
668,
669,
671,
673,
675,
677,
678,
679,
680,
681,
683,
684,
685,
686,
687,
688,
689,
690,
692,
693,
694,
696,
697,
698,
699,
702,
703,
705,
707,
712,
714,
715,
716,
718,
719,
721,
726,
727,
730,
733,
734,
735,
736,
737,
738,
739,
740,
741,
743,
746,
747,
748,
749,
750,
752,
753,
754,
756,
757,
758,
760,
762,
763,
765,
767,
768,
769,
770,
772,
773,
774,
775,
776,
777,
778,
779,
780,
783,
785,
787,
788,
790,
793,
794,
795,
796,
797,
798,
799,
800,
802,
804,
806,
807,
808,
810,
811,
812,
813,
814,
817,
818,
819,
820,
821,
824,
825,
827,
828,
829,
830,
831,
832,
835,
838,
839,
840,
841,
843,
844,
848,
849,
850,
851,
853,
855,
857,
858,
859,
860,
861,
864,
865,
866,
867,
869,
870,
873,
874,
875,
876,
877,
878,
879,
886,
888,
890,
892,
893,
894,
895,
896,
897,
898,
899,
901,
902,
903,
905,
907,
909,
911,
912,
913,
915,
917,
918,
920,
922,
923,
924,
926,
927,
928,
930,
931,
932,
934,
935,
941,
942,
943,
944,
945,
948,
949,
950,
951,
953,
954,
956,
958,
960,
961,
963,
965,
968,
969,
972,
974,
975,
976,
977,
979,
980,
981,
983,
985,
986,
991,
993,
996,
998,
1000,
1001,
1005,
1006,
1008,
1009,
1010,
1011,
1013,
1014,
1015,
1017,
1018,
1019,
1020,
1022,
1023,
1027,
1030,
1031,
1037,
1039,
1042,
1043,
1044,
1046,
1047,
1050,
1051,
1053,
1054,
1055,
1057,
1058,
1059,
1061,
1062,
1063,
1064,
1067,
1068,
1069,
1070,
1071,
1072,
1073,
1076,
1077,
1078,
1079,
1080,
1081,
1082,
1084,
1086,
1087,
1090,
1092,
1094,
1096,
1098,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1115,
1117,
1119,
1121,
1123,
1124,
1126,
1127,
1128,
1131,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Provide the players' names in both teams of the match that was held in June 2014.
|
held in June 2014 refers to SUBSTR(Match_Date, 7, 1) = 6 and SUBSTR(Match_Date, 1, 4) = 2014
|
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Match AS T3 ON T2.Match_Id = T3.Match_Id WHERE SUBSTR(T3.Match_Date, 1, 4) = '2014' AND SUBSTR(T3.Match_Date, 7, 1) = '6' LIMIT 2
|
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,971 | 1,971 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Match_Date DATE
)
CREATE TABLE `Player_Match`
(
Match_Id INTEGER,
Player_Id INTEGER,
primary key Match_Id, Player_Id,
foreign key Match_Id references MatchMatch_Id,
foreign key Player_Id references PlayerPlayer_Id
)
|
[
"AS",
"AND",
"SELECT",
"LIMIT",
"INNER JOIN",
"ON",
"SUBSTR",
"FROM"
] | 13 |
medium
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
89,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
940,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
How many matches did Mohammad Hafeez play?
|
Mohammad Hafeez refers to Player_Name = 'Mohammad Hafeez';
|
SELECT SUM(CASE WHEN T2.Player_Name = 'Mohammad Hafeez' THEN 1 ELSE 0 END) FROM Player_Match AS T1 INNER JOIN Player AS T2 ON T1.Player_Id = T2.Player_Id
|
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,972 | 1,972 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Player_Match`
(
Player_Id INTEGER, Player_Id,
foreign key Player_Id references PlayerPlayer_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"CASE",
"INNER JOIN",
"ON",
"FROM"
] | 9 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1110,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
54,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
122,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
173,
175,
176,
177,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
205,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
245,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
507,
508,
509,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
709,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
872,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
939,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
979,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1093,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1110,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Among the players from South Africa, provide the players' names who were born in 1984.
|
from South Africa refers to Country_Name = 'South Africa'; born in 1984 refers to DOB like '1984%';
|
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_Id WHERE T2.Country_Name = 'South Africa' AND T1.DOB LIKE '1984%'
|
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,973 | 1,973 |
CREATE TABLE `Country`
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key Country_Id references CountryCountry_Id
)
CREATE TABLE `Player`
(
Player_Name TEXT,
DOB DATE,
Country_Name INTEGER,
foreign key Country_Name references CountryCountry_Id
)
|
[
"AS",
"AND",
"SELECT",
"LIKE",
"INNER JOIN",
"ON",
"FROM"
] | 8 |
simple
|
{
"case_1": [
-1
],
"case_2": [
150,
349
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
38,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
168,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
421,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
510,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
591,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1018,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1070,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1117,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Among the" Mumbai Indians" team that played in 2009, how many percent of the matches did they win?
|
played in 2009 Match_Date like '2009%'; Mumbai Indians" team refers to Team_Name = 'Mumbai Indians'; percent of the matches did they win refers to DIVIDE(COUNT(Match_Winner = Team_Id), COUNT(Match_Id))
|
SELECT CAST(SUM(CASE WHEN T1.Match_Winner = T2.Team_Id THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Match_Id) FROM `Match` AS T1 INNER JOIN Team AS T2 ON T1.Team_1 = T2.Team_Id OR T1.Team_2 = T2.Team_Id WHERE T2.Team_Name = 'Mumbai Indians' AND T1.Match_Date LIKE '2009%'
|
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,974 | 1,974 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Match_Winner INTEGER,
foreign key Team_1 references TeamTeam_Id,
foreign key Team_2 references TeamTeam_Id,
foreign key Match_Winner references TeamTeam_Id
)
|
[
"CASE WHEN",
"OR",
"AND",
"SELECT",
"AS",
"SUM",
"LIKE",
"CASE",
"INNER JOIN",
"ON",
"CAST",
"COUNT",
"FROM"
] | 15 |
medium
|
{
"case_1": [
212,
1064
],
"case_2": [
212,
829,
1064,
1087,
1098
],
"case_3": [
201,
212,
225,
314,
383,
518,
547,
550,
564,
640,
714,
743,
787,
829,
943,
959,
1064,
1078,
1087,
1092,
1098
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
4,
6,
16,
20,
22,
24,
26,
30,
37,
39,
42,
47,
51,
53,
57,
61,
63,
64,
68,
69,
71,
73,
74,
75,
77,
81,
82,
88,
90,
93,
96,
98,
106,
112,
113,
115,
117,
118,
119,
120,
125,
126,
127,
129,
131,
141,
142,
143,
146,
148,
152,
153,
155,
158,
160,
164,
169,
170,
173,
175,
179,
183,
184,
187,
189,
191,
192,
195,
197,
201,
202,
207,
212,
214,
215,
219,
223,
225,
226,
227,
234,
236,
240,
244,
247,
248,
254,
256,
258,
261,
264,
267,
268,
271,
276,
277,
278,
279,
299,
300,
301,
304,
314,
315,
316,
317,
319,
322,
323,
325,
330,
335,
339,
341,
347,
356,
360,
370,
373,
374,
375,
382,
383,
391,
393,
398,
402,
403,
406,
409,
412,
415,
416,
417,
423,
424,
426,
427,
433,
436,
438,
444,
448,
451,
452,
453,
458,
464,
469,
470,
476,
477,
478,
483,
485,
486,
487,
488,
490,
493,
500,
504,
510,
514,
515,
516,
517,
518,
519,
520,
526,
528,
532,
535,
537,
540,
544,
547,
550,
557,
558,
559,
560,
563,
564,
571,
573,
575,
580,
581,
582,
595,
597,
608,
612,
613,
620,
623,
624,
627,
628,
630,
632,
633,
640,
641,
646,
658,
662,
663,
666,
668,
671,
675,
676,
682,
686,
687,
690,
710,
712,
714,
723,
727,
734,
735,
739,
740,
743,
744,
747,
749,
750,
753,
754,
756,
760,
762,
768,
772,
776,
777,
787,
788,
795,
796,
797,
798,
799,
800,
802,
804,
808,
810,
813,
814,
819,
824,
825,
827,
829,
830,
832,
838,
841,
844,
848,
849,
851,
853,
858,
867,
868,
870,
871,
874,
877,
879,
886,
888,
894,
896,
898,
902,
907,
909,
912,
917,
918,
922,
923,
924,
926,
930,
935,
943,
944,
954,
956,
958,
959,
961,
969,
975,
985,
986,
996,
998,
1000,
1008,
1012,
1019,
1022,
1023,
1027,
1031,
1042,
1058,
1062,
1064,
1067,
1068,
1069,
1071,
1072,
1078,
1082,
1084,
1086,
1087,
1092,
1098,
1100,
1101,
1103,
1104,
1119,
1121,
1123,
1128,
1131,
1133,
1134,
1135
]
}
|
soccer_2016
|
What is the ratio of players with batting hands of left and right?
|
batting hands of left refers to Batting_hand = 'Left-hand bat'; right refers to Batting_hand = 2; ratio refers to DIVIDE(COUNT(Batting_hand = 'Right-hand bat'), COUNT(Batting_hand = 2))
|
SELECT CAST(SUM(CASE WHEN T2.Batting_hand = 'Left-hand bat' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.Batting_hand = 'Right-hand bat' THEN 1 ELSE 0 END) FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,975 | 1,975 |
CREATE TABLE `Batting_Style`
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE `Player`
(
Batting_hand INTEGER,
foreign key Batting_hand references Batting_StyleBatting_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"CASE",
"-",
"INNER JOIN",
"ON",
"CAST",
"FROM"
] | 16 |
challenging
|
{
"case_1": [
959
],
"case_2": [
550,
943,
959,
1078
],
"case_3": [
201,
212,
225,
383,
509,
518,
547,
550,
564,
640,
787,
829,
943,
959,
979,
1064,
1078,
1087,
1092,
1093,
1098
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
3,
6,
16,
21,
24,
34,
39,
42,
45,
61,
64,
71,
74,
77,
81,
83,
85,
93,
94,
97,
98,
104,
105,
106,
112,
113,
115,
119,
120,
127,
128,
129,
135,
141,
148,
152,
153,
154,
155,
158,
169,
171,
172,
173,
180,
183,
184,
186,
187,
189,
191,
192,
195,
197,
199,
201,
207,
212,
213,
215,
219,
223,
225,
226,
228,
234,
236,
240,
244,
248,
254,
258,
261,
264,
267,
271,
272,
278,
279,
296,
298,
299,
300,
304,
313,
316,
317,
322,
323,
325,
335,
339,
347,
356,
360,
363,
365,
368,
375,
378,
379,
381,
382,
383,
391,
392,
393,
394,
398,
402,
406,
409,
412,
415,
416,
423,
425,
427,
436,
438,
445,
446,
448,
450,
451,
452,
453,
458,
470,
476,
478,
479,
483,
485,
486,
487,
488,
489,
496,
498,
500,
503,
504,
507,
509,
510,
514,
517,
518,
520,
522,
528,
529,
535,
537,
540,
544,
547,
550,
559,
560,
562,
563,
564,
571,
573,
575,
579,
580,
581,
597,
609,
612,
620,
623,
624,
628,
630,
638,
640,
643,
646,
647,
649,
650,
658,
660,
662,
666,
672,
675,
676,
677,
681,
682,
684,
686,
690,
693,
695,
701,
706,
709,
710,
717,
723,
740,
744,
745,
746,
747,
750,
753,
754,
756,
758,
762,
772,
776,
777,
787,
788,
795,
796,
798,
800,
802,
805,
808,
810,
813,
823,
825,
827,
829,
832,
835,
838,
841,
844,
848,
858,
868,
870,
871,
874,
878,
880,
882,
894,
896,
898,
905,
909,
912,
922,
924,
925,
926,
930,
943,
944,
954,
958,
959,
962,
973,
974,
979,
980,
985,
993,
998,
1008,
1012,
1023,
1027,
1031,
1038,
1052,
1062,
1064,
1066,
1068,
1069,
1072,
1074,
1078,
1082,
1087,
1092,
1093,
1098,
1100,
1101,
1111,
1123,
1128,
1131,
1132,
1133,
1134,
1135
]
}
|
soccer_2016
|
Who is the eldest player and where did he/she come from?
|
eldest player refers to MIN(DOB); where he/she come from refers to Country_Name
|
SELECT T1.Player_Name, T2.Country_Name FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_Id ORDER BY T1.DOB LIMIT 1
|
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,976 | 1,976 |
CREATE TABLE `Country`
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key Country_Id references CountryCountry_Id
)
CREATE TABLE `Player`
(
Player_Name TEXT,
DOB DATE,
Country_Name INTEGER,
foreign key Country_Name references CountryCountry_Id
)
|
[
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"FROM"
] | 8 |
simple
|
{
"case_1": [
-1
],
"case_2": [
150,
349
],
"case_3": [
134,
150,
201,
212,
225,
229,
232,
252,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
26,
27,
28,
29,
30,
33,
34,
36,
37,
38,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
78,
80,
81,
82,
83,
84,
85,
86,
88,
89,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
108,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
133,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
173,
174,
175,
176,
177,
178,
179,
180,
181,
183,
184,
185,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
208,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
252,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
285,
286,
287,
289,
290,
291,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
337,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
348,
349,
352,
353,
354,
356,
357,
358,
359,
360,
361,
363,
364,
365,
368,
369,
370,
371,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
400,
401,
402,
403,
404,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
534,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
576,
577,
578,
579,
580,
581,
582,
583,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
619,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
664,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
698,
699,
700,
701,
702,
703,
704,
705,
706,
708,
710,
711,
712,
713,
714,
715,
717,
719,
720,
721,
722,
723,
724,
725,
726,
727,
728,
732,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
748,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
815,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
836,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
869,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
946,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
972,
973,
974,
975,
977,
980,
981,
983,
985,
986,
987,
988,
989,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1024,
1025,
1027,
1029,
1030,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1057,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1071,
1072,
1074,
1075,
1076,
1077,
1078,
1080,
1082,
1083,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137,
1139,
1141
]
}
|
soccer_2016
|
Which bowling skills did the players from Zimbabwea have?
|
Zimbabwea refers to Country_Name = 'Zimbabwea';
|
SELECT T1.Bowling_skill FROM Bowling_Style AS T1 INNER JOIN Player AS T2 ON T1.Bowling_Id = T2.Bowling_skill INNER JOIN Country AS T3 ON T2.Country_Name = T3.Country_Id WHERE T3.Country_Name = 'Zimbabwea'
|
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,977 | 1,977 |
CREATE TABLE `Bowling_Style`
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE `Country`
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key Country_Id references CountryCountry_Id
)
CREATE TABLE `Player`
(
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key Bowling_skill references Bowling_StyleBowling_Id,
foreign key Country_Name references CountryCountry_Id
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 9 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
506,
507,
508,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
653,
654,
655,
657,
658,
659,
660,
661,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
978,
980,
981,
982,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1075,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
List the IDs and names of the umpires from New Zealand.
|
New Zealand refers to Country_Name = 'New Zealand'; ID of the umpire refers to Umpire_Id; name of the umpire refers to Umpire_Name
|
SELECT T1.Umpire_Id, T1.Umpire_Name FROM Umpire AS T1 INNER JOIN Country AS T2 ON T1.Umpire_Country = T2.Country_Id WHERE T2.Country_Name = 'New Zealand'
|
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,978 | 1,978 |
CREATE TABLE `Country`
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key Country_Id references CountryCountry_Id
)
CREATE TABLE `Umpire`
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key Umpire_Country references CountryCountry_Id
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
506,
507,
508,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
653,
654,
655,
657,
658,
659,
660,
661,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
978,
980,
981,
982,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1075,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Who was the captain-keeper of Rising Pune Supergiants?
|
captain-keeper refers to Role_Desc = 'CaptainKeeper'; Rising Pune Supergiants refers to Role_Desc = 'CaptainKeeper'
|
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Team AS T3 ON T2.Team_Id = T3.Team_Id INNER JOIN Rolee AS T4 ON T2.Role_Id = T4.Role_Id WHERE T3.Team_Name = 'Rising Pune Supergiants' AND T4.Role_Desc = 'CaptainKeeper' GROUP BY T1.Player_Name
|
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,979 | 1,979 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Rolee`
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Player_Match`
(
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER, Player_Id, Role_Id,
foreign key Player_Id references PlayerPlayer_Id,
foreign key Team_Id references TeamTeam_Id,
foreign key Role_Id references RoleeRole_Id
)
|
[
"GROUP BY",
"AS",
"AND",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 14 |
medium
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
89,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
510,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
551,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
718,
719,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
817,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1070,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
How many matches did the Sunrisers Hyderabad team win in 2013?
|
Sunrisers Hyderabad team refers to Team_Name = 'Sunrisers Hyderabad'; in 2013 refers to Match_Date like '2013%';
|
SELECT SUM(CASE WHEN Match_Date LIKE '2013%' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Team AS T2 ON T1.Match_Winner = T2.Team_Id WHERE T2.Team_Name = 'Sunrisers Hyderabad'
|
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,980 | 1,980 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Match_Date DATE,
Match_Winner INTEGER,
foreign key Match_Winner references TeamTeam_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"LIKE",
"CASE",
"INNER JOIN",
"ON",
"FROM"
] | 10 |
simple
|
{
"case_1": [
54,
592,
1098,
1110
],
"case_2": [
54,
212,
592,
829,
1064,
1087,
1098,
1110
],
"case_3": [
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1110,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
54,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
122,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
173,
175,
176,
177,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
205,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
245,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
507,
508,
509,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
709,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
872,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
939,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
979,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1093,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1110,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Provide match ID which had the extra type of penalty.
|
extra type of penalty refers to Extra_Name = 'penalty';
|
SELECT T1.Match_Id FROM Extra_Runs AS T1 INNER JOIN Extra_Type AS T2 ON T1.Extra_Type_Id = T2.Extra_Id WHERE T2.Extra_Name = 'penalty'
|
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,981 | 1,981 |
CREATE TABLE `Extra_Type`
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE `Extra_Runs`
(
Match_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
primary key Match_Id,
foreign key Extra_Type_Id references Extra_TypeExtra_Id
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
232
],
"case_2": [
232
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
506,
507,
508,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
653,
654,
655,
657,
658,
659,
660,
661,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
978,
980,
981,
982,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1075,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Name the teams played in a match which resulted in a tie in 2015.
|
resulted in a tie refers to Win_Type = 'Tie'; in 2015 refers to SUBSTR(Match_Date, 1, 4) = 2015
|
SELECT T1.Team_Name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Team_1 OR T1.Team_Id = T2.Team_2 INNER JOIN Win_By AS T3 ON T2.Win_Type = T3.Win_Id WHERE SUBSTR(T2.Match_Date, 1, 4) = '2015' AND T3.Win_Type = 'Tie' LIMIT 1
|
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,982 | 1,982 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Win_By`
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE `Match`
(
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Win_Type INTEGER,
foreign key Team_1 references TeamTeam_Id,
foreign key Team_2 references TeamTeam_Id,
foreign key Win_Type references Win_ByWin_Id
)
|
[
"OR",
"AND",
"SELECT",
"AS",
"LIMIT",
"INNER JOIN",
"ON",
"SUBSTR",
"FROM"
] | 13 |
medium
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
89,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
940,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Calculate the average players out in the first innings per match. How many of them were out by the leg before wicket?
|
out by the leg refers to Out_Name = 'lbw'; out in the first innings refers to Innings_No = 2;
|
SELECT CAST(COUNT(T1.Player_Out) AS REAL) / COUNT(T1.Match_Id), SUM(CASE WHEN T2.Out_Name = 'lbw' THEN 1 ELSE 0 END) FROM Wicket_Taken AS T1 INNER JOIN Out_Type AS T2 ON T1.Kind_Out = T2.Out_Id WHERE T1.Innings_No = 2
|
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,983 | 1,983 |
CREATE TABLE `Out_Type`
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE `Wicket_Taken`
(
Match_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Innings_No INTEGER,
primary key Match_Id, Innings_No,
foreign key Match_Id references MatchMatch_Id,
foreign key Player_Out references PlayerPlayer_Id,
foreign key Kind_Out references Out_TypeOut_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"CASE",
"INNER JOIN",
"ON",
"CAST",
"COUNT",
"FROM"
] | 13 |
medium
|
{
"case_1": [
-1
],
"case_2": [
640
],
"case_3": [
201,
212,
225,
229,
314,
349,
383,
509,
518,
547,
548,
550,
564,
640,
654,
688,
714,
743,
778,
787,
943,
951,
959,
1037,
1064,
1078,
1087,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
4,
6,
11,
16,
22,
24,
27,
30,
35,
36,
37,
39,
42,
47,
51,
53,
55,
61,
62,
63,
64,
68,
69,
71,
73,
74,
75,
77,
81,
82,
83,
86,
87,
88,
91,
93,
94,
96,
98,
104,
106,
112,
113,
115,
117,
118,
119,
120,
121,
125,
126,
127,
129,
131,
140,
141,
142,
143,
146,
148,
152,
153,
155,
158,
159,
160,
164,
167,
169,
170,
171,
173,
175,
179,
183,
184,
186,
187,
188,
189,
190,
191,
192,
195,
196,
197,
199,
201,
202,
206,
207,
212,
213,
214,
215,
219,
223,
225,
226,
227,
228,
229,
233,
234,
236,
243,
244,
247,
248,
254,
256,
258,
261,
264,
267,
268,
269,
271,
276,
277,
278,
279,
298,
299,
300,
301,
304,
311,
313,
314,
316,
317,
319,
320,
322,
323,
325,
330,
334,
335,
336,
338,
339,
341,
344,
345,
347,
349,
354,
356,
358,
360,
363,
364,
365,
370,
373,
374,
375,
378,
379,
381,
382,
383,
384,
391,
392,
393,
394,
398,
401,
402,
403,
406,
409,
411,
412,
415,
416,
417,
423,
424,
426,
427,
436,
438,
444,
445,
448,
450,
451,
452,
453,
454,
458,
460,
462,
464,
465,
467,
469,
470,
471,
473,
476,
477,
478,
479,
483,
484,
485,
486,
487,
488,
490,
493,
500,
504,
505,
509,
510,
514,
515,
516,
517,
518,
519,
520,
526,
528,
532,
535,
536,
537,
538,
540,
544,
547,
548,
550,
552,
558,
559,
560,
563,
564,
566,
571,
573,
575,
579,
580,
581,
582,
595,
596,
597,
606,
608,
609,
611,
612,
613,
620,
623,
627,
628,
630,
632,
633,
634,
638,
640,
641,
645,
646,
649,
650,
654,
658,
659,
662,
663,
665,
666,
668,
669,
671,
672,
676,
681,
682,
686,
687,
688,
690,
694,
695,
696,
701,
705,
706,
710,
712,
714,
717,
721,
723,
727,
733,
734,
735,
736,
739,
740,
743,
744,
745,
747,
749,
750,
752,
753,
756,
760,
762,
768,
769,
772,
776,
777,
778,
779,
787,
788,
790,
795,
796,
797,
798,
799,
800,
802,
804,
805,
808,
810,
812,
813,
814,
818,
819,
823,
824,
825,
827,
830,
832,
838,
839,
841,
844,
848,
849,
851,
853,
857,
866,
867,
868,
870,
871,
874,
876,
877,
880,
886,
888,
893,
894,
896,
897,
898,
901,
902,
909,
911,
912,
913,
915,
917,
918,
922,
923,
924,
926,
927,
930,
934,
935,
941,
943,
944,
950,
951,
954,
956,
958,
959,
961,
962,
963,
969,
973,
975,
977,
981,
985,
986,
993,
996,
998,
1005,
1006,
1008,
1010,
1012,
1013,
1015,
1022,
1023,
1027,
1031,
1037,
1038,
1042,
1043,
1047,
1050,
1051,
1058,
1062,
1064,
1066,
1067,
1068,
1069,
1071,
1072,
1078,
1082,
1084,
1086,
1087,
1092,
1094,
1098,
1100,
1101,
1103,
1104,
1106,
1112,
1119,
1121,
1123,
1124,
1128,
1131,
1133,
1134,
1135,
1137
]
}
|
soccer_2016
|
How many matches are there in 2008?
|
in 2008 refers to Match_Date like '2008%'
|
SELECT COUNT(Match_Id) FROM `Match` WHERE Match_Date LIKE '2008%'
|
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,984 | 1,984 |
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Match_Date DATE
)
|
[
"COUNT",
"LIKE",
"SELECT",
"FROM"
] | 4 |
simple
|
{
"case_1": [
979
],
"case_2": [
979
],
"case_3": [
2,
212,
225,
229,
252,
259,
314,
349,
383,
509,
547,
548,
564,
654,
688,
714,
743,
778,
787,
943,
951,
979,
1037,
1064,
1078,
1087,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
6,
9,
11,
13,
15,
16,
20,
22,
25,
26,
27,
28,
30,
32,
35,
36,
37,
38,
40,
47,
51,
53,
55,
57,
59,
61,
62,
63,
67,
68,
69,
73,
74,
75,
77,
78,
81,
82,
86,
87,
88,
89,
90,
91,
93,
96,
98,
106,
108,
109,
113,
114,
115,
117,
118,
119,
121,
124,
125,
126,
127,
131,
136,
140,
142,
143,
146,
147,
148,
152,
157,
159,
160,
164,
167,
168,
169,
170,
173,
175,
179,
182,
183,
184,
185,
187,
188,
189,
190,
191,
192,
196,
197,
198,
199,
202,
203,
204,
206,
210,
212,
214,
216,
224,
225,
226,
227,
229,
230,
233,
234,
240,
243,
244,
247,
252,
254,
256,
258,
259,
261,
263,
264,
267,
268,
269,
271,
273,
276,
277,
286,
291,
293,
294,
299,
301,
303,
311,
314,
315,
316,
317,
319,
320,
323,
325,
330,
334,
335,
336,
338,
339,
341,
344,
345,
348,
349,
352,
354,
356,
358,
359,
360,
364,
370,
371,
373,
374,
375,
377,
380,
382,
383,
384,
391,
392,
394,
397,
399,
401,
402,
403,
406,
407,
409,
410,
411,
412,
415,
416,
417,
420,
421,
423,
424,
426,
430,
433,
436,
438,
443,
444,
445,
447,
448,
452,
453,
454,
458,
460,
462,
464,
465,
466,
467,
469,
471,
473,
476,
477,
478,
481,
484,
485,
487,
488,
490,
493,
500,
504,
505,
509,
510,
512,
515,
516,
517,
519,
520,
525,
526,
531,
532,
535,
536,
537,
538,
542,
543,
544,
545,
546,
547,
548,
552,
554,
557,
558,
559,
560,
563,
564,
566,
573,
580,
581,
582,
585,
591,
594,
595,
596,
597,
598,
603,
606,
608,
611,
613,
618,
620,
624,
627,
629,
630,
632,
633,
634,
641,
645,
646,
649,
654,
656,
658,
659,
661,
662,
663,
664,
665,
666,
667,
668,
669,
671,
673,
675,
680,
681,
687,
688,
689,
692,
694,
696,
698,
703,
705,
707,
712,
714,
718,
719,
721,
727,
730,
733,
734,
735,
736,
737,
738,
739,
740,
743,
747,
748,
749,
750,
752,
753,
754,
756,
757,
760,
762,
768,
769,
770,
772,
774,
778,
779,
787,
790,
795,
796,
797,
798,
799,
800,
802,
804,
811,
812,
813,
814,
817,
818,
819,
820,
821,
824,
827,
828,
830,
831,
832,
838,
839,
841,
843,
844,
849,
850,
851,
853,
857,
858,
865,
866,
867,
869,
870,
874,
875,
876,
877,
879,
886,
888,
890,
893,
894,
896,
897,
898,
899,
901,
902,
903,
907,
909,
911,
912,
913,
915,
917,
918,
922,
923,
924,
926,
927,
930,
934,
935,
941,
942,
943,
944,
945,
948,
950,
951,
954,
956,
958,
960,
961,
963,
965,
968,
969,
972,
975,
976,
977,
979,
980,
981,
983,
985,
986,
993,
996,
1000,
1005,
1006,
1008,
1010,
1011,
1013,
1014,
1015,
1018,
1019,
1020,
1022,
1023,
1030,
1037,
1042,
1043,
1047,
1050,
1051,
1053,
1054,
1055,
1057,
1058,
1059,
1062,
1064,
1067,
1069,
1070,
1071,
1072,
1076,
1077,
1078,
1079,
1082,
1084,
1086,
1087,
1090,
1094,
1096,
1098,
1100,
1101,
1103,
1104,
1106,
1111,
1112,
1113,
1117,
1119,
1121,
1123,
1124,
1126,
1127,
1128,
1131,
1133,
1134,
1135,
1137
]
}
|
soccer_2016
|
Count the matches with a total of two innings.
|
total of two innings refers to innings_no = 2;
|
SELECT COUNT(Match_Id) FROM Wicket_Taken WHERE innings_no = 2
|
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,985 | 1,985 |
CREATE TABLE `Wicket_Taken`
(
Match_Id INTEGER,
Innings_No INTEGER,
primary key Match_Id, Innings_No,
foreign key Match_Id references MatchMatch_Id
)
|
[
"COUNT",
"SELECT",
"FROM"
] | 3 |
simple
|
{
"case_1": [
245
],
"case_2": [
245
],
"case_3": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
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,
1001,
1002,
1003,
1004,
1005,
1006,
1007,
1008,
1009,
1010,
1011,
1012,
1013,
1014,
1015,
1016,
1017,
1018,
1019,
1020,
1021,
1022,
1023,
1024,
1025,
1026,
1027,
1028,
1029,
1030,
1031,
1032,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1040,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1053,
1054,
1055,
1056,
1057,
1058,
1059,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1073,
1074,
1075,
1076,
1077,
1078,
1079,
1080,
1081,
1082,
1083,
1084,
1085,
1086,
1087,
1088,
1089,
1090,
1091,
1092,
1093,
1094,
1095,
1096,
1097,
1098,
1099,
1100,
1101,
1102,
1103,
1104,
1105,
1106,
1107,
1108,
1109,
1110,
1111,
1112,
1113,
1114,
1115,
1116,
1117,
1118,
1119,
1120,
1121,
1122,
1123,
1124,
1125,
1126,
1127,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137,
1138,
1139,
1140,
1141
]
}
|
soccer_2016
|
Which is the country of the city named "Rajkot"?
|
city named "Rajkot" refers to city_name = 'Rajkot';
|
SELECT T1.Country_Name FROM Country AS T1 INNER JOIN city AS T2 ON T1.Country_Id = T2.Country_Id WHERE city_name = 'Rajkot'
|
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,986 | 1,986 |
CREATE TABLE `City`
(
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE `Country`
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key Country_Id references CountryCountry_Id
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
201
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
506,
507,
508,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
653,
654,
655,
657,
658,
659,
660,
661,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
978,
980,
981,
982,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1075,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
How many of the matches are Superover?
|
are Superover refers to win_type = 'wickets';
|
SELECT SUM(CASE WHEN T2.win_type = 'wickets' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id
|
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,987 | 1,987 |
CREATE TABLE `Win_By`
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE `Match`
(
Win_Type INTEGER,
foreign key Win_Type references Win_ByWin_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"CASE",
"INNER JOIN",
"ON",
"FROM"
] | 9 |
simple
|
{
"case_1": [
518,
577
],
"case_2": [
518,
564,
577
],
"case_3": [
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1110,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
54,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
122,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
173,
175,
176,
177,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
205,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
245,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
507,
508,
509,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
709,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
872,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
939,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
979,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1093,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1110,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
What are the teams that played in a match with the point of winning margin of 38 on April 30, 2009?
|
point of winning margin of 38 refers to win_margin = 38; on April 30, 2009 refers to match_date = '2009-04-30'; team refers to Team_Name;
|
SELECT T1.Team_Name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Team_1 WHERE T2.win_margin = 38 AND match_date = '2009-04-30'
|
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,988 | 1,988 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Team_1 INTEGER,
Match_Date DATE,
Win_Margin INTEGER,
foreign key Team_1 references TeamTeam_Id
)
|
[
"AS",
"AND",
"SELECT",
"-",
"INNER JOIN",
"ON",
"FROM"
] | 9 |
simple
|
{
"case_1": [
592,
1098
],
"case_2": [
212,
592,
829,
1064,
1087,
1098
],
"case_3": [
2,
43,
134,
150,
201,
212,
225,
229,
232,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
32,
33,
34,
36,
37,
39,
41,
42,
43,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
79,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
259,
260,
261,
262,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
362,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
510,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
667,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
679,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
785,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
817,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
864,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1070,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Give the name of the team of T Kohli in the match ID 335989.
|
team of T Kohli refers to player_name = 'T Kohli';
|
SELECT T1.Team_Name FROM Team AS T1 INNER JOIN Player_Match AS T2 ON T1.Team_Id = T2.Team_Id INNER JOIN Player AS T3 ON T2.Player_Id = T3.Player_Id WHERE T2.match_id = 335989 AND T3.player_name = 'T Kohli'
|
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,989 | 1,989 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Player_Match`
(
Match_Id INTEGER,
Player_Id INTEGER,
Team_Id INTEGER,
primary key Match_Id, Player_Id,
foreign key Match_Id references MatchMatch_Id,
foreign key Player_Id references PlayerPlayer_Id,
foreign key Team_Id references TeamTeam_Id
)
|
[
"AS",
"AND",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 10 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
510,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
How many venues are located at Centurion, South Africa?
|
venues are located at Centurion refers to city_name = 'Centurion'; South Africa refers to country_name = 'South Africa'
|
SELECT COUNT(T1.Venue_name) FROM Venue AS T1 INNER JOIN City AS T2 ON T1.City_Id = T2.City_Id INNER JOIN Country AS T3 ON T2.Country_Id = T3.Country_Id WHERE T3.country_name = 'South Africa' AND T2.city_name = 'Centurion'
|
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,990 | 1,990 |
CREATE TABLE `City`
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE `Country`
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key Country_Id references CountryCountry_Id
)
CREATE TABLE `Venue`
(
Venue_Name TEXT,
City_Id INTEGER,
foreign key City_Id references CityCity_Id
)
|
[
"AS",
"AND",
"SELECT",
"INNER JOIN",
"ON",
"COUNT",
"FROM"
] | 11 |
medium
|
{
"case_1": [
714
],
"case_2": [
714
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
32,
33,
34,
35,
36,
37,
39,
40,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
67,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
109,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
230,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
259,
260,
261,
262,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
294,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
399,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
421,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
507,
509,
510,
511,
512,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
554,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
591,
592,
593,
594,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
618,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
656,
657,
658,
659,
660,
661,
662,
663,
665,
666,
667,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
680,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
692,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
707,
710,
711,
712,
714,
715,
717,
718,
719,
720,
721,
722,
723,
724,
725,
726,
727,
728,
730,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
817,
818,
819,
820,
822,
823,
824,
825,
827,
828,
829,
830,
831,
832,
833,
834,
835,
837,
838,
839,
841,
843,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
903,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
945,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
965,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1014,
1015,
1016,
1017,
1019,
1020,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1059,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1078,
1079,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1126,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Among the matches of Delhi Daredevils in 2014, how many won matches are there?
|
Delhi Daredevils refers to team_name = 'Delhi Daredevils'; in 2014 refers to Match_Date contains '2014';
|
SELECT COUNT(T1.Match_Winner) FROM `Match` AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_1 OR T2.Team_Id = T1.Team_2 WHERE T2.team_name = 'Delhi Daredevils' AND T1.Match_Date LIKE '2014%'
|
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,991 | 1,991 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Match_Winner INTEGER,
foreign key Team_1 references TeamTeam_Id,
foreign key Team_2 references TeamTeam_Id,
foreign key Match_Winner references TeamTeam_Id
)
|
[
"OR",
"AND",
"SELECT",
"AS",
"LIKE",
"INNER JOIN",
"ON",
"COUNT",
"FROM"
] | 10 |
simple
|
{
"case_1": [
592,
1098
],
"case_2": [
212,
592,
829,
1064,
1087,
1098
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
421,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
510,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
591,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1070,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Among the matches played by Royal Challengers Bangalore, what is the match ID of the match with the highest winning margin?
|
Royal Challengers Bangalore refers to team_name = 'Royal Challengers Bangalore'; highest winning margin refers to MAX(win_margin)
|
SELECT T2.match_id FROM Team AS T1 INNER JOIN Match AS T2 ON T1.team_id = T2.match_winner WHERE T1.team_name = 'Royal Challengers Bangalore' AND T2.match_date LIKE '2012%' ORDER BY T2.win_margin DESC LIMIT 1
|
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,992 | 1,992 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Match_Date DATE,
Win_Margin INTEGER,
Match_Winner INTEGER,
foreign key Match_Winner references TeamTeam_Id
)
|
[
"AS",
"AND",
"SELECT",
"LIKE",
"LIMIT",
"ORDER BY",
"INNER JOIN",
"ON",
"DESC",
"FROM"
] | 11 |
medium
|
{
"case_1": [
212,
1064
],
"case_2": [
212,
592,
829,
1064,
1098
],
"case_3": [
150,
212,
229,
314,
349,
383,
548,
592,
654,
688,
714,
743,
778,
787,
829,
951,
1037,
1064,
1065,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
1,
3,
4,
5,
8,
10,
11,
12,
19,
20,
21,
22,
24,
26,
29,
30,
33,
36,
37,
38,
39,
44,
45,
47,
49,
51,
52,
53,
55,
57,
59,
62,
63,
66,
68,
69,
71,
73,
74,
75,
76,
81,
82,
85,
86,
88,
89,
90,
93,
95,
96,
98,
99,
111,
112,
113,
115,
116,
117,
118,
119,
121,
125,
126,
127,
128,
129,
131,
136,
138,
141,
142,
143,
144,
146,
150,
152,
154,
158,
159,
160,
162,
163,
164,
167,
169,
170,
172,
175,
176,
177,
179,
180,
183,
184,
187,
188,
197,
199,
200,
202,
206,
212,
213,
214,
219,
227,
229,
233,
239,
240,
244,
247,
256,
258,
262,
263,
264,
265,
266,
267,
268,
272,
275,
276,
277,
278,
281,
282,
286,
296,
301,
309,
311,
313,
314,
315,
317,
319,
320,
324,
325,
329,
330,
334,
336,
339,
341,
342,
345,
348,
349,
353,
356,
361,
364,
365,
368,
370,
373,
374,
376,
378,
379,
381,
382,
383,
385,
391,
393,
394,
395,
398,
402,
403,
405,
406,
407,
408,
409,
411,
413,
414,
415,
416,
417,
419,
424,
425,
426,
427,
428,
429,
430,
433,
434,
435,
436,
437,
438,
440,
444,
445,
446,
448,
451,
452,
454,
455,
460,
462,
463,
464,
469,
470,
475,
476,
477,
480,
482,
490,
493,
494,
495,
496,
497,
498,
500,
505,
507,
514,
515,
516,
519,
520,
522,
524,
526,
528,
529,
530,
532,
533,
536,
537,
538,
539,
541,
542,
544,
548,
552,
557,
558,
559,
560,
561,
562,
563,
566,
567,
578,
579,
581,
582,
584,
586,
588,
589,
590,
592,
595,
605,
608,
610,
611,
612,
613,
615,
621,
624,
625,
626,
627,
632,
633,
634,
637,
638,
641,
643,
645,
648,
651,
654,
657,
659,
663,
665,
666,
668,
669,
671,
675,
677,
678,
681,
683,
684,
685,
686,
687,
688,
690,
691,
693,
697,
699,
701,
702,
712,
714,
715,
719,
726,
727,
733,
734,
735,
739,
740,
741,
743,
746,
747,
749,
752,
753,
754,
756,
758,
759,
760,
763,
765,
767,
768,
773,
774,
775,
776,
777,
778,
780,
783,
787,
788,
790,
793,
796,
797,
799,
800,
803,
804,
806,
807,
808,
810,
814,
818,
819,
823,
824,
825,
827,
828,
829,
830,
832,
835,
838,
841,
844,
848,
849,
850,
851,
853,
858,
859,
860,
861,
866,
867,
870,
873,
875,
876,
877,
878,
879,
886,
888,
889,
891,
892,
893,
895,
896,
901,
902,
905,
907,
909,
911,
917,
918,
922,
923,
924,
927,
928,
929,
930,
931,
932,
934,
935,
944,
949,
950,
951,
953,
954,
956,
958,
961,
962,
963,
966,
967,
969,
970,
973,
974,
975,
977,
980,
981,
985,
986,
991,
994,
996,
1000,
1001,
1004,
1005,
1006,
1010,
1013,
1017,
1019,
1022,
1023,
1025,
1027,
1031,
1034,
1037,
1038,
1039,
1042,
1044,
1046,
1047,
1049,
1050,
1051,
1056,
1057,
1058,
1061,
1063,
1064,
1065,
1067,
1068,
1071,
1072,
1080,
1084,
1086,
1092,
1094,
1098,
1100,
1101,
1103,
1104,
1105,
1109,
1111,
1115,
1119,
1123,
1124,
1128,
1131,
1136,
1137
]
}
|
soccer_2016
|
How many times did K Goel played as a player only?
|
K Goel refers to Player_Name = 'K Goel'; played as a player only refers to Role_Id = 3
|
SELECT COUNT(T1.Match_Id) FROM Player_Match AS T1 INNER JOIN Player AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Rolee AS T3 ON T1.Role_Id = T3.Role_Id WHERE T2.Player_Name = 'K Goel' AND T3.Role_Id = 3
|
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,993 | 1,993 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Rolee`
(
Role_Id INTEGER
primary key
)
CREATE TABLE `Player_Match`
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
primary key Match_Id, Player_Id, Role_Id,
foreign key Match_Id references MatchMatch_Id,
foreign key Player_Id references PlayerPlayer_Id,
foreign key Role_Id references RoleeRole_Id
)
|
[
"AS",
"AND",
"SELECT",
"INNER JOIN",
"ON",
"COUNT",
"FROM"
] | 11 |
medium
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
32,
33,
34,
35,
36,
37,
39,
40,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
67,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
109,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
230,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
259,
260,
261,
262,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
294,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
399,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
421,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
507,
509,
510,
511,
512,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
554,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
591,
592,
593,
594,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
618,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
656,
657,
658,
659,
660,
661,
662,
663,
665,
666,
667,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
680,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
692,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
707,
710,
711,
712,
714,
715,
717,
718,
719,
720,
721,
722,
723,
724,
725,
726,
727,
728,
730,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
817,
818,
819,
820,
822,
823,
824,
825,
827,
828,
829,
830,
831,
832,
833,
834,
835,
837,
838,
839,
841,
843,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
903,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
945,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
965,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1014,
1015,
1016,
1017,
1019,
1020,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1059,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1078,
1079,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1126,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
What is the average winning margin of the matches held in Newlands?
|
average winning margin refers to avg(win_margin); held in Newlands refers to venue_name = 'Newlands'
|
SELECT AVG(T1.win_margin) FROM Match AS T1 INNER JOIN Venue AS T2 ON T1.venue_id = T2.venue_id WHERE T2.venue_name = 'Newlands'
|
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,994 | 1,994 |
CREATE TABLE `Venue`
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT
)
CREATE TABLE `Match`
(
Venue_Id INTEGER,
Win_Margin INTEGER,
foreign key Venue_Id references VenueVenue_Id
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"AVG",
"FROM"
] | 7 |
simple
|
{
"case_1": [
-1
],
"case_2": [
688,
1092
],
"case_3": [
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1005,
1006,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Provide the losing team's name in the match ID 336039.
|
losing team's name refers to Team_Id NOT in "match_winner" column
|
SELECT Team_Name FROM Team WHERE Team_Id = ( SELECT CASE WHEN Team_1 = Match_Winner THEN Team_2 ELSE Team_1 END FROM Match WHERE match_id = 336039 )
|
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,995 | 1,995 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Winner INTEGER,
foreign key Team_1 references TeamTeam_Id,
foreign key Team_2 references TeamTeam_Id,
foreign key Match_Winner references TeamTeam_Id
)
|
[
"CASE WHEN",
"CASE",
"SELECT",
"FROM"
] | 6 |
simple
|
{
"case_1": [
54,
1098,
1110
],
"case_2": [
54,
212,
1064,
1087,
1098,
1110
],
"case_3": [
54,
122,
201,
205,
212,
225,
245,
383,
518,
547,
550,
564,
640,
787,
943,
959,
979,
1064,
1078,
1087,
1092,
1093,
1098,
1110
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
6,
16,
24,
42,
54,
61,
64,
71,
77,
81,
104,
106,
113,
120,
122,
127,
129,
148,
152,
153,
155,
158,
171,
173,
191,
192,
195,
201,
205,
207,
212,
215,
219,
223,
225,
226,
234,
236,
245,
248,
258,
261,
263,
264,
267,
271,
279,
298,
299,
300,
303,
304,
305,
322,
335,
347,
360,
362,
375,
383,
393,
398,
402,
406,
412,
415,
423,
427,
438,
443,
452,
453,
458,
476,
478,
479,
485,
486,
500,
504,
508,
514,
517,
518,
528,
535,
540,
547,
550,
563,
564,
571,
573,
575,
580,
581,
601,
620,
623,
628,
640,
646,
662,
666,
672,
676,
682,
686,
706,
709,
710,
723,
740,
744,
747,
753,
762,
772,
776,
787,
788,
795,
796,
798,
800,
805,
808,
827,
841,
844,
848,
868,
871,
872,
874,
880,
896,
909,
912,
922,
924,
926,
939,
941,
943,
944,
959,
978,
979,
985,
998,
1008,
1012,
1036,
1048,
1062,
1064,
1066,
1069,
1078,
1082,
1087,
1092,
1093,
1098,
1110,
1129,
1131,
1133,
1134,
1135
]
}
|
soccer_2016
|
What is the venue for the match ID 829768?
|
venue refers to Venue_Name
|
SELECT T1.Venue_Name FROM Venue AS T1 INNER JOIN Match AS T2 ON T1.venue_id = T2.venue_id WHERE T2.match_id = 829768
|
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,996 | 1,996 |
CREATE TABLE `Venue`
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT
)
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Venue_Id INTEGER,
foreign key Venue_Id references VenueVenue_Id
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
688,
1092
],
"case_3": [
2,
134,
150,
201,
212,
225,
229,
232,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
367,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
506,
507,
508,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
653,
654,
655,
657,
658,
659,
660,
661,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
978,
980,
981,
982,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1075,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
What is the second team's name in the match with the lowest winning margin?
|
lowest winning margin refers to MIN(win_margin); team name refers to team_name; second team refers to team_2
|
SELECT T1.team_name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.team_id = T2.team_2 ORDER BY T2.win_margin LIMIT 1
|
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,997 | 1,997 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Team_2 INTEGER,
Win_Margin INTEGER,
foreign key Team_2 references TeamTeam_Id
)
|
[
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"FROM"
] | 8 |
simple
|
{
"case_1": [
592,
713,
1098
],
"case_2": [
212,
592,
713,
829,
1064,
1087,
1098
],
"case_3": [
134,
150,
201,
212,
225,
229,
232,
252,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
26,
27,
28,
29,
30,
33,
34,
36,
37,
38,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
78,
80,
81,
82,
83,
84,
85,
86,
88,
89,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
108,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
133,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
173,
174,
175,
176,
177,
178,
179,
180,
181,
183,
184,
185,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
208,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
252,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
285,
286,
287,
289,
290,
291,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
337,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
348,
349,
352,
353,
354,
356,
357,
358,
359,
360,
361,
363,
364,
365,
368,
369,
370,
371,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
400,
401,
402,
403,
404,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
534,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
576,
577,
578,
579,
580,
581,
582,
583,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
619,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
664,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
698,
699,
700,
701,
702,
703,
704,
705,
706,
708,
710,
711,
712,
713,
714,
715,
717,
719,
720,
721,
722,
723,
724,
725,
726,
727,
728,
732,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
748,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
815,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
836,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
869,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
946,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
972,
973,
974,
975,
977,
980,
981,
983,
985,
986,
987,
988,
989,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1024,
1025,
1027,
1029,
1030,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1057,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1071,
1072,
1074,
1075,
1076,
1077,
1078,
1080,
1082,
1083,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137,
1139,
1141
]
}
|
soccer_2016
|
Among the matches in 2013, what is the percentage of winning of the team "Mumbai Indians"?
|
in 2013 refers to Match_Date like '2013%'; winning of the team "Mumbai Indians" refers to Match_Winner = 7; percentage refers to DIVIDE(COUNT(Match_Winner = 7), COUNT(Match_Winner))
|
SELECT CAST(SUM(CASE WHEN T2.Match_Winner = 7 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.Match_Winner) FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Match_Winner WHERE T2.Match_Date LIKE '2013%'
|
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,998 | 1,998 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key
)
CREATE TABLE `Match`
(
Match_Date DATE,
Match_Winner INTEGER,
foreign key Match_Winner references TeamTeam_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"LIKE",
"CASE",
"INNER JOIN",
"ON",
"CAST",
"COUNT",
"FROM"
] | 13 |
medium
|
{
"case_1": [
212,
1064
],
"case_2": [
212,
1064,
1087,
1098
],
"case_3": [
201,
212,
225,
229,
314,
349,
383,
509,
518,
547,
548,
550,
564,
640,
654,
688,
714,
743,
778,
787,
943,
951,
959,
979,
1037,
1064,
1078,
1087,
1092,
1098,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
6,
11,
16,
20,
22,
24,
26,
27,
30,
35,
36,
37,
39,
42,
47,
51,
53,
55,
57,
59,
61,
62,
63,
64,
68,
69,
71,
73,
74,
75,
77,
81,
82,
83,
86,
87,
88,
90,
91,
93,
94,
96,
98,
104,
106,
112,
113,
115,
117,
118,
119,
120,
121,
125,
126,
127,
129,
131,
136,
140,
141,
142,
143,
146,
148,
152,
153,
155,
158,
159,
160,
164,
167,
169,
170,
171,
173,
175,
179,
183,
184,
186,
187,
188,
189,
190,
191,
192,
195,
196,
197,
199,
201,
202,
206,
207,
212,
213,
214,
215,
219,
223,
225,
226,
227,
228,
229,
233,
234,
236,
240,
243,
244,
247,
248,
254,
256,
258,
261,
264,
267,
268,
269,
271,
276,
277,
278,
279,
298,
299,
300,
301,
304,
311,
313,
314,
315,
316,
317,
319,
320,
322,
323,
325,
330,
334,
335,
336,
338,
339,
341,
344,
345,
347,
349,
354,
356,
358,
360,
363,
364,
365,
370,
373,
374,
375,
378,
379,
381,
382,
383,
384,
391,
392,
393,
394,
398,
401,
402,
403,
406,
407,
409,
411,
412,
415,
416,
417,
423,
424,
426,
427,
430,
433,
436,
438,
444,
445,
448,
450,
451,
452,
453,
454,
458,
460,
462,
464,
465,
467,
469,
470,
471,
473,
476,
477,
478,
479,
483,
484,
485,
486,
487,
488,
490,
493,
500,
504,
505,
509,
510,
514,
515,
516,
517,
518,
519,
520,
526,
528,
532,
535,
536,
537,
538,
540,
544,
547,
548,
550,
552,
557,
558,
559,
560,
563,
564,
566,
571,
573,
575,
579,
580,
581,
582,
595,
596,
597,
606,
608,
609,
611,
612,
613,
620,
623,
624,
627,
628,
630,
632,
633,
634,
638,
640,
641,
645,
646,
649,
650,
654,
658,
659,
662,
663,
665,
666,
668,
669,
671,
672,
675,
676,
681,
682,
686,
687,
688,
690,
694,
695,
696,
701,
705,
706,
710,
712,
714,
717,
721,
723,
727,
733,
734,
735,
736,
739,
740,
743,
744,
745,
747,
749,
750,
752,
753,
754,
756,
760,
762,
768,
769,
772,
774,
776,
777,
778,
779,
787,
788,
790,
795,
796,
797,
798,
799,
800,
802,
804,
805,
808,
810,
812,
813,
814,
818,
819,
823,
824,
825,
827,
828,
830,
832,
838,
839,
841,
844,
848,
849,
850,
851,
853,
857,
858,
866,
867,
868,
870,
871,
874,
875,
876,
877,
879,
880,
886,
888,
893,
894,
896,
897,
898,
901,
902,
907,
909,
911,
912,
913,
915,
917,
918,
922,
923,
924,
926,
927,
930,
934,
935,
941,
943,
944,
950,
951,
954,
956,
958,
959,
961,
962,
963,
969,
973,
975,
977,
979,
980,
981,
985,
986,
993,
996,
998,
1000,
1005,
1006,
1008,
1010,
1012,
1013,
1015,
1019,
1022,
1023,
1027,
1031,
1037,
1038,
1042,
1043,
1047,
1050,
1051,
1058,
1062,
1064,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1078,
1082,
1084,
1086,
1087,
1092,
1094,
1098,
1100,
1101,
1103,
1104,
1106,
1111,
1112,
1119,
1121,
1123,
1124,
1128,
1131,
1133,
1134,
1135,
1137
]
}
|
soccer_2016
|
What is the difference between the number of matches where SC Ganguly played as a Captain and those matches where he played other roles?
|
SC Ganguly refers to Player_Name = 'SC Ganguly'; played as a Captain refers to Role_Id = 1; played other roles refers to Role_Id > 1; difference refers to SUBTRACT(COUNT(Role_Id = 1), COUNT(Role_Id > 1))
|
SELECT SUM(CASE WHEN T3.Role_Id = 1 THEN 1 ELSE 0 END) - SUM(CASE WHEN T3.Role_Id > 1 THEN 1 ELSE 0 END) FROM Player_Match AS T1 INNER JOIN Player AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Rolee AS T3 ON T1.Role_Id = T3.Role_Id WHERE T2.Player_Name = 'SC Ganguly'
|
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 1,999 | 1,999 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Rolee`
(
Role_Id INTEGER
primary key
)
CREATE TABLE `Player_Match`
(
Player_Id INTEGER,
Role_Id INTEGER, Player_Id, Role_Id,
foreign key Player_Id references PlayerPlayer_Id,
foreign key Role_Id references RoleeRole_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"CASE",
"INNER JOIN",
"ON",
"FROM"
] | 15 |
medium
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
640,
644,
654,
688,
700,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1110,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
54,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
122,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
173,
175,
176,
177,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
205,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
245,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
507,
508,
509,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
709,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
872,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
939,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
979,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1093,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1110,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
How many players have the bowling skill greater than 2?
|
bowling skill greater than 2 refers to Bowling_skill > 2
|
SELECT COUNT(Player_Name) FROM Player WHERE Bowling_skill > 2
|
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE Bowling_Style
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE City
(
City_Id INTEGER
primary key,
City_Name TEXT,
Country_id INTEGER
)
CREATE TABLE Country
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key (Country_Id) references Country(Country_Id)
)
CREATE TABLE Extra_Type
(
Extra_Id INTEGER
primary key,
Extra_Name TEXT
)
CREATE TABLE Extra_Runs
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Extra_Type_Id INTEGER,
Extra_Runs INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id)
)
CREATE TABLE Out_Type
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE Player
(
Player_Id INTEGER
primary key,
Player_Name TEXT,
DOB DATE,
Batting_hand INTEGER,
Bowling_skill INTEGER,
Country_Name INTEGER,
foreign key (Batting_hand) references Batting_Style(Batting_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
foreign key (Country_Name) references Country(Country_Id)
)
CREATE TABLE Rolee
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE Season
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Purple_Cap INTEGER,
Season_Year INTEGER
)
CREATE TABLE Team
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE Umpire
(
Umpire_Id INTEGER
primary key,
Umpire_Name TEXT,
Umpire_Country INTEGER,
foreign key (Umpire_Country) references Country(Country_Id)
)
CREATE TABLE Venue
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT,
City_Id INTEGER,
foreign key (City_Id) references City(City_Id)
)
CREATE TABLE Win_By
(
Win_Id INTEGER
primary key,
Win_Type TEXT
)
CREATE TABLE Match
(
Match_Id INTEGER
primary key,
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Season_Id INTEGER,
Venue_Id INTEGER,
Toss_Winner INTEGER,
Toss_Decide INTEGER,
Win_Type INTEGER,
Win_Margin INTEGER,
Outcome_type INTEGER,
Match_Winner INTEGER,
Man_of_the_Match INTEGER,
foreign key (Team_1) references Team(Team_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Season_Id) references Season(Season_Id),
foreign key (Venue_Id) references Venue(Venue_Id),
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Man_of_the_Match) references Player(Player_Id)
)
CREATE TABLE Ball_by_Ball
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Team_Batting INTEGER,
Team_Bowling INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
Bowler INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Batsman_Scored
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id)
)
CREATE TABLE Player_Match
(
Match_Id INTEGER,
Player_Id INTEGER,
Role_Id INTEGER,
Team_Id INTEGER,
primary key (Match_Id, Player_Id, Role_Id),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Id) references Player(Player_Id),
foreign key (Team_Id) references Team(Team_Id),
foreign key (Role_Id) references Rolee(Role_Id)
)
CREATE TABLE Wicket_Taken
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Player_Out INTEGER,
Kind_Out INTEGER,
Fielders INTEGER,
Innings_No INTEGER,
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
foreign key (Match_Id) references Match(Match_Id),
foreign key (Player_Out) references Player(Player_Id),
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id)
)
|
na
| 2,000 | 2,000 |
CREATE TABLE `Player`
(
Player_Name TEXT,
Bowling_skill INTEGER,
foreign key Bowling_skill references Bowling_StyleBowling_Id
)
|
[
"COUNT",
"SELECT",
"FROM"
] | 3 |
simple
|
{
"case_1": [
2,
43,
259,
617,
1093
],
"case_2": [
2,
43,
259,
617,
1093
],
"case_3": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_4": [
2,
43,
54,
122,
134,
150,
201,
205,
212,
225,
229,
232,
245,
252,
259,
314,
349,
383,
509,
518,
547,
548,
550,
564,
577,
592,
617,
640,
644,
654,
688,
700,
713,
714,
743,
778,
787,
829,
943,
951,
959,
979,
1024,
1037,
1064,
1065,
1078,
1087,
1091,
1092,
1093,
1098,
1102,
1110,
1124
],
"case_5": [
0,
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,
1001,
1002,
1003,
1004,
1005,
1006,
1007,
1008,
1009,
1010,
1011,
1012,
1013,
1014,
1015,
1016,
1017,
1018,
1019,
1020,
1021,
1022,
1023,
1024,
1025,
1026,
1027,
1028,
1029,
1030,
1031,
1032,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1040,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1053,
1054,
1055,
1056,
1057,
1058,
1059,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1073,
1074,
1075,
1076,
1077,
1078,
1079,
1080,
1081,
1082,
1083,
1084,
1085,
1086,
1087,
1088,
1089,
1090,
1091,
1092,
1093,
1094,
1095,
1096,
1097,
1098,
1099,
1100,
1101,
1102,
1103,
1104,
1105,
1106,
1107,
1108,
1109,
1110,
1111,
1112,
1113,
1114,
1115,
1116,
1117,
1118,
1119,
1120,
1121,
1122,
1123,
1124,
1125,
1126,
1127,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137,
1138,
1139,
1140,
1141
]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.