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
|
What is the role of SC Ganguly in the match on 2008/4/18?
|
role refers to of Role_Id; SC Ganguly refers to Player_Name = 'SC Ganguly'; on 2008/4/18 refers to Match_Date = '2008-04-18'
|
SELECT T2.Role_Id FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Rolee AS T3 ON T2.Role_Id = T3.Role_Id INNER JOIN Match AS T4 ON T2.Match_Id = T4.Match_Id WHERE T1.Player_Name = 'SC Ganguly' AND T4.Match_Date = '2008-04-18'
|
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,801 | 1,801 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Rolee`
(
Role_Id INTEGER
primary key
)
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",
"AND",
"SELECT",
"-",
"INNER JOIN",
"ON",
"FROM"
] | 15 |
medium
|
{
"case_1": [
-1
],
"case_2": [
787
],
"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
|
Among all the matches SC Ganguly has played in, what is the highest winning margin?
|
SC Ganguly refers to Player_Name = 'SC Ganguly'; the highest winning margin refers to max(Win_Margin)
|
SELECT MAX(T3.Win_Margin) 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 T1.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 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,802 | 1,802 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Win_Margin INTEGER
)
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",
"SELECT",
"INNER JOIN",
"ON",
"FROM",
"MAX"
] | 10 |
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,
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,
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,
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,
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,
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
|
What is the average winning margin of all the matches SC Ganguly has played in?
|
SC Ganguly refers to Player_Name = 'SC Ganguly'; the average winning margin = divide(sum(Win_Margin), count(Match_Id)) where Player_Name = 'SC Ganguly'
|
SELECT CAST(SUM(T3.Win_Margin) AS REAL) / COUNT(*) 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 T1.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 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,803 | 1,803 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Win_Margin INTEGER
)
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",
"SELECT",
"SUM",
"INNER JOIN",
"ON",
"CAST",
"COUNT",
"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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Among all the players born after the year 1985, what is the percentage of the players who use the right hand as their batting hand?
|
born after the year 1985 refers to SUBSTR(DOB, 1, 4) > 1985; right hand as batting hand refers to Batting_Hand = 'Right-hand bat'; percentage = divide(count(Player_Id where Batting_Hand = 'Right-hand bat'), count(Player_Id)) * 100% where SUBSTR(DOB, 1, 4) > 1985
|
SELECT CAST(SUM(CASE WHEN T2.Batting_Hand = 'Right-hand bat' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Player_Id) FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id WHERE SUBSTR(T1.DOB, 1, 4) > 1985
|
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,804 | 1,804 |
CREATE TABLE `Batting_Style`
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
DOB DATE,
Batting_hand INTEGER,
foreign key Batting_hand references Batting_StyleBatting_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"CASE",
"-",
"INNER JOIN",
"ON",
"SUBSTR",
"CAST",
"COUNT",
"FROM"
] | 14 |
medium
|
{
"case_1": [
943,
1078
],
"case_2": [
550,
943,
959,
1078
],
"case_3": [
201,
212,
225,
383,
509,
518,
547,
550,
564,
640,
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,
24,
39,
42,
61,
64,
71,
74,
77,
81,
93,
98,
106,
112,
113,
115,
119,
120,
127,
129,
141,
148,
152,
153,
155,
158,
169,
173,
183,
184,
187,
189,
191,
192,
195,
197,
199,
201,
207,
212,
215,
219,
223,
225,
226,
228,
234,
236,
244,
248,
254,
261,
264,
267,
271,
279,
299,
300,
304,
316,
317,
322,
323,
325,
335,
339,
347,
356,
360,
375,
382,
383,
391,
392,
393,
394,
402,
406,
409,
412,
415,
416,
423,
427,
436,
438,
445,
448,
451,
452,
453,
458,
476,
478,
483,
485,
486,
487,
488,
500,
504,
509,
510,
514,
517,
518,
520,
535,
537,
540,
544,
547,
550,
559,
560,
563,
564,
571,
573,
575,
580,
581,
597,
620,
623,
628,
630,
640,
646,
649,
658,
662,
666,
676,
681,
682,
686,
690,
695,
710,
723,
740,
744,
747,
750,
753,
756,
762,
772,
776,
777,
787,
788,
795,
796,
798,
800,
802,
805,
808,
810,
813,
827,
832,
838,
841,
848,
868,
870,
871,
874,
894,
896,
898,
909,
912,
922,
924,
926,
930,
943,
944,
954,
958,
959,
985,
993,
998,
1008,
1012,
1023,
1031,
1062,
1064,
1068,
1069,
1072,
1078,
1082,
1087,
1092,
1098,
1100,
1101,
1123,
1128,
1131,
1133,
1134,
1135
]
}
|
soccer_2016
|
Give the name of the youngest player.
|
name of player refers to Player_Name; the youngest 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,805 | 1,805 |
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
|
How many times has Sunrisers Hyderabad been the toss winner of a game?
|
Sunrisers Hyderabad refers to Team_Name = 'Sunrisers Hyderabad'; time of toss winner refers to count(Toss_Winner)
|
SELECT SUM(CASE WHEN Toss_Winner = ( SELECT Team_Id FROM Team WHERE Team_Name = 'Sunrisers Hyderabad' ) THEN 1 ELSE 0 END) FROM `Match`
|
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,806 | 1,806 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Toss_Winner INTEGER,
foreign key Toss_Winner references TeamTeam_Id
)
|
[
"CASE WHEN",
"SELECT",
"SUM",
"CASE",
"FROM"
] | 7 |
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,
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,
285,
298,
299,
300,
303,
304,
305,
313,
316,
317,
322,
323,
335,
347,
350,
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,
987,
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
|
Give the name of the striker in the match no. 419169, over no.3, ball no.2, inning no.2.
|
name of the striker refers to Player_Name; match no. 419169 refers to Match_Id = 419169; over no.3 refers to Over_Id = 3; ball no.2 refers to Ball_Id = 2; inning no.2 refers to Innings_No = 2
|
SELECT T2.Player_Name FROM Ball_by_Ball AS T1 INNER JOIN Player AS T2 ON T1.Striker = T2.Player_Id WHERE T1.Match_Id = 419169 AND T1.Over_Id = 3 AND T1.Ball_Id = 2 AND T1.Innings_No = 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 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,807 | 1,807 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Ball_by_Ball`
(
Match_Id INTEGER,
Over_Id INTEGER,
Ball_Id INTEGER,
Innings_No INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER,
primary key Match_Id, Over_Id, Ball_Id, Innings_No,
foreign key Match_Id references MatchMatch_Id
)
|
[
"AS",
"AND",
"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,
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
|
Give the name of venue for the game with a win margin of 138 points.
|
name of venue refers to Venue_Name; a win margin of 138 points refers to Win_Margin = 138
|
SELECT T2.Venue_Name FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE T1.Win_Margin = 138
|
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,808 | 1,808 |
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",
"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
|
For the game on 2008/5/12, who was the man of the match?
|
on 2008/5/12 refers to Match_Date = '2008-05-12'; name refers to Player_Name;
|
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Match AS T2 ON T1.Player_Id = T2.Man_of_the_Match WHERE T2.Match_Date = '2008-05-12'
|
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,809 | 1,809 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Match`
(
Match_Date DATE,
Man_of_the_Match INTEGER,
foreign key Man_of_the_Match references PlayerPlayer_Id
)
|
[
"AS",
"SELECT",
"-",
"INNER JOIN",
"ON",
"FROM"
] | 8 |
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,
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
|
State the name of captain keeper of the match no.419117.
|
name refers to Player_Name; captain keeper refers to Role_Desc = 'CaptainKeeper'; match no.419117 refers to Match_Id = '419117'
|
SELECT T3.Player_Name FROM Player_Match AS T1 INNER JOIN Rolee AS T2 ON T1.Role_Id = T2.Role_Id INNER JOIN Player AS T3 ON T1.Player_Id = T3.Player_Id WHERE T1.Match_Id = '419117' AND T2.Role_Desc = 'CaptainKeeper'
|
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,810 | 1,810 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Rolee`
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
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",
"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
|
Who was the man of the series in 2013? Give the full name.
|
full name refers to Player_Name; in 2013 refers to Season_Year = 2013
|
SELECT T2.Player_Name FROM Season AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Series = T2.Player_Id WHERE T1.Season_Year = 2013
|
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,811 | 1,811 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Season`
(
Man_of_the_Series INTEGER,
Season_Year 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
|
Give the date of birth of the 2014 Orange Cap winner.
|
date of birth refers to DOB; 2014 refers to Season_Year = 2014; Orange Cap winner refers to Orange_Cap IS NOT NULL
|
SELECT T2.DOB FROM Season AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Series = T2.Player_Id WHERE T1.Season_Year = 2014 AND T1.Orange_Cap IS NOT NULL
|
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,812 | 1,812 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
DOB DATE
)
CREATE TABLE `Season`
(
Man_of_the_Series INTEGER,
Orange_Cap INTEGER,
Season_Year INTEGER
)
|
[
"AS",
"AND",
"SELECT",
"NULL",
"INNER JOIN",
"ON",
"NOT",
"IS",
"FROM"
] | 10 |
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,
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,
67,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
92,
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,
263,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
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,
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,
443,
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,
508,
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,
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,
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,
965,
966,
967,
969,
970,
971,
973,
974,
975,
977,
978,
980,
981,
982,
985,
986,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1005,
1006,
1010,
1012,
1013,
1014,
1015,
1016,
1017,
1019,
1020,
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,
1059,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
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,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
What is the nationality of the 7th season Purple Cap winner?
|
nationality refers to Country_Name; the 7th season refers to Season_Id = 7; Purple Cap winner refers to Purple_Cap IS NOT NULL
|
SELECT 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_Id = 7 AND T1.Purple_Cap IS NOT NULL
|
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,813 | 1,813 |
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 `Season`
(
Season_Id INTEGER
primary key,
Man_of_the_Series INTEGER,
Purple_Cap INTEGER
)
|
[
"AS",
"AND",
"SELECT",
"NULL",
"INNER JOIN",
"ON",
"NOT",
"IS",
"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,
67,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
92,
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,
263,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
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,
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,
443,
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,
508,
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,
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,
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,
965,
966,
967,
969,
970,
971,
973,
974,
975,
977,
978,
980,
981,
982,
985,
986,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1005,
1006,
1010,
1012,
1013,
1014,
1015,
1016,
1017,
1019,
1020,
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,
1059,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
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,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Which country does Ranchi city belong to?
|
country refers to Country_Name; Ranchi city refers to City_Name = 'Ranchi'
|
SELECT T2.Country_Name FROM City AS T1 INNER JOIN Country AS T2 ON T1.Country_Id = T2.Country_Id WHERE T1.City_Name = 'Ranchi'
|
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,814 | 1,814 |
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 Indian cities are there in the database?
|
Indian refers to Country_Name = 'India'
|
SELECT SUM(CASE WHEN T2.Country_Name = 'India' 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,815 | 1,815 |
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
|
State the name of the city with the most venues.
|
name of the city refers to City_Name; the most venues refers to max(count(Venue_Id))
|
SELECT T1.City_Name FROM City AS T1 INNER JOIN Venue AS T2 ON T1.City_Id = T2.City_Id GROUP BY T1.City_Id ORDER BY COUNT(T2.Venue_Id) DESC 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 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,816 | 1,816 |
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
)
|
[
"GROUP BY",
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"COUNT",
"FROM"
] | 11 |
medium
|
{
"case_1": [
548
],
"case_2": [
548
],
"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 batting hand of MK Pandey?
|
MK Pandey refers to Player_Name = 'MK Pandey'
|
SELECT T2.Batting_hand FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id WHERE T1.Player_Name = 'MK Pandey'
|
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,817 | 1,817 |
CREATE TABLE `Batting_Style`
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE `Player`
(
Player_Name TEXT,
Batting_hand INTEGER,
foreign key Batting_hand references Batting_StyleBatting_Id
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
550
],
"case_2": [
550,
943,
959,
1078
],
"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 the database, how many times is the number of Indian cities to the South African cities?
|
Indian refers to Country_Name = 'India'; South African refers to Country_Name = 'South Africa'; how many times = divide(count(City_Id where Country_Name = 'India'), count(City_Id where Country_Name = 'South Africa'))
|
SELECT CAST(SUM(CASE WHEN T2.Country_Name = 'India' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.Country_Name = 'South Africa' 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,818 | 1,818 |
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",
"CAST",
"FROM"
] | 14 |
medium
|
{
"case_1": [
201
],
"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,
35,
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,
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,
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,
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,
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,
913,
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,
1121,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
How many times does M Chinnaswamy Stadium host games than Maharashtra Cricket Association Stadium?
|
M Chinnaswamy Stadium refers to Venue_Name = 'M Chinnaswamy Stadium'; Maharashtra Cricket Association Stadium refers to Venue_Name = 'Maharashtra Cricket Association Stadium'; how many times = divide(count(Match_Id where Venue_Name = 'M Chinnaswamy Stadium'), count(Match_Id where Venue_Name = 'Maharashtra Cricket Association Stadium'))
|
SELECT SUM(CASE WHEN T2.Venue_Name = 'M Chinnaswamy Stadium' THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.Venue_Name = 'Maharashtra Cricket Association Stadium' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_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,819 | 1,819 |
CREATE TABLE `Venue`
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT
)
CREATE TABLE `Match`
(
Venue_Id INTEGER,
foreign key Venue_Id references VenueVenue_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"CASE",
"INNER JOIN",
"ON",
"FROM"
] | 12 |
medium
|
{
"case_1": [
688,
1092
],
"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
|
Who is the oldest player?
|
name of the player refers to Player_Name; the oldest refers to min(DOB)
|
SELECT Player_Name FROM Player ORDER BY DOB ASC 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,820 | 1,820 |
CREATE TABLE `Player`
(
Player_Name TEXT,
DOB DATE
)
|
[
"SELECT",
"ORDER BY",
"LIMIT",
"ASC",
"FROM"
] | 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 matches were played on May 2008?
|
in May 2008 refers to SUBSTR(Match_Date, 1, 4) = '2008' AND SUBSTR(Match_Date, 7, 1) = '5'
|
SELECT SUM(CASE WHEN SUBSTR(Match_Date, 7, 1) = '5' THEN 1 ELSE 0 END) FROM `Match` WHERE SUBSTR(Match_Date, 1, 4) = '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,821 | 1,821 |
CREATE TABLE `Match`
(
Match_Date DATE
)
|
[
"CASE WHEN",
"SELECT",
"SUM",
"CASE",
"SUBSTR",
"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,
6,
16,
24,
42,
54,
61,
64,
71,
77,
81,
93,
104,
106,
113,
120,
122,
127,
129,
148,
152,
153,
155,
173,
189,
191,
192,
195,
201,
205,
207,
212,
215,
219,
223,
225,
226,
234,
236,
245,
248,
261,
264,
267,
271,
279,
299,
300,
304,
322,
335,
347,
360,
362,
375,
383,
393,
402,
406,
409,
412,
415,
423,
427,
438,
452,
453,
458,
476,
478,
485,
486,
500,
504,
508,
514,
517,
518,
535,
540,
547,
550,
563,
564,
571,
573,
575,
580,
581,
620,
623,
628,
640,
646,
662,
666,
676,
682,
686,
709,
710,
723,
740,
744,
747,
753,
762,
772,
776,
787,
788,
795,
796,
798,
800,
808,
827,
841,
848,
868,
871,
872,
874,
896,
909,
912,
922,
924,
926,
939,
943,
944,
959,
979,
985,
998,
1008,
1012,
1036,
1048,
1062,
1064,
1069,
1078,
1082,
1087,
1092,
1093,
1098,
1110,
1129,
1131,
1133,
1134,
1135
]
}
|
soccer_2016
|
How many players were born in the 90s?
|
born in the 90s refers to DOB > = '1990-01-01' AND DOB < = '1999-12-31'
|
SELECT COUNT(Player_Id) AS cnt FROM Player WHERE DOB BETWEEN '1990-01-01' AND '1999-12-31'
|
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,822 | 1,822 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
DOB DATE
)
|
[
"AS",
"AND",
"SELECT",
"-",
"COUNT",
"BETWEEN",
"FROM"
] | 10 |
simple
|
{
"case_1": [
2,
43,
259
],
"case_2": [
2,
43,
259
],
"case_3": [
2,
43,
212,
225,
229,
259,
314,
349,
383,
509,
547,
548,
550,
564,
654,
688,
714,
743,
778,
787,
829,
943,
951,
959,
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,
3,
4,
5,
6,
8,
10,
11,
12,
16,
19,
20,
21,
22,
24,
26,
27,
30,
32,
33,
34,
35,
36,
37,
39,
40,
42,
43,
44,
45,
47,
51,
52,
53,
55,
57,
61,
62,
63,
66,
67,
68,
69,
71,
73,
74,
75,
76,
77,
79,
82,
85,
86,
87,
88,
89,
90,
91,
93,
95,
96,
97,
98,
99,
105,
106,
109,
111,
112,
113,
115,
116,
117,
118,
119,
121,
125,
126,
127,
128,
129,
131,
135,
138,
140,
141,
142,
143,
144,
146,
148,
152,
154,
158,
159,
160,
163,
164,
167,
169,
170,
172,
173,
175,
176,
177,
179,
180,
183,
184,
187,
188,
189,
190,
191,
192,
196,
197,
199,
200,
202,
206,
212,
214,
219,
223,
225,
226,
227,
228,
229,
230,
233,
234,
239,
240,
243,
244,
247,
254,
256,
258,
259,
261,
262,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
282,
286,
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,
349,
350,
354,
356,
358,
360,
361,
362,
364,
367,
368,
370,
373,
374,
375,
376,
380,
382,
383,
384,
385,
391,
392,
393,
394,
395,
398,
399,
401,
402,
403,
405,
406,
408,
409,
411,
412,
413,
414,
416,
417,
419,
421,
423,
424,
425,
426,
427,
428,
433,
436,
437,
438,
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,
482,
484,
485,
487,
488,
489,
490,
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,
532,
533,
535,
536,
537,
538,
539,
541,
542,
544,
547,
548,
550,
552,
554,
557,
558,
559,
560,
561,
562,
563,
564,
566,
573,
580,
581,
582,
584,
586,
588,
589,
591,
594,
595,
596,
597,
601,
605,
606,
608,
610,
611,
612,
613,
615,
618,
620,
624,
625,
626,
627,
630,
632,
633,
634,
637,
641,
643,
645,
646,
647,
648,
649,
651,
654,
656,
658,
659,
660,
661,
662,
663,
665,
666,
667,
668,
669,
671,
675,
677,
678,
679,
680,
681,
683,
684,
685,
686,
687,
688,
690,
692,
693,
694,
695,
696,
697,
699,
702,
705,
707,
712,
714,
715,
718,
719,
721,
726,
727,
730,
733,
734,
735,
736,
737,
739,
740,
741,
743,
746,
747,
749,
750,
752,
753,
754,
756,
758,
760,
762,
763,
765,
767,
768,
769,
770,
772,
773,
775,
776,
777,
778,
779,
780,
783,
785,
787,
788,
790,
793,
795,
796,
797,
798,
799,
800,
802,
804,
805,
806,
807,
808,
810,
812,
813,
814,
817,
818,
819,
820,
824,
825,
827,
829,
830,
831,
832,
835,
838,
839,
841,
843,
844,
848,
849,
851,
853,
857,
858,
859,
860,
861,
864,
866,
867,
870,
873,
874,
876,
877,
878,
879,
882,
886,
888,
892,
893,
894,
895,
896,
897,
898,
901,
902,
903,
905,
907,
909,
911,
912,
913,
915,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
941,
943,
944,
945,
949,
950,
951,
953,
954,
956,
958,
959,
961,
963,
965,
969,
974,
975,
977,
980,
981,
985,
986,
991,
993,
996,
998,
1000,
1001,
1005,
1006,
1008,
1010,
1011,
1013,
1014,
1015,
1017,
1019,
1020,
1022,
1023,
1027,
1031,
1037,
1039,
1042,
1043,
1044,
1046,
1047,
1050,
1051,
1052,
1057,
1058,
1059,
1061,
1062,
1063,
1064,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1078,
1079,
1080,
1081,
1082,
1084,
1086,
1087,
1092,
1094,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1115,
1119,
1121,
1123,
1124,
1126,
1128,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
How many matches did Team 10 play in 2012?
|
Team 10 refers to Team_1 = 10 OR Team_2 = 10; in 2012 refers to SUBSTR(Match_Date, 1, 4) = '2012'
|
SELECT SUM(CASE WHEN Team_1 = 10 OR Team_2 = 10 THEN 1 ELSE 0 END) FROM `Match` WHERE SUBSTR(Match_Date, 1, 4) = '2012'
|
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,823 | 1,823 |
CREATE TABLE `Match`
(
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
foreign key Team_1 references TeamTeam_Id,
foreign key Team_2 references TeamTeam_Id
)
|
[
"CASE WHEN",
"OR",
"SELECT",
"SUM",
"CASE",
"SUBSTR",
"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,
6,
16,
24,
42,
54,
61,
64,
71,
77,
81,
93,
104,
106,
113,
120,
122,
127,
129,
148,
152,
153,
155,
173,
189,
191,
192,
195,
201,
205,
207,
212,
215,
219,
223,
225,
226,
234,
236,
245,
248,
261,
264,
267,
271,
279,
299,
300,
304,
322,
335,
347,
360,
362,
375,
383,
393,
402,
406,
409,
412,
415,
423,
427,
438,
452,
453,
458,
476,
478,
485,
486,
500,
504,
508,
514,
517,
518,
535,
540,
547,
550,
563,
564,
571,
573,
575,
580,
581,
620,
623,
628,
640,
646,
662,
666,
676,
682,
686,
709,
710,
723,
740,
744,
747,
753,
762,
772,
776,
787,
788,
795,
796,
798,
800,
808,
827,
841,
848,
868,
871,
872,
874,
896,
909,
912,
922,
924,
926,
939,
943,
944,
959,
979,
985,
998,
1008,
1012,
1036,
1048,
1062,
1064,
1069,
1078,
1082,
1087,
1092,
1093,
1098,
1110,
1129,
1131,
1133,
1134,
1135
]
}
|
soccer_2016
|
List the id of the player who won the Orange Cap for 2 consecutive seasons.
|
id of the player who won the Orange Cap refers to Orange_Cap; for 2 consecutive seasons refers to count(Season_Year) > 1
|
SELECT Orange_Cap FROM Season GROUP BY Orange_Cap HAVING COUNT(Season_Year) > 1
|
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,824 | 1,824 |
CREATE TABLE `Season`
(
Orange_Cap INTEGER,
Season_Year INTEGER
)
|
[
"GROUP BY",
"SELECT",
"HAVING",
"COUNT",
"FROM"
] | 5 |
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
|
How many matches were played in Season 7?
|
Season 7 refers to Season_Id = 7
|
SELECT COUNT(Match_Id) FROM `Match` WHERE Season_Id = 7
|
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,825 | 1,825 |
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Season_Id INTEGER,
foreign key Season_Id references SeasonSeason_Id
)
|
[
"COUNT",
"SELECT",
"FROM"
] | 3 |
simple
|
{
"case_1": [
122,
979
],
"case_2": [
122,
979
],
"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 umpires are from South Africa?
|
South Africa refers to Country_Name = 'South Africa'
|
SELECT SUM(CASE WHEN T1.Country_Name = 'South Africa' THEN 1 ELSE 0 END) FROM Country AS T1 INNER JOIN Umpire AS T2 ON T1.Country_ID = T2.Umpire_Country
|
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,826 | 1,826 |
CREATE TABLE `Country`
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key Country_Id references CountryCountry_Id
)
CREATE TABLE `Umpire`
(
Umpire_Country INTEGER,
foreign key Umpire_Country references CountryCountry_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
|
What is the name of the player with the highest number of outstanding player awards in a particular match?
|
name of the player refers to Player_Name; the highest number of outstanding player awards refers to max(count(Man_of_the_Match))
|
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Match AS T2 ON T1.Player_Id = T2.Man_of_the_Match GROUP BY T2.Man_of_the_Match ORDER BY COUNT(T2.Man_of_the_Match) 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,827 | 1,827 |
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
)
|
[
"GROUP BY",
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"COUNT",
"FROM"
] | 11 |
medium
|
{
"case_1": [
1124
],
"case_2": [
1124
],
"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 which country do the majority of the players are from?
|
country refers to Country_Name; the majority of the players refers to max(count(Country_Name))
|
SELECT T1.Country_Name FROM Country AS T1 INNER JOIN Player AS T2 ON T1.Country_Id = T2.Country_Name GROUP BY T2.Country_Name ORDER BY COUNT(T2.Country_Name) 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,828 | 1,828 |
CREATE TABLE `Country`
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key Country_Id references CountryCountry_Id
)
CREATE TABLE `Player`
(
Country_Name INTEGER,
foreign key Country_Name references CountryCountry_Id
)
|
[
"GROUP BY",
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"COUNT",
"FROM"
] | 11 |
medium
|
{
"case_1": [
150,
349
],
"case_2": [
150,
349
],
"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
|
How many Orange Cap awards were won by CH Gayle?
|
CH Gayle refers to Player_Name = 'CH Gayle'
|
SELECT SUM(CASE WHEN T1.Player_Name = 'CH Gayle' THEN 1 ELSE 0 END) AS cnt FROM Player AS T1 INNER JOIN Season AS T2 ON T1.Player_Id = 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,829 | 1,829 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Season`
(
Orange_Cap INTEGER
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"CASE",
"INNER JOIN",
"ON",
"FROM"
] | 10 |
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
|
Which season played the highest number of matches at M Chinnaswamy Stadium?
|
season refers to Season_Id; the highest number of matches refers to max(count(Season_Id)); M Chinnaswamy Stadium refers to Venue_Name = 'M Chinnaswamy Stadium'
|
SELECT T1.Season_Id FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE T2.Venue_Name = 'M Chinnaswamy Stadium' GROUP BY T1.Season_Id ORDER BY COUNT(T1.Season_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,830 | 1,830 |
CREATE TABLE `Venue`
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT
)
CREATE TABLE `Match`
(
Season_Id INTEGER,
Venue_Id INTEGER,
foreign key Season_Id references SeasonSeason_Id,
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
|
What is the name of the team that won the most number of matches in season 1?
|
name of the team refers to Team_Name; the most number of matches refers to max(count(Match_Winner)); season 1 refers to season_Id = 1
|
SELECT Team_Name FROM Team WHERE Team_Id = ( SELECT Match_Winner FROM `Match` WHERE season_Id = 1 GROUP BY Match_Winner ORDER BY COUNT(Match_Winner) 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,831 | 1,831 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Season_Id INTEGER,
Match_Winner INTEGER,
foreign key Season_Id references SeasonSeason_Id,
foreign key Match_Winner references TeamTeam_Id
)
|
[
"GROUP BY",
"SELECT",
"ORDER BY",
"LIMIT",
"COUNT",
"FROM",
"DESC"
] | 9 |
simple
|
{
"case_1": [
592,
713
],
"case_2": [
592,
713
],
"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
|
Which venue did Kolkata Knight Riders play most of their matches as a Team 1?
|
venue refers to Venue_Name; Kolkata Knight Riders refers to Team_Name = 'Kolkata Knight Riders'; most of their matches refers to max(count(Venue_Id)); Team 1 refers to Team_Id = Team_1
|
SELECT T3.Venue_Name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Team_1 INNER JOIN Venue AS T3 ON T2.Venue_Id = T3.Venue_Id WHERE T1.Team_Name = 'Kolkata Knight Riders' GROUP BY T3.Venue_Id ORDER BY COUNT(T3.Venue_Id) DESC LIMIT 1
|
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,832 | 1,832 |
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",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"COUNT",
"FROM"
] | 14 |
medium
|
{
"case_1": [
778
],
"case_2": [
778
],
"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 team has the highest number of losses of all time?
|
name of the team refers to Team_Name; the highest number of losses refers to max(add(count(Team_1 where Team_Id = Team_1 and Team_1 <> Match_Winner), count(Team_2 where Team_Id = Team_2 and Team_2 <> Match_Winner)))
|
SELECT T1.Team_Name FROM Team AS T1 INNER JOIN ( SELECT COUNT(Team_1) AS a, Team_1 FROM Match WHERE Team_1 <> Match_Winner GROUP BY Team_1 UNION SELECT COUNT(Team_2) AS a, Team_2 FROM Match WHERE Team_2 <> Match_Winner GROUP BY Team_2 ORDER BY a DESC LIMIT 1 ) AS T2 ON T1.Team_Id = T2.Team_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,833 | 1,833 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
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
)
|
[
"GROUP BY",
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"UNION",
"DESC",
"COUNT",
"FROM"
] | 20 |
challenging
|
{
"case_1": [
1087
],
"case_2": [
212,
592,
1064,
1087
],
"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
|
Who is the player who won the first ever "man of the match" award?
|
name of the player refers to Player_Name; the first ever refers to min(match_date); "man of the match" award refers to Player_Id in 'Man_of_the_Match'
|
SELECT Player_Name FROM Player WHERE Player_Id = ( SELECT Man_of_the_Match FROM `Match` ORDER BY match_date ASC 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,834 | 1,834 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Match`
(
Match_Date DATE,
Man_of_the_Match INTEGER,
foreign key Man_of_the_Match references PlayerPlayer_Id
)
|
[
"SELECT",
"ORDER BY",
"LIMIT",
"ASC",
"FROM"
] | 7 |
simple
|
{
"case_1": [
1024
],
"case_2": [
1024,
1124
],
"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
|
When did Chennai Super Kings play its first match?
|
match date refers to Match_Date; Chennai Super Kings refers to Team_Name = 'Chennai Super Kings'; first match refers to min(Match_Date)
|
SELECT Match_Date FROM `Match` WHERE team_1 = ( SELECT Team_Id FROM Team WHERE Team_Name = 'Chennai Super Kings' ) OR Team_2 = ( SELECT Team_Id FROM Team WHERE Team_Name = 'Chennai Super Kings' ) ORDER BY Match_Date ASC 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,835 | 1,835 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
foreign key Team_1 references TeamTeam_Id,
foreign key Team_2 references TeamTeam_Id
)
|
[
"OR",
"SELECT",
"ORDER BY",
"LIMIT",
"ASC",
"FROM"
] | 10 |
simple
|
{
"case_1": [
592,
713
],
"case_2": [
592,
713
],
"case_3": [
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,
49,
55,
59,
62,
69,
73,
75,
78,
86,
89,
108,
121,
125,
133,
138,
150,
159,
162,
163,
167,
173,
174,
179,
181,
185,
187,
188,
199,
202,
206,
208,
213,
229,
233,
247,
252,
262,
275,
278,
281,
285,
286,
291,
309,
311,
313,
314,
319,
320,
324,
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,
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,
1076,
1077,
1083,
1094,
1124,
1137,
1139,
1141
]
}
|
soccer_2016
|
How many players with left-hand batting style are from India?
|
left-hand batting style refers to Batting_hand = 'Left-hand bat'; India refers to Country_Name = 'India'
|
SELECT SUM(CASE WHEN T1.Batting_hand = 'Left-hand bat' THEN 1 ELSE 0 END) AS cnt FROM Batting_Style AS T1 INNER JOIN Player AS T2 ON T1.Batting_Id = T2.Batting_hand INNER JOIN Country AS T3 ON T2.Country_Name = T3.Country_Id WHERE T3.Country_Name = 'India'
|
CREATE TABLE Batting_Style
(
Batting_Id INTEGER
primary key,
Batting_hand 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,836 | 1,836 |
CREATE TABLE `Batting_Style`
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE `Country`
(
Country_Id INTEGER
primary key,
Country_Name TEXT,
foreign key Country_Id references CountryCountry_Id
)
CREATE TABLE `Player`
(
Batting_hand INTEGER,
Country_Name INTEGER,
foreign key Batting_hand references Batting_StyleBatting_Id,
foreign key Country_Name references CountryCountry_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"CASE",
"-",
"INNER JOIN",
"ON",
"FROM"
] | 14 |
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,
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
|
Who is the player that has the highest number of roles as a captain for Deccan Chargers?
|
name of the player refers to Player_Name; the highest number of roles refers to max(count(Role_Id)); as a captain refers to Role_Desc = 'Captain'; Deccan Chargers refers to Team_Name = 'Deccan Chargers'
|
SELECT T4.Player_Name FROM Team AS T1 INNER JOIN Player_Match AS T2 ON T1.Team_id = T2.Team_id INNER JOIN Rolee AS T3 ON T2.Role_Id = T3.Role_Id INNER JOIN Player AS T4 ON T2.Player_Id = T4.Player_Id WHERE T1.Team_Name = 'Deccan Chargers' AND T1.Team_Id = 8 AND T3.Role_Desc = 'Captain' AND T3.Role_Id = 1 GROUP BY T4.Player_Id ORDER BY COUNT(T3.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 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,837 | 1,837 |
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",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"COUNT",
"FROM"
] | 20 |
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,
829,
943,
951,
1037,
1064,
1065,
1078,
1087,
1091,
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,
4,
5,
6,
8,
10,
11,
12,
13,
15,
16,
19,
20,
21,
22,
24,
26,
27,
28,
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,
77,
78,
82,
85,
86,
88,
89,
90,
91,
93,
95,
96,
98,
99,
106,
108,
111,
112,
113,
115,
116,
117,
118,
119,
121,
125,
126,
127,
128,
129,
131,
138,
140,
141,
142,
143,
144,
146,
148,
150,
152,
154,
158,
159,
160,
162,
163,
164,
167,
169,
170,
172,
173,
175,
176,
177,
179,
180,
183,
184,
185,
187,
188,
189,
190,
191,
196,
197,
199,
200,
202,
206,
212,
213,
214,
219,
225,
226,
227,
229,
233,
234,
239,
240,
243,
244,
247,
252,
254,
256,
258,
261,
262,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
281,
282,
285,
286,
291,
296,
299,
301,
309,
311,
313,
314,
315,
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,
361,
364,
365,
368,
370,
371,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
408,
409,
411,
412,
413,
414,
416,
417,
419,
424,
425,
426,
427,
428,
429,
433,
434,
435,
436,
437,
438,
440,
444,
445,
446,
448,
451,
452,
454,
455,
460,
462,
463,
464,
465,
467,
469,
470,
471,
473,
475,
476,
477,
478,
480,
482,
484,
487,
488,
490,
493,
494,
495,
496,
497,
498,
500,
505,
507,
509,
514,
515,
516,
519,
520,
522,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
541,
542,
544,
547,
548,
552,
557,
558,
559,
560,
561,
562,
563,
564,
566,
567,
573,
578,
579,
580,
581,
582,
584,
586,
588,
589,
590,
592,
595,
596,
597,
605,
606,
608,
610,
611,
612,
613,
615,
620,
621,
624,
625,
626,
627,
630,
632,
633,
634,
637,
638,
641,
643,
645,
646,
648,
649,
651,
654,
657,
658,
659,
662,
663,
664,
665,
666,
668,
669,
671,
675,
677,
678,
681,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
696,
697,
698,
699,
701,
702,
703,
705,
712,
714,
715,
719,
720,
721,
726,
727,
733,
734,
735,
736,
739,
740,
741,
743,
746,
747,
748,
749,
750,
751,
752,
753,
754,
756,
758,
759,
760,
762,
763,
765,
767,
768,
769,
772,
773,
775,
776,
777,
778,
779,
780,
783,
787,
788,
790,
793,
796,
797,
799,
800,
802,
803,
804,
806,
807,
808,
810,
812,
813,
814,
818,
819,
823,
824,
825,
827,
829,
830,
832,
835,
838,
839,
841,
844,
848,
849,
850,
851,
853,
857,
858,
859,
860,
861,
866,
867,
869,
870,
873,
874,
876,
877,
878,
879,
882,
886,
888,
889,
891,
892,
893,
895,
896,
897,
898,
901,
902,
905,
907,
909,
911,
912,
915,
917,
918,
922,
923,
924,
926,
927,
928,
929,
930,
931,
932,
934,
935,
943,
944,
949,
950,
951,
953,
954,
956,
958,
961,
962,
963,
966,
967,
969,
970,
972,
973,
974,
975,
977,
981,
983,
985,
986,
987,
991,
993,
994,
996,
1000,
1001,
1004,
1005,
1006,
1010,
1013,
1015,
1017,
1019,
1022,
1023,
1025,
1027,
1030,
1031,
1034,
1037,
1038,
1039,
1042,
1043,
1044,
1046,
1047,
1049,
1050,
1051,
1056,
1057,
1058,
1061,
1062,
1063,
1064,
1065,
1067,
1068,
1071,
1072,
1076,
1077,
1078,
1080,
1082,
1084,
1086,
1087,
1091,
1092,
1094,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1112,
1115,
1119,
1123,
1124,
1128,
1131,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
What is the percentage of all right-handed batting players among all the other players?
|
right-handed batting refers to Batting_hand = 'Right-hand bat'; percentage = divide(count(Player_Id where Batting_hand = 'Right-hand bat'), count(Player_Id)) * 100%
|
SELECT CAST(SUM(CASE WHEN T1.Batting_hand = 'Right-hand bat' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.Player_Id) FROM Batting_Style AS T1 INNER JOIN Player AS T2 ON T2.Batting_hand = T1.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,838 | 1,838 |
CREATE TABLE `Batting_Style`
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Batting_hand INTEGER,
foreign key Batting_hand references Batting_StyleBatting_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"CASE",
"-",
"INNER JOIN",
"ON",
"CAST",
"COUNT",
"FROM"
] | 13 |
medium
|
{
"case_1": [
943,
1078
],
"case_2": [
550,
943,
959,
1078
],
"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,
979,
1037,
1064,
1078,
1087,
1092,
1093,
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,
21,
22,
24,
27,
30,
34,
35,
36,
37,
39,
42,
45,
47,
51,
53,
55,
61,
62,
63,
64,
68,
69,
71,
73,
74,
75,
77,
81,
82,
83,
85,
86,
87,
88,
91,
93,
94,
96,
97,
98,
104,
105,
106,
112,
113,
115,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
131,
135,
140,
141,
142,
143,
146,
148,
152,
153,
154,
155,
158,
159,
160,
164,
167,
169,
170,
171,
172,
173,
175,
179,
180,
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,
272,
276,
277,
278,
279,
296,
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,
368,
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,
425,
426,
427,
436,
438,
444,
445,
446,
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,
489,
490,
493,
496,
498,
500,
503,
504,
505,
507,
509,
510,
514,
515,
516,
517,
518,
519,
520,
522,
526,
528,
529,
532,
535,
536,
537,
538,
540,
544,
547,
548,
550,
552,
558,
559,
560,
562,
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,
643,
645,
646,
647,
649,
650,
654,
658,
659,
660,
662,
663,
665,
666,
668,
669,
671,
672,
675,
676,
677,
681,
682,
684,
686,
687,
688,
690,
693,
694,
695,
696,
701,
705,
706,
709,
710,
712,
714,
717,
721,
723,
727,
733,
734,
735,
736,
739,
740,
743,
744,
745,
746,
747,
749,
750,
752,
753,
754,
756,
758,
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,
829,
830,
832,
835,
838,
839,
841,
844,
848,
849,
851,
853,
857,
858,
866,
867,
868,
870,
871,
874,
876,
877,
878,
880,
882,
886,
888,
893,
894,
896,
897,
898,
901,
902,
905,
909,
911,
912,
913,
915,
917,
918,
922,
923,
924,
925,
926,
927,
930,
934,
935,
941,
943,
944,
950,
951,
954,
956,
958,
959,
961,
962,
963,
969,
973,
974,
975,
977,
979,
980,
981,
985,
986,
993,
996,
998,
1005,
1006,
1008,
1010,
1012,
1013,
1015,
1022,
1023,
1027,
1031,
1037,
1038,
1042,
1043,
1047,
1050,
1051,
1052,
1058,
1062,
1064,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1078,
1082,
1084,
1086,
1087,
1092,
1093,
1094,
1098,
1100,
1101,
1103,
1104,
1106,
1111,
1112,
1119,
1121,
1123,
1124,
1128,
1131,
1132,
1133,
1134,
1135,
1137
]
}
|
soccer_2016
|
Name the player who is born on July 7, 1981.
|
name of the player refers to Player_Name; born on July 7 1981 refers to DOB = '1981-07-07'
|
SELECT Player_name FROM Player WHERE DOB = '1981-07-07'
|
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,839 | 1,839 |
CREATE TABLE `Player`
(
Player_Name TEXT,
DOB DATE
)
|
[
"-",
"SELECT",
"FROM"
] | 4 |
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
|
How many matches were played by the player with player ID 2?
|
player ID 2 refers to Player_Id = 2
|
SELECT SUM(CASE WHEN Player_Id = 2 THEN 1 ELSE 0 END) FROM Player_Match
|
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,840 | 1,840 |
CREATE TABLE `Player_Match`
(
Player_Id INTEGER, Player_Id,
foreign key Player_Id references PlayerPlayer_Id
)
|
[
"CASE WHEN",
"SELECT",
"SUM",
"CASE",
"FROM"
] | 5 |
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,
285,
298,
299,
300,
303,
304,
305,
313,
316,
317,
322,
323,
335,
347,
350,
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,
987,
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 first team's name in the match with the highest winning margin.
|
team's name refers to Team_Name; first team refers to Team_Id = Team_1; the highest winning margin refers to max(Win_Margin)
|
SELECT T2.Team_Name FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_1 ORDER BY T1.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,841 | 1,841 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Team_1 INTEGER,
Win_Margin INTEGER,
foreign key Team_1 references TeamTeam_Id
)
|
[
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"FROM"
] | 9 |
simple
|
{
"case_1": [
592,
1098
],
"case_2": [
212,
592,
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,
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
|
Give the country where St. George's Park is located.
|
country refers to Country_Name; St. George's Park refers to Venue_Name = 'St George''s Park'
|
SELECT T3.Country_Name FROM Venue AS T1 INNER JOIN City AS T2 ON T2.City_Id = T1.City_Id INNER JOIN Country AS T3 ON T3.Country_Id = T2.Country_id WHERE T1.Venue_Name = 'St George''s Park'
|
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,842 | 1,842 |
CREATE TABLE `City`
(
City_Id INTEGER
primary key,
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",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 9 |
simple
|
{
"case_1": [
-1
],
"case_2": [
714
],
"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 player's name of Mumbai Indians in the match ID 335990.
|
Mumbai Indians refers to Team_Name = 'Mumbai Indians'; match ID 335990 refers to Match_Id = 335990
|
SELECT T3.Team_Name FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T2.Player_Id = T1.Player_Id INNER JOIN Team AS T3 ON T3.Team_Id = T2.Team_Id WHERE T2.Match_Id = 335990 AND T3.Team_Name = 'Mumbai Indians' GROUP BY T3.Team_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 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,843 | 1,843 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key
)
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
)
|
[
"GROUP BY",
"AS",
"AND",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 11 |
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
|
Provide the winning team's name in the match with the point of winning margin of 7 on May 7, 2009.
|
the winning team refers to Team_Id = Match_Winner; the point of winning margin of 7 refers to Win_Margin = 7; on May 7 2009 refers to Match_Date = '2009-05-07'
|
SELECT T1.Team_Name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Match_Winner WHERE T2.Match_Date = '2009-05-07' AND T2.Win_Margin = 7
|
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,844 | 1,844 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Match_Date DATE,
Win_Margin INTEGER,
Match_Winner INTEGER,
foreign key Match_Winner 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
|
How many of the matches are Superover?
|
Superover refers to Outcome_Type = 'Superover'
|
SELECT SUM(CASE WHEN T2.Outcome_Type = 'Superover' THEN 1 ELSE 0 END) FROM Match AS T1 INNER JOIN Outcome AS T2 ON T2.Outcome_Id = T1.Outcome_type
|
CREATE TABLE Outcome
(
Outcome_Id INTEGER
primary key,
Outcome_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,845 | 1,845 |
CREATE TABLE `Outcome`
(
Outcome_Id INTEGER
primary key,
Outcome_Type TEXT
)
CREATE TABLE `Match`
(
Outcome_type INTEGER,
foreign key Outcome_type references Out_TypeOut_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
|
List the cities located in U.A.E.
|
city refers to City_Name; U.A.E refers to Country_Name = 'U.A.E'
|
SELECT T1.City_Name FROM City AS T1 INNER JOIN Country AS T2 ON T2.Country_Id = T1.Country_id WHERE T2.Country_Name = 'U.A.E'
|
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,846 | 1,846 |
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
|
What is the total number of won matches of the team named "Pune Warriors"?
|
the team named "Pune Warriors" refers to Team_Name = 'Pune Warriors'; the total number of won matches = count(Team_Name where Team_Id = Match_Winner)
|
SELECT SUM(CASE WHEN T2.Team_Name = 'Pune Warriors' THEN 1 ELSE 0 END) FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Match_Winner
|
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,847 | 1,847 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Match_Winner INTEGER,
foreign key Match_Winner references TeamTeam_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"CASE",
"INNER JOIN",
"ON",
"FROM"
] | 9 |
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
|
Among the matches held in 2015, who is the winning team in the match ID 829768?
|
in 2015 refers to Match_Date LIKE '2015%'; the winning team refers to Team_Id = Match_Winner; match ID 829768 refers to Match_Id = 829768
|
SELECT T2.Team_Name FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Match_Winner WHERE T1.Match_Date LIKE '2015%' AND T1.Match_Id = 829768
|
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,848 | 1,848 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Match_Date DATE,
Match_Winner INTEGER,
foreign key Match_Winner references TeamTeam_Id
)
|
[
"AS",
"AND",
"SELECT",
"LIKE",
"INNER JOIN",
"ON",
"FROM"
] | 8 |
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,
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
|
What is the role of K Goel in the match ID 335992?
|
role refers to Role_Desc; K Goel refers to Player_Name = 'K Goel'; match ID 335992 refers to Match_Id = 335992
|
SELECT T3.Role_Desc FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T2.Player_Id = T1.Player_Id INNER JOIN Rolee AS T3 ON T3.Role_Id = T2.Role_Id WHERE T2.Match_Id = 335992 AND T1.Player_Name = 'K Goel'
|
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,849 | 1,849 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Rolee`
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
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",
"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 cities are located in South Africa?
|
South Africa refers to Country_Name = 'South Africa'
|
SELECT SUM(CASE WHEN T2.Country_Name = 'South Africa' THEN 1 ELSE 0 END) FROM City AS T1 INNER JOIN Country AS T2 ON T2.Country_Id = T1.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,850 | 1,850 |
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
|
How many matches were held at the venue named "Newlands"?
|
the venue named "Newlands" refers to Venue_Name = 'Newlands'
|
SELECT SUM(CASE WHEN T2.Venue_Name = 'Newlands' THEN 1 ELSE 0 END) FROM Match AS T1 INNER JOIN Venue AS T2 ON T2.Venue_Id = T1.Venue_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,851 | 1,851 |
CREATE TABLE `Venue`
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT
)
CREATE TABLE `Match`
(
Venue_Id INTEGER,
foreign key Venue_Id references VenueVenue_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
|
Provide the point of the winning margin in a match between Mumbai Indians and Royal Challengers Bangalore on May 28, 2008.
|
point of the winning margin refers to Win_Margin; Mumbai Indians refers to Team_Name = 'Mumbai Indians'; Royal Challengers Bangalore refers to Team_Name = 'Royal Challengers Bangalore'; on May 28 2008 refers to Match_Date = '2008-05-28'
|
SELECT T1.Win_Margin FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_1 INNER JOIN Team AS T3 ON T3.Team_Id = T1.Team_2 WHERE (T2.Team_Name = 'Mumbai Indians' AND T3.Team_Name = 'Royal Challengers Bangalore' AND T1.Match_Date = '2008-05-28') OR (T2.Team_Name = 'Royal Challengers Bangalore' AND T3.Team_Name = 'Mumbai Indians' AND T1.Match_Date = '2008-05-28')
|
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,852 | 1,852 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Win_Margin INTEGER,
foreign key Team_1 references TeamTeam_Id,
foreign key Team_2 references TeamTeam_Id
)
|
[
"OR",
"AND",
"SELECT",
"AS",
"-",
"INNER JOIN",
"ON",
"FROM"
] | 18 |
challenging
|
{
"case_1": [
829,
1087
],
"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,
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,
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,
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,
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
|
List the names of the first andthe second teams that played a match with the point of the winning margin lower than the 30% of the average winning margin of the matches held in 2011.
|
name of the team refers to Team_Name; in 2011 refers to Match_Date LIKE '2011%'; the point of winning margin lower than 30% of the average winning margin refers to Win_Margin < multiply(avg(Win_Margin), 0.3) where Match_Date LIKE '2011%'
|
SELECT DISTINCT CASE WHEN T1.Win_Margin < ( SELECT AVG(Win_Margin) * 0.3 FROM Match WHERE Match_Date LIKE '2011%' ) THEN T2.Team_Name END, CASE WHEN T1.Win_Margin < ( SELECT AVG(Win_Margin) * 0.3 FROM Match WHERE Match_Date LIKE '2011%' ) THEN T3.Team_Name END FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_1 INNER JOIN Team AS T3 ON T3.Team_Id = T1.Team_2 WHERE T1.Match_Date LIKE '2011%'
|
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,853 | 1,853 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Team_1 INTEGER,
Team_2 INTEGER,
Match_Date DATE,
Win_Margin INTEGER,
foreign key Team_1 references TeamTeam_Id,
foreign key Team_2 references TeamTeam_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"LIKE",
"CASE",
"INNER JOIN",
"ON",
"AVG",
"FROM"
] | 22 |
challenging
|
{
"case_1": [
829,
1087
],
"case_2": [
212,
592,
829,
1064,
1087,
1098
],
"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,
979,
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,
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,
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,
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,
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,
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,
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,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
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 born in 1977, what is the percentage of the players with a role as a captain?
|
born in 1977 refers to DOB LIKE '1977%'; a role as a captain refers to Role_Desc = 'Captain'; percentage = divide(count(Role_Id where Role_Desc = 'Captain'), count(Role_Id)) * 100% where DOB LIKE '1977%'
|
SELECT CAST(SUM(CASE WHEN T1.Role_Desc = 'Captain' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Role_Id) FROM Rolee AS T1 INNER JOIN Player_Match AS T2 ON T2.Role_Id = T1.Role_Id INNER JOIN Player AS T3 ON T3.Player_Id = T2.Player_Id WHERE T3.DOB LIKE '1977%'
|
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,854 | 1,854 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
DOB DATE
)
CREATE TABLE `Rolee`
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
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",
"LIKE",
"CASE",
"INNER JOIN",
"ON",
"CAST",
"COUNT",
"FROM"
] | 16 |
challenging
|
{
"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,
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
|
How many overs were there in the first innings of match ID "335996"?
|
the first innings refers to Innings_No = 1; match ID "335996" refers to Match_Id = 335996
|
SELECT COUNT(Over_Id) FROM Ball_by_Ball WHERE Match_Id = 335996 AND Innings_No = 1
|
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,855 | 1,855 |
CREATE TABLE `Ball_by_Ball`
(
Match_Id INTEGER,
Over_Id INTEGER,
Innings_No INTEGER,
primary key Match_Id, Over_Id, Innings_No,
foreign key Match_Id references MatchMatch_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
|
List the over IDs, ball IDs, and innings numbers of the match ID "336004" while the batsman got the maximum scores.
|
over ID refers to Over_Id; ball ID refers to Ball_Id; innings number refers to Innings_No; match ID "336004" refers to Match_Id = 336004; batsman got the maximum scores refers to max(Runs_Scored)
|
SELECT Over_Id, Ball_Id, Innings_No FROM Batsman_Scored WHERE Match_Id = 336004 ORDER BY Runs_Scored DESC LIMIT 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,856 | 1,856 |
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
)
|
[
"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
|
Describe any five matches IDs that reached over ID 20.
|
reached over ID 20 refers to Over_Id = 20
|
SELECT Match_Id FROM Ball_by_Ball WHERE Over_Id = 20 GROUP BY Match_Id LIMIT 5
|
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,857 | 1,857 |
CREATE TABLE `Ball_by_Ball`
(
Match_Id INTEGER,
Over_Id INTEGER,
primary key Match_Id, Over_Id,
foreign key Match_Id references MatchMatch_Id
)
|
[
"GROUP BY",
"LIMIT",
"SELECT",
"FROM"
] | 4 |
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,
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": [
1,
10,
11,
13,
15,
17,
20,
22,
28,
29,
36,
38,
49,
55,
59,
62,
69,
73,
75,
78,
86,
89,
108,
110,
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,
200,
202,
206,
208,
213,
214,
229,
233,
239,
247,
252,
262,
275,
278,
281,
285,
286,
291,
309,
311,
313,
314,
319,
320,
324,
328,
329,
334,
336,
337,
341,
342,
344,
345,
348,
349,
352,
353,
356,
359,
364,
365,
371,
373,
377,
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,
551,
552,
555,
560,
566,
567,
576,
578,
579,
583,
584,
586,
590,
592,
595,
611,
619,
621,
625,
626,
630,
634,
637,
638,
645,
651,
654,
657,
659,
664,
665,
669,
681,
688,
690,
691,
696,
698,
701,
703,
708,
713,
718,
719,
720,
721,
732,
733,
735,
743,
748,
751,
752,
759,
760,
768,
778,
779,
790,
803,
810,
815,
817,
818,
823,
827,
830,
836,
850,
851,
861,
866,
869,
876,
882,
886,
889,
891,
893,
901,
911,
918,
927,
929,
932,
934,
946,
950,
951,
953,
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,
1075,
1076,
1077,
1083,
1091,
1094,
1106,
1108,
1124,
1135,
1137,
1139,
1141
]
}
|
soccer_2016
|
How many players got out in the first inning of match ID "548335"?
|
got out refers to Player_Out; the first inning refers to Innings_No = 1; match ID "548335" refers to Match_Id = 548335
|
SELECT SUM(CASE WHEN Match_Id = 548335 THEN 1 ELSE 0 END) FROM Wicket_Taken WHERE Innings_No = 1
|
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,858 | 1,858 |
CREATE TABLE `Wicket_Taken`
(
Match_Id INTEGER,
Innings_No INTEGER,
primary key Match_Id, Innings_No,
foreign key Match_Id references MatchMatch_Id
)
|
[
"CASE WHEN",
"SELECT",
"SUM",
"CASE",
"FROM"
] | 5 |
simple
|
{
"case_1": [
245
],
"case_2": [
245
],
"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,
285,
298,
299,
300,
303,
304,
305,
313,
316,
317,
322,
323,
335,
347,
350,
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,
987,
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 players' names who were born in 1971.
|
players' name refers to Player_name; born in 1971 refers to DOB LIKE '1971%'
|
SELECT Player_name FROM Player WHERE DOB LIKE '1971%'
|
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,859 | 1,859 |
CREATE TABLE `Player`
(
Player_Name TEXT,
DOB DATE
)
|
[
"LIKE",
"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
|
Provide the match IDs which were held on 18th April 2015.
|
on 18th April 2015 refers to DATE(Match_Date) = '2015-04-18'
|
SELECT Match_Id FROM Match WHERE Match_Date LIKE '%2015-04-18%'
|
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,860 | 1,860 |
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Match_Date DATE
)
|
[
"LIKE",
"-",
"SELECT",
"FROM"
] | 5 |
simple
|
{
"case_1": [
979
],
"case_2": [
979
],
"case_3": [
2,
43,
212,
259,
383,
509,
550,
617,
743,
787,
829,
943,
959,
979,
1064,
1078,
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": [
2,
3,
20,
21,
26,
32,
34,
38,
39,
42,
43,
45,
57,
59,
74,
79,
81,
82,
85,
90,
97,
98,
105,
112,
114,
115,
126,
127,
128,
131,
135,
136,
141,
146,
148,
154,
158,
168,
172,
173,
179,
180,
183,
184,
187,
189,
197,
199,
202,
204,
212,
228,
240,
244,
247,
253,
258,
259,
263,
264,
272,
277,
296,
300,
315,
325,
339,
341,
348,
356,
362,
368,
373,
377,
382,
383,
391,
392,
393,
394,
396,
397,
402,
403,
407,
409,
415,
416,
421,
425,
430,
433,
436,
438,
444,
445,
446,
448,
452,
476,
489,
496,
498,
503,
507,
509,
510,
514,
520,
522,
525,
529,
532,
544,
546,
550,
557,
559,
562,
580,
591,
598,
601,
617,
624,
629,
643,
647,
649,
660,
666,
667,
675,
677,
679,
681,
684,
693,
695,
709,
729,
737,
738,
740,
743,
746,
747,
749,
754,
756,
758,
770,
774,
777,
785,
787,
788,
795,
796,
798,
800,
804,
805,
817,
826,
828,
829,
832,
835,
838,
841,
844,
850,
858,
864,
865,
870,
875,
878,
879,
882,
905,
907,
909,
917,
918,
922,
924,
925,
930,
943,
944,
948,
954,
955,
959,
974,
979,
980,
985,
993,
1000,
1018,
1019,
1022,
1031,
1042,
1052,
1054,
1057,
1064,
1068,
1070,
1074,
1078,
1092,
1093,
1096,
1098,
1101,
1111,
1117,
1123,
1128,
1132
]
}
|
soccer_2016
|
List the match IDs which had players out by hit wickets.
|
had players out by hit wickets refers to Out_Name = 'hit wicket'
|
SELECT T1.Match_Id FROM Wicket_Taken AS T1 INNER JOIN Out_Type AS T2 ON T2.Out_Id = T1.Kind_Out WHERE T2.Out_Name = 'hit wicket'
|
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,861 | 1,861 |
CREATE TABLE `Out_Type`
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE `Wicket_Taken`
(
Match_Id INTEGER,
Kind_Out INTEGER,
primary key Match_Id,
foreign key Match_Id references MatchMatch_Id,
foreign key Kind_Out references Out_TypeOut_Id
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
640
],
"case_2": [
640
],
"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 got out by being stumped in the second innings of all matches?
|
got out by being stumped refers to Out_Name = 'stumped'; the second innings refers to Innings_No = 2
|
SELECT SUM(CASE WHEN T1.Innings_No = 2 THEN 1 ELSE 0 END) FROM Wicket_Taken AS T1 INNER JOIN Out_Type AS T2 ON T2.Out_Id = T1.Kind_Out WHERE T2.Out_Name = 'stumped'
|
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,862 | 1,862 |
CREATE TABLE `Out_Type`
(
Out_Id INTEGER
primary key,
Out_Name TEXT
)
CREATE TABLE `Wicket_Taken`
(
Kind_Out INTEGER,
Innings_No INTEGER, Innings_No,
foreign key Kind_Out references Out_TypeOut_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"CASE",
"INNER JOIN",
"ON",
"FROM"
] | 9 |
simple
|
{
"case_1": [
640
],
"case_2": [
640
],
"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 times did Yuvraj Singh receive the Man of the Match award?
|
Yuvraj Singh refers to Player_Name = 'Yuvraj Singh'; receive the Man of the Match award refers to Player_Id = Man_of_the_Match
|
SELECT SUM(CASE WHEN T2.Player_Name = 'Yuvraj Singh' THEN 1 ELSE 0 END) FROM Match AS T1 INNER JOIN Player AS T2 ON T2.Player_Id = T1.Man_of_the_Match
|
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,863 | 1,863 |
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
|
Among the players who were born in 1977, provide names and birthdates of the players from England.
|
born in 1977 refers to DOB LIKE '1977%'; name refers to Player_Name; birthdate refers to DOB; England refers to Country_Name = 'England'
|
SELECT T2.Player_Name, T2.DOB FROM Country AS T1 INNER JOIN Player AS T2 ON T2.Country_Name = T1.Country_Id WHERE T2.DOB LIKE '1977%' AND T1.Country_Name = 'England'
|
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,864 | 1,864 |
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
|
Who got the Man of the Series Award in 2010?
|
player's name refers to Player_Name; got the Man of the Series Award refers to Man_of_the_Match = Player_Id; in 2010 refers to Season_Year = 2010
|
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Match AS T2 ON T2.Man_of_the_Match = T1.Player_Id INNER JOIN Season AS T3 ON T3.Season_Id = T2.Season_Id WHERE T3.Season_Year = 2010 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 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,865 | 1,865 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Season`
(
Season_Id INTEGER
primary key,
Season_Year INTEGER
)
CREATE TABLE `Match`
(
Season_Id INTEGER,
Man_of_the_Match INTEGER,
foreign key Season_Id references SeasonSeason_Id,
foreign key Man_of_the_Match references PlayerPlayer_Id
)
|
[
"GROUP BY",
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 10 |
simple
|
{
"case_1": [
-1
],
"case_2": [
229
],
"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
|
Calculate the win rate of the team "Chennai Super Kings".
|
team "Chennai Super Kings" refers to Team_Name = 'Chennai Super Kings'; win rate = divide(count(Match_Id where Match_Winner = 3), count(Match_Id)) * 100%
|
SELECT CAST(SUM(CASE WHEN T1.Match_Winner = 3 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Match_Id) FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_1 INNER JOIN Team AS T3 ON T3.Team_Id = T1.Team_2 WHERE T2.Team_Name = 'Chennai Super Kings' OR T3.Team_Name = 'Chennai Super Kings'
|
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,866 | 1,866 |
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",
"OR",
"AS",
"SELECT",
"SUM",
"CASE",
"INNER JOIN",
"ON",
"CAST",
"COUNT",
"FROM"
] | 16 |
challenging
|
{
"case_1": [
829,
1087
],
"case_2": [
54,
212,
829,
1064,
1087,
1098
],
"case_3": [
54,
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,
6,
11,
16,
20,
22,
24,
27,
30,
35,
36,
37,
39,
42,
47,
51,
53,
54,
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,
829,
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
|
List the names and countries of the players from Gujarat Lions who played in the match held on 11th April 2016.
|
player's name refers to Player_Name; country refers to Country_Name; Gujarat Lions refers to Team_Name = 'Gujarat Lions'; on 11th April 2016 refers to Match_Date = '2016-04-11'
|
SELECT T4.Player_Name, T5.Country_Name FROM Player_Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_Id INNER JOIN Match AS T3 ON T3.Match_Id = T1.Match_Id INNER JOIN Player AS T4 ON T4.Player_Id = T1.Player_Id INNER JOIN Country AS T5 ON T5.Country_Id = T4.Country_Name WHERE T2.Team_Name = 'Gujarat Lions' AND T3.Match_Date = '2016-04-11'
|
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 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,867 | 1,867 |
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 `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Match_Date DATE
)
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"
] | 18 |
challenging
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"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
|
Provide the names and birthdates of players who have left-arm fast skills.
|
player's name refers to Player_Name; birthdate refers to DOB; have left-arm fast skills refers to Bowling_skill = 'Left-arm fast'
|
SELECT T1.Player_Name, T1.DOB FROM Player AS T1 INNER JOIN Bowling_Style AS T2 ON T2.Bowling_Id = T1.Bowling_skill WHERE T2.Bowling_skill = 'Left-arm fast'
|
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,868 | 1,868 |
CREATE TABLE `Bowling_Style`
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE `Player`
(
Player_Name TEXT,
DOB DATE,
Bowling_skill INTEGER,
foreign key Bowling_skill references Bowling_StyleBowling_Id
)
|
[
"AS",
"SELECT",
"-",
"INNER JOIN",
"ON",
"FROM"
] | 7 |
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,
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
|
Where did BR Doctrove come from?
|
the country the umpire comes from refers to Country_Name; BR Doctrove refers to Umpire_Name = 'BR Doctrove'
|
SELECT T1.Country_Name FROM Country AS T1 INNER JOIN Umpire AS T2 ON T2.Umpire_Country = T1.Country_Id WHERE T2.Umpire_Name = 'BR Doctrove'
|
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,869 | 1,869 |
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
|
Who was the captain of the winning team in the match held on 1st June 2008?
|
player's name refers to Player_Name; captain refers to Role_Desc = 'Captain'; the winning team refers to Match_Winner = Team_Id; on 1st June 2008 refers to Match_Date = '2008-06-01'
|
SELECT T3.Player_Name FROM Player_Match AS T1 INNER JOIN Match AS T2 ON T2.Match_Id = T1.Match_Id INNER JOIN Player AS T3 ON T3.Player_Id = T1.Player_Id INNER JOIN Rolee AS T4 ON T4.Role_Id = T1.Role_Id WHERE T2.Match_Date = '2008-06-01' AND T4.Role_Desc = 'Captain' AND T2.Match_Winner = T1.Team_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 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,870 | 1,870 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Player_Name TEXT
)
CREATE TABLE `Rolee`
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Match_Date DATE,
Match_Winner INTEGER,
foreign key Match_Winner references TeamTeam_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 MatchMatch_Id,
foreign key Player_Id references PlayerPlayer_Id,
foreign key Team_Id references TeamTeam_Id,
foreign key Role_Id references RoleeRole_Id
)
|
[
"AS",
"AND",
"SELECT",
"-",
"INNER JOIN",
"ON",
"FROM"
] | 16 |
challenging
|
{
"case_1": [
787
],
"case_2": [
787
],
"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
|
Which team did CK Kapugedera belong to? How many matches did he play?
|
team refers to Team_Name; CK Kapugedera refers to Player_Name = 'CK Kapugedera'
|
SELECT T3.Team_Name, COUNT(T2.Match_Id) FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T2.Player_Id = T1.Player_Id INNER JOIN Team AS T3 ON T3.Team_Id = T2.Team_Id WHERE T1.Player_Name = 'CK Kapugedera'
|
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,871 | 1,871 |
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",
"SELECT",
"INNER JOIN",
"ON",
"COUNT",
"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,
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,
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,
192,
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,
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,
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,
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,
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,
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,
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,
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,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
Among the matches held in Mumbai, how many percent of them were held in Wankhede Stadium?
|
Mumbai refers to City_Name = 'Mumbai'; Wankhede Stadium refers to Venue_Name = 'Wankhede Stadium'; percent = divide(count(Match_Id where Venue_Name = 'Wankhede Stadium'), count(Match_Id)) * 100% where City_Name = 'Mumbai'
|
SELECT CAST(SUM(CASE WHEN T2.Venue_Name = 'Wankhede Stadium' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.Match_Id) FROM City AS T1 INNER JOIN Venue AS T2 ON T2.City_Id = T1.City_Id INNER JOIN Match AS T3 ON T3.Venue_Id = T2.Venue_Id WHERE T1.City_Name = 'Mumbai'
|
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,872 | 1,872 |
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
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"CASE",
"INNER JOIN",
"ON",
"CAST",
"COUNT",
"FROM"
] | 15 |
medium
|
{
"case_1": [
225
],
"case_2": [
225
],
"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
|
Among the players out in match ID 392187, calculate the percentage of players out by bowl.
|
out by bowl refers to Out_Name = 'bowled'; percentage = divide(count(Player_Out where Out_Name = 'bowled'), count(Player_Out)) * 100% where Match_Id = 392187
|
SELECT CAST(SUM(CASE WHEN T2.Out_Name = 'bowled' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Player_Out) FROM Wicket_Taken AS T1 INNER JOIN Out_Type AS T2 ON T2.Out_Id = T1.Kind_Out WHERE T1.Match_Id = 392187
|
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,873 | 1,873 |
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,
primary key Match_Id,
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"
] | 12 |
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 percent of the toss-winners decided to bowl first on the pitch from 2010 to 2016?
|
decide to bowl first refers to Toss_Name = 'field'; from 2010 to 2016 refers to Match_Date BETWEEN '2010-01-01' AND '2016-12-31'; percent = divide(count(Toss_Id where Toss_Name = 'field'), count(Toss_Id)) * 100% where Match_Date BETWEEN '2010-01-01' AND '2016-12-31'
|
SELECT CAST(SUM(CASE WHEN T2.Toss_Name = 'field' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.Toss_Id) FROM Match AS T1 INNER JOIN Toss_Decision AS T2 ON T2.Toss_Id = T1.Toss_Decide WHERE T1.Match_Date BETWEEN '2010-01-01' AND '2016-12-31'
|
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,874 | 1,874 |
CREATE TABLE `Toss_Decision`
(
Toss_Id INTEGER
primary key,
Toss_Name TEXT
)
CREATE TABLE `Match`
(
Match_Date DATE,
Toss_Decide INTEGER,
foreign key Toss_Decide references Toss_DecisionToss_Id
)
|
[
"CASE WHEN",
"AS",
"AND",
"SELECT",
"SUM",
"CASE",
"-",
"INNER JOIN",
"ON",
"CAST",
"COUNT",
"BETWEEN",
"FROM"
] | 18 |
challenging
|
{
"case_1": [
383
],
"case_2": [
383
],
"case_3": [
2,
201,
212,
225,
314,
383,
509,
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,
2,
4,
6,
16,
21,
22,
24,
30,
37,
39,
42,
45,
47,
51,
53,
61,
63,
64,
68,
69,
71,
73,
74,
75,
76,
77,
81,
85,
88,
93,
96,
98,
106,
112,
113,
115,
117,
118,
119,
120,
125,
127,
128,
129,
131,
141,
142,
143,
146,
148,
152,
153,
154,
155,
158,
160,
164,
169,
170,
172,
173,
175,
180,
183,
184,
187,
189,
191,
192,
195,
197,
199,
201,
207,
212,
214,
215,
219,
223,
225,
226,
227,
228,
234,
236,
240,
244,
248,
254,
256,
258,
261,
264,
267,
268,
271,
272,
276,
277,
278,
279,
296,
299,
300,
301,
304,
314,
316,
317,
319,
322,
323,
325,
330,
335,
339,
341,
347,
356,
360,
368,
370,
374,
375,
382,
383,
391,
392,
393,
394,
398,
402,
403,
406,
409,
412,
415,
416,
417,
423,
424,
425,
426,
427,
436,
438,
444,
445,
446,
448,
451,
452,
453,
458,
463,
464,
469,
470,
476,
477,
478,
482,
483,
485,
486,
487,
488,
490,
493,
496,
498,
500,
504,
507,
509,
510,
514,
515,
516,
517,
518,
519,
520,
522,
526,
528,
529,
530,
535,
537,
540,
544,
547,
550,
558,
559,
560,
562,
563,
564,
571,
573,
575,
580,
581,
582,
595,
597,
608,
612,
613,
620,
623,
624,
627,
628,
630,
632,
633,
640,
641,
643,
646,
649,
658,
662,
663,
666,
668,
671,
675,
676,
677,
681,
682,
684,
686,
687,
690,
693,
695,
710,
712,
714,
723,
727,
734,
735,
739,
740,
743,
744,
746,
747,
749,
750,
753,
754,
756,
758,
760,
762,
768,
772,
776,
777,
787,
788,
795,
796,
797,
798,
799,
800,
802,
804,
805,
808,
810,
813,
814,
819,
824,
825,
827,
829,
830,
832,
835,
838,
841,
844,
848,
849,
851,
853,
858,
867,
868,
870,
871,
874,
877,
878,
886,
888,
894,
896,
898,
902,
905,
909,
912,
917,
922,
923,
924,
926,
930,
935,
943,
944,
954,
956,
958,
959,
961,
969,
974,
985,
986,
993,
996,
998,
1008,
1012,
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
|
List down the ID of toss winners who decided to bat after winning the "toss of the coin".
|
decided to bat refers to Toss_Decide = 2; ID of toss winners refers to Toss_winner
|
SELECT Toss_Winner FROM Match WHERE 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,875 | 1,875 |
CREATE TABLE `Match`
(
Toss_Winner INTEGER,
Toss_Decide INTEGER,
foreign key Toss_Winner references TeamTeam_Id,
foreign key Toss_Decide references Toss_DecisionToss_Id
)
|
[
"SELECT",
"FROM"
] | 2 |
simple
|
{
"case_1": [
122,
979
],
"case_2": [
122,
979
],
"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
|
List down the match ID of matches that the "man of the match" award was given to BB McCullum.
|
SELECT T1.Match_Id FROM Match AS T1 INNER JOIN Player AS T2 ON T2.Player_Id = T1.Man_of_the_Match WHERE T2.Player_Name = 'BB McCullum'
|
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,876 | 1,876 |
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
|
List down the DOB of players who received the "man of the match" award.
|
SELECT T2.DOB FROM Match AS T1 INNER JOIN Player AS T2 ON T2.Player_Id = T1.Man_of_the_Match
|
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,877 | 1,877 |
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
DOB DATE
)
CREATE TABLE `Match`
(
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
|
List down the name of teams that won the toss of the coin from matches with ID from 336010 to 336020.
|
name of teams refers to Team_Name; won the toss refers to Toss_Winner; matches with ID from 336010 to 336020 refers to Match_Id BETWEEN 336010 AND 336020
|
SELECT T2.Team_Name FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Toss_Winner WHERE T1.Match_Id BETWEEN 336010 AND 336020
|
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,878 | 1,878 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Toss_Winner INTEGER,
foreign key Toss_Winner references TeamTeam_Id
)
|
[
"AS",
"AND",
"SELECT",
"INNER JOIN",
"ON",
"BETWEEN",
"FROM"
] | 8 |
simple
|
{
"case_1": [
592,
1098
],
"case_2": [
212,
592,
829,
1064,
1087,
1098
],
"case_3": [
2,
43,
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,
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,
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,
350,
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,
399,
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,
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,
656,
657,
658,
659,
660,
662,
663,
665,
666,
667,
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,
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,
1071,
1072,
1074,
1078,
1080,
1081,
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 have Mumbai Indians won?
|
Mumbai Indians refers to Team_Name = 'Mumbai Indians'; won refers to Match_Winner
|
SELECT SUM(CASE WHEN T2.Team_Name = 'Mumbai Indians' THEN 1 ELSE 0 END) FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Match_Winner
|
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,879 | 1,879 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Match_Winner INTEGER,
foreign key Match_Winner references TeamTeam_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"CASE",
"INNER JOIN",
"ON",
"FROM"
] | 9 |
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
|
List down names of teams that have played as second team against Pune Warriors.
|
names of teams refers to Team_Name; second team refers to Team_2; Pune Warriors refers to Team_Name = 'Pune Warriors'
|
SELECT T2.Team_Name FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_2 WHERE T1.Team_1 = ( SELECT Team_Id FROM Team WHERE Team_Name = 'Pune Warriors' ) GROUP BY T2.Team_Name
|
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,880 | 1,880 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Team_1 INTEGER,
Team_2 INTEGER,
foreign key Team_1 references TeamTeam_Id,
foreign key Team_2 references TeamTeam_Id
)
|
[
"GROUP BY",
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 9 |
simple
|
{
"case_1": [
592,
1098
],
"case_2": [
212,
592,
829,
1064,
1087,
1098
],
"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
|
What is the name of the team that won match ID 336000?
|
name of the team refers to Team_Name; won refers to Match_Winner
|
SELECT T2.Team_Name FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Match_Winner WHERE T1.Match_Id = 336000
|
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,881 | 1,881 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
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
|
What are the match IDs that were played at Brabourne Stadium?
|
at Brabourne Stadium refers to Venue_Name = 'Brabourne Stadium'
|
SELECT T1.Match_Id FROM Match AS T1 INNER JOIN Venue AS T2 ON T2.Venue_Id = T1.Venue_Id WHERE T2.Venue_Name = 'Brabourne Stadium'
|
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,882 | 1,882 |
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
|
List down the name of venues in season 2.
|
name of venues refers to Venue_Name; season 2 refers to Season_Id = 2
|
SELECT T2.Venue_Name FROM Match AS T1 INNER JOIN Venue AS T2 ON T2.Venue_Id = T1.Venue_Id WHERE T1.Season_Id = 2 GROUP BY T2.Venue_Name
|
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,883 | 1,883 |
CREATE TABLE `Venue`
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT
)
CREATE TABLE `Match`
(
Season_Id INTEGER,
Venue_Id INTEGER,
foreign key Season_Id references SeasonSeason_Id,
foreign key Venue_Id references VenueVenue_Id
)
|
[
"GROUP BY",
"AS",
"SELECT",
"INNER JOIN",
"ON",
"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,
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
|
What is the city of M Chinnaswamy Stadium?
|
city refers to City_Name; M Chinnaswamy Stadium refers to Venue_Name = 'M Chinnaswamy Stadium'
|
SELECT T1.City_Name FROM City AS T1 INNER JOIN Venue AS T2 ON T2.City_Id = T1.City_Id WHERE T2.Venue_Name = 'M Chinnaswamy Stadium'
|
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,884 | 1,884 |
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
|
List down all of the venues in Mumbai.
|
venues refers to Venue_Name; Mumbai refers to City_Name = 'Mumbai'
|
SELECT T2.Venue_Name FROM City AS T1 INNER JOIN Venue AS T2 ON T2.City_Id = T1.City_Id WHERE T1.City_Name = 'Mumbai'
|
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,885 | 1,885 |
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
|
List down all of the winning teams' IDs that played in St George's Park.
|
winning teams' refers to Match_Winner; played in St George's Park refers to Venue_Name like 'St George%'
|
SELECT T2.Match_Winner FROM Venue AS T1 INNER JOIN Match AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE T1.Venue_Name LIKE 'St George%'
|
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,886 | 1,886 |
CREATE TABLE `Venue`
(
Venue_Id INTEGER
primary key,
Venue_Name TEXT
)
CREATE TABLE `Match`
(
Venue_Id INTEGER,
Match_Winner INTEGER,
foreign key Venue_Id references VenueVenue_Id,
foreign key Match_Winner references TeamTeam_Id
)
|
[
"AS",
"SELECT",
"LIKE",
"INNER JOIN",
"ON",
"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,
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,
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,
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,
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
|
Is SuperSport Park located at Centurion?
|
SuperSport Park refers to Venue_Name = 'SuperSport Park'; Centurion refers to City_Name = 'Centurion'
|
SELECT T2.City_Name FROM Venue AS T1 INNER JOIN City AS T2 ON T1.City_Id = T2.City_Id WHERE T1.Venue_Name LIKE 'St George%'
|
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,887 | 1,887 |
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",
"LIKE",
"INNER JOIN",
"ON",
"FROM"
] | 7 |
simple
|
{
"case_1": [
700
],
"case_2": [
548,
700
],
"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,
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,
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,
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,
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
|
Calculate the total winning match for Deccan Chargers.
|
winning refers to Match_Winner; Deccan Chargers refers to Team_Name = 'Deccan Chargers'
|
SELECT SUM(T2.Match_Winner) FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Match_Winner WHERE T1.Team_Name = 'Deccan Chargers'
|
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,888 | 1,888 |
CREATE TABLE `Team`
(
Team_Id INTEGER
primary key,
Team_Name TEXT
)
CREATE TABLE `Match`
(
Match_Winner INTEGER,
foreign key Match_Winner references TeamTeam_Id
)
|
[
"AS",
"SELECT",
"SUM",
"INNER JOIN",
"ON",
"FROM"
] | 7 |
simple
|
{
"case_1": [
592,
1098
],
"case_2": [
212,
592,
829,
1064,
1087,
1098
],
"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,
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,
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,
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,
453,
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,
504,
505,
506,
507,
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,
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,
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,
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,
1069,
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
|
Count the total venues located in Pune City.
|
Pune City refers to City_Name = 'Pune'
|
SELECT SUM(T1.Venue_Name) FROM Venue AS T1 INNER JOIN City AS T2 ON T1.City_Id = T2.City_Id WHERE T2.City_Name = 'Pune'
|
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,889 | 1,889 |
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",
"SUM",
"INNER JOIN",
"ON",
"FROM"
] | 7 |
simple
|
{
"case_1": [
700
],
"case_2": [
548,
700
],
"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,
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,
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,
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,
453,
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,
504,
505,
506,
507,
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,
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,
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,
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,
1069,
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 player id of the player who was at the non-striker end for the most number of balls in the match 501219.
|
most number of balls refers to max(Ball_Id); match 501219 refers to Match_Id = 501219;
player id also refers to non_striker or ball_id
|
SELECT Ball_Id FROM Ball_by_Ball WHERE Non_Striker = Ball_Id ORDER BY Ball_Id DESC LIMIT 1
|
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,890 | 1,890 |
CREATE TABLE `Ball_by_Ball`
(
Ball_Id INTEGER,
Striker_Batting_Position INTEGER,
Striker INTEGER,
Non_Striker INTEGER, Ball_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
|
Calculate the average runs scored during the first half of all first innings.
|
first half refers to 1 < Over_Id and Over_Id < 25; average = divide(sum(Over_Id) when 1 < Over_Id and Over_Id < 25, sum(Runs_Scored)) as percentage; first innings refers to Innings_No = 1
|
SELECT CAST(SUM(CASE WHEN 1 < Over_Id AND Over_Id < 25 THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(Runs_Scored) FROM Batsman_Scored WHERE Innings_No = 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,891 | 1,891 |
CREATE TABLE `Batsman_Scored`
(
Over_Id INTEGER,
Runs_Scored INTEGER,
Innings_No INTEGER, Over_Id, Innings_No
)
|
[
"CASE WHEN",
"AS",
"AND",
"SELECT",
"SUM",
"CASE",
"CAST",
"FROM"
] | 9 |
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,
10,
16,
24,
35,
39,
42,
54,
61,
64,
71,
77,
81,
87,
93,
104,
106,
112,
113,
119,
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,
254,
258,
261,
264,
267,
271,
278,
279,
299,
300,
304,
305,
316,
317,
322,
323,
335,
347,
356,
360,
362,
367,
375,
383,
393,
398,
402,
406,
409,
412,
415,
423,
427,
438,
448,
451,
452,
453,
458,
470,
476,
478,
483,
485,
486,
487,
500,
504,
508,
510,
514,
517,
518,
527,
528,
535,
537,
540,
547,
550,
563,
564,
571,
573,
575,
580,
581,
597,
601,
612,
620,
623,
628,
640,
646,
658,
662,
666,
676,
682,
686,
690,
709,
710,
723,
740,
744,
747,
750,
753,
762,
772,
776,
777,
787,
788,
795,
796,
798,
800,
802,
808,
810,
813,
825,
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,
1027,
1031,
1036,
1048,
1062,
1064,
1068,
1069,
1072,
1078,
1082,
1087,
1092,
1093,
1098,
1100,
1110,
1121,
1128,
1129,
1131,
1133,
1134,
1135
]
}
|
soccer_2016
|
What are the average extra runs given in the second innings of every match?
|
second innings refers to Innings_No = 2; average extra runs = divide(sum(Extra_Runs), count(Innings_No)) when Innings_No = 2
|
SELECT AVG(Innings_No) FROM Extra_Runs WHERE Innings_No = 2
|
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,892 | 1,892 |
CREATE TABLE `Extra_Runs`
(
Extra_Runs INTEGER,
Innings_No INTEGER, Innings_No
)
|
[
"SELECT",
"FROM",
"AVG"
] | 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
|
Among the matches, what percentage have a winning margin above 100?
|
winning margin above 100 refers to Win_Margin > 100; percentage = divide(count(Match_Id) when Win_Margin > 100, count(Match_Id)) as percentage
|
SELECT CAST(COUNT(CASE WHEN Win_Margin > 100 THEN 1 ELSE 0 END) AS REAL) * 100 / TOTAL(Match_Id) 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,893 | 1,893 |
CREATE TABLE `Match`
(
Match_Id INTEGER
primary key,
Win_Margin INTEGER
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"CASE",
"CAST",
"COUNT",
"FROM"
] | 7 |
simple
|
{
"case_1": [
122,
979
],
"case_2": [
122,
979
],
"case_3": [
2,
54,
122,
201,
205,
212,
225,
229,
245,
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,
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,
2,
4,
6,
10,
11,
16,
22,
24,
27,
30,
35,
36,
37,
42,
47,
51,
53,
54,
55,
61,
62,
63,
64,
68,
69,
71,
73,
74,
75,
77,
81,
82,
86,
87,
88,
89,
91,
93,
96,
98,
104,
106,
113,
115,
117,
118,
119,
120,
121,
122,
125,
126,
127,
129,
131,
140,
142,
143,
146,
148,
152,
153,
155,
158,
159,
160,
164,
167,
169,
170,
171,
173,
175,
179,
183,
184,
187,
188,
189,
190,
191,
192,
195,
196,
197,
199,
201,
202,
205,
206,
207,
212,
214,
215,
219,
223,
225,
226,
227,
229,
233,
234,
236,
243,
244,
245,
247,
248,
254,
256,
258,
261,
263,
264,
267,
268,
269,
271,
276,
277,
278,
279,
286,
298,
299,
300,
301,
303,
304,
305,
311,
314,
316,
317,
319,
320,
322,
323,
325,
330,
334,
335,
336,
338,
339,
341,
344,
345,
347,
349,
354,
358,
360,
362,
364,
367,
370,
373,
374,
375,
380,
382,
383,
384,
391,
392,
393,
394,
398,
401,
402,
403,
406,
409,
411,
412,
415,
416,
417,
423,
424,
426,
427,
436,
438,
443,
444,
445,
447,
448,
451,
452,
453,
454,
458,
460,
462,
464,
465,
466,
467,
469,
471,
473,
476,
477,
478,
479,
483,
484,
485,
486,
487,
488,
490,
493,
500,
504,
505,
508,
509,
510,
514,
515,
516,
517,
518,
519,
520,
526,
527,
528,
532,
535,
536,
537,
538,
540,
542,
544,
547,
548,
550,
552,
558,
559,
560,
563,
564,
566,
571,
573,
575,
580,
581,
582,
595,
596,
597,
601,
606,
608,
611,
613,
620,
623,
627,
628,
630,
632,
633,
634,
640,
641,
645,
646,
649,
654,
658,
659,
661,
662,
663,
665,
666,
668,
669,
671,
672,
676,
681,
682,
686,
687,
688,
690,
694,
696,
705,
706,
709,
710,
712,
714,
721,
723,
727,
733,
734,
735,
736,
739,
740,
743,
744,
747,
749,
750,
752,
753,
756,
760,
762,
768,
769,
772,
776,
778,
779,
787,
788,
790,
795,
796,
797,
798,
799,
800,
802,
804,
805,
808,
810,
812,
813,
814,
818,
819,
824,
827,
830,
832,
838,
839,
841,
844,
848,
849,
851,
853,
857,
866,
867,
868,
870,
871,
872,
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,
939,
941,
943,
944,
950,
951,
954,
956,
958,
959,
961,
963,
969,
975,
977,
978,
979,
981,
985,
986,
993,
996,
998,
1004,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1022,
1023,
1036,
1037,
1042,
1043,
1047,
1048,
1050,
1051,
1058,
1062,
1064,
1066,
1067,
1069,
1070,
1071,
1072,
1075,
1078,
1082,
1084,
1086,
1087,
1092,
1093,
1094,
1098,
1100,
1101,
1103,
1104,
1106,
1110,
1112,
1113,
1119,
1121,
1123,
1124,
1128,
1129,
1131,
1133,
1134,
1135,
1137
]
}
|
soccer_2016
|
List the name of the players born between 1970 and 1990 in descending order of age.
|
name of the players refers to Player_Name; born between 1970 and 1990 refers to DOB between '1970-01-01' and '1990-12-31'
|
SELECT Player_Name FROM Player WHERE DOB BETWEEN '1970-01-01' AND '1990-12-31' ORDER BY DOB DESC
|
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,894 | 1,894 |
CREATE TABLE `Player`
(
Player_Name TEXT,
DOB DATE
)
|
[
"AND",
"SELECT",
"ORDER BY",
"-",
"DESC",
"BETWEEN",
"FROM"
] | 10 |
simple
|
{
"case_1": [
2,
43,
259
],
"case_2": [
2,
43,
259
],
"case_3": [
2,
43,
229,
252,
259,
314,
349,
383,
548,
592,
654,
688,
778,
829,
951,
1037,
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": [
1,
2,
10,
11,
13,
15,
17,
20,
21,
28,
29,
32,
36,
38,
39,
43,
45,
49,
55,
59,
62,
69,
73,
74,
75,
76,
78,
79,
85,
86,
89,
93,
98,
108,
112,
115,
121,
125,
128,
133,
138,
141,
154,
158,
159,
162,
163,
167,
172,
173,
174,
179,
180,
181,
183,
184,
185,
187,
188,
197,
199,
202,
206,
208,
213,
223,
229,
233,
240,
244,
247,
252,
256,
259,
262,
263,
272,
275,
278,
281,
285,
286,
291,
296,
305,
309,
311,
313,
314,
319,
320,
324,
325,
329,
334,
336,
337,
339,
341,
345,
348,
349,
350,
352,
356,
359,
362,
364,
365,
368,
371,
373,
378,
379,
381,
382,
383,
385,
391,
393,
394,
395,
399,
400,
403,
404,
409,
411,
416,
421,
425,
428,
429,
434,
435,
436,
444,
445,
446,
448,
451,
454,
460,
462,
463,
469,
482,
493,
495,
496,
497,
498,
505,
507,
510,
514,
520,
522,
529,
530,
532,
534,
536,
538,
542,
544,
548,
552,
559,
560,
562,
566,
567,
576,
578,
579,
583,
584,
586,
590,
592,
595,
601,
611,
619,
621,
624,
625,
626,
634,
637,
638,
643,
645,
654,
656,
657,
659,
664,
665,
667,
669,
675,
677,
679,
681,
684,
686,
688,
690,
691,
693,
698,
701,
703,
708,
719,
732,
733,
735,
740,
746,
748,
752,
754,
756,
758,
759,
760,
768,
777,
778,
785,
788,
790,
798,
800,
810,
815,
817,
818,
823,
827,
829,
830,
835,
836,
838,
849,
851,
858,
861,
864,
866,
869,
870,
876,
878,
886,
893,
901,
905,
911,
917,
924,
927,
929,
930,
934,
946,
950,
951,
954,
956,
962,
963,
966,
967,
970,
972,
973,
974,
975,
977,
981,
983,
985,
987,
994,
1004,
1005,
1006,
1010,
1013,
1017,
1025,
1030,
1031,
1034,
1037,
1038,
1047,
1049,
1050,
1051,
1056,
1057,
1067,
1068,
1076,
1077,
1081,
1083,
1092,
1094,
1101,
1123,
1124,
1137,
1139,
1141
]
}
|
soccer_2016
|
Of the wickets taken in the third overs, how many are without the involvement of fielders?
|
third overs refers to Over_Id = 3; without the involvement of fielders refers to Fielders = ''
|
SELECT SUM(CASE WHEN Fielders = '' THEN 1 ELSE 0 END) FROM Wicket_Taken WHERE Over_Id = 3
|
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,895 | 1,895 |
CREATE TABLE `Wicket_Taken`
(
Over_Id INTEGER,
Fielders INTEGER, Over_Id,
foreign key Fielders references PlayerPlayer_Id
)
|
[
"CASE WHEN",
"SELECT",
"SUM",
"CASE",
"FROM"
] | 5 |
simple
|
{
"case_1": [
245
],
"case_2": [
245
],
"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,
285,
298,
299,
300,
303,
304,
305,
313,
316,
317,
322,
323,
335,
347,
350,
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,
987,
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
|
From which country does the most umpires are from? How many of them are from the mentioned country?
|
which country refers to Country_Id; most umpires refers to max(count(Umpire_Id))
|
SELECT T2.Country_Id, COUNT(T1.Umpire_Id) FROM Umpire AS T1 INNER JOIN Country AS T2 ON T2.Country_Id = T1.Umpire_Country GROUP BY T2.Country_Id ORDER BY COUNT(T1.Umpire_Id) DESC LIMIT 1
|
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,896 | 1,896 |
CREATE TABLE `Country`
(
Country_Id INTEGER
primary key,
foreign key Country_Id references CountryCountry_Id
)
CREATE TABLE `Umpire`
(
Umpire_Id INTEGER
primary key,
Umpire_Country INTEGER,
foreign key Umpire_Country references CountryCountry_Id
)
|
[
"GROUP BY",
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"COUNT",
"FROM"
] | 12 |
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
|
Among the players, what percentage are both captain and keeper?
|
captain and keeper refers to Role_Desc = 'CaptainKeeper'; percentage = divide(count(Player_Id) when Role_Desc = 'CaptainKeeper', count(Player_Id)) as percentage
|
SELECT CAST(SUM(CASE WHEN T2.Role_Desc = 'CaptainKeeper' THEN 1 ELSE 0 END) AS REAL) * 100 / TOTAL(T1.Player_Id) FROM Player_Match AS T1 INNER JOIN Rolee AS T2 ON T1.Role_Id = T2.Role_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,897 | 1,897 |
CREATE TABLE `Rolee`
(
Role_Id INTEGER
primary key,
Role_Desc TEXT
)
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",
"CAST",
"FROM"
] | 11 |
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,
35,
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,
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,
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,
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,
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,
913,
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,
1121,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
soccer_2016
|
In the players, how many were out by hit wicket?
|
out by hit wicket refers to Out_Name = 'hit wicket'
|
SELECT Player_Out FROM Wicket_Taken AS T1 INNER JOIN Out_Type AS T2 ON T1.Kind_Out = T2.Out_Id WHERE Out_Name = 'hit wicket'
|
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,898 | 1,898 |
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",
"FROM"
] | 6 |
simple
|
{
"case_1": [
640
],
"case_2": [
640
],
"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
|
On average, how many players from each country bat with their right hand?
|
bat with their right hand refers to Batting_hand = 'Right-hand bat'; average = divide(count(Player_Id) when Batting_hand = 'Right-hand bat', count(Country_Name))
|
SELECT CAST(SUM(CASE WHEN T1.Batting_hand = 'Right-hand bat' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.Country_Name) FROM Batting_Style AS T1 INNER JOIN Player AS T2 ON T1.Batting_id = T2.Batting_hand
|
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,899 | 1,899 |
CREATE TABLE `Batting_Style`
(
Batting_Id INTEGER
primary key,
Batting_hand TEXT
)
CREATE TABLE `Player`
(
Batting_hand INTEGER,
Country_Name INTEGER,
foreign key Batting_hand references Batting_StyleBatting_Id,
foreign key Country_Name references CountryCountry_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"CASE",
"-",
"INNER JOIN",
"ON",
"CAST",
"COUNT",
"FROM"
] | 13 |
medium
|
{
"case_1": [
943,
1078
],
"case_2": [
550,
943,
959,
1078
],
"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,
979,
1037,
1064,
1078,
1087,
1092,
1093,
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,
21,
22,
24,
27,
30,
34,
35,
36,
37,
39,
42,
45,
47,
51,
53,
55,
61,
62,
63,
64,
68,
69,
71,
73,
74,
75,
77,
81,
82,
83,
85,
86,
87,
88,
91,
93,
94,
96,
97,
98,
104,
105,
106,
112,
113,
115,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
131,
135,
140,
141,
142,
143,
146,
148,
152,
153,
154,
155,
158,
159,
160,
164,
167,
169,
170,
171,
172,
173,
175,
179,
180,
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,
272,
276,
277,
278,
279,
296,
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,
368,
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,
425,
426,
427,
436,
438,
444,
445,
446,
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,
489,
490,
493,
496,
498,
500,
503,
504,
505,
507,
509,
510,
514,
515,
516,
517,
518,
519,
520,
522,
526,
528,
529,
532,
535,
536,
537,
538,
540,
544,
547,
548,
550,
552,
558,
559,
560,
562,
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,
643,
645,
646,
647,
649,
650,
654,
658,
659,
660,
662,
663,
665,
666,
668,
669,
671,
672,
675,
676,
677,
681,
682,
684,
686,
687,
688,
690,
693,
694,
695,
696,
701,
705,
706,
709,
710,
712,
714,
717,
721,
723,
727,
733,
734,
735,
736,
739,
740,
743,
744,
745,
746,
747,
749,
750,
752,
753,
754,
756,
758,
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,
829,
830,
832,
835,
838,
839,
841,
844,
848,
849,
851,
853,
857,
858,
866,
867,
868,
870,
871,
874,
876,
877,
878,
880,
882,
886,
888,
893,
894,
896,
897,
898,
901,
902,
905,
909,
911,
912,
913,
915,
917,
918,
922,
923,
924,
925,
926,
927,
930,
934,
935,
941,
943,
944,
950,
951,
954,
956,
958,
959,
961,
962,
963,
969,
973,
974,
975,
977,
979,
980,
981,
985,
986,
993,
996,
998,
1005,
1006,
1008,
1010,
1012,
1013,
1015,
1022,
1023,
1027,
1031,
1037,
1038,
1042,
1043,
1047,
1050,
1051,
1052,
1058,
1062,
1064,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1078,
1082,
1084,
1086,
1087,
1092,
1093,
1094,
1098,
1100,
1101,
1103,
1104,
1106,
1111,
1112,
1119,
1121,
1123,
1124,
1128,
1131,
1132,
1133,
1134,
1135,
1137
]
}
|
soccer_2016
|
What percentage of players have Legbreak skill?
|
Legbreak skill refers to Bowling_skill = 'Legbreak' ; percentage = divide(sum(Player_Id) when Bowling_skill = 'Legbreak', count(Player_Id)) as percentage
|
SELECT CAST(SUM(CASE WHEN T2.Bowling_skill = ' Legbreak' THEN 1 ELSE 0 END) AS REAL) * 100 / TOTAL(T1.Player_Id) FROM Player AS T1 INNER JOIN Bowling_Style AS T2 ON T1.Bowling_skill = T2.Bowling_Id
|
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,900 | 1,900 |
CREATE TABLE `Bowling_Style`
(
Bowling_Id INTEGER
primary key,
Bowling_skill TEXT
)
CREATE TABLE `Player`
(
Player_Id INTEGER
primary key,
Bowling_skill INTEGER,
foreign key Bowling_skill references Bowling_StyleBowling_Id
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"CASE",
"INNER JOIN",
"ON",
"CAST",
"FROM"
] | 11 |
medium
|
{
"case_1": [
1037
],
"case_2": [
509,
644,
1037
],
"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,
35,
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,
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,
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,
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,
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,
913,
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,
1121,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.