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
regional_sales
Please indicate store id in the state of California that have been applied 20% discount in store.
"California" is the name of State; in store refers to Sales Channel = 'In-Store'; 20% discount refers to Discount Applied = '0.2'
SELECT T FROM ( SELECT DISTINCT CASE WHEN T2.State = 'California' AND T1.`Sales Channel` = 'In-Store' AND T1.`Discount Applied` = 0.2 THEN T2.StoreID END AS T FROM `Sales Orders` T1 INNER JOIN `Store Locations` T2 ON T2.StoreID = T1._StoreID ) WHERE T IS NOT NULL
CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,711
2,711
CREATE TABLE `Store Locations` ( CREATE TABLE "Store Locations" StoreID INTEGER constraint "Store Locations_pk" primary key, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references RegionsStateCode, State TEXT ) CREATE TABLE `Sales Orders` ( "Sales Channel" TEXT, _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"StoreID, "Discount Applied" REAL )
[ "AS", "AND", "SELECT", "CASE", "-", "NULL", "INNER JOIN", "ON", "NOT", "In", "IS", "FROM" ]
15
medium
{ "case_1": [ 127, 129, 158, 479, 666, 944 ], "case_2": [ 127, 129, 158, 479, 666, 944 ], "case_3": [ 34, 127, 129, 158, 171, 219, 258, 263, 298, 303, 305, 398, 438, 443, 479, 528, 601, 666, 672, 706, 724, 747, 805, 837, 844, 880, 944, 978, 1066 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "case_5": [ 0, 16, 21, 24, 34, 39, 42, 45, 53, 71, 74, 85, 98, 106, 112, 113, 115, 127, 128, 129, 138, 141, 148, 150, 152, 154, 158, 171, 172, 180, 183, 184, 187, 195, 197, 200, 219, 240, 244, 258, 263, 267, 272, 296, 298, 299, 300, 303, 305, 325, 339, 356, 368, 375, 382, 383, 391, 393, 395, 398, 402, 406, 416, 425, 427, 436, 438, 443, 446, 448, 452, 476, 478, 479, 493, 496, 498, 500, 507, 508, 514, 516, 520, 522, 528, 529, 533, 544, 550, 559, 562, 563, 573, 580, 581, 589, 601, 620, 624, 637, 643, 646, 666, 672, 675, 677, 684, 686, 693, 706, 712, 724, 740, 746, 747, 753, 754, 756, 758, 772, 776, 777, 788, 800, 805, 808, 829, 835, 837, 838, 844, 848, 858, 870, 878, 880, 894, 896, 905, 922, 924, 926, 927, 930, 935, 941, 943, 944, 954, 959, 974, 978, 985, 1031, 1036, 1048, 1062, 1064, 1066, 1068, 1069, 1078, 1092, 1101, 1123, 1129, 1131, 1133, 1134 ] }
regional_sales
List the name of the customer with the most number of order quantity from 2018 to 2020.
name of customer refers to Customer Names; from 2018 to 2020 refers to OrderDate between '1/1/2018' and '31/12/2020'; most number of order quantity refers to Order Quantity = 8
SELECT T1.`Customer Names` FROM Customers AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._CustomerID = T1.CustomerID WHERE T2.OrderDate LIKE '%/%/18' OR T2.OrderDate LIKE '%/%/19' OR T2.OrderDate LIKE '%/%/20' ORDER BY T2.`Order Quantity` DESC LIMIT 1
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,712
2,712
CREATE TABLE `Customers` ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE `Sales Orders` ( OrderDate TEXT, _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references CustomersCustomerID, "Order Quantity" INTEGER )
[ "OR", "AS", "SELECT", "LIKE", "LIMIT", "ORDER BY", "INNER JOIN", "ON", "DESC", "FROM" ]
14
medium
{ "case_1": [ 126, 258, 747, 844 ], "case_2": [ 49, 126, 258, 747, 844 ], "case_3": [ 49, 126, 127, 202, 247, 258, 263, 264, 348, 394, 411, 438, 666, 747, 832, 844, 909, 918, 944, 975, 1128 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "case_5": [ 1, 3, 10, 11, 20, 26, 29, 36, 38, 42, 49, 55, 57, 59, 62, 69, 73, 75, 81, 82, 86, 89, 90, 121, 125, 126, 127, 131, 136, 138, 146, 150, 159, 162, 163, 167, 173, 179, 184, 187, 188, 199, 200, 202, 206, 212, 213, 229, 233, 239, 240, 247, 258, 262, 263, 264, 275, 277, 278, 281, 286, 309, 311, 313, 314, 315, 319, 320, 324, 329, 334, 336, 341, 342, 345, 348, 349, 353, 356, 364, 365, 373, 378, 379, 381, 385, 394, 395, 402, 403, 407, 409, 411, 415, 428, 429, 430, 433, 434, 435, 438, 444, 445, 451, 452, 454, 460, 462, 469, 476, 482, 495, 497, 505, 530, 532, 536, 538, 542, 548, 552, 557, 560, 566, 567, 578, 579, 584, 586, 590, 592, 595, 611, 621, 624, 625, 626, 634, 637, 638, 645, 654, 657, 659, 664, 665, 666, 669, 675, 681, 688, 690, 691, 701, 733, 735, 740, 743, 747, 749, 752, 754, 756, 759, 760, 768, 774, 778, 787, 790, 796, 800, 803, 804, 810, 818, 823, 827, 828, 829, 830, 832, 838, 841, 844, 850, 851, 858, 861, 866, 870, 875, 876, 879, 886, 889, 891, 893, 901, 907, 909, 911, 917, 918, 922, 924, 927, 929, 930, 934, 944, 950, 951, 953, 954, 956, 962, 963, 966, 967, 970, 973, 975, 977, 980, 981, 994, 1000, 1004, 1005, 1006, 1010, 1013, 1017, 1019, 1022, 1025, 1034, 1037, 1038, 1042, 1047, 1049, 1050, 1051, 1056, 1057, 1064, 1065, 1067, 1068, 1087, 1094, 1098, 1101, 1111, 1124, 1128, 1137 ] }
regional_sales
Please indicate total order quantity of product Candles and calculate the percentage of such product among all the orders.
total order quantity refers to Sum (Order Quantity); 'Candles' is the Products Name; percentage = Divide (Sum(Order Quantity where Product Name = 'Candles'), Sum(Order Quantity)) * 100
SELECT SUM(CASE WHEN T1.`Product Name` = 'Candles' THEN T2.`Order Quantity` ELSE 0 END), CAST(SUM(CASE WHEN T1.`Product Name` = 'Candles' THEN T2.`Order Quantity` ELSE 0 END) AS REAL) * 100 / SUM(T2.`Order Quantity`) FROM Products AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._ProductID = T1.ProductID INNER JOIN `Store Locations` AS T3 ON T3.StoreID = T2._StoreID
CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,713
2,713
CREATE TABLE `Products` ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE `Store Locations` ( CREATE TABLE "Store Locations" StoreID INTEGER constraint "Store Locations_pk" primary key ) CREATE TABLE `Sales Orders` ( _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"StoreID, _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references ProductsProductID, "Order Quantity" INTEGER )
[ "CASE WHEN", "AS", "SELECT", "SUM", "CASE", "INNER JOIN", "ON", "CAST", "FROM" ]
18
challenging
{ "case_1": [ 264, 528, 744 ], "case_2": [ 264, 528, 744 ], "case_3": [ 34, 49, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 264, 298, 394, 398, 411, 438, 479, 499, 528, 666, 672, 706, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 1066, 1128 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "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 ] }
regional_sales
Which region is Joshua Bennet located in?
"Joshua Bennett" is the name of Sales Team
SELECT T FROM ( SELECT DISTINCT CASE WHEN `Sales Team` = 'Joshua Bennett' THEN Region ELSE NULL END AS T FROM `Sales Team` ) WHERE T IS NOT NULL
CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,714
2,714
CREATE TABLE `Sales Team` ( CREATE TABLE "Sales Team" SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT )
[ "AS", "SELECT", "CASE", "NULL", "NOT", "IS", "FROM" ]
10
simple
{ "case_1": [ 978 ], "case_2": [ 978 ], "case_3": [ 92, 126, 127, 129, 153, 158, 171, 219, 258, 263, 264, 298, 303, 305, 398, 438, 443, 479, 528, 601, 666, 672, 706, 724, 744, 747, 805, 837, 844, 880, 909, 912, 944, 978, 982, 1066 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "case_5": [ 0, 6, 7, 16, 24, 42, 53, 61, 64, 67, 71, 77, 81, 92, 104, 106, 113, 120, 126, 127, 129, 138, 148, 150, 152, 153, 155, 158, 171, 191, 192, 195, 200, 201, 207, 212, 215, 219, 223, 225, 226, 234, 236, 248, 258, 261, 263, 264, 267, 271, 279, 294, 298, 299, 300, 303, 304, 305, 322, 335, 347, 360, 375, 383, 393, 395, 398, 402, 406, 412, 415, 423, 427, 436, 438, 443, 452, 453, 458, 476, 478, 479, 485, 486, 493, 500, 504, 508, 514, 516, 517, 518, 522, 528, 533, 535, 540, 547, 550, 563, 564, 571, 573, 575, 580, 581, 589, 601, 620, 623, 628, 637, 640, 646, 662, 666, 672, 676, 682, 686, 706, 710, 712, 723, 724, 740, 744, 747, 753, 762, 772, 776, 787, 788, 795, 796, 798, 800, 805, 808, 827, 837, 841, 844, 848, 868, 871, 874, 880, 894, 896, 909, 912, 922, 924, 926, 927, 935, 941, 943, 944, 959, 965, 978, 982, 985, 998, 1008, 1012, 1014, 1020, 1036, 1048, 1059, 1062, 1064, 1066, 1069, 1078, 1082, 1087, 1092, 1098, 1129, 1131, 1133, 1134, 1135 ] }
regional_sales
What is the store id of the store located in the most populous county?
most populous country refers to Max(Population)
SELECT CASE WHEN MAX(Population) THEN StoreID END FROM `Store Locations`
CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,715
2,715
CREATE TABLE `Store Locations` ( CREATE TABLE "Store Locations" StoreID INTEGER constraint "Store Locations_pk" primary key, Population INTEGER )
[ "CASE WHEN", "SELECT", "CASE", "FROM", "MAX" ]
5
simple
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 127, 129, 153, 158, 171, 219, 258, 263, 264, 298, 303, 305, 398, 438, 443, 479, 528, 601, 666, 672, 706, 744, 747, 805, 844, 880, 909, 912, 944, 978, 1066 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "case_5": [ 0, 6, 16, 24, 31, 35, 42, 54, 61, 64, 71, 72, 77, 81, 104, 106, 109, 113, 119, 120, 122, 123, 127, 129, 148, 152, 153, 155, 158, 171, 173, 191, 192, 195, 201, 205, 207, 212, 215, 219, 223, 225, 226, 234, 236, 241, 245, 248, 258, 261, 263, 264, 267, 270, 271, 279, 298, 299, 300, 303, 304, 305, 322, 335, 347, 360, 362, 375, 383, 386, 393, 398, 402, 406, 410, 412, 415, 423, 427, 438, 443, 452, 453, 458, 466, 476, 478, 479, 485, 486, 498, 500, 504, 508, 514, 517, 518, 528, 529, 535, 540, 547, 550, 557, 563, 564, 565, 571, 573, 575, 580, 581, 601, 620, 623, 628, 633, 640, 642, 646, 662, 666, 672, 676, 682, 686, 706, 709, 710, 723, 740, 744, 747, 753, 762, 772, 776, 787, 788, 795, 796, 798, 800, 805, 808, 820, 827, 841, 842, 844, 845, 848, 856, 868, 871, 872, 874, 880, 896, 909, 912, 922, 924, 926, 932, 939, 941, 943, 944, 959, 978, 979, 984, 985, 998, 1008, 1012, 1026, 1028, 1036, 1048, 1062, 1064, 1066, 1069, 1073, 1078, 1082, 1087, 1092, 1093, 1098, 1110, 1118, 1129, 1131, 1133, 1134, 1135, 1138 ] }
regional_sales
How many sales teams are there in the Midwest?
"Midwest" is the Region
SELECT SUM(CASE WHEN Region = 'Midwest' THEN 1 ELSE 0 END) FROM `Sales Team`
CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,716
2,716
CREATE TABLE `Sales Team` ( CREATE TABLE "Sales Team" SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT )
[ "CASE WHEN", "SELECT", "SUM", "CASE", "FROM" ]
5
simple
{ "case_1": [ 978 ], "case_2": [ 978 ], "case_3": [ 127, 129, 153, 158, 171, 219, 258, 263, 264, 298, 303, 305, 398, 438, 443, 479, 528, 601, 666, 672, 706, 744, 747, 805, 832, 844, 880, 909, 912, 944, 978, 1066 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "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 ] }
regional_sales
What is the type of store located in the city with the highest amount of water area?
type of store in City refers to Type = 'City'; highest amount of water area refers to Max(Water Area)
SELECT CASE WHEN MAX(`Water Area`) THEN Type END FROM `Store Locations`
CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,717
2,717
CREATE TABLE `Store Locations` ( "Water Area" INTEGER )
[ "CASE WHEN", "SELECT", "CASE", "FROM", "MAX" ]
5
simple
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 127, 129, 153, 158, 171, 219, 258, 263, 264, 298, 303, 305, 398, 438, 443, 479, 528, 601, 666, 672, 706, 744, 747, 805, 844, 880, 909, 912, 944, 978, 1066 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "case_5": [ 0, 6, 16, 24, 31, 35, 42, 54, 61, 64, 71, 72, 77, 81, 104, 106, 109, 113, 119, 120, 122, 123, 127, 129, 148, 152, 153, 155, 158, 171, 173, 191, 192, 195, 201, 205, 207, 212, 215, 219, 223, 225, 226, 234, 236, 241, 245, 248, 258, 261, 263, 264, 267, 270, 271, 279, 298, 299, 300, 303, 304, 305, 322, 335, 347, 360, 362, 375, 383, 386, 393, 398, 402, 406, 410, 412, 415, 423, 427, 438, 443, 452, 453, 458, 466, 476, 478, 479, 485, 486, 498, 500, 504, 508, 514, 517, 518, 528, 529, 535, 540, 547, 550, 557, 563, 564, 565, 571, 573, 575, 580, 581, 601, 620, 623, 628, 633, 640, 642, 646, 662, 666, 672, 676, 682, 686, 706, 709, 710, 723, 740, 744, 747, 753, 762, 772, 776, 787, 788, 795, 796, 798, 800, 805, 808, 820, 827, 841, 842, 844, 845, 848, 856, 868, 871, 872, 874, 880, 896, 909, 912, 922, 924, 926, 932, 939, 941, 943, 944, 959, 978, 979, 984, 985, 998, 1008, 1012, 1026, 1028, 1036, 1048, 1062, 1064, 1066, 1069, 1073, 1078, 1082, 1087, 1092, 1093, 1098, 1110, 1118, 1129, 1131, 1133, 1134, 1135, 1138 ] }
regional_sales
How many online orders were shipped during the month of June 2018?
online orders refers to Sales Channel = 'Online'; shipped during the month of June 2018 refers to SUBSTR(ShipDate, 1, 1) = '6' AND SUBSTR(ShipDate,-2) = '18'
SELECT SUM(IIF(ShipDate LIKE '6/%/18' AND `Sales Channel` = 'Online', 1, 0)) FROM `Sales Orders`
CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,718
2,718
CREATE TABLE `Sales Orders` ( "Sales Channel" TEXT, ShipDate TEXT )
[ "AND", "SELECT", "SUM", "LIKE", "FROM" ]
5
simple
{ "case_1": [ 348 ], "case_2": [ 348, 601 ], "case_3": [ 126, 127, 129, 153, 158, 202, 219, 247, 258, 263, 264, 305, 348, 398, 438, 528, 601, 666, 744, 747, 806, 832, 844, 909, 912, 918, 944, 1128 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "case_5": [ 2, 3, 4, 5, 6, 8, 10, 12, 19, 20, 21, 22, 24, 26, 30, 32, 33, 35, 37, 38, 39, 40, 42, 43, 44, 45, 47, 50, 51, 52, 53, 54, 56, 57, 59, 61, 63, 64, 66, 67, 68, 69, 71, 73, 74, 75, 76, 77, 79, 81, 82, 83, 85, 87, 88, 90, 93, 94, 95, 96, 98, 99, 100, 104, 109, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 122, 125, 126, 127, 128, 129, 131, 136, 138, 141, 142, 143, 144, 146, 148, 152, 153, 154, 155, 158, 160, 163, 164, 168, 169, 170, 172, 173, 175, 176, 177, 179, 180, 183, 184, 186, 187, 189, 191, 192, 195, 197, 200, 201, 202, 204, 205, 207, 212, 213, 214, 215, 219, 223, 225, 226, 227, 228, 230, 234, 236, 239, 240, 244, 245, 247, 248, 254, 255, 256, 258, 259, 261, 262, 263, 264, 265, 266, 267, 268, 270, 271, 272, 275, 276, 277, 278, 279, 282, 285, 294, 296, 300, 301, 304, 305, 313, 314, 315, 316, 317, 319, 323, 325, 330, 335, 339, 341, 347, 348, 350, 356, 360, 361, 362, 363, 365, 367, 368, 370, 373, 374, 376, 377, 378, 379, 381, 382, 383, 385, 391, 393, 395, 397, 398, 399, 402, 403, 405, 406, 407, 408, 409, 412, 413, 414, 415, 416, 417, 418, 419, 421, 424, 425, 426, 427, 428, 430, 433, 436, 437, 438, 439, 440, 444, 446, 448, 450, 451, 452, 453, 455, 463, 464, 469, 470, 475, 476, 477, 480, 482, 483, 486, 487, 488, 490, 492, 493, 494, 496, 497, 498, 500, 504, 506, 507, 510, 512, 514, 515, 516, 517, 518, 519, 520, 522, 524, 525, 526, 527, 528, 529, 530, 532, 533, 535, 537, 539, 540, 541, 544, 546, 547, 550, 551, 554, 557, 558, 559, 561, 562, 563, 564, 571, 575, 579, 580, 581, 582, 584, 586, 588, 589, 591, 594, 595, 597, 598, 599, 601, 605, 608, 609, 610, 612, 613, 615, 618, 622, 623, 624, 625, 626, 627, 628, 629, 630, 632, 633, 637, 638, 640, 641, 643, 648, 650, 651, 656, 658, 662, 663, 666, 667, 668, 671, 675, 676, 677, 678, 679, 680, 682, 683, 684, 685, 686, 687, 690, 692, 693, 695, 697, 699, 701, 702, 707, 709, 710, 712, 714, 715, 716, 717, 718, 719, 723, 726, 727, 730, 734, 735, 738, 739, 740, 741, 743, 744, 745, 746, 747, 749, 750, 753, 754, 756, 758, 760, 762, 763, 765, 767, 768, 773, 774, 775, 776, 777, 780, 783, 785, 787, 788, 793, 794, 795, 796, 797, 798, 799, 800, 802, 804, 806, 807, 808, 810, 813, 814, 817, 819, 820, 823, 824, 825, 827, 828, 829, 830, 831, 832, 835, 838, 840, 841, 843, 844, 848, 849, 850, 851, 853, 855, 858, 859, 860, 861, 864, 865, 867, 868, 870, 871, 872, 873, 874, 875, 877, 878, 879, 886, 888, 892, 894, 895, 896, 902, 903, 905, 907, 909, 912, 913, 917, 918, 920, 922, 923, 924, 928, 929, 930, 931, 932, 935, 939, 943, 944, 945, 948, 949, 953, 954, 956, 958, 959, 961, 962, 965, 969, 973, 974, 979, 980, 985, 986, 987, 991, 996, 998, 1000, 1001, 1008, 1009, 1012, 1014, 1017, 1018, 1019, 1020, 1022, 1023, 1027, 1031, 1038, 1039, 1042, 1044, 1046, 1054, 1057, 1058, 1059, 1061, 1063, 1064, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1078, 1079, 1080, 1081, 1082, 1084, 1086, 1087, 1092, 1093, 1096, 1098, 1100, 1101, 1103, 1104, 1105, 1109, 1110, 1111, 1115, 1117, 1119, 1121, 1123, 1126, 1128, 1131, 1135, 1136 ] }
regional_sales
How much is the discount applied to the order with the highest unit price?
highest unit price refers to Max(Unit Price)
SELECT `Discount Applied` FROM `Sales Orders` WHERE REPLACE(`Unit Price`, ',', '') = ( SELECT REPLACE(`Unit Price`, ',', '') FROM `Sales Orders` ORDER BY REPLACE(`Unit Price`, ',', '') DESC LIMIT 1 ) ORDER BY REPLACE(`Unit Price`, ',', '') DESC LIMIT 1
CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,719
2,719
CREATE TABLE `Sales Orders` ( "Discount Applied" REAL, "Unit Price" TEXT )
[ "SELECT", "ORDER BY", "LIMIT", "FROM", "DESC" ]
10
simple
{ "case_1": [ 17, 348, 708 ], "case_2": [ 17, 348, 708 ], "case_3": [ 17, 49, 202, 247, 263, 348, 394, 411, 708, 918, 975, 1077 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "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 ] }
regional_sales
What is the name of the product with the highest net profit?
highest net profit = Max(Subtract (Unit Price, Unit Cost)); name of product refers to Product Name
SELECT T2.`Product Name` FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID ORDER BY REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '') DESC LIMIT 1
CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,720
2,720
CREATE TABLE `Products` ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE `Sales Orders` ( _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references ProductsProductID, "Unit Price" TEXT, "Unit Cost" TEXT )
[ "AS", "SELECT", "ORDER BY", "LIMIT", "INNER JOIN", "ON", "DESC", "FROM" ]
9
simple
{ "case_1": [ 34 ], "case_2": [ 34, 202, 438, 724, 832, 837, 880 ], "case_3": [ 17, 34, 49, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 348, 394, 398, 411, 438, 479, 499, 528, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 1066, 1077, 1128 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "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 ] }
regional_sales
In the Northeast region, what is the average household income for each city located in the state with the highest number of stores?
average household income = Divide (Sum(Household Income), Count(City Name)); highest number of store refers to Max(Count(StoreID))
SELECT AVG(T2.`Household Income`) FROM Regions AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StateCode = T1.StateCode WHERE T1.Region = 'Northeast' GROUP BY T2.State ORDER BY COUNT(T2.StoreID) DESC LIMIT 1
CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,721
2,721
CREATE TABLE `Regions` ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE `Store Locations` ( CREATE TABLE "Store Locations" StoreID INTEGER constraint "Store Locations_pk" primary key, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references RegionsStateCode, State TEXT, "Household Income" INTEGER )
[ "GROUP BY", "AS", "SELECT", "ORDER BY", "LIMIT", "INNER JOIN", "ON", "AVG", "DESC", "COUNT", "FROM" ]
12
medium
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 49, 126, 202, 247, 348, 394, 411, 909, 912, 918, 975, 1077, 1128 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "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, 76, 77, 78, 80, 82, 86, 88, 89, 91, 93, 96, 98, 106, 108, 113, 115, 117, 118, 119, 121, 125, 126, 131, 137, 138, 140, 142, 143, 144, 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, 211, 212, 213, 214, 220, 225, 226, 227, 229, 232, 233, 234, 235, 239, 243, 244, 246, 247, 252, 254, 256, 261, 262, 267, 268, 269, 275, 276, 277, 278, 281, 285, 286, 291, 295, 299, 301, 309, 311, 313, 314, 315, 316, 317, 319, 320, 322, 323, 324, 325, 329, 330, 333, 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, 407, 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, 704, 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, 784, 787, 790, 796, 797, 799, 800, 802, 803, 804, 810, 812, 813, 814, 818, 819, 823, 824, 827, 830, 833, 838, 839, 841, 849, 850, 851, 853, 857, 861, 862, 863, 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, 1001, 1004, 1005, 1006, 1010, 1013, 1015, 1017, 1019, 1022, 1023, 1025, 1030, 1034, 1037, 1038, 1042, 1043, 1047, 1049, 1050, 1051, 1056, 1057, 1058, 1060, 1062, 1064, 1065, 1067, 1068, 1071, 1072, 1076, 1077, 1078, 1082, 1084, 1086, 1087, 1091, 1094, 1100, 1101, 1103, 1104, 1106, 1111, 1112, 1119, 1123, 1124, 1128, 1131, 1133, 1134, 1135, 1137 ] }
regional_sales
In which region can you find the stores located in the state whose median income is no more than 30,000?
median income no more than 30,000 refers to Median Income < 30,000
SELECT T FROM ( SELECT DISTINCT CASE WHEN T2.`Median Income` < 30000 THEN T1.Region END AS T FROM Regions T1 INNER JOIN `Store Locations` T2 ON T2.StateCode = T1.StateCode ) WHERE T IS NOT NULL
CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,722
2,722
CREATE TABLE `Regions` ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE `Store Locations` ( StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references RegionsStateCode, State TEXT, "Median Income" INTEGER )
[ "AS", "SELECT", "CASE", "NULL", "INNER JOIN", "ON", "NOT", "IS", "FROM" ]
11
medium
{ "case_1": [ 171, 672, 706 ], "case_2": [ 171, 672, 706 ], "case_3": [ 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1128 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "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, 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, 423, 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, 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, 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, 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 ] }
regional_sales
In the West, how many stores are there in the city whose land area is below 20,000,000?
"West" is the Region; land area is below 20,000,000 refers to Land Area < 20,000,000
SELECT SUM(CASE WHEN T1.Region = 'West' AND T2.`Land Area` < 20000000 THEN 1 ELSE 0 END) FROM Regions AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StateCode = T1.StateCode
CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,723
2,723
CREATE TABLE `Regions` ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE `Store Locations` ( StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references RegionsStateCode, State TEXT, "Land Area" INTEGER )
[ "CASE WHEN", "AS", "AND", "SELECT", "SUM", "CASE", "INNER JOIN", "ON", "FROM" ]
10
simple
{ "case_1": [ -1 ], "case_2": [ 171, 672, 706 ], "case_3": [ 34, 49, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 264, 298, 305, 394, 398, 411, 438, 479, 499, 528, 601, 666, 672, 706, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 1066, 1128 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "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, 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, 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, 1121, 1122, 1123, 1124, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
regional_sales
What is the name of the customer who purchased the product with the highest net profiit?
highest net profit = Max(Subtract (Unit Price, Unit Cost)); name of customer refers to Customer Names
SELECT `Customer Names` FROM ( SELECT T1.`Customer Names`, T2.`Unit Price` - T2.`Unit Cost` AS "net profit" FROM Customers T1 INNER JOIN `Sales Orders` T2 ON T2._CustomerID = T1.CustomerID ) ORDER BY `net profit` DESC LIMIT 1
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,724
2,724
CREATE TABLE `Customers` ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE `Sales Orders` ( _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references CustomersCustomerID, "Unit Price" TEXT, "Unit Cost" TEXT )
[ "AS", "SELECT", "ORDER BY", "LIMIT", "INNER JOIN", "ON", "DESC", "FROM" ]
10
simple
{ "case_1": [ 49, 153 ], "case_2": [ 49, 126, 153, 219, 258, 747, 844 ], "case_3": [ 17, 34, 49, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 348, 394, 398, 411, 438, 479, 499, 528, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 1066, 1077, 1128 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "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 ] }
regional_sales
In 2019, how many orders were shipped by the sales team with the highest number of orders in the said year? Provide the name of the sales team.
shipped refers to ShipDate; in 2019 refers to shipped in 2019 refers to SUBSTR(ShipDate, -2) = '19'; order in the said year refers to SUBSTR(OrderDate, -2) = '19'; highest number of order refers to Max(Count(OrderNumber))
SELECT COUNT(T1.OrderNumber), T2.`Sales Team` FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T1.OrderDate LIKE '%/%/19' AND T1.ShipDate LIKE '%/%/19' GROUP BY T2.`Sales Team` ORDER BY COUNT(T1.OrderNumber) DESC LIMIT 1
CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,725
2,725
CREATE TABLE `Sales Team` ( CREATE TABLE "Sales Team" SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT ) CREATE TABLE `Sales Orders` ( CREATE TABLE "Sales Orders" OrderNumber TEXT constraint "Sales Orders_pk" primary key, OrderDate TEXT, ShipDate TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"SalesTeamID )
[ "GROUP BY", "AS", "AND", "SELECT", "LIKE", "LIMIT", "ORDER BY", "INNER JOIN", "ON", "DESC", "COUNT", "FROM" ]
15
medium
{ "case_1": [ 247, 918 ], "case_2": [ 247, 918, 1128 ], "case_3": [ 49, 126, 127, 202, 247, 258, 348, 394, 411, 438, 666, 747, 832, 844, 909, 918, 944, 975, 1077, 1128 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "case_5": [ 1, 4, 10, 11, 13, 15, 20, 22, 26, 28, 29, 30, 36, 37, 38, 47, 49, 51, 53, 55, 57, 59, 62, 63, 68, 69, 73, 74, 75, 78, 82, 86, 88, 89, 90, 93, 96, 98, 108, 113, 115, 117, 118, 119, 121, 125, 126, 127, 131, 138, 140, 142, 143, 146, 150, 152, 159, 160, 162, 163, 164, 167, 169, 170, 173, 175, 179, 183, 184, 187, 188, 191, 197, 199, 200, 202, 206, 212, 213, 214, 227, 229, 233, 239, 240, 244, 247, 252, 256, 258, 262, 267, 268, 275, 276, 277, 278, 281, 286, 301, 309, 311, 313, 314, 315, 317, 319, 320, 324, 325, 329, 330, 334, 336, 339, 341, 342, 344, 345, 348, 349, 352, 353, 356, 359, 364, 365, 370, 371, 373, 374, 378, 379, 381, 382, 383, 385, 391, 394, 395, 402, 403, 406, 409, 411, 416, 417, 424, 426, 428, 429, 433, 434, 435, 436, 438, 444, 445, 448, 451, 452, 454, 460, 462, 464, 469, 473, 476, 477, 482, 490, 493, 495, 497, 500, 505, 515, 516, 519, 520, 526, 530, 532, 536, 537, 538, 542, 544, 548, 552, 557, 558, 559, 560, 563, 566, 567, 578, 579, 581, 582, 584, 586, 590, 592, 595, 608, 611, 613, 621, 624, 625, 626, 627, 630, 632, 633, 634, 637, 638, 641, 645, 651, 654, 657, 659, 663, 664, 665, 666, 668, 669, 671, 675, 681, 687, 688, 690, 691, 696, 698, 701, 703, 712, 714, 719, 721, 727, 733, 734, 735, 739, 740, 743, 747, 748, 749, 752, 753, 754, 756, 759, 760, 768, 778, 779, 787, 790, 796, 797, 799, 800, 803, 804, 810, 814, 818, 819, 823, 824, 827, 830, 832, 838, 841, 844, 849, 850, 851, 853, 858, 861, 866, 867, 869, 870, 876, 877, 879, 886, 888, 889, 891, 893, 896, 901, 902, 907, 909, 911, 917, 918, 922, 923, 924, 927, 929, 930, 932, 934, 935, 944, 950, 951, 953, 954, 956, 958, 961, 962, 963, 966, 967, 969, 970, 972, 973, 975, 977, 981, 985, 986, 993, 994, 996, 1000, 1005, 1006, 1010, 1013, 1017, 1019, 1022, 1023, 1025, 1030, 1034, 1037, 1038, 1042, 1043, 1047, 1049, 1050, 1051, 1056, 1057, 1058, 1064, 1065, 1067, 1068, 1071, 1072, 1076, 1077, 1084, 1086, 1094, 1100, 1101, 1103, 1104, 1106, 1119, 1123, 1124, 1128, 1131, 1135, 1137 ] }
regional_sales
Among the products with an order quantity of no less than 5 that was shipped in the month of May 2019, what is the name of the product with the lowest net profit?
order quantity of no less than 5 refers to Order Quantity > 5; shipped in the month of May 2019 refers to ShipDate LIKE '5/%/19'; lowest net profit = Min(Subtract(Unit Price, Unit Cost)); name of product refers to Products Name
SELECT T2.`Product Name` FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID WHERE T1.`Order Quantity` > 5 AND ShipDate LIKE '5/%/19' ORDER BY REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '') ASC LIMIT 1
CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,726
2,726
CREATE TABLE `Products` ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE `Sales Orders` ( ShipDate TEXT, _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references ProductsProductID, "Order Quantity" INTEGER, "Unit Price" TEXT, "Unit Cost" TEXT )
[ "AS", "AND", "SELECT", "LIKE", "LIMIT", "ORDER BY", "INNER JOIN", "ON", "ASC", "FROM" ]
11
medium
{ "case_1": [ 202, 438, 832 ], "case_2": [ 202, 438, 832 ], "case_3": [ 49, 126, 127, 129, 158, 202, 219, 247, 258, 264, 394, 398, 411, 438, 528, 666, 747, 806, 832, 844, 909, 918, 944, 975, 1128 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "case_5": [ 1, 3, 4, 5, 8, 10, 11, 12, 19, 20, 21, 22, 24, 26, 29, 30, 33, 36, 37, 38, 39, 44, 45, 47, 49, 51, 52, 53, 55, 57, 59, 62, 63, 66, 68, 69, 71, 73, 74, 75, 76, 81, 82, 85, 86, 88, 90, 93, 95, 96, 98, 99, 111, 112, 113, 115, 116, 117, 118, 119, 121, 125, 126, 127, 128, 129, 131, 136, 138, 141, 142, 143, 144, 146, 150, 152, 154, 158, 159, 160, 162, 163, 164, 167, 169, 170, 172, 175, 176, 177, 179, 180, 183, 184, 187, 188, 197, 199, 200, 202, 206, 212, 213, 214, 219, 227, 229, 233, 239, 240, 244, 247, 256, 258, 262, 264, 265, 266, 267, 268, 272, 275, 276, 277, 278, 281, 282, 296, 301, 309, 311, 313, 314, 315, 317, 319, 320, 324, 325, 329, 330, 334, 336, 339, 341, 342, 345, 349, 353, 356, 361, 364, 365, 368, 370, 373, 374, 376, 378, 379, 381, 382, 383, 385, 391, 393, 394, 395, 398, 402, 403, 405, 406, 407, 408, 409, 411, 413, 414, 415, 416, 417, 419, 424, 425, 426, 427, 428, 429, 430, 433, 434, 435, 436, 437, 438, 440, 444, 445, 446, 448, 451, 452, 454, 455, 460, 462, 463, 464, 469, 470, 475, 476, 477, 480, 482, 490, 493, 494, 495, 496, 497, 498, 500, 505, 507, 514, 515, 516, 519, 520, 522, 524, 526, 528, 529, 530, 532, 533, 536, 537, 538, 539, 541, 544, 548, 552, 557, 558, 559, 560, 561, 562, 563, 566, 567, 578, 579, 581, 582, 584, 586, 588, 589, 590, 592, 595, 605, 608, 610, 611, 612, 613, 615, 621, 624, 625, 626, 627, 632, 633, 634, 637, 638, 641, 643, 645, 648, 651, 654, 657, 659, 663, 665, 666, 668, 669, 671, 675, 677, 678, 681, 683, 684, 685, 686, 687, 688, 690, 691, 693, 697, 699, 701, 702, 712, 714, 715, 726, 727, 733, 734, 735, 739, 740, 741, 743, 746, 747, 749, 752, 753, 754, 756, 758, 759, 760, 763, 765, 767, 768, 773, 774, 775, 776, 777, 778, 780, 783, 787, 788, 790, 793, 796, 797, 799, 800, 803, 804, 806, 807, 808, 810, 814, 818, 819, 823, 824, 825, 827, 828, 829, 830, 832, 835, 838, 841, 844, 848, 849, 850, 851, 853, 858, 859, 860, 861, 866, 867, 870, 873, 875, 876, 877, 878, 879, 886, 888, 889, 891, 892, 893, 895, 896, 901, 902, 905, 907, 909, 911, 917, 918, 922, 923, 924, 927, 928, 930, 931, 932, 934, 935, 944, 949, 950, 951, 953, 954, 956, 958, 961, 962, 963, 966, 967, 969, 970, 973, 974, 975, 977, 980, 981, 985, 986, 991, 994, 996, 1000, 1001, 1005, 1006, 1010, 1013, 1017, 1019, 1022, 1023, 1025, 1027, 1031, 1034, 1037, 1038, 1039, 1042, 1044, 1046, 1047, 1049, 1050, 1051, 1056, 1058, 1061, 1063, 1064, 1065, 1067, 1068, 1071, 1072, 1080, 1084, 1086, 1092, 1094, 1098, 1100, 1101, 1103, 1104, 1105, 1109, 1111, 1115, 1119, 1123, 1124, 1128, 1131, 1136, 1137 ] }
regional_sales
What is the detailed coordinates of the store where the product with the 4th highest profit were purchased from?
detailed coordinates refers to Latitude, Longitude; highest net profit = Max(Subtract(Unit Price, Unit Cost))
SELECT T2.Latitude, T2.Longitude FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID ORDER BY REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '') DESC LIMIT 3, 1
CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,727
2,727
CREATE TABLE `Store Locations` ( CREATE TABLE "Store Locations" StoreID INTEGER constraint "Store Locations_pk" primary key, Latitude REAL, Longitude REAL ) CREATE TABLE `Sales Orders` ( _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"StoreID, "Unit Price" TEXT, "Unit Cost" TEXT )
[ "AS", "SELECT", "ORDER BY", "LIMIT", "INNER JOIN", "ON", "DESC", "FROM" ]
9
simple
{ "case_1": [ 139 ], "case_2": [ 127, 129, 139, 158, 394, 411, 479, 666, 909, 944, 975 ], "case_3": [ 17, 34, 49, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 348, 394, 398, 411, 438, 479, 499, 528, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 1066, 1077, 1128 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "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 ] }
regional_sales
How many orders were shipped by the sales team with the highest amount of shipped orders in 2020? Give the name of the said sales team.
shipped refers to ShipDate; in 2020 refers to SUBSTR(ShipDate, -2) = '20'; highest amount of shipped orders refers to Max(Count(OrderNumber))
SELECT COUNT(T1.OrderNumber), T2.`Sales Team` FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T1.ShipDate LIKE '%/%/20' GROUP BY T2.`Sales Team` ORDER BY COUNT(T1.OrderNumber) DESC LIMIT 1
CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,728
2,728
CREATE TABLE `Sales Team` ( CREATE TABLE "Sales Team" SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT ) CREATE TABLE `Sales Orders` ( CREATE TABLE "Sales Orders" OrderNumber TEXT constraint "Sales Orders_pk" primary key, ShipDate TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"SalesTeamID )
[ "GROUP BY", "AS", "SELECT", "LIKE", "LIMIT", "ORDER BY", "INNER JOIN", "ON", "DESC", "COUNT", "FROM" ]
13
medium
{ "case_1": [ 247, 912, 918 ], "case_2": [ 247, 912, 918, 1128 ], "case_3": [ 49, 126, 127, 202, 247, 258, 263, 264, 348, 394, 411, 438, 666, 747, 832, 844, 909, 912, 918, 944, 975, 1077, 1128 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "case_5": [ 0, 1, 3, 4, 6, 10, 11, 13, 15, 16, 20, 22, 26, 27, 28, 29, 30, 36, 37, 38, 47, 49, 51, 53, 55, 57, 59, 62, 63, 68, 69, 73, 74, 75, 77, 78, 81, 82, 86, 88, 89, 90, 91, 93, 96, 98, 106, 108, 113, 115, 117, 118, 119, 121, 125, 126, 127, 131, 136, 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, 240, 243, 244, 247, 252, 254, 256, 258, 261, 262, 263, 264, 267, 268, 269, 275, 276, 277, 278, 281, 285, 286, 291, 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, 364, 365, 370, 371, 373, 374, 375, 378, 379, 381, 382, 383, 384, 385, 391, 392, 394, 395, 401, 402, 403, 406, 407, 409, 411, 412, 415, 416, 417, 424, 426, 428, 429, 430, 433, 434, 435, 436, 438, 444, 445, 448, 451, 452, 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, 557, 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, 624, 625, 626, 627, 630, 632, 633, 634, 637, 638, 641, 645, 646, 649, 651, 654, 657, 658, 659, 662, 663, 664, 665, 666, 668, 669, 671, 675, 681, 687, 688, 690, 691, 694, 696, 698, 701, 703, 705, 712, 714, 719, 720, 721, 727, 733, 734, 735, 736, 739, 740, 743, 747, 748, 749, 750, 751, 752, 753, 754, 756, 759, 760, 762, 768, 769, 772, 774, 778, 779, 787, 790, 796, 797, 799, 800, 802, 803, 804, 810, 812, 813, 814, 818, 819, 823, 824, 827, 828, 830, 832, 838, 839, 841, 844, 849, 850, 851, 853, 857, 858, 861, 866, 867, 869, 870, 874, 875, 876, 877, 879, 882, 886, 888, 889, 891, 893, 896, 897, 898, 901, 902, 907, 909, 911, 912, 915, 917, 918, 922, 923, 924, 926, 927, 929, 930, 932, 934, 935, 943, 944, 950, 951, 953, 954, 956, 958, 961, 962, 963, 966, 967, 969, 970, 972, 973, 975, 977, 980, 981, 983, 985, 986, 987, 993, 994, 996, 1000, 1004, 1005, 1006, 1010, 1013, 1015, 1017, 1019, 1022, 1023, 1025, 1030, 1034, 1037, 1038, 1042, 1043, 1047, 1049, 1050, 1051, 1056, 1057, 1058, 1062, 1064, 1065, 1067, 1068, 1070, 1071, 1072, 1076, 1077, 1078, 1082, 1084, 1086, 1087, 1091, 1094, 1098, 1100, 1101, 1103, 1104, 1106, 1111, 1112, 1119, 1123, 1124, 1128, 1131, 1133, 1134, 1135, 1137 ] }
regional_sales
Between 2018 to 2020, what is the average amount of shipped orders per year under Carl Nguyen?
shipped refers to ShipDate; between 2018 and 2020 refers to SUBSTR(ShipDate, -2) IN ('18', '19', '20'); 'Carl Nguyen' is the name of Sales Team; average shipped orders per year = Divide (Count(OrderNumber), 3)
SELECT CAST(COUNT(T1.OrderNumber) AS REAL) / 3 FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE (T2.`Sales Team` = 'Carl Nguyen' AND ShipDate LIKE '%/%/18') OR (T2.`Sales Team` = 'Carl Nguyen' AND ShipDate LIKE '%/%/19') OR (T2.`Sales Team` = 'Carl Nguyen' AND ShipDate LIKE '%/%/20')
CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,729
2,729
CREATE TABLE `Sales Team` ( CREATE TABLE "Sales Team" SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT ) CREATE TABLE `Sales Orders` ( CREATE TABLE "Sales Orders" OrderNumber TEXT constraint "Sales Orders_pk" primary key, ShipDate TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"SalesTeamID )
[ "OR", "AND", "SELECT", "AS", "LIKE", "INNER JOIN", "ON", "CAST", "COUNT", "FROM" ]
17
challenging
{ "case_1": [ 1128 ], "case_2": [ 247, 912, 918, 1128 ], "case_3": [ 126, 127, 129, 158, 202, 219, 247, 258, 264, 394, 398, 411, 438, 528, 666, 744, 747, 806, 832, 844, 909, 912, 918, 944, 975, 1128 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "case_5": [ 0, 1, 3, 4, 5, 6, 8, 11, 12, 16, 19, 20, 21, 22, 24, 26, 27, 30, 33, 36, 37, 39, 42, 44, 45, 47, 51, 52, 53, 55, 57, 59, 62, 63, 64, 66, 68, 69, 71, 73, 74, 75, 76, 77, 81, 82, 85, 86, 88, 90, 91, 93, 95, 96, 98, 99, 106, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 131, 136, 138, 140, 141, 142, 143, 144, 146, 148, 152, 154, 158, 159, 160, 163, 164, 167, 169, 170, 172, 175, 176, 177, 179, 180, 183, 184, 187, 188, 189, 190, 191, 195, 196, 197, 199, 200, 201, 202, 206, 212, 214, 219, 225, 226, 227, 229, 233, 234, 236, 239, 240, 243, 244, 247, 248, 254, 256, 258, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 282, 296, 299, 300, 301, 304, 311, 314, 315, 316, 317, 319, 320, 322, 323, 325, 330, 334, 335, 336, 338, 339, 341, 344, 345, 347, 349, 354, 356, 358, 360, 361, 364, 368, 370, 373, 374, 375, 376, 382, 383, 384, 385, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 424, 425, 426, 427, 428, 430, 433, 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, 483, 484, 487, 488, 490, 493, 494, 496, 497, 498, 500, 505, 507, 509, 510, 514, 515, 516, 519, 520, 522, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 552, 557, 558, 559, 560, 561, 562, 563, 564, 566, 573, 575, 580, 581, 582, 584, 586, 588, 589, 595, 596, 597, 605, 606, 608, 610, 611, 612, 613, 615, 620, 623, 624, 625, 626, 627, 630, 632, 633, 634, 637, 641, 643, 645, 646, 648, 649, 651, 654, 658, 659, 662, 663, 665, 666, 668, 669, 671, 675, 676, 677, 678, 681, 683, 684, 685, 686, 687, 688, 690, 693, 694, 696, 697, 699, 702, 705, 710, 712, 714, 715, 721, 726, 727, 733, 734, 735, 736, 739, 740, 741, 743, 744, 746, 747, 749, 750, 752, 753, 754, 756, 758, 760, 762, 763, 765, 767, 768, 769, 772, 773, 774, 775, 776, 777, 778, 779, 780, 783, 787, 788, 790, 793, 796, 797, 798, 799, 800, 802, 804, 806, 807, 808, 810, 812, 813, 814, 818, 819, 824, 825, 827, 828, 829, 830, 832, 835, 838, 839, 841, 844, 848, 849, 850, 851, 853, 857, 858, 859, 860, 861, 866, 867, 870, 873, 874, 875, 876, 877, 878, 879, 886, 888, 892, 893, 894, 895, 896, 897, 898, 901, 902, 905, 907, 909, 911, 912, 915, 917, 918, 922, 923, 924, 926, 927, 928, 930, 931, 932, 934, 935, 943, 944, 949, 950, 951, 953, 954, 956, 958, 959, 961, 963, 969, 974, 975, 977, 980, 981, 985, 986, 991, 993, 996, 1000, 1001, 1005, 1006, 1008, 1010, 1013, 1015, 1017, 1019, 1022, 1023, 1027, 1031, 1037, 1039, 1042, 1043, 1044, 1046, 1047, 1050, 1051, 1058, 1061, 1062, 1063, 1064, 1067, 1068, 1070, 1071, 1072, 1078, 1080, 1082, 1084, 1086, 1087, 1092, 1094, 1098, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1115, 1119, 1121, 1123, 1124, 1128, 1131, 1133, 1134, 1135, 1136, 1137 ] }
regional_sales
What is the amount of discount applied to the product with the highest net profit and what is the name of the said product?
highest net profit refers to Max(Subtract(Unit Price, Unit Cost)); name of product refers to Product Name
SELECT T1.`Unit Price` * T1.`Discount Applied`, T2.`Product Name` FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID ORDER BY REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '') DESC LIMIT 1
CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,730
2,730
CREATE TABLE `Products` ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE `Sales Orders` ( _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references ProductsProductID, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
[ "AS", "SELECT", "ORDER BY", "LIMIT", "INNER JOIN", "ON", "DESC", "FROM" ]
9
simple
{ "case_1": [ 34 ], "case_2": [ 34, 202, 438, 724, 832, 837, 880 ], "case_3": [ 17, 34, 49, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 348, 394, 398, 411, 438, 479, 499, 528, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 1066, 1077, 1128 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "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 ] }
regional_sales
What are the names of the top 3 customers who paid the highest amount of price per order after discount?
highest price per order after discount refers to Max(Subtract(Multiply (Unit Price, Order Quantity), Discount Applied)); name of customer refers to Customer Names
SELECT `Customer Names` FROM ( SELECT T1.`Customer Names` , REPLACE(T2.`Unit Price`, ',', '') * T2.`Order Quantity` - REPLACE(T2.`Unit Price`, ',', '') * T2.`Discount Applied` AS T FROM Customers T1 INNER JOIN `Sales Orders` T2 ON T2._CustomerID = T1.CustomerID ) ORDER BY T DESC LIMIT 3
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,731
2,731
CREATE TABLE `Customers` ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE `Sales Orders` ( _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references CustomersCustomerID, "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT )
[ "AS", "SELECT", "ORDER BY", "LIMIT", "INNER JOIN", "ON", "DESC", "FROM" ]
10
simple
{ "case_1": [ 49, 153 ], "case_2": [ 49, 126, 153, 219, 258, 747, 844 ], "case_3": [ 17, 34, 49, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 348, 394, 398, 411, 438, 479, 499, 528, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 1066, 1077, 1128 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "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 ] }
regional_sales
Which sales channel was most preferred in commercializing products in January 2020 based on the number of orders placed?
order refers to OrderDate; in 2020 refers to Substr(OrderDate, -2) = '20'; January refers to Substr(OrderDate, 1, 1) = '1';  most preferred sales channel refers to Sales Channel where Max(Count(OrderNumber))
SELECT `Sales Channel` FROM `Sales Orders` WHERE OrderDate LIKE '1/%/20' GROUP BY `Sales Channel` ORDER BY COUNT(`Sales Channel`) DESC LIMIT 1
CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,732
2,732
CREATE TABLE `Sales Orders` ( "Sales Channel" TEXT, OrderDate TEXT )
[ "GROUP BY", "SELECT", "LIKE", "LIMIT", "ORDER BY", "DESC", "COUNT", "FROM" ]
8
simple
{ "case_1": [ 17, 348, 708 ], "case_2": [ 17, 348, 708 ], "case_3": [ 17, 49, 126, 202, 247, 263, 348, 394, 411, 708, 918, 975, 1077 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "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, 126, 133, 159, 162, 163, 167, 173, 174, 179, 181, 185, 187, 188, 199, 202, 206, 208, 213, 229, 233, 247, 252, 262, 263, 278, 281, 285, 286, 291, 309, 311, 313, 314, 319, 320, 324, 329, 334, 336, 337, 341, 345, 348, 349, 352, 356, 359, 364, 365, 371, 373, 378, 379, 381, 394, 400, 403, 404, 409, 411, 429, 434, 435, 444, 445, 451, 454, 460, 462, 469, 482, 495, 497, 505, 530, 532, 534, 536, 538, 542, 548, 552, 560, 566, 567, 576, 578, 579, 583, 584, 586, 590, 592, 595, 611, 619, 621, 625, 626, 634, 638, 645, 654, 657, 659, 664, 665, 669, 681, 688, 690, 691, 698, 701, 703, 708, 719, 732, 733, 735, 743, 748, 752, 759, 760, 768, 778, 790, 810, 815, 818, 823, 827, 830, 836, 850, 851, 861, 866, 869, 876, 886, 889, 893, 901, 911, 918, 927, 929, 934, 946, 950, 951, 954, 956, 962, 963, 966, 967, 970, 972, 973, 975, 977, 981, 983, 987, 994, 1004, 1005, 1006, 1010, 1013, 1017, 1025, 1030, 1034, 1037, 1038, 1047, 1049, 1050, 1051, 1056, 1057, 1067, 1070, 1076, 1077, 1083, 1094, 1124, 1137, 1139, 1141 ] }
regional_sales
Name the product that was registered in the sales order 'SO - 0005951'.
sales order 'SO - 0005951' refers to OrderNumber = 'SO - 0005951'; product refers to Product Name
SELECT T FROM ( SELECT DISTINCT CASE WHEN T2.OrderNumber = 'SO - 0005951' THEN T1.`Product Name` ELSE NULL END AS T FROM Products T1 INNER JOIN `Sales Orders` T2 ON T2._ProductID = T1.ProductID ) WHERE T IS NOT NULL
CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,733
2,733
CREATE TABLE `Products` ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE `Sales Orders` ( CREATE TABLE "Sales Orders" OrderNumber TEXT constraint "Sales Orders_pk" primary key, _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references ProductsProductID )
[ "AS", "SELECT", "CASE", "NULL", "INNER JOIN", "ON", "NOT", "IS", "FROM" ]
12
medium
{ "case_1": [ 202, 438, 724, 832, 837, 880 ], "case_2": [ 34, 202, 438, 724, 832, 837, 880 ], "case_3": [ 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1128 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "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, 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, 423, 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, 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, 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, 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 ] }
regional_sales
Identify the store location and sales team who processed the sales order 'SO - 0001004'.
sales order 'SO - 0001004' refers to OrderNumber = 'SO - 0001004'; store location refers to City Name
SELECT T3.`Sales Team`, T1.`City Name` FROM `Store Locations` AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._StoreID = T1.StoreID INNER JOIN `Sales Team` AS T3 ON T3.SalesTeamID = T2._SalesTeamID WHERE T2.OrderNumber = 'SO - 0001004'
CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,734
2,734
CREATE TABLE `Sales Team` ( CREATE TABLE "Sales Team" SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT ) CREATE TABLE `Store Locations` ( CREATE TABLE "Store Locations" StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT ) CREATE TABLE `Sales Orders` ( CREATE TABLE "Sales Orders" OrderNumber TEXT constraint "Sales Orders_pk" primary key, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"SalesTeamID, _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"StoreID )
[ "AS", "SELECT", "INNER JOIN", "ON", "FROM" ]
9
simple
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1128 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "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 ] }
regional_sales
Identify the top customer of the store located in Gilbert, Arizona based on net profit associated with the customer relationship in 2019.
"Gilbert" is the City Name; 'Arizona' is the name of State; customer relationship in 2019 refers to ProcuredDate LIKE '%/19'; top net profit refers to Max(Subtract(Unit Price, Unit Cost))
SELECT T1.`Customer Names` FROM Customers AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._CustomerID = T1.CustomerID INNER JOIN `Store Locations` AS T3 ON T3.StoreID = T2._StoreID WHERE T3.`City Name` = 'Gilbert' AND T2.ProcuredDate LIKE '%/%/19' ORDER BY REPLACE(T2.`Unit Price`, ',', '') - REPLACE(T2.`Unit Cost`, ',', '') DESC LIMIT 1
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,735
2,735
CREATE TABLE `Customers` ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE `Store Locations` ( CREATE TABLE "Store Locations" StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT ) CREATE TABLE `Sales Orders` ( ProcuredDate TEXT, _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references CustomersCustomerID, _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"StoreID, "Unit Price" TEXT, "Unit Cost" TEXT )
[ "AS", "AND", "SELECT", "LIKE", "LIMIT", "ORDER BY", "INNER JOIN", "ON", "DESC", "FROM" ]
14
medium
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 49, 126, 127, 129, 158, 202, 219, 247, 258, 263, 264, 348, 394, 398, 411, 438, 528, 666, 747, 806, 832, 844, 909, 918, 944, 975, 1128 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "case_5": [ 1, 3, 4, 5, 8, 10, 11, 12, 19, 20, 21, 22, 24, 26, 29, 30, 33, 36, 37, 38, 39, 44, 45, 47, 49, 51, 52, 53, 55, 57, 59, 62, 63, 66, 68, 69, 71, 73, 74, 75, 76, 81, 82, 85, 86, 88, 89, 90, 93, 95, 96, 98, 99, 111, 112, 113, 115, 116, 117, 118, 119, 121, 125, 126, 127, 128, 129, 131, 136, 138, 141, 142, 143, 144, 146, 150, 152, 154, 158, 159, 160, 162, 163, 164, 167, 169, 170, 172, 175, 176, 177, 179, 180, 183, 184, 187, 188, 197, 199, 200, 202, 206, 212, 213, 214, 219, 227, 229, 233, 239, 240, 244, 247, 256, 258, 262, 263, 264, 265, 266, 267, 268, 272, 275, 276, 277, 278, 281, 282, 286, 296, 301, 309, 311, 313, 314, 315, 317, 319, 320, 324, 325, 329, 330, 334, 336, 339, 341, 342, 345, 348, 349, 353, 356, 361, 364, 365, 368, 370, 373, 374, 376, 378, 379, 381, 382, 383, 385, 391, 393, 394, 395, 398, 402, 403, 405, 406, 407, 408, 409, 411, 413, 414, 415, 416, 417, 419, 424, 425, 426, 427, 428, 429, 430, 433, 434, 435, 436, 437, 438, 440, 444, 445, 446, 448, 451, 452, 454, 455, 460, 462, 463, 464, 469, 470, 475, 476, 477, 480, 482, 490, 493, 494, 495, 496, 497, 498, 500, 505, 507, 514, 515, 516, 519, 520, 522, 524, 526, 528, 529, 530, 532, 533, 536, 537, 538, 539, 541, 542, 544, 548, 552, 557, 558, 559, 560, 561, 562, 563, 566, 567, 578, 579, 581, 582, 584, 586, 588, 589, 590, 592, 595, 605, 608, 610, 611, 612, 613, 615, 621, 624, 625, 626, 627, 632, 633, 634, 637, 638, 641, 643, 645, 648, 651, 654, 657, 659, 663, 665, 666, 668, 669, 671, 675, 677, 678, 681, 683, 684, 685, 686, 687, 688, 690, 691, 693, 697, 699, 701, 702, 712, 714, 715, 719, 726, 727, 733, 734, 735, 739, 740, 741, 743, 746, 747, 749, 752, 753, 754, 756, 758, 759, 760, 763, 765, 767, 768, 773, 774, 775, 776, 777, 778, 780, 783, 787, 788, 790, 793, 796, 797, 799, 800, 803, 804, 806, 807, 808, 810, 814, 818, 819, 823, 824, 825, 827, 828, 829, 830, 832, 835, 838, 841, 844, 848, 849, 850, 851, 853, 858, 859, 860, 861, 866, 867, 870, 873, 875, 876, 877, 878, 879, 886, 888, 889, 891, 892, 893, 895, 896, 901, 902, 905, 907, 909, 911, 917, 918, 922, 923, 924, 927, 928, 929, 930, 931, 932, 934, 935, 944, 949, 950, 951, 953, 954, 956, 958, 961, 962, 963, 966, 967, 969, 970, 973, 974, 975, 977, 980, 981, 985, 986, 991, 994, 996, 1000, 1001, 1004, 1005, 1006, 1010, 1013, 1017, 1019, 1022, 1023, 1025, 1027, 1031, 1034, 1037, 1038, 1039, 1042, 1044, 1046, 1047, 1049, 1050, 1051, 1056, 1057, 1058, 1061, 1063, 1064, 1065, 1067, 1068, 1071, 1072, 1080, 1084, 1086, 1092, 1094, 1098, 1100, 1101, 1103, 1104, 1105, 1109, 1111, 1115, 1119, 1123, 1124, 1128, 1131, 1136, 1137 ] }
regional_sales
How many sales orders were processed by the store located in Chandler in 2020?
"Chandler" is the City Name; orders refers to OrderDate; in 2020 refers to Substr(OrderDate, -2) = '20'
SELECT SUM(CASE WHEN T2.`City Name` = 'Chandler' AND T1.OrderDate LIKE '%/%/20' THEN 1 ELSE 0 END) FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID
CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,736
2,736
CREATE TABLE `Store Locations` ( CREATE TABLE "Store Locations" StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT ) CREATE TABLE `Sales Orders` ( OrderDate TEXT, _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"StoreID )
[ "CASE WHEN", "AS", "AND", "SELECT", "SUM", "LIKE", "CASE", "INNER JOIN", "ON", "FROM" ]
11
medium
{ "case_1": [ 127, 129, 158, 479, 666, 909, 944 ], "case_2": [ 127, 129, 158, 479, 666, 909, 944 ], "case_3": [ 126, 127, 129, 153, 158, 171, 202, 219, 247, 258, 264, 298, 398, 438, 479, 528, 666, 672, 706, 744, 747, 805, 806, 832, 844, 880, 909, 912, 918, 944, 1066, 1128 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "case_5": [ 0, 3, 4, 5, 6, 8, 12, 16, 19, 20, 21, 22, 24, 26, 30, 33, 37, 39, 42, 44, 45, 47, 51, 52, 53, 57, 59, 61, 63, 64, 66, 68, 69, 71, 73, 74, 75, 76, 77, 81, 82, 83, 85, 88, 90, 93, 94, 95, 96, 98, 99, 104, 106, 111, 112, 113, 115, 116, 117, 118, 119, 120, 125, 126, 127, 128, 129, 131, 136, 138, 141, 142, 143, 144, 146, 148, 152, 153, 154, 155, 158, 160, 163, 164, 169, 170, 171, 172, 175, 176, 177, 179, 180, 183, 184, 186, 187, 189, 191, 192, 195, 197, 200, 201, 202, 207, 212, 213, 214, 215, 219, 223, 225, 226, 227, 228, 234, 236, 239, 240, 244, 247, 248, 254, 256, 258, 261, 262, 264, 265, 266, 267, 268, 271, 272, 275, 276, 277, 278, 279, 282, 296, 298, 299, 300, 301, 304, 313, 314, 315, 316, 317, 319, 322, 323, 325, 330, 335, 339, 341, 347, 356, 360, 361, 363, 365, 368, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 385, 391, 393, 395, 398, 402, 403, 405, 406, 407, 408, 409, 412, 413, 414, 415, 416, 417, 419, 424, 425, 426, 427, 428, 430, 433, 436, 437, 438, 440, 444, 446, 448, 450, 451, 452, 453, 455, 463, 464, 469, 470, 475, 476, 477, 478, 479, 480, 482, 483, 486, 487, 488, 490, 493, 494, 496, 497, 498, 500, 504, 507, 514, 515, 516, 517, 518, 519, 520, 522, 524, 526, 528, 529, 530, 532, 533, 535, 537, 539, 540, 541, 544, 547, 550, 557, 558, 559, 561, 562, 563, 564, 571, 573, 575, 579, 580, 581, 582, 584, 586, 588, 589, 595, 597, 605, 608, 609, 610, 612, 613, 615, 620, 623, 624, 625, 626, 627, 628, 630, 632, 633, 637, 638, 640, 641, 643, 646, 648, 650, 651, 658, 662, 663, 666, 668, 671, 672, 675, 676, 677, 678, 682, 683, 684, 685, 686, 687, 690, 693, 695, 697, 699, 701, 702, 706, 710, 712, 714, 715, 717, 723, 726, 727, 734, 735, 739, 740, 741, 743, 744, 745, 746, 747, 749, 750, 753, 754, 756, 758, 760, 762, 763, 765, 767, 768, 772, 773, 774, 775, 776, 777, 780, 783, 787, 788, 793, 795, 796, 797, 798, 799, 800, 802, 804, 805, 806, 807, 808, 810, 813, 814, 819, 823, 824, 825, 827, 828, 829, 830, 832, 835, 838, 841, 844, 848, 849, 850, 851, 853, 858, 859, 860, 861, 867, 868, 870, 871, 873, 874, 875, 877, 878, 879, 880, 886, 888, 892, 895, 896, 902, 905, 907, 909, 912, 917, 918, 922, 923, 924, 926, 928, 930, 931, 932, 935, 943, 944, 949, 953, 954, 956, 958, 959, 961, 962, 969, 973, 974, 979, 980, 985, 986, 991, 996, 998, 1000, 1001, 1008, 1012, 1017, 1019, 1022, 1023, 1027, 1031, 1038, 1039, 1042, 1044, 1046, 1058, 1061, 1062, 1063, 1064, 1066, 1067, 1068, 1069, 1071, 1072, 1078, 1080, 1082, 1084, 1086, 1087, 1092, 1098, 1100, 1101, 1103, 1104, 1105, 1109, 1111, 1115, 1119, 1123, 1128, 1131, 1133, 1134, 1135, 1136 ] }
regional_sales
What is the average household income of Glendale?
"Glendale" is the City Name; Average household income refers to avg(Household Income)
SELECT AVG(`Household Income`) FROM `Store Locations` WHERE `City Name` = 'Glendale'
CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,737
2,737
CREATE TABLE `Store Locations` ( "City Name" TEXT, "Household Income" INTEGER )
[ "SELECT", "FROM", "AVG" ]
3
simple
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "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 ] }
regional_sales
What was the best discount applied to sales orders in 2020?
sales orders in 2020 refers to Substr(OrderDate, -2) = '20'; best discount applied refers to Max(Discount Applied)
SELECT MAX(`Discount Applied`) FROM `Sales Orders` WHERE OrderDate LIKE '%/%/20'
CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( StateCode TEXT constraint Regions_pk primary key, State TEXT, Region TEXT ) CREATE TABLE "Sales Team" ( SalesTeamID INTEGER constraint "Sales Team_pk" primary key, "Sales Team" TEXT, Region TEXT ) CREATE TABLE "Store Locations" ( StoreID INTEGER constraint "Store Locations_pk" primary key, "City Name" TEXT, County TEXT, StateCode TEXT constraint "Store Locations_Regions_StateCode_fk" references Regions(StateCode), State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, "Household Income" INTEGER, "Median Income" INTEGER, "Land Area" INTEGER, "Water Area" INTEGER, "Time Zone" TEXT ) CREATE TABLE "Sales Orders" ( OrderNumber TEXT constraint "Sales Orders_pk" primary key, "Sales Channel" TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER constraint "Sales Orders_Sales Team_SalesTeamID_fk" references "Sales Team"(SalesTeamID), _CustomerID INTEGER constraint "Sales Orders_Customers_CustomerID_fk" references Customers(CustomerID), _StoreID INTEGER constraint "Sales Orders_Store Locations_StoreID_fk" references "Store Locations"(StoreID), _ProductID INTEGER constraint "Sales Orders_Products_ProductID_fk" references Products(ProductID), "Order Quantity" INTEGER, "Discount Applied" REAL, "Unit Price" TEXT, "Unit Cost" TEXT )
na
2,738
2,738
CREATE TABLE `Sales Orders` ( OrderDate TEXT, "Discount Applied" REAL )
[ "LIKE", "SELECT", "FROM", "MAX" ]
4
simple
{ "case_1": [ 348 ], "case_2": [ 348 ], "case_3": [ 126, 127, 202, 247, 258, 263, 264, 348, 438, 666, 747, 832, 844, 909, 918, 944, 1128 ], "case_4": [ 17, 34, 49, 92, 126, 127, 129, 139, 153, 158, 171, 202, 219, 247, 258, 263, 264, 298, 303, 305, 348, 394, 398, 411, 438, 443, 479, 499, 528, 601, 666, 672, 706, 708, 724, 744, 747, 805, 806, 832, 837, 844, 880, 909, 912, 918, 944, 975, 978, 982, 1066, 1077, 1128 ], "case_5": [ 3, 20, 26, 31, 35, 38, 57, 59, 72, 81, 82, 90, 109, 114, 119, 123, 126, 127, 131, 136, 146, 168, 179, 184, 202, 204, 212, 240, 241, 247, 258, 263, 264, 270, 277, 315, 341, 348, 356, 373, 377, 386, 397, 402, 403, 407, 410, 415, 421, 430, 433, 438, 444, 452, 466, 476, 498, 525, 529, 532, 546, 557, 565, 591, 598, 624, 629, 633, 642, 666, 675, 738, 740, 743, 747, 749, 754, 756, 774, 787, 796, 800, 804, 820, 828, 832, 841, 842, 844, 845, 850, 856, 858, 865, 870, 875, 879, 907, 909, 917, 918, 922, 924, 930, 932, 944, 948, 979, 980, 984, 1000, 1018, 1019, 1022, 1026, 1028, 1042, 1054, 1057, 1064, 1070, 1073, 1096, 1098, 1101, 1111, 1117, 1118, 1128, 1138 ] }
european_football_1
What is the most consecutive games tied by Ebbsfleet as an away team in the 2008 season?
consecutive games mean happen one after the other without interruption and refer to Date; tied refers to FTR = 'D';
SELECT COUNT(*) FROM matchs WHERE season = 2008 AND AwayTeam = 'Ebbsfleet' AND FTR = 'D'
CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,739
2,739
CREATE TABLE `matchs` ( AwayTeam TEXT, FTR TEXT, season INTEGER )
[ "COUNT", "AND", "SELECT", "FROM" ]
5
simple
{ "case_1": [ 362, 719, 795 ], "case_2": [ 362, 458, 719, 795 ], "case_3": [ 75, 152, 183, 267, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "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 ] }
european_football_1
Of all the divisions in the world, what percentage of them belong to England?
DIVIDE(COUNT(division where country = 'England'), COUNT(division)) as percentage;
SELECT CAST(COUNT(CASE WHEN country = 'England' THEN division ELSE NULL END) AS REAL) * 100 / COUNT(division) FROM divisions
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,740
2,740
CREATE TABLE `divisions` ( division TEXT not null primary key, country TEXT )
[ "CASE WHEN", "AS", "SELECT", "CASE", "NULL", "CAST", "COUNT", "FROM" ]
9
simple
{ "case_1": [ 423 ], "case_2": [ 423 ], "case_3": [ 152, 267, 423, 458, 795, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 6, 16, 24, 35, 42, 53, 61, 64, 71, 77, 81, 87, 93, 104, 106, 113, 119, 120, 126, 127, 129, 148, 152, 153, 155, 158, 171, 173, 184, 191, 192, 195, 201, 207, 212, 215, 219, 223, 225, 226, 234, 236, 248, 254, 258, 261, 263, 264, 267, 271, 279, 298, 299, 300, 303, 304, 305, 316, 317, 322, 323, 335, 347, 360, 375, 380, 383, 393, 398, 402, 406, 409, 412, 415, 423, 427, 436, 438, 443, 448, 452, 453, 458, 476, 478, 479, 485, 486, 487, 493, 500, 504, 508, 510, 514, 516, 517, 518, 528, 535, 537, 540, 547, 550, 560, 563, 564, 571, 573, 575, 580, 581, 597, 601, 620, 623, 628, 640, 646, 658, 661, 662, 666, 672, 676, 682, 686, 706, 710, 712, 723, 740, 744, 747, 750, 753, 762, 772, 776, 787, 788, 795, 796, 798, 800, 802, 805, 808, 813, 827, 841, 844, 848, 868, 870, 871, 874, 880, 894, 896, 898, 909, 912, 913, 922, 924, 926, 927, 935, 941, 943, 944, 958, 959, 978, 985, 998, 1008, 1012, 1023, 1036, 1048, 1062, 1064, 1066, 1069, 1070, 1072, 1078, 1082, 1087, 1092, 1098, 1121, 1128, 1129, 1131, 1133, 1134, 1135 ] }
european_football_1
What percentage of games won, games lost and games drawn does Cittadella have as a home team in total?
Percentage of games won = DIVIDE(COUNT(FTR = 'H' where HomeTeam = 'Cittadella'), COUNT(Div where HomeTeam = 'Cittadella')) as percentage; Percentage of games lost = DIVIDE(COUNT(FTR = 'A' where HomeTeam = 'Cittadella')), COUNT(Div where HomeTeam = 'Cittadella') as percentage; percentage of games drawn = DIVIDE(SUM(FTR = 'D'where HomeTeam = 'Cittadella'), COUNT(Div where HomeTeam = 'Cittadella')) as percentage;
SELECT CAST(COUNT(CASE WHEN FTR = 'H' THEN 1 ELSE NULL END) / COUNT(HomeTeam) AS REAL) * 100, CAST(COUNT(CASE WHEN FTR = 'A' THEN 1 ELSE NULL END) AS REAL) / COUNT(HomeTeam), CAST(COUNT(CASE WHEN FTR = 'D' THEN 1 ELSE NULL END) AS REAL) / COUNT(HomeTeam) FROM matchs WHERE HomeTeam = 'Cittadella'
CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,741
2,741
CREATE TABLE `matchs` ( HomeTeam TEXT, FTR TEXT )
[ "CASE WHEN", "AS", "SELECT", "CASE", "NULL", "CAST", "COUNT", "FROM" ]
23
challenging
{ "case_1": [ 458 ], "case_2": [ 458, 795 ], "case_3": [ 152, 267, 423, 458, 795, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 6, 16, 24, 35, 42, 53, 61, 64, 71, 77, 81, 87, 93, 104, 106, 113, 119, 120, 126, 127, 129, 148, 152, 153, 155, 158, 171, 173, 184, 191, 192, 195, 201, 207, 212, 215, 219, 223, 225, 226, 234, 236, 248, 254, 258, 261, 263, 264, 267, 271, 279, 298, 299, 300, 303, 304, 305, 316, 317, 322, 323, 335, 347, 360, 375, 380, 383, 393, 398, 402, 406, 409, 412, 415, 423, 427, 436, 438, 443, 448, 452, 453, 458, 476, 478, 479, 485, 486, 487, 493, 500, 504, 508, 510, 514, 516, 517, 518, 528, 535, 537, 540, 547, 550, 560, 563, 564, 571, 573, 575, 580, 581, 597, 601, 620, 623, 628, 640, 646, 658, 661, 662, 666, 672, 676, 682, 686, 706, 710, 712, 723, 740, 744, 747, 750, 753, 762, 772, 776, 787, 788, 795, 796, 798, 800, 802, 805, 808, 813, 827, 841, 844, 848, 868, 870, 871, 874, 880, 894, 896, 898, 909, 912, 913, 922, 924, 926, 927, 935, 941, 943, 944, 958, 959, 978, 985, 998, 1008, 1012, 1023, 1036, 1048, 1062, 1064, 1066, 1069, 1070, 1072, 1078, 1082, 1087, 1092, 1098, 1121, 1128, 1129, 1131, 1133, 1134, 1135 ] }
european_football_1
Of all the teams that played as a team away against Caen in the 2010 season, which one has the highest winning percentage?
Caen refers to HomeTeam; which one refers to AwayTeam; the highest winning percentage = MAX(DIVIDE(COUNT(FTR = 'A' where HomeTeam = 'Caen', season = '2010')), COUNT(Div where HomeTeam = 'Caen', season = '2010')) as percentage;
SELECT AwayTeam FROM matchs WHERE HomeTeam = 'Caen' AND season = 2010 AND FTR = 'A' GROUP BY AwayTeam ORDER BY COUNT(AwayTeam) DESC LIMIT 1
CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,742
2,742
CREATE TABLE `matchs` ( HomeTeam TEXT, AwayTeam TEXT, FTR TEXT, season INTEGER )
[ "GROUP BY", "AND", "SELECT", "ORDER BY", "LIMIT", "DESC", "COUNT", "FROM" ]
9
simple
{ "case_1": [ 719 ], "case_2": [ 719 ], "case_3": [ 75, 719 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "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, 133, 138, 142, 143, 159, 162, 163, 167, 169, 173, 174, 179, 181, 185, 187, 188, 199, 202, 206, 208, 213, 214, 229, 233, 247, 252, 262, 275, 278, 281, 285, 286, 291, 309, 311, 313, 314, 319, 320, 324, 329, 334, 336, 337, 341, 345, 348, 349, 352, 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, 469, 482, 495, 497, 505, 530, 532, 534, 536, 538, 542, 548, 552, 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, 718, 719, 732, 733, 735, 743, 748, 752, 759, 760, 768, 778, 790, 810, 815, 817, 818, 823, 827, 830, 836, 851, 861, 866, 869, 876, 886, 889, 893, 901, 911, 918, 927, 929, 934, 946, 950, 951, 954, 956, 962, 963, 966, 967, 970, 972, 973, 975, 977, 981, 983, 987, 994, 1004, 1005, 1006, 1010, 1013, 1017, 1025, 1030, 1034, 1037, 1038, 1047, 1049, 1050, 1051, 1056, 1057, 1067, 1068, 1076, 1077, 1083, 1094, 1124, 1137, 1139, 1141 ] }
european_football_1
What percentage of matches played on 2005/07/30 belong to the F1 division?
Division refers to Div; DIVIDE(COUNT(Div = 'F1', Date = '2005/07/30'), COUNT(Div, Date = '2005/07/30')) as percentage;
SELECT CAST(SUM(CASE WHEN Div = 'F1' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(Div) FROM matchs WHERE Date = '2005-07-30'
CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,743
2,743
CREATE TABLE `matchs` ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key Div references divisionsdivision )
[ "CASE WHEN", "AS", "SELECT", "SUM", "CASE", "-", "CAST", "COUNT", "FROM" ]
10
simple
{ "case_1": [ 362, 795 ], "case_2": [ 362, 458, 795 ], "case_3": [ 152, 183, 267, 362, 416, 423, 458, 795, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 2, 6, 16, 24, 35, 39, 42, 54, 61, 64, 71, 74, 77, 81, 87, 93, 98, 104, 106, 112, 113, 115, 119, 120, 122, 127, 129, 141, 148, 152, 153, 155, 158, 169, 173, 183, 184, 187, 189, 191, 192, 195, 197, 199, 201, 205, 207, 212, 215, 219, 223, 225, 226, 228, 234, 236, 244, 245, 248, 254, 261, 264, 267, 271, 279, 299, 300, 303, 304, 316, 317, 322, 323, 325, 335, 339, 347, 356, 360, 362, 375, 380, 382, 383, 391, 392, 393, 394, 402, 406, 409, 412, 415, 416, 423, 427, 436, 438, 443, 445, 448, 452, 453, 458, 476, 478, 483, 485, 486, 487, 488, 500, 504, 508, 509, 510, 514, 517, 518, 520, 527, 535, 537, 540, 544, 547, 550, 559, 560, 563, 564, 571, 573, 575, 580, 581, 597, 601, 620, 623, 628, 630, 640, 646, 649, 658, 661, 662, 666, 676, 681, 682, 686, 690, 695, 709, 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, 872, 874, 894, 896, 898, 909, 912, 913, 922, 924, 926, 930, 939, 941, 943, 944, 954, 958, 959, 979, 985, 993, 998, 1008, 1012, 1023, 1031, 1036, 1048, 1062, 1064, 1068, 1069, 1070, 1072, 1078, 1082, 1087, 1092, 1093, 1098, 1100, 1101, 1110, 1121, 1123, 1128, 1129, 1131, 1133, 1134, 1135 ] }
european_football_1
What percentage of all tied games did the Sassuolo team play in?
tied games refer FTR = 'D'; DIVIDE(COUNT(Div where FTR = 'D', HomeTeam = 'Sassuolo' or AwayTeam = 'Sassuolo'), COUNT(Div where HomeTeam = 'Sassuolo' or AwayTeam = 'Sassuolo')) as percentage;
SELECT CAST(SUM(CASE WHEN HomeTeam = 'Sassuolo' OR AwayTeam = 'Sassuolo' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(FTR) FROM matchs WHERE FTR = 'D'
CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,744
2,744
CREATE TABLE `matchs` ( HomeTeam TEXT, AwayTeam TEXT, FTR TEXT )
[ "CASE WHEN", "OR", "AS", "SELECT", "SUM", "CASE", "CAST", "COUNT", "FROM" ]
9
simple
{ "case_1": [ 795 ], "case_2": [ 458, 795 ], "case_3": [ 152, 267, 423, 458, 795, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 6, 16, 24, 35, 42, 54, 61, 64, 71, 77, 81, 87, 93, 104, 106, 113, 119, 120, 122, 127, 129, 148, 152, 153, 155, 169, 173, 184, 189, 191, 192, 195, 201, 205, 207, 212, 215, 219, 223, 225, 226, 234, 236, 245, 248, 254, 261, 264, 267, 271, 279, 299, 300, 303, 304, 316, 317, 322, 323, 335, 347, 360, 375, 380, 383, 393, 402, 406, 409, 412, 415, 423, 427, 438, 443, 448, 452, 453, 458, 476, 478, 483, 485, 486, 487, 488, 500, 504, 508, 510, 514, 517, 518, 527, 535, 537, 540, 547, 550, 560, 563, 564, 571, 573, 575, 580, 581, 597, 620, 623, 628, 630, 640, 646, 658, 661, 662, 666, 676, 682, 686, 690, 709, 710, 723, 740, 744, 747, 750, 753, 762, 772, 776, 787, 788, 795, 796, 798, 800, 802, 808, 810, 813, 827, 832, 838, 841, 848, 868, 870, 871, 872, 874, 894, 896, 898, 909, 912, 913, 922, 924, 926, 939, 941, 943, 944, 958, 959, 975, 979, 985, 998, 1008, 1012, 1023, 1036, 1048, 1062, 1064, 1069, 1070, 1072, 1078, 1082, 1087, 1092, 1093, 1098, 1100, 1101, 1110, 1121, 1128, 1129, 1131, 1133, 1134, 1135 ] }
european_football_1
What is the percentage whereby the away team scored 2 goals during the 2017 seasons?
scored 2 goals refers to FTAG = 2, which is short name for Final-time Away-team Goals; DIVIDE(COUNT(Div where season = 2017, FTAG = '2'), COUNT(Div where season = 2017)) as percentage;
SELECT CAST(SUM(CASE WHEN FTAG = 2 THEN 1 ELSE 0 END) / COUNT(FTAG) AS REAL) * 100 FROM matchs WHERE season = 2017
CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,745
2,745
CREATE TABLE `matchs` ( FTAG INTEGER, season INTEGER )
[ "CASE WHEN", "AS", "SELECT", "SUM", "CASE", "CAST", "COUNT", "FROM" ]
8
simple
{ "case_1": [ 795 ], "case_2": [ 458, 795 ], "case_3": [ 152, 267, 423, 458, 795, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 6, 16, 24, 35, 42, 54, 61, 64, 71, 77, 81, 87, 93, 104, 106, 113, 119, 120, 122, 127, 129, 148, 152, 153, 155, 169, 173, 184, 189, 191, 192, 195, 201, 205, 207, 212, 215, 219, 223, 225, 226, 234, 236, 245, 248, 254, 261, 264, 267, 271, 279, 299, 300, 303, 304, 316, 317, 322, 323, 335, 347, 360, 375, 380, 383, 393, 402, 406, 409, 412, 415, 423, 427, 438, 443, 448, 452, 453, 458, 476, 478, 483, 485, 486, 487, 488, 500, 504, 508, 510, 514, 517, 518, 527, 535, 537, 540, 547, 550, 560, 563, 564, 571, 573, 575, 580, 581, 597, 620, 623, 628, 630, 640, 646, 658, 661, 662, 666, 676, 682, 686, 690, 709, 710, 723, 740, 744, 747, 750, 753, 762, 772, 776, 787, 788, 795, 796, 798, 800, 802, 808, 810, 813, 827, 832, 841, 848, 868, 870, 871, 872, 874, 894, 896, 898, 909, 912, 913, 922, 924, 926, 939, 941, 943, 944, 958, 959, 979, 985, 998, 1008, 1012, 1023, 1036, 1048, 1062, 1064, 1069, 1070, 1072, 1078, 1082, 1087, 1092, 1093, 1098, 1100, 1110, 1121, 1128, 1129, 1131, 1133, 1134, 1135 ] }
european_football_1
What is the name of all the teams that played in the EFL League One division?
all the teams include both HomeTeam and AwayTeam; name = 'EFL League One'; DIV = 'E2';
SELECT T1.HomeTeam,T1.AwayTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div=T2.division WHERE T2.name = 'EFL League One' and T1.Div = 'E2'
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,746
2,746
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, HomeTeam TEXT, AwayTeam TEXT, foreign key Div references divisionsdivision )
[ "AS", "SELECT", "=", "and", "INNER JOIN", "ON", "FROM" ]
8
simple
{ "case_1": [ 715, 969 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 1, 3, 4, 5, 6, 7, 8, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 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, 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, 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 ] }
european_football_1
How many teams playing in divisions in Greece have ever scored 4 or more goals?
teams include both HomeTeam and AwayTeam; country = 'Greece'; scored 4 or more goals refer to FTAG≥4, which is short name for Final-time Away-team Goals;
SELECT COUNT(DISTINCT CASE WHEN T1.FTHG >= 4 THEN HomeTeam ELSE NULL end) + COUNT(DISTINCT CASE WHEN T1.FTAG >= 4 THEN AwayTeam ELSE NULL end) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.country = 'Greece'
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,747
2,747
CREATE TABLE `divisions` ( division TEXT not null primary key, country TEXT ) CREATE TABLE `matchs` ( Div TEXT, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, foreign key Div references divisionsdivision )
[ "CASE WHEN", "AS", "SELECT", "CASE", "NULL", "INNER JOIN", "ON", "COUNT", "FROM" ]
14
medium
{ "case_1": [ 75, 152, 183, 267, 416, 464, 1131 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 423, 458, 464, 715, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "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, 173, 175, 176, 177, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 215, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 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, 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, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 507, 508, 509, 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, 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, 978, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 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 ] }
european_football_1
How many matches played in the 2019 season of Scottish Championship league were ended with an equal result of 2-2?
matches refer to Div; Scottish Championship is a name of the league; equal result of 2-2 refers to FTAG = 2 AND FTHG = 2;
SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2019 AND T2.name = 'Scottish Championship' AND T1.FTAG = 2 AND T1.FTHG = 2
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,748
2,748
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, FTHG INTEGER, FTAG INTEGER, season INTEGER, foreign key Div references divisionsdivision )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "COUNT", "FROM" ]
10
simple
{ "case_1": [ 715, 969 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 423, 458, 464, 715, 719, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 109, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 230, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 259, 260, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 399, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 507, 509, 510, 511, 512, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 554, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 618, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 665, 666, 667, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 680, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 692, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 707, 710, 711, 712, 714, 715, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 730, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 817, 818, 819, 820, 822, 823, 824, 825, 827, 828, 829, 830, 831, 832, 833, 834, 835, 837, 838, 839, 841, 843, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 903, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 945, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 965, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1019, 1020, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1078, 1079, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1126, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
european_football_1
Which 2 Scottish teams scored 10 goals playing as a local team and in which seasons?
local team refers to HomeTeam; Scottish means belong to the country = 'Scotland'; scored 10 goals refer to FTHG = 10, which is short name for Final-time Away-team Goals;
SELECT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.country = 'Scotland' AND T1.FTHG = 10
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,749
2,749
CREATE TABLE `divisions` ( division TEXT not null primary key, country TEXT ) CREATE TABLE `matchs` ( Div TEXT, HomeTeam TEXT, FTHG INTEGER, foreign key Div references divisionsdivision )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
7
simple
{ "case_1": [ 715, 969 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "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 ] }
european_football_1
From the Spanish LaLiga division in the 2017 season, which team won the most times as a local team and by what percentage?
local team refers to HomeTeam; Spanish means belong to the country = 'Spain'; LaLiga is a name of division; won as a local team refers to FTR = 'H', where H stands for home victory; DIVIDE(COUNT(Div where name = 'LaLiga', country = 'Spain', season = 2017, FRT = 'H'), COUNT(Div where name = 'LaLiga', country = 'Spain', season = 2017)) as percentage;
SELECT T1.HomeTeam HWHT , CAST(COUNT(CASE WHEN T1.FTR = 'H' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(HomeTeam) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'LaLiga' AND T2.country = 'Spain' AND T1.season = 2017
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,750
2,750
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE `matchs` ( Div TEXT, HomeTeam TEXT, FTR TEXT, season INTEGER, foreign key Div references divisionsdivision )
[ "CASE WHEN", "AS", "AND", "SELECT", "CASE", "NULL", "INNER JOIN", "ON", "CAST", "COUNT", "FROM" ]
15
medium
{ "case_1": [ 75, 152, 183, 267, 416, 464, 1131 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 423, 458, 464, 715, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 1, 4, 5, 6, 8, 11, 12, 16, 19, 20, 21, 22, 24, 26, 27, 30, 33, 36, 37, 39, 42, 44, 45, 47, 51, 52, 53, 55, 57, 61, 62, 63, 64, 66, 68, 69, 71, 73, 74, 75, 76, 77, 81, 82, 85, 86, 88, 90, 91, 93, 95, 96, 98, 99, 106, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 131, 138, 140, 141, 142, 143, 144, 146, 148, 150, 152, 153, 154, 155, 158, 159, 160, 163, 164, 167, 169, 170, 171, 172, 175, 176, 177, 179, 180, 183, 184, 187, 188, 189, 190, 191, 192, 195, 196, 197, 199, 200, 201, 202, 206, 207, 212, 214, 215, 219, 223, 225, 226, 227, 229, 233, 234, 236, 239, 240, 243, 244, 247, 248, 254, 256, 258, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 282, 296, 298, 299, 300, 301, 303, 304, 305, 311, 314, 315, 316, 317, 319, 320, 322, 323, 325, 330, 334, 335, 336, 338, 339, 341, 344, 345, 347, 349, 354, 356, 358, 360, 361, 364, 368, 370, 373, 374, 375, 376, 382, 383, 384, 385, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 423, 424, 425, 426, 427, 428, 433, 436, 437, 438, 440, 443, 444, 445, 446, 448, 451, 452, 453, 454, 455, 458, 460, 462, 463, 464, 465, 467, 469, 470, 471, 473, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 490, 493, 494, 496, 497, 498, 500, 504, 505, 507, 508, 509, 510, 514, 515, 516, 517, 518, 519, 520, 522, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 557, 558, 559, 560, 561, 562, 563, 564, 566, 571, 573, 575, 580, 581, 582, 584, 586, 588, 589, 595, 596, 597, 601, 605, 606, 608, 610, 611, 612, 613, 615, 620, 623, 624, 625, 626, 627, 628, 630, 632, 633, 634, 637, 640, 641, 643, 645, 646, 648, 649, 651, 654, 658, 659, 662, 663, 665, 666, 668, 669, 671, 672, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 693, 694, 696, 697, 699, 702, 705, 706, 710, 712, 714, 715, 721, 723, 724, 726, 727, 733, 734, 735, 736, 739, 740, 741, 743, 744, 746, 747, 749, 750, 752, 753, 754, 756, 758, 760, 762, 763, 765, 767, 768, 769, 772, 773, 775, 776, 777, 778, 779, 780, 783, 787, 788, 790, 793, 795, 796, 797, 798, 799, 800, 802, 804, 805, 806, 807, 808, 810, 812, 813, 814, 818, 819, 824, 825, 827, 829, 830, 832, 835, 837, 838, 839, 841, 844, 848, 849, 851, 853, 857, 858, 859, 860, 861, 866, 867, 868, 870, 871, 873, 874, 876, 877, 878, 879, 880, 886, 888, 892, 893, 894, 895, 896, 897, 898, 901, 902, 905, 907, 909, 911, 912, 915, 917, 918, 922, 923, 924, 926, 927, 928, 930, 931, 932, 934, 935, 941, 943, 944, 949, 950, 951, 953, 954, 956, 958, 959, 961, 963, 969, 974, 975, 977, 981, 985, 986, 991, 993, 996, 998, 1000, 1001, 1005, 1006, 1008, 1010, 1012, 1013, 1015, 1017, 1019, 1022, 1023, 1027, 1031, 1036, 1037, 1039, 1042, 1043, 1044, 1046, 1047, 1048, 1050, 1051, 1058, 1061, 1062, 1063, 1064, 1066, 1067, 1068, 1069, 1071, 1072, 1078, 1080, 1082, 1084, 1086, 1087, 1092, 1094, 1098, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1112, 1115, 1119, 1121, 1123, 1124, 1128, 1129, 1131, 1133, 1134, 1135, 1136, 1137 ] }
european_football_1
How many teams that played in the 2012 season belong to any of the English divisions and what percentage play in each of the divisions?
matches = Div
SELECT ( SELECT COUNT(T1.Div) AS total FROM matchs T1 INNER JOIN divisions T2 ON T2.division = T1.Div WHERE T2.country = 'England' AND T1.season = 2012 ) AS num , CASE WHEN 1 THEN T.result END AS percentage FROM ( SELECT 100.0 * COUNT(T1.Div) / ( SELECT COUNT(T1.Div) FROM matchs T1 INNER JOIN divisions T2 ON T2.division = T1.Div WHERE T2.country = 'England' AND T1.season = 2012 ) AS result FROM matchs T1 INNER JOIN divisions T2 ON T2.division = T1.Div WHERE T2.country = 'England' AND T1.season = 2012 GROUP BY T2.division ) AS T
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,751
2,751
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE `matchs` ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key Div references divisionsdivision )
[ "GROUP BY", "CASE WHEN", "AS", "AND", "SELECT", "CASE", "INNER JOIN", "ON", "COUNT", "FROM" ]
28
challenging
{ "case_1": [ -1 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 423, 458, 464, 715, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 1, 4, 5, 6, 8, 11, 12, 16, 19, 20, 21, 22, 24, 26, 27, 30, 33, 36, 37, 39, 42, 44, 45, 47, 51, 52, 53, 55, 57, 61, 62, 63, 64, 66, 68, 69, 71, 73, 74, 75, 76, 77, 81, 82, 85, 86, 88, 90, 91, 93, 95, 96, 98, 99, 106, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 131, 138, 140, 141, 142, 143, 144, 146, 148, 152, 153, 154, 155, 158, 159, 160, 163, 164, 167, 169, 170, 171, 172, 173, 175, 176, 177, 179, 180, 183, 184, 187, 188, 189, 190, 191, 192, 195, 196, 197, 199, 200, 201, 202, 206, 207, 212, 213, 214, 219, 223, 225, 226, 227, 229, 233, 234, 236, 239, 240, 243, 244, 247, 248, 254, 256, 258, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 282, 296, 298, 299, 300, 301, 304, 311, 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, 361, 364, 365, 368, 370, 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, 415, 416, 417, 419, 423, 424, 425, 426, 427, 428, 433, 436, 437, 438, 440, 444, 445, 446, 448, 451, 452, 453, 454, 455, 458, 460, 462, 463, 464, 465, 467, 469, 470, 471, 473, 475, 476, 477, 478, 479, 480, 482, 484, 485, 486, 487, 488, 490, 493, 494, 496, 497, 498, 500, 504, 505, 507, 509, 514, 515, 516, 517, 518, 519, 520, 522, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 557, 558, 559, 560, 561, 562, 563, 564, 566, 571, 573, 575, 579, 580, 581, 582, 584, 586, 588, 589, 595, 596, 597, 605, 606, 608, 610, 611, 612, 613, 615, 620, 623, 624, 625, 626, 627, 628, 630, 632, 633, 634, 637, 638, 640, 641, 643, 645, 646, 648, 649, 651, 654, 658, 659, 662, 663, 665, 666, 668, 669, 671, 672, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 693, 694, 696, 697, 699, 701, 702, 705, 706, 710, 712, 714, 715, 720, 721, 723, 726, 727, 733, 734, 735, 736, 739, 740, 741, 743, 744, 746, 747, 749, 750, 751, 752, 753, 754, 756, 758, 760, 762, 763, 765, 767, 768, 769, 772, 773, 775, 776, 777, 778, 779, 780, 783, 787, 788, 790, 793, 795, 796, 797, 798, 799, 800, 802, 804, 805, 806, 807, 808, 810, 812, 813, 814, 818, 819, 823, 824, 825, 827, 829, 830, 832, 835, 838, 839, 841, 844, 848, 849, 851, 853, 857, 858, 859, 860, 861, 866, 867, 868, 870, 871, 873, 874, 876, 877, 878, 879, 880, 882, 886, 888, 889, 892, 893, 895, 896, 897, 898, 901, 902, 905, 907, 909, 911, 912, 915, 917, 918, 922, 923, 924, 926, 927, 928, 930, 931, 932, 934, 935, 941, 943, 944, 949, 950, 951, 953, 954, 956, 958, 959, 961, 962, 963, 969, 973, 974, 975, 977, 981, 985, 986, 991, 993, 996, 998, 1000, 1001, 1005, 1006, 1008, 1010, 1012, 1013, 1015, 1017, 1019, 1022, 1023, 1025, 1027, 1031, 1037, 1039, 1042, 1043, 1044, 1046, 1047, 1050, 1051, 1058, 1061, 1062, 1063, 1064, 1066, 1067, 1068, 1069, 1071, 1072, 1078, 1080, 1082, 1084, 1086, 1087, 1091, 1092, 1094, 1098, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1112, 1115, 1119, 1123, 1124, 1128, 1131, 1133, 1134, 1135, 1136, 1137 ] }
european_football_1
What is the highest final-time score across all divisions in the 2021 season? Which team was the team that made up that score?
MAX(SUM where FTHG, FTAG, season = 2021);
SELECT ( SELECT MAX(MAX(FTAG), MAX(FTHG)) FROM matchs WHERE season = 2021 ) AS T1, AwayTeam FROM matchs WHERE season = 2021 AND FTHG = T1 OR FTAG = T1
CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,752
2,752
CREATE TABLE `matchs` ( AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, season INTEGER )
[ "AS", "OR", "AND", "SELECT", "FROM", "MAX" ]
10
simple
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 2, 4, 5, 8, 10, 12, 19, 20, 21, 22, 24, 26, 30, 33, 35, 37, 39, 42, 44, 45, 47, 51, 52, 53, 57, 63, 66, 68, 69, 71, 72, 73, 74, 75, 76, 85, 88, 90, 93, 95, 96, 98, 99, 109, 111, 112, 113, 115, 116, 117, 118, 119, 125, 127, 128, 129, 131, 138, 141, 142, 143, 144, 146, 152, 154, 158, 160, 163, 164, 169, 170, 172, 175, 176, 177, 180, 183, 184, 187, 197, 200, 214, 219, 223, 227, 239, 240, 241, 244, 256, 258, 262, 265, 266, 267, 268, 270, 272, 275, 276, 277, 278, 282, 296, 301, 305, 314, 315, 317, 319, 325, 330, 339, 341, 356, 361, 367, 368, 370, 374, 376, 382, 383, 385, 386, 391, 393, 395, 398, 402, 403, 405, 406, 408, 413, 414, 416, 417, 419, 424, 425, 426, 427, 428, 433, 436, 437, 438, 440, 444, 446, 448, 451, 452, 455, 463, 464, 466, 469, 470, 475, 476, 477, 480, 482, 490, 493, 494, 496, 497, 498, 500, 507, 510, 514, 515, 516, 519, 520, 522, 524, 526, 528, 529, 530, 533, 537, 539, 541, 544, 557, 558, 559, 561, 562, 563, 565, 581, 582, 584, 586, 588, 589, 595, 601, 605, 608, 610, 612, 613, 615, 624, 625, 626, 627, 632, 633, 637, 641, 643, 648, 651, 663, 666, 668, 671, 675, 677, 678, 683, 684, 685, 686, 687, 690, 693, 697, 699, 702, 712, 714, 715, 726, 727, 734, 735, 739, 740, 741, 743, 746, 747, 749, 753, 754, 756, 758, 760, 763, 765, 767, 768, 773, 775, 776, 777, 780, 783, 788, 793, 797, 798, 799, 800, 804, 806, 807, 808, 810, 814, 819, 820, 824, 825, 829, 830, 832, 835, 838, 844, 845, 848, 849, 851, 853, 858, 859, 860, 861, 867, 870, 873, 877, 878, 879, 886, 888, 892, 895, 896, 902, 905, 907, 917, 923, 924, 928, 930, 931, 932, 935, 944, 949, 953, 954, 956, 958, 961, 969, 974, 975, 985, 986, 991, 996, 998, 1000, 1001, 1008, 1017, 1019, 1022, 1023, 1027, 1031, 1039, 1042, 1044, 1046, 1058, 1061, 1063, 1064, 1067, 1068, 1071, 1072, 1073, 1080, 1084, 1086, 1087, 1092, 1100, 1101, 1103, 1104, 1105, 1109, 1115, 1118, 1119, 1121, 1123, 1128, 1131, 1136 ] }
european_football_1
What is the name of the home team in division P1 with the highest final time goal in all seasons?
the highest final time goal refers to MAX(FTHG); P1 = Div;
SELECT HomeTeam FROM matchs WHERE Div = 'P1' AND season = 2021 ORDER BY FTHG DESC LIMIT 1
CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,753
2,753
CREATE TABLE `matchs` ( HomeTeam TEXT, FTHG INTEGER, season INTEGER )
[ "AND", "SELECT", "ORDER BY", "LIMIT", "DESC", "FROM" ]
6
simple
{ "case_1": [ 719 ], "case_2": [ 719 ], "case_3": [ 75, 719 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "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, 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, 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, 1076, 1077, 1083, 1094, 1124, 1137, 1139, 1141 ] }
european_football_1
What was the difference in home team and away team win percentages across all divisions in 2010?
2010 refers to season = 2010; SUBTRACT(DIVIDE(COUNT(Div where FTR = 'H', season = 2010), COUNT(Div where season = 2010)), COUNT(Div where FTR = 'A', season = 2010), COUNT(Div where season = 2010)) as percentage;
SELECT CAST(COUNT(CASE WHEN FTR = 'H' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(FTR) - CAST(COUNT(CASE WHEN FTR = 'A' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(FTR) DIFFERENCE FROM matchs WHERE season = 2010
CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,754
2,754
CREATE TABLE `matchs` ( FTR TEXT, season INTEGER )
[ "CASE WHEN", "AS", "SELECT", "CASE", "NULL", "CAST", "COUNT", "FROM" ]
16
challenging
{ "case_1": [ 458 ], "case_2": [ 458, 795 ], "case_3": [ 152, 267, 423, 458, 795, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 6, 16, 24, 35, 42, 53, 61, 64, 71, 77, 81, 87, 93, 104, 106, 113, 119, 120, 126, 127, 129, 148, 152, 153, 155, 158, 171, 173, 184, 191, 192, 195, 201, 207, 212, 215, 219, 223, 225, 226, 234, 236, 248, 254, 258, 261, 263, 264, 267, 271, 279, 298, 299, 300, 303, 304, 305, 316, 317, 322, 323, 335, 347, 360, 375, 380, 383, 393, 398, 402, 406, 409, 412, 415, 423, 427, 436, 438, 443, 448, 452, 453, 458, 476, 478, 479, 485, 486, 487, 493, 500, 504, 508, 510, 514, 516, 517, 518, 528, 535, 537, 540, 547, 550, 560, 563, 564, 571, 573, 575, 580, 581, 597, 601, 620, 623, 628, 640, 646, 658, 661, 662, 666, 672, 676, 682, 686, 706, 710, 712, 723, 740, 744, 747, 750, 753, 762, 772, 776, 787, 788, 795, 796, 798, 800, 802, 805, 808, 813, 827, 841, 844, 848, 868, 870, 871, 874, 880, 894, 896, 898, 909, 912, 913, 922, 924, 926, 927, 935, 941, 943, 944, 958, 959, 978, 985, 998, 1008, 1012, 1023, 1036, 1048, 1062, 1064, 1066, 1069, 1070, 1072, 1078, 1082, 1087, 1092, 1098, 1121, 1128, 1129, 1131, 1133, 1134, 1135 ] }
european_football_1
Which division had the most draft matches in the 2008 season?
the most draft matches refer to MAX(COUNT(Div)) where FTR = 'D';
SELECT Div FROM matchs WHERE season = 2008 AND FTR = 'D' GROUP BY Div ORDER BY COUNT(FTR) DESC LIMIT 1
CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,755
2,755
CREATE TABLE `matchs` ( FTR TEXT, season INTEGER )
[ "GROUP BY", "AND", "SELECT", "ORDER BY", "LIMIT", "DESC", "COUNT", "FROM" ]
8
simple
{ "case_1": [ 719 ], "case_2": [ 719 ], "case_3": [ 75, 719 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "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, 133, 138, 142, 143, 159, 162, 163, 167, 169, 173, 174, 179, 181, 185, 187, 188, 199, 202, 206, 208, 213, 214, 229, 233, 247, 252, 262, 275, 278, 281, 285, 286, 291, 309, 311, 313, 314, 319, 320, 324, 329, 334, 336, 337, 341, 345, 348, 349, 352, 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, 469, 482, 495, 497, 505, 530, 532, 534, 536, 538, 542, 548, 552, 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, 718, 719, 732, 733, 735, 743, 748, 752, 759, 760, 768, 778, 790, 810, 815, 817, 818, 823, 827, 830, 836, 851, 861, 866, 869, 876, 886, 889, 893, 901, 911, 918, 927, 929, 934, 946, 950, 951, 954, 956, 962, 963, 966, 967, 970, 972, 973, 975, 977, 981, 983, 987, 994, 1004, 1005, 1006, 1010, 1013, 1017, 1025, 1030, 1034, 1037, 1038, 1047, 1049, 1050, 1051, 1056, 1057, 1067, 1068, 1076, 1077, 1083, 1094, 1124, 1137, 1139, 1141 ] }
european_football_1
Which team won the match in the EC division on January 20, 2008 at home?
won at home refers to FTR = 'H'; January 20, 2008 refers to Date = '2008-01-20'; EC division refers to Div = 'EC';
SELECT HomeTeam FROM matchs WHERE Div = 'EC' AND Date = '2008-01-20' AND FTR = 'H'
CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,756
2,756
CREATE TABLE `matchs` ( HomeTeam TEXT, FTR TEXT )
[ "-", "AND", "SELECT", "FROM" ]
6
simple
{ "case_1": [ 362, 719, 795 ], "case_2": [ 362, 719, 795 ], "case_3": [ 75, 152, 183, 267, 362, 416, 464, 715, 719, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 2, 3, 4, 5, 8, 10, 12, 19, 20, 21, 22, 24, 26, 30, 32, 33, 34, 37, 38, 39, 40, 42, 43, 44, 45, 47, 50, 51, 52, 53, 56, 57, 63, 66, 67, 68, 69, 71, 73, 74, 75, 76, 79, 85, 88, 90, 93, 95, 96, 97, 98, 99, 100, 105, 109, 111, 112, 113, 115, 116, 117, 118, 119, 125, 127, 128, 129, 131, 135, 138, 141, 142, 143, 144, 146, 148, 152, 154, 158, 160, 163, 164, 168, 169, 170, 172, 173, 175, 176, 177, 180, 183, 184, 187, 189, 197, 199, 200, 214, 219, 223, 227, 228, 230, 239, 240, 244, 253, 255, 256, 258, 259, 262, 265, 266, 267, 268, 270, 272, 275, 276, 277, 278, 282, 294, 296, 300, 301, 305, 314, 315, 317, 319, 325, 330, 339, 341, 350, 356, 361, 362, 367, 368, 370, 374, 376, 382, 383, 385, 391, 392, 393, 394, 395, 396, 398, 399, 402, 403, 405, 406, 408, 409, 413, 414, 416, 417, 418, 419, 421, 424, 425, 426, 427, 428, 433, 436, 437, 438, 439, 440, 444, 445, 446, 448, 451, 452, 455, 463, 464, 469, 470, 475, 476, 477, 480, 482, 489, 490, 492, 493, 494, 496, 497, 498, 500, 503, 507, 509, 510, 512, 514, 515, 516, 519, 520, 522, 524, 526, 528, 529, 530, 533, 537, 539, 541, 544, 550, 551, 554, 557, 558, 559, 561, 562, 563, 580, 581, 582, 584, 586, 588, 589, 591, 594, 595, 599, 601, 605, 608, 610, 612, 613, 615, 617, 618, 622, 624, 625, 626, 627, 632, 633, 637, 641, 643, 647, 648, 649, 651, 656, 660, 663, 666, 667, 668, 671, 675, 677, 678, 679, 680, 681, 683, 684, 685, 686, 687, 690, 692, 693, 695, 697, 699, 702, 707, 709, 712, 714, 715, 716, 718, 719, 726, 727, 729, 730, 734, 735, 737, 739, 740, 741, 743, 746, 747, 749, 753, 754, 756, 758, 760, 763, 765, 767, 768, 770, 773, 775, 776, 777, 780, 783, 785, 788, 793, 794, 795, 797, 798, 799, 800, 804, 805, 806, 807, 808, 810, 814, 817, 819, 820, 824, 825, 826, 829, 830, 831, 832, 835, 838, 840, 843, 844, 848, 849, 851, 853, 855, 858, 859, 860, 861, 864, 867, 870, 873, 877, 878, 879, 882, 886, 888, 892, 895, 896, 902, 903, 905, 907, 917, 920, 922, 923, 924, 925, 928, 930, 931, 932, 935, 943, 944, 945, 949, 953, 954, 955, 956, 958, 959, 961, 965, 969, 974, 979, 980, 985, 986, 991, 993, 996, 998, 1000, 1001, 1008, 1009, 1014, 1017, 1018, 1019, 1020, 1022, 1023, 1027, 1031, 1039, 1042, 1044, 1046, 1052, 1057, 1058, 1059, 1061, 1063, 1064, 1067, 1068, 1070, 1071, 1072, 1073, 1074, 1078, 1079, 1080, 1081, 1084, 1086, 1092, 1093, 1100, 1101, 1103, 1104, 1105, 1109, 1111, 1115, 1117, 1119, 1121, 1123, 1126, 1128, 1131, 1132, 1136 ] }
european_football_1
What is the name of the division in which Club Brugge and Genk competed on September 13, 2009?
September 13, 2009 refers to Date = '2009-09-13'; Club Brugge refers to HomeTeam; Genk refers to AwayTeam;
SELECT T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.Date = '2009-09-13' and T1.HomeTeam = 'Club Brugge' AND T1.AwayTeam = 'Genk'
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,757
2,757
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, foreign key Div references divisionsdivision )
[ "AS", "AND", "SELECT", "and", "-", "INNER JOIN", "ON", "FROM" ]
10
simple
{ "case_1": [ 715, 969 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "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 ] }
european_football_1
How many matches were played in the Scottish Premiership division from 2006 to 2008?
Scottish Premiership is a name of division; from 2006 to 2008 means seasons between 2006 and 2008;
SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Scottish Premiership' AND (T1.season BETWEEN 2006 AND 2008)
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,758
2,758
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, season INTEGER, foreign key Div references divisionsdivision )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "COUNT", "BETWEEN", "FROM" ]
10
simple
{ "case_1": [ 715, 969 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "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, 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, 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, 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, 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, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
european_football_1
In which division was the match between Hibernian, the away team, and Hearts, the home team, played? To which country does this division belong?
FALSE;
SELECT DISTINCT T2.division,T2.country FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.HomeTeam = 'Hearts' AND T1.AwayTeam = 'Hibernian'
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,759
2,759
CREATE TABLE `divisions` ( division TEXT not null primary key, country TEXT ) CREATE TABLE `matchs` ( Div TEXT, HomeTeam TEXT, AwayTeam TEXT, foreign key Div references divisionsdivision )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
7
simple
{ "case_1": [ 715, 969 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "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 ] }
european_football_1
Which away team in the division of Bundesliga has the highest final time goals?
Bundesliga is a name of division; the highest final time goals refers to MAX(FTAG);
SELECT T1.AwayTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div=T2.division WHERE T2.name = 'Bundesliga' ORDER BY T1.FTAG DESC LIMIT 1
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,760
2,760
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, AwayTeam TEXT, FTAG INTEGER, foreign key Div references divisionsdivision )
[ "AS", "SELECT", "=", "ORDER BY", "LIMIT", "INNER JOIN", "ON", "DESC", "FROM" ]
10
simple
{ "case_1": [ 715, 969 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 464, 715, 719, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "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 ] }
european_football_1
Please provide the names of any three away teams that competed in the Italian divisions.
Italian means belong to country = 'Italy";
SELECT T1.AwayTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div=T2.division WHERE T2.country = 'Italy' LIMIT 3
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,761
2,761
CREATE TABLE `divisions` ( division TEXT not null primary key, country TEXT ) CREATE TABLE `matchs` ( Div TEXT, AwayTeam TEXT, foreign key Div references divisionsdivision )
[ "AS", "SELECT", "=", "LIMIT", "INNER JOIN", "ON", "FROM" ]
8
simple
{ "case_1": [ 715, 969 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 1, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 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, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 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, 1004, 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, 1075, 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 ] }
european_football_1
What is the name of the division that has had the lowest number of draft matches in the 2019 season?
the lowest number of draft matches refers to MIN(COUNT(FTR = 'D'));
SELECT T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2019 AND T1.FTR = 'D' GROUP BY T2.division ORDER BY COUNT(FTR) LIMIT 1
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,762
2,762
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, FTR TEXT, season INTEGER, foreign key Div references divisionsdivision )
[ "GROUP BY", "AS", "AND", "SELECT", "ORDER BY", "LIMIT", "INNER JOIN", "ON", "COUNT", "FROM" ]
11
medium
{ "case_1": [ 75, 152, 183, 267, 416, 464, 1131 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 464, 715, 719, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "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, 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, 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, 286, 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, 985, 986, 991, 993, 994, 996, 1000, 1001, 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 ] }
european_football_1
How many times did Valencia's home team win in the LaLiga division?
LaLiga is a name of the division; Valencia's home team refers to HomeTeam = 'Valencia'; win refers to FTR = 'H';
SELECT COUNT(T1.HomeTeam) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'LaLiga' AND T1.HomeTeam = 'Valencia' AND T1.FTR = 'H'
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,763
2,763
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, HomeTeam TEXT, FTR TEXT, foreign key Div references divisionsdivision )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "COUNT", "FROM" ]
9
simple
{ "case_1": [ 715, 969 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 423, 458, 464, 715, 719, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 109, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 230, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 259, 260, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 399, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 507, 509, 510, 511, 512, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 554, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 618, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 665, 666, 667, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 680, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 692, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 707, 710, 711, 712, 714, 715, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 730, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 817, 818, 819, 820, 822, 823, 824, 825, 827, 828, 829, 830, 831, 832, 833, 834, 835, 837, 838, 839, 841, 843, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 903, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 945, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 965, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1019, 1020, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1078, 1079, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1126, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
european_football_1
In how many matches in the Seria A division did both teams have equal goals?
Seria A is a name of division; equal goals refers to FTR = 'D', where D stands for draft;
SELECT COUNT(T1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Seria A' AND T1.FTR = 'D'
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,764
2,764
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, FTR TEXT, foreign key Div references divisionsdivision )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "COUNT", "FROM" ]
8
simple
{ "case_1": [ 715, 969 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 423, 458, 464, 715, 719, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 109, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 230, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 259, 260, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 399, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 507, 509, 510, 511, 512, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 554, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 618, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 665, 666, 667, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 680, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 692, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 707, 710, 711, 712, 714, 715, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 730, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 817, 818, 819, 820, 822, 823, 824, 825, 827, 828, 829, 830, 831, 832, 833, 834, 835, 837, 838, 839, 841, 843, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 903, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 945, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 965, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1019, 1020, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1078, 1079, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1126, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
european_football_1
How many football divisions does England have?
England is the name of country;
SELECT COUNT(division) FROM divisions WHERE country = 'England'
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,765
2,765
CREATE TABLE `divisions` ( division TEXT not null primary key, country TEXT )
[ "COUNT", "SELECT", "FROM" ]
3
simple
{ "case_1": [ 326, 423 ], "case_2": [ 326, 423 ], "case_3": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "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 ] }
european_football_1
What's the name of the football division in the Netherlands?
Netherlands is the name of country;
SELECT name FROM divisions WHERE country = 'Netherlands'
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,766
2,766
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT, country TEXT )
[ "SELECT", "FROM" ]
2
simple
{ "case_1": [ 326, 423 ], "case_2": [ 326, 423 ], "case_3": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "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 ] }
european_football_1
Who is the winner of the game happened on 2009/10/10, between "East Fife" and "Dumbarton"?
2009/10/10 is a date; the winner refers to FTR = 'A'; East Fife and Dumbarton are name of teams where HomeTeam = 'East Fife'; AwayTeam = 'Dumbarton';
SELECT CASE WHEN FTR = 'H' THEN 'East Fife' ELSE 'Dumbarton' END WINNER FROM matchs WHERE Date = '2009-10-10' AND HomeTeam = 'East Fife' AND AwayTeam = 'Dumbarton'
CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,767
2,767
CREATE TABLE `matchs` ( HomeTeam TEXT, AwayTeam TEXT, FTR TEXT )
[ "CASE WHEN", "AND", "SELECT", "CASE", "-", "FROM" ]
8
simple
{ "case_1": [ 362, 795 ], "case_2": [ 362, 458, 795 ], "case_3": [ 152, 183, 267, 362, 416, 423, 458, 795, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 2, 6, 16, 21, 24, 32, 39, 42, 43, 45, 54, 61, 64, 71, 74, 77, 79, 81, 85, 98, 104, 106, 112, 113, 115, 120, 122, 127, 128, 129, 141, 148, 152, 153, 154, 155, 158, 172, 173, 180, 183, 184, 187, 191, 192, 195, 197, 201, 205, 207, 212, 215, 219, 223, 225, 226, 234, 236, 240, 244, 245, 248, 258, 259, 261, 264, 267, 271, 272, 279, 296, 299, 300, 304, 305, 322, 325, 335, 339, 347, 356, 360, 362, 368, 375, 382, 383, 391, 393, 398, 402, 406, 412, 415, 416, 423, 425, 427, 436, 438, 446, 448, 452, 453, 458, 476, 478, 485, 486, 496, 498, 500, 504, 507, 508, 510, 514, 517, 518, 520, 522, 528, 529, 535, 540, 544, 547, 550, 559, 562, 563, 564, 571, 573, 575, 580, 581, 601, 620, 623, 624, 628, 640, 643, 646, 662, 666, 667, 675, 676, 677, 679, 682, 684, 686, 693, 709, 710, 723, 740, 744, 746, 747, 753, 754, 756, 758, 762, 772, 776, 777, 785, 787, 788, 795, 796, 798, 800, 805, 808, 817, 827, 829, 835, 838, 841, 844, 848, 858, 864, 868, 870, 871, 872, 874, 878, 896, 905, 909, 912, 922, 924, 926, 930, 939, 943, 944, 954, 959, 974, 979, 985, 998, 1008, 1012, 1031, 1036, 1048, 1062, 1064, 1068, 1069, 1078, 1082, 1087, 1092, 1093, 1098, 1101, 1110, 1123, 1129, 1131, 1133, 1134, 1135 ] }
european_football_1
What was the final score for the game Bursaspor vs Denizlispor on 2009/4/26?
Bursaspor vs Denizlispor are names of teams where HomeTeam = 'Bursaspor' and AwayTeam = 'Denizlispor'; Date = '2009-04-26'; final score refers to FTHG, FTAG;
SELECT FTHG, FTAG FROM matchs WHERE Date = '2009-04-26' AND HomeTeam = 'Bursaspor' AND AwayTeam = 'Denizlispor'
CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,768
2,768
CREATE TABLE `matchs` ( HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER )
[ "-", "AND", "SELECT", "FROM" ]
6
simple
{ "case_1": [ 362, 719, 795 ], "case_2": [ 362, 719, 795 ], "case_3": [ 75, 152, 183, 267, 362, 416, 464, 715, 719, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 2, 3, 4, 5, 8, 10, 12, 19, 20, 21, 22, 24, 26, 30, 32, 33, 34, 37, 38, 39, 40, 42, 43, 44, 45, 47, 50, 51, 52, 53, 56, 57, 63, 66, 67, 68, 69, 71, 73, 74, 75, 76, 79, 85, 88, 90, 93, 95, 96, 97, 98, 99, 100, 105, 109, 111, 112, 113, 115, 116, 117, 118, 119, 125, 127, 128, 129, 131, 135, 138, 141, 142, 143, 144, 146, 148, 152, 154, 158, 160, 163, 164, 168, 169, 170, 172, 173, 175, 176, 177, 180, 183, 184, 187, 189, 197, 199, 200, 214, 219, 223, 227, 228, 230, 239, 240, 244, 253, 255, 256, 258, 259, 262, 265, 266, 267, 268, 270, 272, 275, 276, 277, 278, 282, 294, 296, 300, 301, 305, 314, 315, 317, 319, 325, 330, 339, 341, 350, 356, 361, 362, 367, 368, 370, 374, 376, 382, 383, 385, 391, 392, 393, 394, 395, 396, 398, 399, 402, 403, 405, 406, 408, 409, 413, 414, 416, 417, 418, 419, 421, 424, 425, 426, 427, 428, 433, 436, 437, 438, 439, 440, 444, 445, 446, 448, 451, 452, 455, 463, 464, 469, 470, 475, 476, 477, 480, 482, 489, 490, 492, 493, 494, 496, 497, 498, 500, 503, 507, 509, 510, 512, 514, 515, 516, 519, 520, 522, 524, 526, 528, 529, 530, 533, 537, 539, 541, 544, 550, 551, 554, 557, 558, 559, 561, 562, 563, 580, 581, 582, 584, 586, 588, 589, 591, 594, 595, 599, 601, 605, 608, 610, 612, 613, 615, 617, 618, 622, 624, 625, 626, 627, 632, 633, 637, 641, 643, 647, 648, 649, 651, 656, 660, 663, 666, 667, 668, 671, 675, 677, 678, 679, 680, 681, 683, 684, 685, 686, 687, 690, 692, 693, 695, 697, 699, 702, 707, 709, 712, 714, 715, 716, 718, 719, 726, 727, 729, 730, 734, 735, 737, 739, 740, 741, 743, 746, 747, 749, 753, 754, 756, 758, 760, 763, 765, 767, 768, 770, 773, 775, 776, 777, 780, 783, 785, 788, 793, 794, 795, 797, 798, 799, 800, 804, 805, 806, 807, 808, 810, 814, 817, 819, 820, 824, 825, 826, 829, 830, 831, 832, 835, 838, 840, 843, 844, 848, 849, 851, 853, 855, 858, 859, 860, 861, 864, 867, 870, 873, 877, 878, 879, 882, 886, 888, 892, 895, 896, 902, 903, 905, 907, 917, 920, 922, 923, 924, 925, 928, 930, 931, 932, 935, 943, 944, 945, 949, 953, 954, 955, 956, 958, 959, 961, 965, 969, 974, 979, 980, 985, 986, 991, 993, 996, 998, 1000, 1001, 1008, 1009, 1014, 1017, 1018, 1019, 1020, 1022, 1023, 1027, 1031, 1039, 1042, 1044, 1046, 1052, 1057, 1058, 1059, 1061, 1063, 1064, 1067, 1068, 1070, 1071, 1072, 1073, 1074, 1078, 1079, 1080, 1081, 1084, 1086, 1092, 1093, 1100, 1101, 1103, 1104, 1105, 1109, 1111, 1115, 1117, 1119, 1121, 1123, 1126, 1128, 1131, 1132, 1136 ] }
european_football_1
When did the first match that score more than 10 goals happen?
score more than 10 goals refers to SUM(FTHG, FTAG)>10, which are short names for Final-time Home-team Goals and Final-time Away-team Goals; the first means the earliest and refers to MIN(Date);
SELECT MIN(Date) FROM matchs WHERE FTHG + FTAG > 10
CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,769
2,769
CREATE TABLE `matchs` ( FTHG INTEGER, FTAG INTEGER )
[ "MIN", "SELECT", "FROM" ]
3
simple
{ "case_1": [ 362, 719, 795, 1040 ], "case_2": [ 362, 458, 719, 795, 1040 ], "case_3": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "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 ] }
european_football_1
For the Ligue 2 game that made the most goals, who is the winner of that game?
Ligue 2 is the name of division; the most goals refer to MAX(SUM(FTHG, FTAG)) which are short names for Final-time Home-team Goals and Final-time Away-team Goals; winner refers to FTR = 'A';
SELECT CASE WHEN T1.FTR = 'H' THEN T1.HomeTeam ELSE T1.AwayTeam END WINNER FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Ligue 2' ORDER BY T1.FTAG + T1.FTHG DESC LIMIT 1
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,770
2,770
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, foreign key Div references divisionsdivision )
[ "CASE WHEN", "AS", "SELECT", "ORDER BY", "CASE", "LIMIT", "INNER JOIN", "ON", "DESC", "FROM" ]
11
medium
{ "case_1": [ 75, 152, 267, 1131 ], "case_2": [ 75, 152, 267, 1131 ], "case_3": [ 75, 152, 267, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 1, 6, 10, 11, 16, 20, 24, 29, 36, 42, 49, 55, 59, 62, 64, 69, 71, 73, 75, 77, 81, 86, 89, 106, 113, 120, 121, 125, 127, 129, 138, 148, 150, 152, 153, 155, 158, 159, 162, 163, 167, 171, 173, 179, 187, 188, 191, 195, 199, 200, 201, 202, 206, 207, 212, 213, 219, 225, 226, 229, 233, 234, 236, 239, 247, 248, 258, 261, 262, 263, 264, 267, 275, 278, 279, 281, 286, 298, 299, 300, 304, 309, 311, 313, 314, 319, 320, 322, 324, 329, 334, 335, 336, 341, 342, 345, 347, 349, 353, 356, 360, 364, 365, 373, 375, 378, 379, 381, 383, 385, 393, 394, 395, 398, 402, 403, 406, 409, 411, 412, 415, 427, 428, 429, 434, 435, 438, 444, 445, 451, 452, 454, 460, 462, 469, 476, 478, 479, 482, 486, 495, 497, 500, 505, 514, 518, 528, 530, 532, 535, 536, 538, 540, 542, 547, 548, 550, 552, 560, 563, 564, 566, 567, 571, 573, 575, 578, 579, 580, 581, 584, 586, 590, 592, 595, 611, 620, 621, 623, 625, 626, 628, 634, 637, 638, 640, 645, 646, 654, 657, 659, 662, 665, 666, 669, 672, 676, 681, 682, 686, 688, 690, 691, 701, 706, 710, 723, 733, 735, 740, 744, 747, 752, 753, 759, 760, 762, 768, 772, 776, 778, 787, 788, 790, 796, 800, 803, 805, 808, 810, 818, 823, 827, 830, 841, 844, 848, 850, 851, 861, 866, 868, 871, 874, 876, 880, 886, 889, 891, 893, 896, 901, 909, 911, 912, 918, 922, 924, 926, 927, 929, 934, 943, 944, 950, 951, 953, 954, 956, 959, 962, 963, 966, 967, 970, 973, 975, 977, 981, 985, 994, 1004, 1005, 1006, 1010, 1012, 1013, 1017, 1025, 1034, 1037, 1038, 1047, 1049, 1050, 1051, 1056, 1062, 1064, 1065, 1066, 1067, 1068, 1078, 1082, 1087, 1092, 1094, 1098, 1124, 1131, 1133, 1134, 1135, 1137 ] }
european_football_1
How many Away Victories happened on 2016/3/27 in the LaLiga 2 division?
Away victories refer to FTR = 'A'; LaLiga 2 is the name of division; Date = '2016-03-27';
SELECT COUNT(T1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'LaLiga 2' AND T1.Date = '2016-03-27' AND T1.FTR = 'A'
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,771
2,771
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, Date DATE, FTR TEXT, foreign key Div references divisionsdivision )
[ "AS", "AND", "SELECT", "-", "INNER JOIN", "ON", "COUNT", "FROM" ]
11
medium
{ "case_1": [ 75, 152, 183, 267, 416, 464, 1131 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 464, 715, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "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, 32, 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, 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, 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, 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, 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, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1070, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
european_football_1
How many draw games happened on 2018/8/7 for National League?
National League is the name of division; Date = '2018-08-07'; draw refers to FTR = 'D'; games refer to Div;
SELECT COUNT(T1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'National League' AND T1.Date = '2018-08-07' AND T1.FTR = 'D'
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,772
2,772
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, Date DATE, FTR TEXT, foreign key Div references divisionsdivision )
[ "AS", "AND", "SELECT", "-", "INNER JOIN", "ON", "COUNT", "FROM" ]
11
medium
{ "case_1": [ 75, 152, 183, 267, 416, 464, 1131 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 464, 715, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "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, 32, 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, 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, 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, 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, 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, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1070, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
european_football_1
Which country had the game that Away team made the most goals?
the most goals refer to MAX(FTAG), which is a short name for Final-time Away-team Goals;
SELECT T2.country FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division GROUP BY T2.country ORDER BY SUM(T1.FTAG) DESC LIMIT 1
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,773
2,773
CREATE TABLE `divisions` ( division TEXT not null primary key, country TEXT ) CREATE TABLE `matchs` ( Div TEXT, FTAG INTEGER, foreign key Div references divisionsdivision )
[ "GROUP BY", "AS", "SELECT", "SUM", "ORDER BY", "LIMIT", "INNER JOIN", "ON", "DESC", "FROM" ]
11
medium
{ "case_1": [ 75 ], "case_2": [ 75 ], "case_3": [ 75, 719 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 1, 6, 10, 11, 13, 15, 20, 22, 24, 28, 29, 36, 39, 42, 49, 55, 59, 62, 64, 69, 71, 73, 75, 77, 78, 81, 83, 86, 89, 93, 94, 108, 112, 113, 115, 120, 121, 125, 126, 127, 129, 138, 140, 141, 142, 143, 148, 150, 153, 155, 159, 162, 163, 167, 169, 173, 179, 184, 186, 187, 188, 189, 191, 195, 199, 200, 201, 202, 206, 207, 212, 213, 214, 219, 225, 226, 228, 229, 233, 234, 236, 239, 247, 248, 252, 254, 261, 262, 264, 275, 278, 279, 281, 285, 286, 300, 304, 309, 311, 313, 314, 316, 317, 319, 320, 323, 324, 329, 334, 335, 336, 341, 342, 344, 345, 347, 348, 349, 352, 353, 356, 359, 360, 363, 364, 365, 371, 373, 378, 379, 381, 383, 385, 394, 395, 402, 403, 409, 411, 412, 415, 424, 427, 428, 429, 434, 435, 438, 444, 445, 448, 450, 451, 452, 454, 460, 462, 469, 470, 473, 476, 482, 483, 486, 487, 488, 495, 497, 500, 505, 518, 530, 532, 535, 536, 537, 538, 540, 542, 547, 548, 550, 552, 560, 563, 564, 566, 567, 571, 575, 578, 579, 580, 581, 584, 586, 590, 592, 595, 597, 609, 611, 612, 621, 623, 625, 626, 628, 630, 634, 637, 638, 640, 645, 650, 651, 654, 657, 658, 659, 662, 664, 665, 666, 669, 676, 681, 682, 686, 688, 690, 691, 695, 696, 698, 701, 703, 710, 717, 719, 720, 721, 723, 733, 735, 740, 743, 744, 745, 747, 748, 750, 751, 752, 753, 759, 760, 762, 768, 776, 777, 778, 779, 787, 788, 790, 796, 800, 802, 803, 808, 810, 813, 818, 823, 825, 827, 830, 832, 841, 848, 850, 851, 861, 866, 868, 869, 870, 871, 874, 876, 882, 886, 889, 891, 893, 896, 901, 909, 911, 912, 918, 922, 924, 927, 929, 932, 934, 943, 944, 950, 951, 953, 954, 956, 958, 959, 962, 963, 966, 967, 970, 972, 973, 975, 977, 981, 987, 993, 994, 1004, 1005, 1006, 1010, 1012, 1013, 1017, 1023, 1025, 1027, 1030, 1031, 1034, 1037, 1038, 1043, 1047, 1049, 1050, 1051, 1056, 1057, 1064, 1065, 1067, 1068, 1076, 1077, 1078, 1082, 1087, 1091, 1092, 1094, 1098, 1100, 1106, 1124, 1135, 1137 ] }
european_football_1
For a game had a score of 1-8 in the year of 2011, what division was that game in? Give the full name of the division.
2011 refers to season; a score of 1-8 refers to FTHG = '1' and FTAG = '8';
SELECT T2.division, T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2011 AND T1.FTHG = 1 AND T1.FTAG = 8
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,774
2,774
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, FTHG INTEGER, FTAG INTEGER, season INTEGER, foreign key Div references divisionsdivision )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
8
simple
{ "case_1": [ 715, 969 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "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 ] }
european_football_1
Which division had the most games with more than 5 total field goals on 2020/2/22? Give the full name of the division?
more than 5 total field goals refers to SUM(FTHG, FTAG)>5, which are short names for Final-time Home-team Goals and Final-time Away-team Goals; 2020/2/22 is a date;
SELECT T2.division, T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.Date = '2020-02-22' AND T1.FTAG + T1.FTHG > 5 ORDER BY T1.FTAG + T1.FTHG DESC LIMIT 1
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,775
2,775
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, Date DATE, FTHG INTEGER, FTAG INTEGER, foreign key Div references divisionsdivision )
[ "AS", "AND", "SELECT", "ORDER BY", "LIMIT", "-", "INNER JOIN", "ON", "DESC", "FROM" ]
12
medium
{ "case_1": [ 75, 152, 183, 267, 416, 464, 1131 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 464, 715, 719, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 1, 3, 4, 5, 8, 10, 11, 12, 19, 20, 21, 22, 24, 26, 29, 30, 33, 34, 36, 37, 38, 39, 42, 43, 44, 45, 47, 49, 51, 52, 53, 55, 57, 59, 62, 63, 66, 68, 69, 71, 73, 74, 75, 76, 85, 86, 88, 89, 90, 93, 95, 96, 97, 98, 99, 105, 111, 112, 113, 115, 116, 117, 118, 119, 121, 125, 127, 128, 129, 131, 135, 138, 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, 187, 188, 189, 197, 199, 200, 202, 206, 213, 214, 219, 227, 228, 229, 233, 239, 240, 244, 247, 256, 258, 262, 265, 266, 267, 268, 272, 275, 276, 277, 278, 281, 282, 286, 296, 300, 301, 309, 311, 313, 314, 315, 317, 319, 320, 324, 325, 329, 330, 334, 336, 339, 341, 342, 345, 349, 353, 356, 361, 364, 365, 368, 370, 373, 374, 376, 378, 379, 381, 382, 383, 385, 391, 392, 393, 394, 395, 398, 402, 403, 405, 406, 408, 409, 411, 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, 469, 470, 475, 476, 477, 480, 482, 489, 490, 493, 494, 495, 496, 497, 498, 500, 503, 505, 507, 509, 514, 515, 516, 519, 520, 522, 524, 526, 528, 529, 530, 532, 533, 536, 537, 538, 539, 541, 542, 544, 548, 550, 552, 557, 558, 559, 560, 561, 562, 563, 566, 567, 578, 579, 580, 581, 582, 584, 586, 588, 589, 590, 592, 595, 605, 608, 610, 611, 612, 613, 615, 621, 624, 625, 626, 627, 632, 633, 634, 637, 638, 641, 643, 645, 647, 648, 649, 651, 654, 657, 659, 660, 663, 665, 666, 668, 669, 671, 675, 677, 678, 681, 683, 684, 685, 686, 687, 688, 690, 691, 693, 695, 697, 699, 701, 702, 712, 714, 715, 719, 726, 727, 733, 734, 735, 739, 740, 741, 743, 746, 747, 749, 752, 753, 754, 756, 758, 759, 760, 763, 765, 767, 768, 773, 775, 776, 777, 778, 780, 783, 788, 790, 793, 797, 799, 800, 803, 804, 805, 806, 807, 808, 810, 814, 818, 819, 823, 824, 825, 827, 829, 830, 832, 835, 838, 844, 848, 849, 850, 851, 853, 858, 859, 860, 861, 866, 867, 870, 873, 876, 877, 878, 879, 882, 886, 888, 889, 891, 892, 893, 895, 896, 901, 902, 905, 907, 911, 917, 918, 922, 923, 924, 925, 927, 928, 929, 930, 931, 932, 934, 935, 943, 944, 949, 950, 951, 953, 954, 956, 958, 959, 961, 962, 963, 966, 967, 969, 970, 973, 974, 975, 977, 980, 981, 985, 986, 991, 993, 994, 996, 1000, 1001, 1004, 1005, 1006, 1010, 1013, 1017, 1019, 1022, 1023, 1025, 1027, 1031, 1034, 1037, 1038, 1039, 1042, 1044, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1057, 1058, 1061, 1063, 1064, 1065, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1084, 1086, 1092, 1094, 1100, 1101, 1103, 1104, 1105, 1109, 1111, 1115, 1119, 1123, 1124, 1128, 1131, 1132, 1136, 1137 ] }
european_football_1
Give the full name of the divison that had the most 0-0 games.
the most 0-0 games means a no-score draw and refers to MAX(COUNT(Div where FTHG = '0' and FTAG = '0'));
SELECT T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.FTAG = 0 AND T1.FTHG = 0 GROUP BY T2.division ORDER BY COUNT(T1.FTAG) DESC LIMIT 1
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,776
2,776
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, FTHG INTEGER, FTAG INTEGER, foreign key Div references divisionsdivision )
[ "GROUP BY", "AS", "AND", "SELECT", "ORDER BY", "LIMIT", "INNER JOIN", "ON", "DESC", "COUNT", "FROM" ]
12
medium
{ "case_1": [ 75, 152, 183, 267, 416, 464, 1131 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 464, 715, 719, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "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 ] }
european_football_1
How many Scottish League One games took place on the day that "Pro Vercelli" and "Pescara"had a 5-2 game?
Pro Vercelli and Pescara are names of teams; HomeTeam = 'Pro Vercelli'; AwayTeam = 'Pescara'; 5-2 is a score where FTHG = '5' and FTAG = '2'; Scottish League One is a name of division; games refer to Div;
SELECT COUNT(T1.Date) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Scottish League One' AND T1.Date = ( SELECT Date FROM matchs WHERE FTHG = 5 AND FTAG = 2 AND HomeTeam = 'Pro Vercelli' AND AwayTeam = 'Pescara' )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,777
2,777
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, foreign key Div references divisionsdivision )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "COUNT", "FROM" ]
13
medium
{ "case_1": [ 75, 152, 183, 267, 416, 464, 1131 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 423, 458, 464, 715, 719, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 109, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 230, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 259, 260, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 399, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 507, 509, 510, 511, 512, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 554, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 618, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 665, 666, 667, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 680, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 692, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 707, 710, 711, 712, 714, 715, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 730, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 817, 818, 819, 820, 822, 823, 824, 825, 827, 828, 829, 830, 831, 832, 833, 834, 835, 837, 838, 839, 841, 843, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 903, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 945, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 965, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1019, 1020, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1078, 1079, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1126, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
european_football_1
List the number of games that ended up with 5-0 in Greece.
5-0 is a score where FTHG = '5' and FTAG = '0'; Greece is a name of country; games refer to Div;
SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.country = 'Greece' AND T1.FTHG = 5 AND T1.FTAG = 0
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,778
2,778
CREATE TABLE `divisions` ( division TEXT not null primary key, country TEXT ) CREATE TABLE `matchs` ( Div TEXT, FTHG INTEGER, FTAG INTEGER, foreign key Div references divisionsdivision )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "COUNT", "FROM" ]
9
simple
{ "case_1": [ 715, 969 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 423, 458, 464, 715, 719, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 109, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 230, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 259, 260, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 399, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 507, 509, 510, 511, 512, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 554, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 618, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 665, 666, 667, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 680, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 692, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 707, 710, 711, 712, 714, 715, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 730, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 817, 818, 819, 820, 822, 823, 824, 825, 827, 828, 829, 830, 831, 832, 833, 834, 835, 837, 838, 839, 841, 843, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 903, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 945, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 965, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1019, 1020, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1078, 1079, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1126, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
european_football_1
Which country did Bradford Team belongs to?
Bradford team refers to HomeTeam = 'Bradford' or AwayTeam = 'Bradford';
SELECT DISTINCT T2.country FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.HomeTeam = 'Bradford' OR T1.AwayTeam = 'Bradford'
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,779
2,779
CREATE TABLE `divisions` ( division TEXT not null primary key, country TEXT ) CREATE TABLE `matchs` ( Div TEXT, HomeTeam TEXT, AwayTeam TEXT, foreign key Div references divisionsdivision )
[ "OR", "AS", "SELECT", "INNER JOIN", "ON", "FROM" ]
7
simple
{ "case_1": [ 715, 969 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 1, 3, 4, 5, 6, 7, 8, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 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 ] }
european_football_1
How many Eredivisie teams have played in 2008?
Eredivisie is the name of division; 2008 refers to season; teams refer to HomeTeam;
SELECT COUNT(DISTINCT T1.HomeTeam) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Eredivisie' AND T1.season = 2008
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,780
2,780
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, HomeTeam TEXT, season INTEGER, foreign key Div references divisionsdivision )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "COUNT", "FROM" ]
8
simple
{ "case_1": [ 715, 969 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 423, 458, 464, 715, 719, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 109, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 230, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 259, 260, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 399, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 507, 509, 510, 511, 512, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 554, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 618, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 665, 666, 667, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 680, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 692, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 707, 710, 711, 712, 714, 715, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 730, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 817, 818, 819, 820, 822, 823, 824, 825, 827, 828, 829, 830, 831, 832, 833, 834, 835, 837, 838, 839, 841, 843, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 903, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 945, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 965, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1019, 1020, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1078, 1079, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1126, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
european_football_1
What's the home win ratio of the Bundesliga division in 2021?
home win refers to FTR = 'H', where H stands for home victory; season = '2021'; Bundesliga is a name of division; DIVIDE(COUNT(Div where FTR = 'H, season = '2021' and name = 'Bundesliga'), COUNT(Div where season = '2021' and name = 'Bundesliga')) as percentage;
SELECT CAST(COUNT(CASE WHEN T1.FTR = 'H' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T2.name = 'Bundesliga'
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,781
2,781
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, FTR TEXT, season INTEGER, foreign key Div references divisionsdivision )
[ "CASE WHEN", "AS", "AND", "SELECT", "CASE", "NULL", "INNER JOIN", "ON", "CAST", "COUNT", "FROM" ]
14
medium
{ "case_1": [ 75, 152, 183, 267, 416, 464, 1131 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 423, 458, 464, 715, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 1, 4, 5, 6, 8, 11, 12, 16, 19, 20, 21, 22, 24, 26, 27, 30, 33, 36, 37, 39, 42, 44, 45, 47, 51, 52, 53, 55, 57, 61, 62, 63, 64, 66, 68, 69, 71, 73, 74, 75, 76, 77, 81, 82, 85, 86, 88, 90, 91, 93, 95, 96, 98, 99, 106, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 131, 138, 140, 141, 142, 143, 144, 146, 148, 150, 152, 153, 154, 155, 158, 159, 160, 163, 164, 167, 169, 170, 171, 172, 175, 176, 177, 179, 180, 183, 184, 187, 188, 189, 190, 191, 192, 195, 196, 197, 199, 200, 201, 202, 206, 207, 212, 214, 215, 219, 223, 225, 226, 227, 229, 233, 234, 236, 239, 240, 243, 244, 247, 248, 254, 256, 258, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 282, 296, 298, 299, 300, 301, 303, 304, 305, 311, 314, 315, 316, 317, 319, 320, 322, 323, 325, 330, 334, 335, 336, 338, 339, 341, 344, 345, 347, 349, 354, 356, 358, 360, 361, 364, 368, 370, 373, 374, 375, 376, 382, 383, 384, 385, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 423, 424, 425, 426, 427, 428, 433, 436, 437, 438, 440, 443, 444, 445, 446, 448, 451, 452, 453, 454, 455, 458, 460, 462, 463, 464, 465, 467, 469, 470, 471, 473, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 490, 493, 494, 496, 497, 498, 500, 504, 505, 507, 508, 509, 510, 514, 515, 516, 517, 518, 519, 520, 522, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 557, 558, 559, 560, 561, 562, 563, 564, 566, 571, 573, 575, 580, 581, 582, 584, 586, 588, 589, 595, 596, 597, 601, 605, 606, 608, 610, 611, 612, 613, 615, 620, 623, 624, 625, 626, 627, 628, 630, 632, 633, 634, 637, 640, 641, 643, 645, 646, 648, 649, 651, 654, 658, 659, 662, 663, 665, 666, 668, 669, 671, 672, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 693, 694, 696, 697, 699, 702, 705, 706, 710, 712, 714, 715, 721, 723, 724, 726, 727, 733, 734, 735, 736, 739, 740, 741, 743, 744, 746, 747, 749, 750, 752, 753, 754, 756, 758, 760, 762, 763, 765, 767, 768, 769, 772, 773, 775, 776, 777, 778, 779, 780, 783, 787, 788, 790, 793, 795, 796, 797, 798, 799, 800, 802, 804, 805, 806, 807, 808, 810, 812, 813, 814, 818, 819, 824, 825, 827, 829, 830, 832, 835, 837, 838, 839, 841, 844, 848, 849, 851, 853, 857, 858, 859, 860, 861, 866, 867, 868, 870, 871, 873, 874, 876, 877, 878, 879, 880, 886, 888, 892, 893, 894, 895, 896, 897, 898, 901, 902, 905, 907, 909, 911, 912, 915, 917, 918, 922, 923, 924, 926, 927, 928, 930, 931, 932, 934, 935, 941, 943, 944, 949, 950, 951, 953, 954, 956, 958, 959, 961, 963, 969, 974, 975, 977, 981, 985, 986, 991, 993, 996, 998, 1000, 1001, 1005, 1006, 1008, 1010, 1012, 1013, 1015, 1017, 1019, 1022, 1023, 1027, 1031, 1036, 1037, 1039, 1042, 1043, 1044, 1046, 1047, 1048, 1050, 1051, 1058, 1061, 1062, 1063, 1064, 1066, 1067, 1068, 1069, 1071, 1072, 1078, 1080, 1082, 1084, 1086, 1087, 1092, 1094, 1098, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1112, 1115, 1119, 1121, 1123, 1124, 1128, 1129, 1131, 1133, 1134, 1135, 1136, 1137 ] }
european_football_1
For all the games ended up with 1-1, what percentage of them are from Liga NOS division?
1-1 is a score where FTHG = '1' and FTAG = '1'; Liga NOS is the name of division; DIVIDE(COUNT(Div where FTHG = '1', FTAG = '1', name = 'Liga NOS'), COUNT(Div where FTHG = '1' and FTAG = '1')) as percentage;
SELECT CAST(COUNT(CASE WHEN T2.name = 'Liga NOS' THEN T1.Div ELSE NULL END) AS REAL) * 100 / COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.FTHG = 1 AND FTAG = 1
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,782
2,782
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, FTHG INTEGER, FTAG INTEGER, foreign key Div references divisionsdivision )
[ "CASE WHEN", "AS", "AND", "SELECT", "CASE", "NULL", "INNER JOIN", "ON", "CAST", "COUNT", "FROM" ]
14
medium
{ "case_1": [ 75, 152, 183, 267, 416, 464, 1131 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 423, 458, 464, 715, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 1, 4, 5, 6, 8, 11, 12, 16, 19, 20, 21, 22, 24, 26, 27, 30, 33, 36, 37, 39, 42, 44, 45, 47, 51, 52, 53, 55, 57, 61, 62, 63, 64, 66, 68, 69, 71, 73, 74, 75, 76, 77, 81, 82, 85, 86, 88, 90, 91, 93, 95, 96, 98, 99, 106, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 131, 138, 140, 141, 142, 143, 144, 146, 148, 150, 152, 153, 154, 155, 158, 159, 160, 163, 164, 167, 169, 170, 171, 172, 175, 176, 177, 179, 180, 183, 184, 187, 188, 189, 190, 191, 192, 195, 196, 197, 199, 200, 201, 202, 206, 207, 212, 214, 215, 219, 223, 225, 226, 227, 229, 233, 234, 236, 239, 240, 243, 244, 247, 248, 254, 256, 258, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 282, 296, 298, 299, 300, 301, 303, 304, 305, 311, 314, 315, 316, 317, 319, 320, 322, 323, 325, 330, 334, 335, 336, 338, 339, 341, 344, 345, 347, 349, 354, 356, 358, 360, 361, 364, 368, 370, 373, 374, 375, 376, 382, 383, 384, 385, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 423, 424, 425, 426, 427, 428, 433, 436, 437, 438, 440, 443, 444, 445, 446, 448, 451, 452, 453, 454, 455, 458, 460, 462, 463, 464, 465, 467, 469, 470, 471, 473, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 490, 493, 494, 496, 497, 498, 500, 504, 505, 507, 508, 509, 510, 514, 515, 516, 517, 518, 519, 520, 522, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 557, 558, 559, 560, 561, 562, 563, 564, 566, 571, 573, 575, 580, 581, 582, 584, 586, 588, 589, 595, 596, 597, 601, 605, 606, 608, 610, 611, 612, 613, 615, 620, 623, 624, 625, 626, 627, 628, 630, 632, 633, 634, 637, 640, 641, 643, 645, 646, 648, 649, 651, 654, 658, 659, 662, 663, 665, 666, 668, 669, 671, 672, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 693, 694, 696, 697, 699, 702, 705, 706, 710, 712, 714, 715, 721, 723, 724, 726, 727, 733, 734, 735, 736, 739, 740, 741, 743, 744, 746, 747, 749, 750, 752, 753, 754, 756, 758, 760, 762, 763, 765, 767, 768, 769, 772, 773, 775, 776, 777, 778, 779, 780, 783, 787, 788, 790, 793, 795, 796, 797, 798, 799, 800, 802, 804, 805, 806, 807, 808, 810, 812, 813, 814, 818, 819, 824, 825, 827, 829, 830, 832, 835, 837, 838, 839, 841, 844, 848, 849, 851, 853, 857, 858, 859, 860, 861, 866, 867, 868, 870, 871, 873, 874, 876, 877, 878, 879, 880, 886, 888, 892, 893, 894, 895, 896, 897, 898, 901, 902, 905, 907, 909, 911, 912, 915, 917, 918, 922, 923, 924, 926, 927, 928, 930, 931, 932, 934, 935, 941, 943, 944, 949, 950, 951, 953, 954, 956, 958, 959, 961, 963, 969, 974, 975, 977, 981, 985, 986, 991, 993, 996, 998, 1000, 1001, 1005, 1006, 1008, 1010, 1012, 1013, 1015, 1017, 1019, 1022, 1023, 1027, 1031, 1036, 1037, 1039, 1042, 1043, 1044, 1046, 1047, 1048, 1050, 1051, 1058, 1061, 1062, 1063, 1064, 1066, 1067, 1068, 1069, 1071, 1072, 1078, 1080, 1082, 1084, 1086, 1087, 1092, 1094, 1098, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1112, 1115, 1119, 1121, 1123, 1124, 1128, 1129, 1131, 1133, 1134, 1135, 1136, 1137 ] }
european_football_1
How many matches were held during the 2021 season's Premier League?
Premier League is the name of division;
SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T2.name = 'Premier League'
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,783
2,783
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, season INTEGER, foreign key Div references divisionsdivision )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "COUNT", "FROM" ]
8
simple
{ "case_1": [ 715, 969 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 423, 458, 464, 715, 719, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 109, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 230, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 259, 260, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 399, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 507, 509, 510, 511, 512, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 554, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 618, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 665, 666, 667, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 680, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 692, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 707, 710, 711, 712, 714, 715, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 730, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 817, 818, 819, 820, 822, 823, 824, 825, 827, 828, 829, 830, 831, 832, 833, 834, 835, 837, 838, 839, 841, 843, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 903, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 945, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 965, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1019, 1020, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1078, 1079, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1126, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
european_football_1
Which team was the home team in the match of the Bundesliga division on 2020/10/2?
Bundesliga is the name of division; Date = '2020/10/2';
SELECT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.Date = '2020-10-02' AND T2.name = 'Bundesliga'
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,784
2,784
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, Date DATE, HomeTeam TEXT, foreign key Div references divisionsdivision )
[ "AS", "AND", "SELECT", "-", "INNER JOIN", "ON", "FROM" ]
9
simple
{ "case_1": [ 715, 969 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 362, 416, 464, 715, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "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 ] }
european_football_1
Which team won the match of the Bundesliga division on 2020/10/2?
Bundesliga is the name of division; Date = '2020/10/2'; won the match refers to FTR = 'H';
SELECT CASE WHEN T1.FTR = 'H' THEN T1.HomeTeam WHEN T1.FTR = 'A' THEN T1.AwayTeam END WINNER FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.Date = '2020-10-02' AND T2.name = 'Bundesliga'
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,785
2,785
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTR TEXT, foreign key Div references divisionsdivision )
[ "CASE WHEN", "AS", "AND", "SELECT", "CASE", "-", "INNER JOIN", "ON", "FROM" ]
11
medium
{ "case_1": [ 75, 152, 183, 267, 416, 464, 1131 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 362, 416, 423, 458, 464, 715, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "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, 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, 173, 175, 176, 177, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 215, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 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, 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, 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, 1093, 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 ] }
european_football_1
Which team has the most victories as the home team in matches of the Bundesliga division?
Bundesliga is the name of division; the most victories as the home team refers to MAX(COUNT(FTR = 'H'));
SELECT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.FTR = 'H' GROUP BY T1.HomeTeam ORDER BY COUNT(T1.FTR) DESC LIMIT 1
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,786
2,786
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, HomeTeam TEXT, FTR TEXT, foreign key Div references divisionsdivision )
[ "GROUP BY", "AS", "AND", "SELECT", "ORDER BY", "LIMIT", "INNER JOIN", "ON", "DESC", "COUNT", "FROM" ]
12
medium
{ "case_1": [ 75, 152, 183, 267, 416, 464, 1131 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 464, 715, 719, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "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 ] }
european_football_1
How many times did the team Werder Bremen win as the away team in matches of the Bundesliga division?
Bundesliga is the name of division; win as the away team refers to FTR = 'A', where 'A' stands for away victory;
SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.AwayTeam = 'Werder Bremen' AND T1.FTR = 'A'
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,787
2,787
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, AwayTeam TEXT, FTR TEXT, foreign key Div references divisionsdivision )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "COUNT", "FROM" ]
9
simple
{ "case_1": [ 715, 969 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 423, 458, 464, 715, 719, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 109, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 230, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 259, 260, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 399, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 507, 509, 510, 511, 512, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 554, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 618, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 665, 666, 667, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 680, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 692, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 707, 710, 711, 712, 714, 715, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 730, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 817, 818, 819, 820, 822, 823, 824, 825, 827, 828, 829, 830, 831, 832, 833, 834, 835, 837, 838, 839, 841, 843, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 903, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 945, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 965, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1019, 1020, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1078, 1079, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1126, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
european_football_1
How many matches of the Bundesliga division ended with an away victory in the 2021 season?
Bundesliga is the name of division; away victory refers to FTR = 'A', where 'A' stands for away victory;
SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.FTR = 'A' AND T1.season = 2021
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,788
2,788
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, FTR TEXT, season INTEGER, foreign key Div references divisionsdivision )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "COUNT", "FROM" ]
9
simple
{ "case_1": [ 715, 969 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 423, 458, 464, 715, 719, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 109, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 230, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 259, 260, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 399, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 507, 509, 510, 511, 512, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 554, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 618, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 665, 666, 667, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 680, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 692, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 707, 710, 711, 712, 714, 715, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 730, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 817, 818, 819, 820, 822, 823, 824, 825, 827, 828, 829, 830, 831, 832, 833, 834, 835, 837, 838, 839, 841, 843, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 903, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 945, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 965, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1019, 1020, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1078, 1079, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1126, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
european_football_1
Of the matches in all seasons of the Bundesliga division, how many of them ended with a tie?
Bundesliga is the name of division; tie refers to FTR = 'D', where D stands for draft;
SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.FTR = 'D'
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,789
2,789
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, FTR TEXT, foreign key Div references divisionsdivision )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "COUNT", "FROM" ]
8
simple
{ "case_1": [ 715, 969 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 423, 458, 464, 715, 719, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 109, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 230, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 259, 260, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 399, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 507, 509, 510, 511, 512, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 554, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 618, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 665, 666, 667, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 680, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 692, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 707, 710, 711, 712, 714, 715, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 730, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 817, 818, 819, 820, 822, 823, 824, 825, 827, 828, 829, 830, 831, 832, 833, 834, 835, 837, 838, 839, 841, 843, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 903, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 945, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 965, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1019, 1020, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1078, 1079, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1126, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
european_football_1
How many home victories does the Bundesliga division have in more or less than the Premier League division in the 2021 season?
Bundesliga and the Premier League are names of division; home victories refer to FTR = 'H', where H stands for home victory; SUBTRACT(COUNT(FTR = 'H' where season = 2021, name = 'Bundesliga'), COUNT(FTR = 'H' where season = 2021, name = 'Premier League'));
SELECT COUNT(CASE WHEN T2.name = 'Bundesliga' THEN 1 ELSE NULL END) - COUNT(CASE WHEN T2.name = 'Premier League' THEN 1 ELSE NULL END) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T1.FTR = 'H'
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,790
2,790
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, FTR TEXT, season INTEGER, foreign key Div references divisionsdivision )
[ "CASE WHEN", "AS", "AND", "SELECT", "CASE", "NULL", "INNER JOIN", "ON", "COUNT", "FROM" ]
15
medium
{ "case_1": [ 75, 152, 183, 267, 416, 464, 1131 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 423, 458, 464, 715, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 1, 4, 5, 6, 8, 11, 12, 16, 19, 20, 21, 22, 24, 26, 27, 30, 33, 36, 37, 39, 42, 44, 45, 47, 51, 52, 53, 55, 57, 61, 62, 63, 64, 66, 68, 69, 71, 73, 74, 75, 76, 77, 81, 82, 85, 86, 88, 90, 91, 93, 95, 96, 98, 99, 106, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 131, 138, 140, 141, 142, 143, 144, 146, 148, 150, 152, 153, 154, 155, 158, 159, 160, 163, 164, 167, 169, 170, 171, 172, 175, 176, 177, 179, 180, 183, 184, 187, 188, 189, 190, 191, 192, 195, 196, 197, 199, 200, 201, 202, 206, 207, 212, 214, 219, 223, 225, 226, 227, 229, 233, 234, 236, 239, 240, 243, 244, 247, 248, 254, 256, 258, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 282, 296, 298, 299, 300, 301, 303, 304, 305, 311, 314, 315, 316, 317, 319, 320, 322, 323, 325, 330, 334, 335, 336, 338, 339, 341, 344, 345, 347, 349, 354, 356, 358, 360, 361, 364, 368, 370, 373, 374, 375, 376, 382, 383, 384, 385, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 423, 424, 425, 426, 427, 428, 433, 436, 437, 438, 440, 443, 444, 445, 446, 448, 451, 452, 453, 454, 455, 458, 460, 462, 463, 464, 465, 467, 469, 470, 471, 473, 475, 476, 477, 478, 479, 480, 482, 484, 485, 486, 487, 488, 490, 493, 494, 496, 497, 498, 500, 504, 505, 507, 508, 509, 514, 515, 516, 517, 518, 519, 520, 522, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 557, 558, 559, 560, 561, 562, 563, 564, 566, 571, 573, 575, 580, 581, 582, 584, 586, 588, 589, 595, 596, 597, 601, 605, 606, 608, 610, 611, 612, 613, 615, 620, 623, 624, 625, 626, 627, 628, 630, 632, 633, 634, 637, 640, 641, 643, 645, 646, 648, 649, 651, 654, 658, 659, 662, 663, 665, 666, 668, 669, 671, 672, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 693, 694, 696, 697, 699, 702, 705, 706, 710, 712, 714, 715, 721, 723, 724, 726, 727, 733, 734, 735, 736, 739, 740, 741, 743, 744, 746, 747, 749, 750, 752, 753, 754, 756, 758, 760, 762, 763, 765, 767, 768, 769, 772, 773, 775, 776, 777, 778, 779, 780, 783, 787, 788, 790, 793, 795, 796, 797, 798, 799, 800, 802, 804, 805, 806, 807, 808, 810, 812, 813, 814, 818, 819, 824, 825, 827, 829, 830, 832, 835, 837, 838, 839, 841, 844, 848, 849, 851, 853, 857, 858, 859, 860, 861, 866, 867, 868, 870, 871, 873, 874, 876, 877, 878, 879, 880, 886, 888, 892, 893, 894, 895, 896, 897, 898, 901, 902, 905, 907, 909, 911, 912, 915, 917, 918, 922, 923, 924, 926, 927, 928, 930, 931, 932, 934, 935, 941, 943, 944, 949, 950, 951, 953, 954, 956, 958, 959, 961, 963, 969, 974, 975, 977, 981, 985, 986, 991, 993, 996, 998, 1000, 1001, 1005, 1006, 1008, 1010, 1012, 1013, 1015, 1017, 1019, 1022, 1023, 1027, 1031, 1036, 1037, 1039, 1042, 1043, 1044, 1046, 1047, 1048, 1050, 1051, 1058, 1061, 1062, 1063, 1064, 1066, 1067, 1068, 1069, 1071, 1072, 1078, 1080, 1082, 1084, 1086, 1087, 1092, 1094, 1098, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1112, 1115, 1119, 1123, 1124, 1128, 1129, 1131, 1133, 1134, 1135, 1136, 1137 ] }
european_football_1
Please list the home teams in the matches of the Bundesliga division that ended with a home victory in the 2021 season.
Bundesliga is the name of division; home victory refers to refer to FTR = 'H', where H stands for home victory;
SELECT DISTINCT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T1.FTR = 'H' AND T2.name = 'Bundesliga'
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,791
2,791
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, HomeTeam TEXT, FTR TEXT, season INTEGER, foreign key Div references divisionsdivision )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
8
simple
{ "case_1": [ 715, 969 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "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 ] }
european_football_1
Which team had more home victories in the 2021 season's matches of the Bundesliga division, Augsburg or Mainz?
Bundesliga is the name of division; more home victories refer to MAX(FTR = 'H)'; Augsburg and Mainz are names of teams and refer to HomeTeam;
SELECT CASE WHEN COUNT(CASE WHEN T1.HomeTeam = 'Augsburg' THEN 1 ELSE NULL END) - COUNT(CASE WHEN T1.HomeTeam = ' Mainz' THEN 1 ELSE NULL END) > 0 THEN 'Augsburg' ELSE 'Mainz' END FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T1.FTR = 'H'
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,792
2,792
CREATE TABLE `divisions` ( division TEXT not null primary key ) CREATE TABLE `matchs` ( Div TEXT, HomeTeam TEXT, FTR TEXT, season INTEGER, foreign key Div references divisionsdivision )
[ "CASE WHEN", "AS", "AND", "SELECT", "CASE", "NULL", "INNER JOIN", "ON", "COUNT", "FROM" ]
17
challenging
{ "case_1": [ -1 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 423, 458, 464, 715, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 1, 4, 5, 6, 8, 11, 12, 16, 19, 20, 21, 22, 24, 26, 27, 30, 33, 36, 37, 39, 42, 44, 45, 47, 51, 52, 53, 55, 57, 61, 62, 63, 64, 66, 68, 69, 71, 73, 74, 75, 76, 77, 81, 82, 85, 86, 88, 90, 91, 93, 95, 96, 98, 99, 106, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 131, 138, 140, 141, 142, 143, 144, 146, 148, 150, 152, 153, 154, 155, 158, 159, 160, 163, 164, 167, 169, 170, 171, 172, 175, 176, 177, 179, 180, 183, 184, 187, 188, 189, 190, 191, 192, 195, 196, 197, 199, 200, 201, 202, 206, 207, 212, 214, 219, 223, 225, 226, 227, 229, 233, 234, 236, 239, 240, 243, 244, 247, 248, 254, 256, 258, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 282, 296, 298, 299, 300, 301, 303, 304, 305, 311, 314, 315, 316, 317, 319, 320, 322, 323, 325, 330, 334, 335, 336, 338, 339, 341, 344, 345, 347, 349, 354, 356, 358, 360, 361, 364, 368, 370, 373, 374, 375, 376, 382, 383, 384, 385, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 423, 424, 425, 426, 427, 428, 433, 436, 437, 438, 440, 443, 444, 445, 446, 448, 451, 452, 453, 454, 455, 458, 460, 462, 463, 464, 465, 467, 469, 470, 471, 473, 475, 476, 477, 478, 479, 480, 482, 484, 485, 486, 487, 488, 490, 493, 494, 496, 497, 498, 500, 504, 505, 507, 508, 509, 514, 515, 516, 517, 518, 519, 520, 522, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 557, 558, 559, 560, 561, 562, 563, 564, 566, 571, 573, 575, 580, 581, 582, 584, 586, 588, 589, 595, 596, 597, 601, 605, 606, 608, 610, 611, 612, 613, 615, 620, 623, 624, 625, 626, 627, 628, 630, 632, 633, 634, 637, 640, 641, 643, 645, 646, 648, 649, 651, 654, 658, 659, 662, 663, 665, 666, 668, 669, 671, 672, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 693, 694, 696, 697, 699, 702, 705, 706, 710, 712, 714, 715, 721, 723, 724, 726, 727, 733, 734, 735, 736, 739, 740, 741, 743, 744, 746, 747, 749, 750, 752, 753, 754, 756, 758, 760, 762, 763, 765, 767, 768, 769, 772, 773, 775, 776, 777, 778, 779, 780, 783, 787, 788, 790, 793, 795, 796, 797, 798, 799, 800, 802, 804, 805, 806, 807, 808, 810, 812, 813, 814, 818, 819, 824, 825, 827, 829, 830, 832, 835, 837, 838, 839, 841, 844, 848, 849, 851, 853, 857, 858, 859, 860, 861, 866, 867, 868, 870, 871, 873, 874, 876, 877, 878, 879, 880, 886, 888, 892, 893, 894, 895, 896, 897, 898, 901, 902, 905, 907, 909, 911, 912, 915, 917, 918, 922, 923, 924, 926, 927, 928, 930, 931, 932, 934, 935, 941, 943, 944, 949, 950, 951, 953, 954, 956, 958, 959, 961, 963, 969, 974, 975, 977, 981, 985, 986, 991, 993, 996, 998, 1000, 1001, 1005, 1006, 1008, 1010, 1012, 1013, 1015, 1017, 1019, 1022, 1023, 1027, 1031, 1036, 1037, 1039, 1042, 1043, 1044, 1046, 1047, 1048, 1050, 1051, 1058, 1061, 1062, 1063, 1064, 1066, 1067, 1068, 1069, 1071, 1072, 1078, 1080, 1082, 1084, 1086, 1087, 1092, 1094, 1098, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1112, 1115, 1119, 1123, 1124, 1128, 1129, 1131, 1133, 1134, 1135, 1136, 1137 ] }
european_football_1
Which team had the most final-time home-team goals in the 2021 season's matches of the Bundesliga division?
Bundesliga is the name of division; the most final-time home-team goals refers to MAX(FTHG);
SELECT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.season = 2021 ORDER BY T1.FTHG DESC LIMIT 1
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,793
2,793
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, HomeTeam TEXT, FTHG INTEGER, season INTEGER, foreign key Div references divisionsdivision )
[ "AS", "AND", "SELECT", "ORDER BY", "LIMIT", "INNER JOIN", "ON", "DESC", "FROM" ]
10
simple
{ "case_1": [ 715, 969 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 464, 715, 719, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "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, 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, 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 ] }
european_football_1
How many final-time home-team goals were there in total in all the matches of the Bundesliga division in the 2021 season?
Bundesliga is the name of division; final-time home-team goals refers to FTHG;
SELECT SUM(T1.FTHG) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.season = 2021
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,794
2,794
CREATE TABLE `divisions` ( division TEXT not null primary key, name TEXT ) CREATE TABLE `matchs` ( Div TEXT, FTHG INTEGER, season INTEGER, foreign key Div references divisionsdivision )
[ "AS", "AND", "SELECT", "SUM", "INNER JOIN", "ON", "FROM" ]
8
simple
{ "case_1": [ 715, 969 ], "case_2": [ 75, 152, 183, 267, 416, 464, 715, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 464, 715, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "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, 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, 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, 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, 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, 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 ] }
european_football_1
What's the winning rate of Club Brugge in the 2021 Premier League?
Premier League is name of division; season = 2021; Club Brugge is name of team; Club Brugge wins implies HomeTeam = 'Club Brugge' and FTR = 'H' and AwayTeam = 'Club Brugge' and FTR = 'A'; DIVIDE(SUM(COUNT(FTR = 'H' where HomeTeam = 'Club Brugge', name = 'Premier League', season = 2021), COUNT(FTR = 'A'where AwayTeam = 'Club Brugge', name = 'Premier League', season = 2021)), COUNT(Div where name = 'Premier League', season = 2021));
SELECT CAST(COUNT(CASE WHEN T1.FTR = 'H' THEN 1 ELSE NULL END) + COUNT(CASE WHEN T1.FTR = 'A' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(t1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T1.AwayTeam = 'Club Brugge' OR T1.HomeTeam = 'Club Brugge'
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, foreign key (Div) references divisions(division) )
na
2,795
2,795
CREATE TABLE `divisions` ( division TEXT not null primary key ) CREATE TABLE `matchs` ( Div TEXT, HomeTeam TEXT, AwayTeam TEXT, FTR TEXT, season INTEGER, foreign key Div references divisionsdivision )
[ "CASE WHEN", "OR", "AND", "SELECT", "AS", "CASE", "NULL", "INNER JOIN", "ON", "CAST", "COUNT", "FROM" ]
19
challenging
{ "case_1": [ -1 ], "case_2": [ 75, 152, 183, 267, 416, 464, 969, 1131 ], "case_3": [ 75, 152, 183, 267, 416, 423, 458, 464, 795, 969, 1131 ], "case_4": [ 75, 152, 183, 267, 326, 362, 416, 423, 458, 464, 715, 719, 795, 969, 1040, 1131 ], "case_5": [ 0, 4, 6, 16, 20, 22, 24, 30, 37, 42, 47, 51, 53, 61, 63, 64, 68, 69, 71, 73, 74, 75, 77, 81, 88, 93, 96, 98, 106, 113, 115, 117, 118, 119, 120, 125, 126, 127, 129, 131, 138, 142, 143, 146, 148, 152, 153, 155, 158, 160, 164, 169, 170, 171, 175, 183, 184, 187, 191, 192, 195, 197, 200, 201, 207, 212, 214, 219, 223, 225, 226, 227, 234, 236, 244, 248, 254, 256, 258, 261, 264, 267, 268, 271, 276, 277, 278, 279, 298, 299, 300, 301, 304, 314, 316, 317, 319, 322, 323, 325, 330, 335, 339, 341, 347, 360, 370, 374, 375, 382, 383, 391, 393, 395, 398, 402, 403, 406, 409, 412, 415, 416, 417, 423, 424, 426, 427, 436, 438, 444, 448, 451, 452, 453, 458, 464, 469, 476, 477, 478, 479, 485, 486, 487, 490, 493, 500, 504, 514, 515, 516, 517, 518, 519, 520, 522, 526, 528, 533, 535, 537, 540, 544, 547, 550, 558, 559, 560, 563, 564, 571, 573, 575, 580, 581, 582, 589, 595, 597, 608, 613, 620, 623, 627, 628, 632, 633, 637, 640, 641, 646, 658, 662, 663, 666, 668, 671, 672, 676, 682, 686, 687, 690, 706, 710, 712, 714, 723, 727, 734, 735, 739, 740, 743, 744, 747, 749, 750, 753, 756, 760, 762, 768, 772, 776, 787, 788, 795, 796, 797, 798, 799, 800, 802, 804, 805, 808, 810, 813, 814, 819, 824, 827, 829, 830, 832, 838, 841, 844, 848, 849, 851, 853, 867, 868, 870, 871, 874, 877, 880, 886, 888, 894, 896, 898, 902, 909, 912, 917, 922, 923, 924, 926, 927, 930, 935, 941, 943, 944, 954, 956, 958, 959, 961, 969, 975, 985, 986, 996, 998, 1008, 1012, 1022, 1023, 1042, 1058, 1062, 1064, 1066, 1067, 1069, 1071, 1072, 1078, 1082, 1084, 1086, 1087, 1092, 1098, 1100, 1101, 1103, 1104, 1119, 1123, 1128, 1131, 1133, 1134, 1135 ] }
professional_basketball
Among the winning game from the team, what is the percentage of the winning was home game.
percentage of winning at the home = Divide(homeWon, won) * 100
SELECT CAST(homeWon AS REAL) * 100 / won FROM teams
CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) )
CREATE TABLE awards_players ( playerID TEXT not null, award TEXT not null, year INTEGER not null, lgID TEXT null, note TEXT null, pos TEXT null, primary key (playerID, year, award), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE coaches ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, lgID TEXT null, stint INTEGER not null, won INTEGER null, lost INTEGER null, post_wins INTEGER null, post_losses INTEGER null, primary key (coachID, year, tmID, stint), foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE draft ( id INTEGER default 0 not null primary key, draftYear INTEGER null, draftRound INTEGER null, draftSelection INTEGER null, draftOverall INTEGER null, tmID TEXT null, firstName TEXT null, lastName TEXT null, suffixName TEXT null, playerID TEXT null, draftFrom TEXT null, lgID TEXT null, foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE player_allstar ( playerID TEXT not null, last_name TEXT null, first_name TEXT null, season_id INTEGER not null, conference TEXT null, league_id TEXT null, games_played INTEGER null, minutes INTEGER null, points INTEGER null, o_rebounds INTEGER null, d_rebounds INTEGER null, rebounds INTEGER null, assists INTEGER null, steals INTEGER null, blocks INTEGER null, turnovers INTEGER null, personal_fouls INTEGER null, fg_attempted INTEGER null, fg_made INTEGER null, ft_attempted INTEGER null, ft_made INTEGER null, three_attempted INTEGER null, three_made INTEGER null, primary key (playerID, season_id), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE players ( playerID TEXT not null primary key, useFirst TEXT null, firstName TEXT null, middleName TEXT null, lastName TEXT null, nameGiven TEXT null, fullGivenName TEXT null, nameSuffix TEXT null, nameNick TEXT null, pos TEXT null, firstseason INTEGER null, lastseason INTEGER null, height REAL null, weight INTEGER null, college TEXT null, collegeOther TEXT null, birthDate DATE null, birthCity TEXT null, birthState TEXT null, birthCountry TEXT null, highSchool TEXT null, hsCity TEXT null, hsState TEXT null, hsCountry TEXT null, deathDate DATE null, race TEXT null ) CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) ) CREATE TABLE "awards_coaches" ( id INTEGER primary key autoincrement, year INTEGER, coachID TEXT, award TEXT, lgID TEXT, note TEXT, foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade ) CREATE TABLE sqlite_sequence(name,seq) CREATE TABLE "players_teams" ( id INTEGER primary key autoincrement, playerID TEXT not null references players on update cascade on delete cascade, year INTEGER, stint INTEGER, tmID TEXT, lgID TEXT, GP INTEGER, GS INTEGER, minutes INTEGER, points INTEGER, oRebounds INTEGER, dRebounds INTEGER, rebounds INTEGER, assists INTEGER, steals INTEGER, blocks INTEGER, turnovers INTEGER, PF INTEGER, fgAttempted INTEGER, fgMade INTEGER, ftAttempted INTEGER, ftMade INTEGER, threeAttempted INTEGER, threeMade INTEGER, PostGP INTEGER, PostGS INTEGER, PostMinutes INTEGER, PostPoints INTEGER, PostoRebounds INTEGER, PostdRebounds INTEGER, PostRebounds INTEGER, PostAssists INTEGER, PostSteals INTEGER, PostBlocks INTEGER, PostTurnovers INTEGER, PostPF INTEGER, PostfgAttempted INTEGER, PostfgMade INTEGER, PostftAttempted INTEGER, PostftMade INTEGER, PostthreeAttempted INTEGER, PostthreeMade INTEGER, note TEXT, foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE "series_post" ( id INTEGER primary key autoincrement, year INTEGER, round TEXT, series TEXT, tmIDWinner TEXT, lgIDWinner TEXT, tmIDLoser TEXT, lgIDLoser TEXT, W INTEGER, L INTEGER, foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade, foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade )
na
2,796
2,796
CREATE TABLE `teams` ( homeWon INTEGER null, awayWon INTEGER null, -- neutWon int null, -- confWon int null, -- divWon int null, won INTEGER null )
[ "AS", "SELECT", "FROM", "CAST" ]
4
simple
{ "case_1": [ -1 ], "case_2": [ 278 ], "case_3": [ 10, 39, 62, 169, 241, 278, 318, 364, 414, 463, 482, 838, 927, 998, 1004, 1051, 1060, 1072, 1109 ], "case_4": [ 10, 39, 62, 169, 241, 278, 285, 318, 364, 399, 414, 463, 482, 622, 656, 838, 927, 998, 1004, 1051, 1060, 1072, 1109 ], "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 ] }
professional_basketball
Which team(s) has greater than 75% lost among all the games played.
greater than 75% lost refers to Divide(lost, games) > 0.75; team refers to tmID
SELECT name FROM teams WHERE CAST(lost AS REAL) * 100 / games > 75
CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) )
CREATE TABLE awards_players ( playerID TEXT not null, award TEXT not null, year INTEGER not null, lgID TEXT null, note TEXT null, pos TEXT null, primary key (playerID, year, award), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE coaches ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, lgID TEXT null, stint INTEGER not null, won INTEGER null, lost INTEGER null, post_wins INTEGER null, post_losses INTEGER null, primary key (coachID, year, tmID, stint), foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE draft ( id INTEGER default 0 not null primary key, draftYear INTEGER null, draftRound INTEGER null, draftSelection INTEGER null, draftOverall INTEGER null, tmID TEXT null, firstName TEXT null, lastName TEXT null, suffixName TEXT null, playerID TEXT null, draftFrom TEXT null, lgID TEXT null, foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE player_allstar ( playerID TEXT not null, last_name TEXT null, first_name TEXT null, season_id INTEGER not null, conference TEXT null, league_id TEXT null, games_played INTEGER null, minutes INTEGER null, points INTEGER null, o_rebounds INTEGER null, d_rebounds INTEGER null, rebounds INTEGER null, assists INTEGER null, steals INTEGER null, blocks INTEGER null, turnovers INTEGER null, personal_fouls INTEGER null, fg_attempted INTEGER null, fg_made INTEGER null, ft_attempted INTEGER null, ft_made INTEGER null, three_attempted INTEGER null, three_made INTEGER null, primary key (playerID, season_id), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE players ( playerID TEXT not null primary key, useFirst TEXT null, firstName TEXT null, middleName TEXT null, lastName TEXT null, nameGiven TEXT null, fullGivenName TEXT null, nameSuffix TEXT null, nameNick TEXT null, pos TEXT null, firstseason INTEGER null, lastseason INTEGER null, height REAL null, weight INTEGER null, college TEXT null, collegeOther TEXT null, birthDate DATE null, birthCity TEXT null, birthState TEXT null, birthCountry TEXT null, highSchool TEXT null, hsCity TEXT null, hsState TEXT null, hsCountry TEXT null, deathDate DATE null, race TEXT null ) CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) ) CREATE TABLE "awards_coaches" ( id INTEGER primary key autoincrement, year INTEGER, coachID TEXT, award TEXT, lgID TEXT, note TEXT, foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade ) CREATE TABLE sqlite_sequence(name,seq) CREATE TABLE "players_teams" ( id INTEGER primary key autoincrement, playerID TEXT not null references players on update cascade on delete cascade, year INTEGER, stint INTEGER, tmID TEXT, lgID TEXT, GP INTEGER, GS INTEGER, minutes INTEGER, points INTEGER, oRebounds INTEGER, dRebounds INTEGER, rebounds INTEGER, assists INTEGER, steals INTEGER, blocks INTEGER, turnovers INTEGER, PF INTEGER, fgAttempted INTEGER, fgMade INTEGER, ftAttempted INTEGER, ftMade INTEGER, threeAttempted INTEGER, threeMade INTEGER, PostGP INTEGER, PostGS INTEGER, PostMinutes INTEGER, PostPoints INTEGER, PostoRebounds INTEGER, PostdRebounds INTEGER, PostRebounds INTEGER, PostAssists INTEGER, PostSteals INTEGER, PostBlocks INTEGER, PostTurnovers INTEGER, PostPF INTEGER, PostfgAttempted INTEGER, PostfgMade INTEGER, PostftAttempted INTEGER, PostftMade INTEGER, PostthreeAttempted INTEGER, PostthreeMade INTEGER, note TEXT, foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE "series_post" ( id INTEGER primary key autoincrement, year INTEGER, round TEXT, series TEXT, tmIDWinner TEXT, lgIDWinner TEXT, tmIDLoser TEXT, lgIDLoser TEXT, W INTEGER, L INTEGER, foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade, foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade )
na
2,797
2,797
CREATE TABLE `teams` ( name TEXT null, homeLost INTEGER null, awayLost INTEGER null, lost INTEGER null, games INTEGER null )
[ "AS", "SELECT", "FROM", "CAST" ]
4
simple
{ "case_1": [ -1 ], "case_2": [ 278 ], "case_3": [ 10, 39, 62, 169, 241, 278, 318, 364, 414, 463, 482, 838, 927, 998, 1004, 1051, 1060, 1072, 1109 ], "case_4": [ 10, 39, 62, 169, 241, 278, 285, 318, 364, 399, 414, 463, 482, 622, 656, 838, 927, 998, 1004, 1051, 1060, 1072, 1109 ], "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 ] }
professional_basketball
List the team name and the total wins of the team in year 2005 which has greater winning from the previous year.
2005 refers to year = 2005 ; previous year refers to year = 2004; team with greater winning than previous year refers to Won where year = 2005 > Won where year = 2004; team name refers to tmID
SELECT T1.name, T1.won FROM teams AS T1 INNER JOIN ( SELECT * FROM teams WHERE year = 2004 ) AS T2 on T1.tmID = T2.tmID WHERE T1.year = 2005 and T1.won > T2.won
CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) )
CREATE TABLE awards_players ( playerID TEXT not null, award TEXT not null, year INTEGER not null, lgID TEXT null, note TEXT null, pos TEXT null, primary key (playerID, year, award), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE coaches ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, lgID TEXT null, stint INTEGER not null, won INTEGER null, lost INTEGER null, post_wins INTEGER null, post_losses INTEGER null, primary key (coachID, year, tmID, stint), foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE draft ( id INTEGER default 0 not null primary key, draftYear INTEGER null, draftRound INTEGER null, draftSelection INTEGER null, draftOverall INTEGER null, tmID TEXT null, firstName TEXT null, lastName TEXT null, suffixName TEXT null, playerID TEXT null, draftFrom TEXT null, lgID TEXT null, foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE player_allstar ( playerID TEXT not null, last_name TEXT null, first_name TEXT null, season_id INTEGER not null, conference TEXT null, league_id TEXT null, games_played INTEGER null, minutes INTEGER null, points INTEGER null, o_rebounds INTEGER null, d_rebounds INTEGER null, rebounds INTEGER null, assists INTEGER null, steals INTEGER null, blocks INTEGER null, turnovers INTEGER null, personal_fouls INTEGER null, fg_attempted INTEGER null, fg_made INTEGER null, ft_attempted INTEGER null, ft_made INTEGER null, three_attempted INTEGER null, three_made INTEGER null, primary key (playerID, season_id), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE players ( playerID TEXT not null primary key, useFirst TEXT null, firstName TEXT null, middleName TEXT null, lastName TEXT null, nameGiven TEXT null, fullGivenName TEXT null, nameSuffix TEXT null, nameNick TEXT null, pos TEXT null, firstseason INTEGER null, lastseason INTEGER null, height REAL null, weight INTEGER null, college TEXT null, collegeOther TEXT null, birthDate DATE null, birthCity TEXT null, birthState TEXT null, birthCountry TEXT null, highSchool TEXT null, hsCity TEXT null, hsState TEXT null, hsCountry TEXT null, deathDate DATE null, race TEXT null ) CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) ) CREATE TABLE "awards_coaches" ( id INTEGER primary key autoincrement, year INTEGER, coachID TEXT, award TEXT, lgID TEXT, note TEXT, foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade ) CREATE TABLE sqlite_sequence(name,seq) CREATE TABLE "players_teams" ( id INTEGER primary key autoincrement, playerID TEXT not null references players on update cascade on delete cascade, year INTEGER, stint INTEGER, tmID TEXT, lgID TEXT, GP INTEGER, GS INTEGER, minutes INTEGER, points INTEGER, oRebounds INTEGER, dRebounds INTEGER, rebounds INTEGER, assists INTEGER, steals INTEGER, blocks INTEGER, turnovers INTEGER, PF INTEGER, fgAttempted INTEGER, fgMade INTEGER, ftAttempted INTEGER, ftMade INTEGER, threeAttempted INTEGER, threeMade INTEGER, PostGP INTEGER, PostGS INTEGER, PostMinutes INTEGER, PostPoints INTEGER, PostoRebounds INTEGER, PostdRebounds INTEGER, PostRebounds INTEGER, PostAssists INTEGER, PostSteals INTEGER, PostBlocks INTEGER, PostTurnovers INTEGER, PostPF INTEGER, PostfgAttempted INTEGER, PostfgMade INTEGER, PostftAttempted INTEGER, PostftMade INTEGER, PostthreeAttempted INTEGER, PostthreeMade INTEGER, note TEXT, foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE "series_post" ( id INTEGER primary key autoincrement, year INTEGER, round TEXT, series TEXT, tmIDWinner TEXT, lgIDWinner TEXT, tmIDLoser TEXT, lgIDLoser TEXT, W INTEGER, L INTEGER, foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade, foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade )
na
2,798
2,798
CREATE TABLE `teams` ( year INTEGER not null, tmID TEXT not null, name TEXT null, homeWon INTEGER null, awayWon INTEGER null, -- neutWon int null, -- confWon int null, -- divWon int null, won INTEGER null, -- bbtmID varchar255 null, primary key year, tmID )
[ "AS", "on", "SELECT", "and", "INNER JOIN", "FROM" ]
9
simple
{ "case_1": [ -1 ], "case_2": [ 278 ], "case_3": [ 39, 62, 169, 241, 278, 318, 364, 414, 463, 482, 838, 927, 1051, 1060, 1072, 1109 ], "case_4": [ 10, 39, 62, 169, 241, 278, 285, 318, 364, 399, 414, 463, 482, 622, 656, 838, 927, 998, 1004, 1051, 1060, 1072, 1109 ], "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, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 913, 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, 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 ] }
professional_basketball
For team who has more home won than home lost more than 80%, list the team name and the offense points.
home won than home lost more than 80% refers to Divide(Subtract(homeWon, homeLost), games) > 0.8; offense point refers to o_fgm
SELECT name, o_pts FROM teams WHERE CAST((homeWon - homeLost) AS REAL) * 100 / games > 80
CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) )
CREATE TABLE awards_players ( playerID TEXT not null, award TEXT not null, year INTEGER not null, lgID TEXT null, note TEXT null, pos TEXT null, primary key (playerID, year, award), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE coaches ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, lgID TEXT null, stint INTEGER not null, won INTEGER null, lost INTEGER null, post_wins INTEGER null, post_losses INTEGER null, primary key (coachID, year, tmID, stint), foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE draft ( id INTEGER default 0 not null primary key, draftYear INTEGER null, draftRound INTEGER null, draftSelection INTEGER null, draftOverall INTEGER null, tmID TEXT null, firstName TEXT null, lastName TEXT null, suffixName TEXT null, playerID TEXT null, draftFrom TEXT null, lgID TEXT null, foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE player_allstar ( playerID TEXT not null, last_name TEXT null, first_name TEXT null, season_id INTEGER not null, conference TEXT null, league_id TEXT null, games_played INTEGER null, minutes INTEGER null, points INTEGER null, o_rebounds INTEGER null, d_rebounds INTEGER null, rebounds INTEGER null, assists INTEGER null, steals INTEGER null, blocks INTEGER null, turnovers INTEGER null, personal_fouls INTEGER null, fg_attempted INTEGER null, fg_made INTEGER null, ft_attempted INTEGER null, ft_made INTEGER null, three_attempted INTEGER null, three_made INTEGER null, primary key (playerID, season_id), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE players ( playerID TEXT not null primary key, useFirst TEXT null, firstName TEXT null, middleName TEXT null, lastName TEXT null, nameGiven TEXT null, fullGivenName TEXT null, nameSuffix TEXT null, nameNick TEXT null, pos TEXT null, firstseason INTEGER null, lastseason INTEGER null, height REAL null, weight INTEGER null, college TEXT null, collegeOther TEXT null, birthDate DATE null, birthCity TEXT null, birthState TEXT null, birthCountry TEXT null, highSchool TEXT null, hsCity TEXT null, hsState TEXT null, hsCountry TEXT null, deathDate DATE null, race TEXT null ) CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) ) CREATE TABLE "awards_coaches" ( id INTEGER primary key autoincrement, year INTEGER, coachID TEXT, award TEXT, lgID TEXT, note TEXT, foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade ) CREATE TABLE sqlite_sequence(name,seq) CREATE TABLE "players_teams" ( id INTEGER primary key autoincrement, playerID TEXT not null references players on update cascade on delete cascade, year INTEGER, stint INTEGER, tmID TEXT, lgID TEXT, GP INTEGER, GS INTEGER, minutes INTEGER, points INTEGER, oRebounds INTEGER, dRebounds INTEGER, rebounds INTEGER, assists INTEGER, steals INTEGER, blocks INTEGER, turnovers INTEGER, PF INTEGER, fgAttempted INTEGER, fgMade INTEGER, ftAttempted INTEGER, ftMade INTEGER, threeAttempted INTEGER, threeMade INTEGER, PostGP INTEGER, PostGS INTEGER, PostMinutes INTEGER, PostPoints INTEGER, PostoRebounds INTEGER, PostdRebounds INTEGER, PostRebounds INTEGER, PostAssists INTEGER, PostSteals INTEGER, PostBlocks INTEGER, PostTurnovers INTEGER, PostPF INTEGER, PostfgAttempted INTEGER, PostfgMade INTEGER, PostftAttempted INTEGER, PostftMade INTEGER, PostthreeAttempted INTEGER, PostthreeMade INTEGER, note TEXT, foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE "series_post" ( id INTEGER primary key autoincrement, year INTEGER, round TEXT, series TEXT, tmIDWinner TEXT, lgIDWinner TEXT, tmIDLoser TEXT, lgIDLoser TEXT, W INTEGER, L INTEGER, foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade, foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade )
na
2,799
2,799
CREATE TABLE `teams` ( name TEXT null, o_pts INTEGER null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- confWon int null, -- divWon int null, won INTEGER null, lost INTEGER null, games INTEGER null )
[ "AS", "SELECT", "FROM", "CAST" ]
4
simple
{ "case_1": [ -1 ], "case_2": [ 278 ], "case_3": [ 10, 39, 62, 169, 241, 278, 318, 364, 414, 463, 482, 838, 927, 998, 1004, 1051, 1060, 1072, 1109 ], "case_4": [ 10, 39, 62, 169, 241, 278, 285, 318, 364, 399, 414, 463, 482, 622, 656, 838, 927, 998, 1004, 1051, 1060, 1072, 1109 ], "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 ] }
professional_basketball
What is the percentage of the teams who had post season (playoff) were ranked number 1?
had post season (play off) refers to playoff is not null; percentage = Divide (Count(Team where rank = 1, Count(Team))) * 100
SELECT CAST(SUM(CASE WHEN rank = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(name) FROM teams
CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) )
CREATE TABLE awards_players ( playerID TEXT not null, award TEXT not null, year INTEGER not null, lgID TEXT null, note TEXT null, pos TEXT null, primary key (playerID, year, award), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE coaches ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, lgID TEXT null, stint INTEGER not null, won INTEGER null, lost INTEGER null, post_wins INTEGER null, post_losses INTEGER null, primary key (coachID, year, tmID, stint), foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE draft ( id INTEGER default 0 not null primary key, draftYear INTEGER null, draftRound INTEGER null, draftSelection INTEGER null, draftOverall INTEGER null, tmID TEXT null, firstName TEXT null, lastName TEXT null, suffixName TEXT null, playerID TEXT null, draftFrom TEXT null, lgID TEXT null, foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE player_allstar ( playerID TEXT not null, last_name TEXT null, first_name TEXT null, season_id INTEGER not null, conference TEXT null, league_id TEXT null, games_played INTEGER null, minutes INTEGER null, points INTEGER null, o_rebounds INTEGER null, d_rebounds INTEGER null, rebounds INTEGER null, assists INTEGER null, steals INTEGER null, blocks INTEGER null, turnovers INTEGER null, personal_fouls INTEGER null, fg_attempted INTEGER null, fg_made INTEGER null, ft_attempted INTEGER null, ft_made INTEGER null, three_attempted INTEGER null, three_made INTEGER null, primary key (playerID, season_id), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE players ( playerID TEXT not null primary key, useFirst TEXT null, firstName TEXT null, middleName TEXT null, lastName TEXT null, nameGiven TEXT null, fullGivenName TEXT null, nameSuffix TEXT null, nameNick TEXT null, pos TEXT null, firstseason INTEGER null, lastseason INTEGER null, height REAL null, weight INTEGER null, college TEXT null, collegeOther TEXT null, birthDate DATE null, birthCity TEXT null, birthState TEXT null, birthCountry TEXT null, highSchool TEXT null, hsCity TEXT null, hsState TEXT null, hsCountry TEXT null, deathDate DATE null, race TEXT null ) CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) ) CREATE TABLE "awards_coaches" ( id INTEGER primary key autoincrement, year INTEGER, coachID TEXT, award TEXT, lgID TEXT, note TEXT, foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade ) CREATE TABLE sqlite_sequence(name,seq) CREATE TABLE "players_teams" ( id INTEGER primary key autoincrement, playerID TEXT not null references players on update cascade on delete cascade, year INTEGER, stint INTEGER, tmID TEXT, lgID TEXT, GP INTEGER, GS INTEGER, minutes INTEGER, points INTEGER, oRebounds INTEGER, dRebounds INTEGER, rebounds INTEGER, assists INTEGER, steals INTEGER, blocks INTEGER, turnovers INTEGER, PF INTEGER, fgAttempted INTEGER, fgMade INTEGER, ftAttempted INTEGER, ftMade INTEGER, threeAttempted INTEGER, threeMade INTEGER, PostGP INTEGER, PostGS INTEGER, PostMinutes INTEGER, PostPoints INTEGER, PostoRebounds INTEGER, PostdRebounds INTEGER, PostRebounds INTEGER, PostAssists INTEGER, PostSteals INTEGER, PostBlocks INTEGER, PostTurnovers INTEGER, PostPF INTEGER, PostfgAttempted INTEGER, PostfgMade INTEGER, PostftAttempted INTEGER, PostftMade INTEGER, PostthreeAttempted INTEGER, PostthreeMade INTEGER, note TEXT, foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE "series_post" ( id INTEGER primary key autoincrement, year INTEGER, round TEXT, series TEXT, tmIDWinner TEXT, lgIDWinner TEXT, tmIDLoser TEXT, lgIDLoser TEXT, W INTEGER, L INTEGER, foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade, foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade )
na
2,800
2,800
CREATE TABLE `teams` ( `rank` INTEGER null, confRank INTEGER null, name TEXT null )
[ "CASE WHEN", "AS", "SELECT", "SUM", "CASE", "CAST", "COUNT", "FROM" ]
8
simple
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 169, 998, 1072 ], "case_4": [ 10, 39, 62, 169, 241, 278, 285, 318, 364, 399, 414, 463, 482, 622, 656, 838, 927, 998, 1004, 1051, 1060, 1072, 1109 ], "case_5": [ 0, 6, 16, 24, 35, 42, 54, 61, 64, 71, 77, 81, 87, 93, 104, 106, 113, 119, 120, 122, 127, 129, 148, 152, 153, 155, 169, 173, 184, 189, 191, 192, 195, 201, 205, 207, 212, 215, 219, 223, 225, 226, 234, 236, 245, 248, 254, 261, 264, 267, 271, 279, 299, 300, 303, 304, 316, 317, 322, 323, 335, 347, 360, 375, 380, 383, 393, 402, 406, 409, 412, 415, 423, 427, 438, 443, 448, 452, 453, 458, 476, 478, 483, 485, 486, 487, 488, 500, 504, 508, 510, 514, 517, 518, 527, 535, 537, 540, 547, 550, 560, 563, 564, 571, 573, 575, 580, 581, 597, 620, 623, 628, 630, 640, 646, 658, 661, 662, 666, 676, 682, 686, 690, 709, 710, 723, 740, 744, 747, 750, 753, 762, 772, 776, 787, 788, 795, 796, 798, 800, 802, 808, 810, 813, 827, 832, 841, 848, 868, 870, 871, 872, 874, 894, 896, 898, 909, 912, 913, 922, 924, 926, 939, 941, 943, 944, 958, 959, 979, 985, 998, 1008, 1012, 1023, 1036, 1048, 1062, 1064, 1069, 1070, 1072, 1078, 1082, 1087, 1092, 1093, 1098, 1100, 1110, 1121, 1128, 1129, 1131, 1133, 1134, 1135 ] }
professional_basketball
Who is the coach for 'BOS' team in year 1950. List the coach ID together with the number of game won and lost.
'BOS' is the tmID; 1950 refers to year = 1950; number of game won refers to won; number of game lost refers to lost
SELECT coachID, won, lost FROM coaches WHERE year = 1950 AND tmID = 'BOS'
CREATE TABLE coaches ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, lgID TEXT null, stint INTEGER not null, won INTEGER null, lost INTEGER null, post_wins INTEGER null, post_losses INTEGER null, primary key (coachID, year, tmID, stint), foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade )
CREATE TABLE awards_players ( playerID TEXT not null, award TEXT not null, year INTEGER not null, lgID TEXT null, note TEXT null, pos TEXT null, primary key (playerID, year, award), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE coaches ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, lgID TEXT null, stint INTEGER not null, won INTEGER null, lost INTEGER null, post_wins INTEGER null, post_losses INTEGER null, primary key (coachID, year, tmID, stint), foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE draft ( id INTEGER default 0 not null primary key, draftYear INTEGER null, draftRound INTEGER null, draftSelection INTEGER null, draftOverall INTEGER null, tmID TEXT null, firstName TEXT null, lastName TEXT null, suffixName TEXT null, playerID TEXT null, draftFrom TEXT null, lgID TEXT null, foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE player_allstar ( playerID TEXT not null, last_name TEXT null, first_name TEXT null, season_id INTEGER not null, conference TEXT null, league_id TEXT null, games_played INTEGER null, minutes INTEGER null, points INTEGER null, o_rebounds INTEGER null, d_rebounds INTEGER null, rebounds INTEGER null, assists INTEGER null, steals INTEGER null, blocks INTEGER null, turnovers INTEGER null, personal_fouls INTEGER null, fg_attempted INTEGER null, fg_made INTEGER null, ft_attempted INTEGER null, ft_made INTEGER null, three_attempted INTEGER null, three_made INTEGER null, primary key (playerID, season_id), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE players ( playerID TEXT not null primary key, useFirst TEXT null, firstName TEXT null, middleName TEXT null, lastName TEXT null, nameGiven TEXT null, fullGivenName TEXT null, nameSuffix TEXT null, nameNick TEXT null, pos TEXT null, firstseason INTEGER null, lastseason INTEGER null, height REAL null, weight INTEGER null, college TEXT null, collegeOther TEXT null, birthDate DATE null, birthCity TEXT null, birthState TEXT null, birthCountry TEXT null, highSchool TEXT null, hsCity TEXT null, hsState TEXT null, hsCountry TEXT null, deathDate DATE null, race TEXT null ) CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) ) CREATE TABLE "awards_coaches" ( id INTEGER primary key autoincrement, year INTEGER, coachID TEXT, award TEXT, lgID TEXT, note TEXT, foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade ) CREATE TABLE sqlite_sequence(name,seq) CREATE TABLE "players_teams" ( id INTEGER primary key autoincrement, playerID TEXT not null references players on update cascade on delete cascade, year INTEGER, stint INTEGER, tmID TEXT, lgID TEXT, GP INTEGER, GS INTEGER, minutes INTEGER, points INTEGER, oRebounds INTEGER, dRebounds INTEGER, rebounds INTEGER, assists INTEGER, steals INTEGER, blocks INTEGER, turnovers INTEGER, PF INTEGER, fgAttempted INTEGER, fgMade INTEGER, ftAttempted INTEGER, ftMade INTEGER, threeAttempted INTEGER, threeMade INTEGER, PostGP INTEGER, PostGS INTEGER, PostMinutes INTEGER, PostPoints INTEGER, PostoRebounds INTEGER, PostdRebounds INTEGER, PostRebounds INTEGER, PostAssists INTEGER, PostSteals INTEGER, PostBlocks INTEGER, PostTurnovers INTEGER, PostPF INTEGER, PostfgAttempted INTEGER, PostfgMade INTEGER, PostftAttempted INTEGER, PostftMade INTEGER, PostthreeAttempted INTEGER, PostthreeMade INTEGER, note TEXT, foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE "series_post" ( id INTEGER primary key autoincrement, year INTEGER, round TEXT, series TEXT, tmIDWinner TEXT, lgIDWinner TEXT, tmIDLoser TEXT, lgIDLoser TEXT, W INTEGER, L INTEGER, foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade, foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade )
na
2,801
2,801
CREATE TABLE `coaches` ( coachID TEXT not null, tmID TEXT not null, won INTEGER null, lost INTEGER null, primary key coachID, tmID, foreign key tmID, year references teams tmID )
[ "AND", "SELECT", "FROM" ]
3
simple
{ "case_1": [ 1004 ], "case_2": [ 1004 ], "case_3": [ 10, 39, 62, 169, 241, 278, 285, 318, 364, 399, 414, 463, 482, 622, 656, 838, 927, 998, 1004, 1051, 1060, 1072, 1109 ], "case_4": [ 10, 39, 62, 169, 241, 278, 285, 318, 364, 399, 414, 463, 482, 622, 656, 838, 927, 998, 1004, 1051, 1060, 1072, 1109 ], "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 ] }
professional_basketball
Who is the longest serving coach from year 1970 to 1980. List the coach ID and the team(s) he served.
1970 to 1980 refers to year between 1970 and 1980; longest serving coach Max(Count(coachID)); team(s) he served refers to tmID
SELECT coachID, tmID FROM coaches WHERE year BETWEEN 1970 AND 1980 ORDER BY stint DESC LIMIT 1
CREATE TABLE coaches ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, lgID TEXT null, stint INTEGER not null, won INTEGER null, lost INTEGER null, post_wins INTEGER null, post_losses INTEGER null, primary key (coachID, year, tmID, stint), foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade )
CREATE TABLE awards_players ( playerID TEXT not null, award TEXT not null, year INTEGER not null, lgID TEXT null, note TEXT null, pos TEXT null, primary key (playerID, year, award), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE coaches ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, lgID TEXT null, stint INTEGER not null, won INTEGER null, lost INTEGER null, post_wins INTEGER null, post_losses INTEGER null, primary key (coachID, year, tmID, stint), foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE draft ( id INTEGER default 0 not null primary key, draftYear INTEGER null, draftRound INTEGER null, draftSelection INTEGER null, draftOverall INTEGER null, tmID TEXT null, firstName TEXT null, lastName TEXT null, suffixName TEXT null, playerID TEXT null, draftFrom TEXT null, lgID TEXT null, foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE player_allstar ( playerID TEXT not null, last_name TEXT null, first_name TEXT null, season_id INTEGER not null, conference TEXT null, league_id TEXT null, games_played INTEGER null, minutes INTEGER null, points INTEGER null, o_rebounds INTEGER null, d_rebounds INTEGER null, rebounds INTEGER null, assists INTEGER null, steals INTEGER null, blocks INTEGER null, turnovers INTEGER null, personal_fouls INTEGER null, fg_attempted INTEGER null, fg_made INTEGER null, ft_attempted INTEGER null, ft_made INTEGER null, three_attempted INTEGER null, three_made INTEGER null, primary key (playerID, season_id), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE players ( playerID TEXT not null primary key, useFirst TEXT null, firstName TEXT null, middleName TEXT null, lastName TEXT null, nameGiven TEXT null, fullGivenName TEXT null, nameSuffix TEXT null, nameNick TEXT null, pos TEXT null, firstseason INTEGER null, lastseason INTEGER null, height REAL null, weight INTEGER null, college TEXT null, collegeOther TEXT null, birthDate DATE null, birthCity TEXT null, birthState TEXT null, birthCountry TEXT null, highSchool TEXT null, hsCity TEXT null, hsState TEXT null, hsCountry TEXT null, deathDate DATE null, race TEXT null ) CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) ) CREATE TABLE "awards_coaches" ( id INTEGER primary key autoincrement, year INTEGER, coachID TEXT, award TEXT, lgID TEXT, note TEXT, foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade ) CREATE TABLE sqlite_sequence(name,seq) CREATE TABLE "players_teams" ( id INTEGER primary key autoincrement, playerID TEXT not null references players on update cascade on delete cascade, year INTEGER, stint INTEGER, tmID TEXT, lgID TEXT, GP INTEGER, GS INTEGER, minutes INTEGER, points INTEGER, oRebounds INTEGER, dRebounds INTEGER, rebounds INTEGER, assists INTEGER, steals INTEGER, blocks INTEGER, turnovers INTEGER, PF INTEGER, fgAttempted INTEGER, fgMade INTEGER, ftAttempted INTEGER, ftMade INTEGER, threeAttempted INTEGER, threeMade INTEGER, PostGP INTEGER, PostGS INTEGER, PostMinutes INTEGER, PostPoints INTEGER, PostoRebounds INTEGER, PostdRebounds INTEGER, PostRebounds INTEGER, PostAssists INTEGER, PostSteals INTEGER, PostBlocks INTEGER, PostTurnovers INTEGER, PostPF INTEGER, PostfgAttempted INTEGER, PostfgMade INTEGER, PostftAttempted INTEGER, PostftMade INTEGER, PostthreeAttempted INTEGER, PostthreeMade INTEGER, note TEXT, foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE "series_post" ( id INTEGER primary key autoincrement, year INTEGER, round TEXT, series TEXT, tmIDWinner TEXT, lgIDWinner TEXT, tmIDLoser TEXT, lgIDLoser TEXT, W INTEGER, L INTEGER, foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade, foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade )
na
2,802
2,802
CREATE TABLE `coaches` ( coachID TEXT not null, tmID TEXT not null, stint INTEGER not null, primary key coachID, tmID, stint, foreign key tmID, year references teams tmID )
[ "AND", "SELECT", "ORDER BY", "LIMIT", "DESC", "BETWEEN", "FROM" ]
7
simple
{ "case_1": [ 1004 ], "case_2": [ 1004 ], "case_3": [ 10, 39, 62, 278, 285, 364, 399, 463, 482, 656, 927, 1004, 1051 ], "case_4": [ 10, 39, 62, 169, 241, 278, 285, 318, 364, 399, 414, 463, 482, 622, 656, 838, 927, 998, 1004, 1051, 1060, 1072, 1109 ], "case_5": [ 1, 2, 10, 11, 13, 15, 17, 20, 28, 29, 32, 36, 38, 39, 43, 49, 55, 59, 62, 69, 73, 74, 75, 76, 78, 79, 86, 89, 93, 98, 108, 121, 125, 133, 138, 150, 159, 162, 163, 167, 173, 174, 179, 181, 185, 187, 188, 199, 200, 202, 206, 208, 213, 223, 229, 233, 239, 247, 252, 256, 262, 263, 275, 278, 281, 285, 286, 291, 305, 309, 311, 313, 314, 319, 320, 324, 325, 329, 334, 336, 337, 339, 341, 342, 345, 348, 349, 350, 352, 353, 356, 359, 364, 365, 371, 373, 378, 379, 381, 383, 385, 394, 395, 399, 400, 403, 404, 409, 411, 421, 428, 429, 434, 435, 444, 445, 451, 454, 460, 462, 463, 469, 482, 493, 495, 497, 505, 530, 532, 534, 536, 538, 542, 544, 548, 552, 555, 559, 560, 562, 566, 567, 576, 578, 579, 583, 584, 586, 590, 592, 595, 611, 619, 621, 625, 626, 634, 637, 638, 645, 654, 656, 657, 659, 664, 665, 667, 669, 677, 681, 686, 688, 690, 691, 698, 701, 703, 708, 713, 719, 732, 733, 735, 740, 748, 752, 759, 760, 768, 777, 778, 788, 790, 798, 800, 803, 810, 815, 818, 823, 827, 830, 836, 849, 850, 851, 861, 864, 866, 869, 876, 886, 889, 891, 893, 901, 911, 917, 918, 924, 927, 929, 934, 946, 950, 951, 953, 954, 956, 962, 963, 966, 967, 970, 972, 973, 975, 977, 981, 983, 985, 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, 1081, 1083, 1092, 1094, 1123, 1124, 1137, 1139, 1141 ] }
professional_basketball
In year 2000, who are the coaches with more than 50 games won. List the coachID, team name and number of game won at home game.
more than 50 games won refers to won > 50
SELECT T1.coachID, T2.name, T2.won FROM coaches AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = 2000 AND T2.won > 50
CREATE TABLE coaches ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, lgID TEXT null, stint INTEGER not null, won INTEGER null, lost INTEGER null, post_wins INTEGER null, post_losses INTEGER null, primary key (coachID, year, tmID, stint), foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) )
CREATE TABLE awards_players ( playerID TEXT not null, award TEXT not null, year INTEGER not null, lgID TEXT null, note TEXT null, pos TEXT null, primary key (playerID, year, award), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE coaches ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, lgID TEXT null, stint INTEGER not null, won INTEGER null, lost INTEGER null, post_wins INTEGER null, post_losses INTEGER null, primary key (coachID, year, tmID, stint), foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE draft ( id INTEGER default 0 not null primary key, draftYear INTEGER null, draftRound INTEGER null, draftSelection INTEGER null, draftOverall INTEGER null, tmID TEXT null, firstName TEXT null, lastName TEXT null, suffixName TEXT null, playerID TEXT null, draftFrom TEXT null, lgID TEXT null, foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE player_allstar ( playerID TEXT not null, last_name TEXT null, first_name TEXT null, season_id INTEGER not null, conference TEXT null, league_id TEXT null, games_played INTEGER null, minutes INTEGER null, points INTEGER null, o_rebounds INTEGER null, d_rebounds INTEGER null, rebounds INTEGER null, assists INTEGER null, steals INTEGER null, blocks INTEGER null, turnovers INTEGER null, personal_fouls INTEGER null, fg_attempted INTEGER null, fg_made INTEGER null, ft_attempted INTEGER null, ft_made INTEGER null, three_attempted INTEGER null, three_made INTEGER null, primary key (playerID, season_id), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE players ( playerID TEXT not null primary key, useFirst TEXT null, firstName TEXT null, middleName TEXT null, lastName TEXT null, nameGiven TEXT null, fullGivenName TEXT null, nameSuffix TEXT null, nameNick TEXT null, pos TEXT null, firstseason INTEGER null, lastseason INTEGER null, height REAL null, weight INTEGER null, college TEXT null, collegeOther TEXT null, birthDate DATE null, birthCity TEXT null, birthState TEXT null, birthCountry TEXT null, highSchool TEXT null, hsCity TEXT null, hsState TEXT null, hsCountry TEXT null, deathDate DATE null, race TEXT null ) CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) ) CREATE TABLE "awards_coaches" ( id INTEGER primary key autoincrement, year INTEGER, coachID TEXT, award TEXT, lgID TEXT, note TEXT, foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade ) CREATE TABLE sqlite_sequence(name,seq) CREATE TABLE "players_teams" ( id INTEGER primary key autoincrement, playerID TEXT not null references players on update cascade on delete cascade, year INTEGER, stint INTEGER, tmID TEXT, lgID TEXT, GP INTEGER, GS INTEGER, minutes INTEGER, points INTEGER, oRebounds INTEGER, dRebounds INTEGER, rebounds INTEGER, assists INTEGER, steals INTEGER, blocks INTEGER, turnovers INTEGER, PF INTEGER, fgAttempted INTEGER, fgMade INTEGER, ftAttempted INTEGER, ftMade INTEGER, threeAttempted INTEGER, threeMade INTEGER, PostGP INTEGER, PostGS INTEGER, PostMinutes INTEGER, PostPoints INTEGER, PostoRebounds INTEGER, PostdRebounds INTEGER, PostRebounds INTEGER, PostAssists INTEGER, PostSteals INTEGER, PostBlocks INTEGER, PostTurnovers INTEGER, PostPF INTEGER, PostfgAttempted INTEGER, PostfgMade INTEGER, PostftAttempted INTEGER, PostftMade INTEGER, PostthreeAttempted INTEGER, PostthreeMade INTEGER, note TEXT, foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE "series_post" ( id INTEGER primary key autoincrement, year INTEGER, round TEXT, series TEXT, tmIDWinner TEXT, lgIDWinner TEXT, tmIDLoser TEXT, lgIDLoser TEXT, W INTEGER, L INTEGER, foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade, foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade )
na
2,803
2,803
CREATE TABLE `coaches` ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, won INTEGER null, primary key coachID, year, tmID, foreign key tmID, year references teams tmID, year on update cascade on delete cascade ) CREATE TABLE `teams` ( year INTEGER not null, tmID TEXT not null, name TEXT null, homeWon INTEGER null, awayWon INTEGER null, -- neutWon int null, -- confWon int null, -- divWon int null, won INTEGER null, -- bbtmID varchar255 null, primary key year, tmID )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
8
simple
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 10, 39, 62, 169, 241, 278, 318, 364, 414, 463, 482, 838, 927, 998, 1051, 1060, 1072, 1109 ], "case_4": [ 10, 39, 62, 169, 241, 278, 285, 318, 364, 399, 414, 463, 482, 622, 656, 838, 927, 998, 1004, 1051, 1060, 1072, 1109 ], "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 ] }
professional_basketball
List all the coaches with more game lost than won from year 2000-2010. List the coach ID, team name and year.
from year 2000 to 2010 refers to year between 2000 and 2010; more game lost then won refers to lost > won
SELECT DISTINCT T1.coachID, T2.tmID, T1.year FROM coaches AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year BETWEEN 2000 AND 2010 AND T2.lost > T2.won
CREATE TABLE coaches ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, lgID TEXT null, stint INTEGER not null, won INTEGER null, lost INTEGER null, post_wins INTEGER null, post_losses INTEGER null, primary key (coachID, year, tmID, stint), foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) )
CREATE TABLE awards_players ( playerID TEXT not null, award TEXT not null, year INTEGER not null, lgID TEXT null, note TEXT null, pos TEXT null, primary key (playerID, year, award), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE coaches ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, lgID TEXT null, stint INTEGER not null, won INTEGER null, lost INTEGER null, post_wins INTEGER null, post_losses INTEGER null, primary key (coachID, year, tmID, stint), foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE draft ( id INTEGER default 0 not null primary key, draftYear INTEGER null, draftRound INTEGER null, draftSelection INTEGER null, draftOverall INTEGER null, tmID TEXT null, firstName TEXT null, lastName TEXT null, suffixName TEXT null, playerID TEXT null, draftFrom TEXT null, lgID TEXT null, foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE player_allstar ( playerID TEXT not null, last_name TEXT null, first_name TEXT null, season_id INTEGER not null, conference TEXT null, league_id TEXT null, games_played INTEGER null, minutes INTEGER null, points INTEGER null, o_rebounds INTEGER null, d_rebounds INTEGER null, rebounds INTEGER null, assists INTEGER null, steals INTEGER null, blocks INTEGER null, turnovers INTEGER null, personal_fouls INTEGER null, fg_attempted INTEGER null, fg_made INTEGER null, ft_attempted INTEGER null, ft_made INTEGER null, three_attempted INTEGER null, three_made INTEGER null, primary key (playerID, season_id), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE players ( playerID TEXT not null primary key, useFirst TEXT null, firstName TEXT null, middleName TEXT null, lastName TEXT null, nameGiven TEXT null, fullGivenName TEXT null, nameSuffix TEXT null, nameNick TEXT null, pos TEXT null, firstseason INTEGER null, lastseason INTEGER null, height REAL null, weight INTEGER null, college TEXT null, collegeOther TEXT null, birthDate DATE null, birthCity TEXT null, birthState TEXT null, birthCountry TEXT null, highSchool TEXT null, hsCity TEXT null, hsState TEXT null, hsCountry TEXT null, deathDate DATE null, race TEXT null ) CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) ) CREATE TABLE "awards_coaches" ( id INTEGER primary key autoincrement, year INTEGER, coachID TEXT, award TEXT, lgID TEXT, note TEXT, foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade ) CREATE TABLE sqlite_sequence(name,seq) CREATE TABLE "players_teams" ( id INTEGER primary key autoincrement, playerID TEXT not null references players on update cascade on delete cascade, year INTEGER, stint INTEGER, tmID TEXT, lgID TEXT, GP INTEGER, GS INTEGER, minutes INTEGER, points INTEGER, oRebounds INTEGER, dRebounds INTEGER, rebounds INTEGER, assists INTEGER, steals INTEGER, blocks INTEGER, turnovers INTEGER, PF INTEGER, fgAttempted INTEGER, fgMade INTEGER, ftAttempted INTEGER, ftMade INTEGER, threeAttempted INTEGER, threeMade INTEGER, PostGP INTEGER, PostGS INTEGER, PostMinutes INTEGER, PostPoints INTEGER, PostoRebounds INTEGER, PostdRebounds INTEGER, PostRebounds INTEGER, PostAssists INTEGER, PostSteals INTEGER, PostBlocks INTEGER, PostTurnovers INTEGER, PostPF INTEGER, PostfgAttempted INTEGER, PostfgMade INTEGER, PostftAttempted INTEGER, PostftMade INTEGER, PostthreeAttempted INTEGER, PostthreeMade INTEGER, note TEXT, foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE "series_post" ( id INTEGER primary key autoincrement, year INTEGER, round TEXT, series TEXT, tmIDWinner TEXT, lgIDWinner TEXT, tmIDLoser TEXT, lgIDLoser TEXT, W INTEGER, L INTEGER, foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade, foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade )
na
2,804
2,804
CREATE TABLE `coaches` ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, won INTEGER null, lost INTEGER null, primary key coachID, year, tmID, foreign key tmID, year references teams tmID, year on update cascade on delete cascade ) CREATE TABLE `teams` ( year INTEGER not null, tmID TEXT not null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- confWon int null, -- divWon int null, won INTEGER null, lost INTEGER null, -- bbtmID varchar255 null, primary key year, tmID )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "BETWEEN", "FROM" ]
10
simple
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 10, 39, 62, 169, 241, 278, 318, 364, 399, 414, 463, 482, 656, 838, 927, 998, 1051, 1060, 1072, 1109 ], "case_4": [ 10, 39, 62, 169, 241, 278, 285, 318, 364, 399, 414, 463, 482, 622, 656, 838, 927, 998, 1004, 1051, 1060, 1072, 1109 ], "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 ] }
professional_basketball
Which are the teams coached by 'adelmri01' from year 1990-1995. List the team name, year and offense point.
year 1990-1995 refers to year between 1990 and 1995; 'adelmri01' is the coachID; offense point refers to o_fgm
SELECT T2.name, T1.year, T2.o_pts FROM coaches AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year BETWEEN 1990 AND 1995 AND T1.coachID = 'adelmri01'
CREATE TABLE coaches ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, lgID TEXT null, stint INTEGER not null, won INTEGER null, lost INTEGER null, post_wins INTEGER null, post_losses INTEGER null, primary key (coachID, year, tmID, stint), foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) )
CREATE TABLE awards_players ( playerID TEXT not null, award TEXT not null, year INTEGER not null, lgID TEXT null, note TEXT null, pos TEXT null, primary key (playerID, year, award), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE coaches ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, lgID TEXT null, stint INTEGER not null, won INTEGER null, lost INTEGER null, post_wins INTEGER null, post_losses INTEGER null, primary key (coachID, year, tmID, stint), foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE draft ( id INTEGER default 0 not null primary key, draftYear INTEGER null, draftRound INTEGER null, draftSelection INTEGER null, draftOverall INTEGER null, tmID TEXT null, firstName TEXT null, lastName TEXT null, suffixName TEXT null, playerID TEXT null, draftFrom TEXT null, lgID TEXT null, foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE player_allstar ( playerID TEXT not null, last_name TEXT null, first_name TEXT null, season_id INTEGER not null, conference TEXT null, league_id TEXT null, games_played INTEGER null, minutes INTEGER null, points INTEGER null, o_rebounds INTEGER null, d_rebounds INTEGER null, rebounds INTEGER null, assists INTEGER null, steals INTEGER null, blocks INTEGER null, turnovers INTEGER null, personal_fouls INTEGER null, fg_attempted INTEGER null, fg_made INTEGER null, ft_attempted INTEGER null, ft_made INTEGER null, three_attempted INTEGER null, three_made INTEGER null, primary key (playerID, season_id), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE players ( playerID TEXT not null primary key, useFirst TEXT null, firstName TEXT null, middleName TEXT null, lastName TEXT null, nameGiven TEXT null, fullGivenName TEXT null, nameSuffix TEXT null, nameNick TEXT null, pos TEXT null, firstseason INTEGER null, lastseason INTEGER null, height REAL null, weight INTEGER null, college TEXT null, collegeOther TEXT null, birthDate DATE null, birthCity TEXT null, birthState TEXT null, birthCountry TEXT null, highSchool TEXT null, hsCity TEXT null, hsState TEXT null, hsCountry TEXT null, deathDate DATE null, race TEXT null ) CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) ) CREATE TABLE "awards_coaches" ( id INTEGER primary key autoincrement, year INTEGER, coachID TEXT, award TEXT, lgID TEXT, note TEXT, foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade ) CREATE TABLE sqlite_sequence(name,seq) CREATE TABLE "players_teams" ( id INTEGER primary key autoincrement, playerID TEXT not null references players on update cascade on delete cascade, year INTEGER, stint INTEGER, tmID TEXT, lgID TEXT, GP INTEGER, GS INTEGER, minutes INTEGER, points INTEGER, oRebounds INTEGER, dRebounds INTEGER, rebounds INTEGER, assists INTEGER, steals INTEGER, blocks INTEGER, turnovers INTEGER, PF INTEGER, fgAttempted INTEGER, fgMade INTEGER, ftAttempted INTEGER, ftMade INTEGER, threeAttempted INTEGER, threeMade INTEGER, PostGP INTEGER, PostGS INTEGER, PostMinutes INTEGER, PostPoints INTEGER, PostoRebounds INTEGER, PostdRebounds INTEGER, PostRebounds INTEGER, PostAssists INTEGER, PostSteals INTEGER, PostBlocks INTEGER, PostTurnovers INTEGER, PostPF INTEGER, PostfgAttempted INTEGER, PostfgMade INTEGER, PostftAttempted INTEGER, PostftMade INTEGER, PostthreeAttempted INTEGER, PostthreeMade INTEGER, note TEXT, foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE "series_post" ( id INTEGER primary key autoincrement, year INTEGER, round TEXT, series TEXT, tmIDWinner TEXT, lgIDWinner TEXT, tmIDLoser TEXT, lgIDLoser TEXT, W INTEGER, L INTEGER, foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade, foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade )
na
2,805
2,805
CREATE TABLE `coaches` ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, primary key coachID, year, tmID, foreign key tmID, year references teams tmID, year on update cascade on delete cascade ) CREATE TABLE `teams` ( year INTEGER not null, tmID TEXT not null, name TEXT null, o_pts INTEGER null, -- bbtmID varchar255 null, primary key year, tmID )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "BETWEEN", "FROM" ]
10
simple
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 10, 39, 62, 169, 241, 278, 318, 364, 399, 414, 463, 482, 656, 838, 927, 998, 1051, 1060, 1072, 1109 ], "case_4": [ 10, 39, 62, 169, 241, 278, 285, 318, 364, 399, 414, 463, 482, 622, 656, 838, 927, 998, 1004, 1051, 1060, 1072, 1109 ], "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 ] }
professional_basketball
Which team(s) had 90% games won. List the coach ID for the team and year played.
team with 90% games won refers to Divide (won, games) > 0.9
SELECT DISTINCT T2.name, T1.year, T1.coachID FROM coaches AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID WHERE CAST(T2.won AS REAL) * 100 / T2.games > 90
CREATE TABLE coaches ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, lgID TEXT null, stint INTEGER not null, won INTEGER null, lost INTEGER null, post_wins INTEGER null, post_losses INTEGER null, primary key (coachID, year, tmID, stint), foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) )
CREATE TABLE awards_players ( playerID TEXT not null, award TEXT not null, year INTEGER not null, lgID TEXT null, note TEXT null, pos TEXT null, primary key (playerID, year, award), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE coaches ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, lgID TEXT null, stint INTEGER not null, won INTEGER null, lost INTEGER null, post_wins INTEGER null, post_losses INTEGER null, primary key (coachID, year, tmID, stint), foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE draft ( id INTEGER default 0 not null primary key, draftYear INTEGER null, draftRound INTEGER null, draftSelection INTEGER null, draftOverall INTEGER null, tmID TEXT null, firstName TEXT null, lastName TEXT null, suffixName TEXT null, playerID TEXT null, draftFrom TEXT null, lgID TEXT null, foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE player_allstar ( playerID TEXT not null, last_name TEXT null, first_name TEXT null, season_id INTEGER not null, conference TEXT null, league_id TEXT null, games_played INTEGER null, minutes INTEGER null, points INTEGER null, o_rebounds INTEGER null, d_rebounds INTEGER null, rebounds INTEGER null, assists INTEGER null, steals INTEGER null, blocks INTEGER null, turnovers INTEGER null, personal_fouls INTEGER null, fg_attempted INTEGER null, fg_made INTEGER null, ft_attempted INTEGER null, ft_made INTEGER null, three_attempted INTEGER null, three_made INTEGER null, primary key (playerID, season_id), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE players ( playerID TEXT not null primary key, useFirst TEXT null, firstName TEXT null, middleName TEXT null, lastName TEXT null, nameGiven TEXT null, fullGivenName TEXT null, nameSuffix TEXT null, nameNick TEXT null, pos TEXT null, firstseason INTEGER null, lastseason INTEGER null, height REAL null, weight INTEGER null, college TEXT null, collegeOther TEXT null, birthDate DATE null, birthCity TEXT null, birthState TEXT null, birthCountry TEXT null, highSchool TEXT null, hsCity TEXT null, hsState TEXT null, hsCountry TEXT null, deathDate DATE null, race TEXT null ) CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) ) CREATE TABLE "awards_coaches" ( id INTEGER primary key autoincrement, year INTEGER, coachID TEXT, award TEXT, lgID TEXT, note TEXT, foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade ) CREATE TABLE sqlite_sequence(name,seq) CREATE TABLE "players_teams" ( id INTEGER primary key autoincrement, playerID TEXT not null references players on update cascade on delete cascade, year INTEGER, stint INTEGER, tmID TEXT, lgID TEXT, GP INTEGER, GS INTEGER, minutes INTEGER, points INTEGER, oRebounds INTEGER, dRebounds INTEGER, rebounds INTEGER, assists INTEGER, steals INTEGER, blocks INTEGER, turnovers INTEGER, PF INTEGER, fgAttempted INTEGER, fgMade INTEGER, ftAttempted INTEGER, ftMade INTEGER, threeAttempted INTEGER, threeMade INTEGER, PostGP INTEGER, PostGS INTEGER, PostMinutes INTEGER, PostPoints INTEGER, PostoRebounds INTEGER, PostdRebounds INTEGER, PostRebounds INTEGER, PostAssists INTEGER, PostSteals INTEGER, PostBlocks INTEGER, PostTurnovers INTEGER, PostPF INTEGER, PostfgAttempted INTEGER, PostfgMade INTEGER, PostftAttempted INTEGER, PostftMade INTEGER, PostthreeAttempted INTEGER, PostthreeMade INTEGER, note TEXT, foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE "series_post" ( id INTEGER primary key autoincrement, year INTEGER, round TEXT, series TEXT, tmIDWinner TEXT, lgIDWinner TEXT, tmIDLoser TEXT, lgIDLoser TEXT, W INTEGER, L INTEGER, foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade, foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade )
na
2,806
2,806
CREATE TABLE `coaches` ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, won INTEGER null, primary key coachID, year, tmID, foreign key tmID, year references teams tmID, year on update cascade on delete cascade ) CREATE TABLE `teams` ( year INTEGER not null, tmID TEXT not null, name TEXT null, homeWon INTEGER null, awayWon INTEGER null, -- neutWon int null, -- confWon int null, -- divWon int null, won INTEGER null, games INTEGER null, -- bbtmID varchar255 null, primary key year, tmID )
[ "AS", "SELECT", "INNER JOIN", "ON", "CAST", "FROM" ]
8
simple
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 10, 39, 62, 169, 241, 278, 318, 364, 414, 463, 482, 838, 927, 998, 1004, 1051, 1060, 1072, 1109 ], "case_4": [ 10, 39, 62, 169, 241, 278, 285, 318, 364, 399, 414, 463, 482, 622, 656, 838, 927, 998, 1004, 1051, 1060, 1072, 1109 ], "case_5": [ 0, 1, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 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, 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, 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, 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, 1004, 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, 1075, 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 ] }
professional_basketball
What is the percentage of player who won "All-Defensive First Team" from 1980 - 2000 is from 'NY'.
"All-Defensive First Team" is the award; ' NY' is the birthState; 1980 to 2000 refers to year between 1980 and 2000; percentage = Divide (Count(playerID where birthState = 'NY'), Count(playerID)) * 100
SELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T1.birthState = 'NY' AND T2.award = 'All-Defensive First Team' AND T2.year BETWEEN 1980 AND 2000
CREATE TABLE awards_players ( playerID TEXT not null, award TEXT not null, year INTEGER not null, lgID TEXT null, note TEXT null, pos TEXT null, primary key (playerID, year, award), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE players ( playerID TEXT not null primary key, useFirst TEXT null, firstName TEXT null, middleName TEXT null, lastName TEXT null, nameGiven TEXT null, fullGivenName TEXT null, nameSuffix TEXT null, nameNick TEXT null, pos TEXT null, firstseason INTEGER null, lastseason INTEGER null, height REAL null, weight INTEGER null, college TEXT null, collegeOther TEXT null, birthDate DATE null, birthCity TEXT null, birthState TEXT null, birthCountry TEXT null, highSchool TEXT null, hsCity TEXT null, hsState TEXT null, hsCountry TEXT null, deathDate DATE null, race TEXT null )
CREATE TABLE awards_players ( playerID TEXT not null, award TEXT not null, year INTEGER not null, lgID TEXT null, note TEXT null, pos TEXT null, primary key (playerID, year, award), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE coaches ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, lgID TEXT null, stint INTEGER not null, won INTEGER null, lost INTEGER null, post_wins INTEGER null, post_losses INTEGER null, primary key (coachID, year, tmID, stint), foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE draft ( id INTEGER default 0 not null primary key, draftYear INTEGER null, draftRound INTEGER null, draftSelection INTEGER null, draftOverall INTEGER null, tmID TEXT null, firstName TEXT null, lastName TEXT null, suffixName TEXT null, playerID TEXT null, draftFrom TEXT null, lgID TEXT null, foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE player_allstar ( playerID TEXT not null, last_name TEXT null, first_name TEXT null, season_id INTEGER not null, conference TEXT null, league_id TEXT null, games_played INTEGER null, minutes INTEGER null, points INTEGER null, o_rebounds INTEGER null, d_rebounds INTEGER null, rebounds INTEGER null, assists INTEGER null, steals INTEGER null, blocks INTEGER null, turnovers INTEGER null, personal_fouls INTEGER null, fg_attempted INTEGER null, fg_made INTEGER null, ft_attempted INTEGER null, ft_made INTEGER null, three_attempted INTEGER null, three_made INTEGER null, primary key (playerID, season_id), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE players ( playerID TEXT not null primary key, useFirst TEXT null, firstName TEXT null, middleName TEXT null, lastName TEXT null, nameGiven TEXT null, fullGivenName TEXT null, nameSuffix TEXT null, nameNick TEXT null, pos TEXT null, firstseason INTEGER null, lastseason INTEGER null, height REAL null, weight INTEGER null, college TEXT null, collegeOther TEXT null, birthDate DATE null, birthCity TEXT null, birthState TEXT null, birthCountry TEXT null, highSchool TEXT null, hsCity TEXT null, hsState TEXT null, hsCountry TEXT null, deathDate DATE null, race TEXT null ) CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) ) CREATE TABLE "awards_coaches" ( id INTEGER primary key autoincrement, year INTEGER, coachID TEXT, award TEXT, lgID TEXT, note TEXT, foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade ) CREATE TABLE sqlite_sequence(name,seq) CREATE TABLE "players_teams" ( id INTEGER primary key autoincrement, playerID TEXT not null references players on update cascade on delete cascade, year INTEGER, stint INTEGER, tmID TEXT, lgID TEXT, GP INTEGER, GS INTEGER, minutes INTEGER, points INTEGER, oRebounds INTEGER, dRebounds INTEGER, rebounds INTEGER, assists INTEGER, steals INTEGER, blocks INTEGER, turnovers INTEGER, PF INTEGER, fgAttempted INTEGER, fgMade INTEGER, ftAttempted INTEGER, ftMade INTEGER, threeAttempted INTEGER, threeMade INTEGER, PostGP INTEGER, PostGS INTEGER, PostMinutes INTEGER, PostPoints INTEGER, PostoRebounds INTEGER, PostdRebounds INTEGER, PostRebounds INTEGER, PostAssists INTEGER, PostSteals INTEGER, PostBlocks INTEGER, PostTurnovers INTEGER, PostPF INTEGER, PostfgAttempted INTEGER, PostfgMade INTEGER, PostftAttempted INTEGER, PostftMade INTEGER, PostthreeAttempted INTEGER, PostthreeMade INTEGER, note TEXT, foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE "series_post" ( id INTEGER primary key autoincrement, year INTEGER, round TEXT, series TEXT, tmIDWinner TEXT, lgIDWinner TEXT, tmIDLoser TEXT, lgIDLoser TEXT, W INTEGER, L INTEGER, foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade, foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade )
na
2,807
2,807
CREATE TABLE `awards_players` ( playerID TEXT not null, award TEXT not null, year INTEGER not null, primary key playerID, year, award, foreign key playerID references players playerID on update cascade on delete cascade ) CREATE TABLE `players` ( playerID TEXT not null primary key, birthState TEXT null )
[ "AS", "AND", "SELECT", "-", "INNER JOIN", "ON", "All", "COUNT", "BETWEEN", "FROM" ]
13
medium
{ "case_1": [ 364, 927 ], "case_2": [ 364, 927 ], "case_3": [ 39, 62, 169, 278, 364, 414, 463, 482, 838, 927, 1051, 1072, 1109 ], "case_4": [ 10, 39, 62, 169, 241, 278, 285, 318, 364, 399, 414, 463, 482, 622, 656, 838, 927, 998, 1004, 1051, 1060, 1072, 1109 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 8, 11, 12, 16, 19, 20, 21, 22, 24, 26, 27, 30, 32, 33, 34, 36, 37, 39, 42, 44, 45, 47, 51, 52, 53, 55, 57, 62, 63, 66, 68, 69, 71, 73, 74, 75, 76, 77, 82, 85, 86, 88, 90, 91, 93, 95, 96, 97, 98, 99, 105, 106, 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, 175, 176, 177, 179, 180, 183, 184, 187, 188, 189, 190, 191, 196, 197, 199, 200, 202, 206, 212, 214, 219, 225, 226, 227, 228, 229, 233, 234, 239, 240, 243, 244, 247, 254, 256, 258, 261, 262, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 282, 296, 299, 300, 301, 311, 314, 315, 316, 317, 319, 320, 323, 325, 330, 334, 335, 336, 338, 339, 341, 344, 345, 349, 354, 356, 358, 360, 361, 364, 368, 370, 373, 374, 375, 376, 382, 383, 384, 385, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 408, 409, 411, 412, 413, 414, 416, 417, 419, 424, 425, 426, 427, 428, 433, 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, 489, 490, 493, 494, 496, 497, 498, 500, 503, 505, 507, 509, 510, 514, 515, 516, 519, 520, 522, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 541, 544, 547, 548, 550, 552, 557, 558, 559, 560, 561, 562, 563, 564, 566, 573, 580, 581, 582, 584, 586, 588, 589, 595, 596, 597, 605, 606, 608, 610, 611, 612, 613, 615, 620, 624, 625, 626, 627, 630, 632, 633, 634, 637, 641, 643, 645, 646, 647, 648, 649, 651, 654, 658, 659, 660, 662, 663, 665, 666, 667, 668, 669, 671, 675, 677, 678, 681, 683, 684, 685, 686, 687, 688, 690, 693, 694, 695, 696, 697, 699, 702, 705, 712, 714, 715, 721, 726, 727, 733, 734, 735, 736, 739, 740, 741, 743, 746, 747, 749, 750, 752, 753, 754, 756, 758, 760, 762, 763, 765, 767, 768, 769, 772, 773, 775, 776, 777, 778, 779, 780, 783, 787, 788, 790, 793, 796, 797, 798, 799, 800, 802, 804, 805, 806, 807, 808, 810, 812, 813, 814, 818, 819, 824, 825, 827, 829, 830, 832, 835, 838, 839, 841, 844, 848, 849, 851, 853, 857, 858, 859, 860, 861, 866, 867, 870, 873, 874, 876, 877, 878, 879, 882, 886, 888, 892, 893, 895, 896, 897, 898, 901, 902, 905, 907, 909, 911, 912, 915, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 943, 944, 949, 950, 951, 953, 954, 956, 958, 959, 961, 963, 969, 974, 975, 977, 980, 981, 985, 986, 991, 993, 996, 1000, 1001, 1005, 1006, 1010, 1013, 1015, 1017, 1019, 1022, 1023, 1027, 1031, 1037, 1039, 1042, 1043, 1044, 1046, 1047, 1050, 1051, 1052, 1058, 1061, 1062, 1063, 1064, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1086, 1087, 1092, 1094, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1115, 1119, 1123, 1124, 1128, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
professional_basketball
What division did the team coached by the winner of the 1977 NBA Coach of the Year award play in in 1976?
"NBA Coach of the Year" is the award; in 1977 refers to year = 1977; in 1976 refers to year = 1976; division refers to divisionID
SELECT DISTINCT T3.divID FROM awards_coaches AS T1 INNER JOIN coaches AS T2 ON T1.coachID = T2.coachID INNER JOIN teams AS T3 ON T2.tmID = T3.tmID WHERE T1.year = 1977 AND T1.award = 'NBA Coach of the Year' AND T3.year = 1976
CREATE TABLE coaches ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, lgID TEXT null, stint INTEGER not null, won INTEGER null, lost INTEGER null, post_wins INTEGER null, post_losses INTEGER null, primary key (coachID, year, tmID, stint), foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) ) CREATE TABLE "awards_coaches" ( id INTEGER primary key autoincrement, year INTEGER, coachID TEXT, award TEXT, lgID TEXT, note TEXT, foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade )
CREATE TABLE awards_players ( playerID TEXT not null, award TEXT not null, year INTEGER not null, lgID TEXT null, note TEXT null, pos TEXT null, primary key (playerID, year, award), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE coaches ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, lgID TEXT null, stint INTEGER not null, won INTEGER null, lost INTEGER null, post_wins INTEGER null, post_losses INTEGER null, primary key (coachID, year, tmID, stint), foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE draft ( id INTEGER default 0 not null primary key, draftYear INTEGER null, draftRound INTEGER null, draftSelection INTEGER null, draftOverall INTEGER null, tmID TEXT null, firstName TEXT null, lastName TEXT null, suffixName TEXT null, playerID TEXT null, draftFrom TEXT null, lgID TEXT null, foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE player_allstar ( playerID TEXT not null, last_name TEXT null, first_name TEXT null, season_id INTEGER not null, conference TEXT null, league_id TEXT null, games_played INTEGER null, minutes INTEGER null, points INTEGER null, o_rebounds INTEGER null, d_rebounds INTEGER null, rebounds INTEGER null, assists INTEGER null, steals INTEGER null, blocks INTEGER null, turnovers INTEGER null, personal_fouls INTEGER null, fg_attempted INTEGER null, fg_made INTEGER null, ft_attempted INTEGER null, ft_made INTEGER null, three_attempted INTEGER null, three_made INTEGER null, primary key (playerID, season_id), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE players ( playerID TEXT not null primary key, useFirst TEXT null, firstName TEXT null, middleName TEXT null, lastName TEXT null, nameGiven TEXT null, fullGivenName TEXT null, nameSuffix TEXT null, nameNick TEXT null, pos TEXT null, firstseason INTEGER null, lastseason INTEGER null, height REAL null, weight INTEGER null, college TEXT null, collegeOther TEXT null, birthDate DATE null, birthCity TEXT null, birthState TEXT null, birthCountry TEXT null, highSchool TEXT null, hsCity TEXT null, hsState TEXT null, hsCountry TEXT null, deathDate DATE null, race TEXT null ) CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) ) CREATE TABLE "awards_coaches" ( id INTEGER primary key autoincrement, year INTEGER, coachID TEXT, award TEXT, lgID TEXT, note TEXT, foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade ) CREATE TABLE sqlite_sequence(name,seq) CREATE TABLE "players_teams" ( id INTEGER primary key autoincrement, playerID TEXT not null references players on update cascade on delete cascade, year INTEGER, stint INTEGER, tmID TEXT, lgID TEXT, GP INTEGER, GS INTEGER, minutes INTEGER, points INTEGER, oRebounds INTEGER, dRebounds INTEGER, rebounds INTEGER, assists INTEGER, steals INTEGER, blocks INTEGER, turnovers INTEGER, PF INTEGER, fgAttempted INTEGER, fgMade INTEGER, ftAttempted INTEGER, ftMade INTEGER, threeAttempted INTEGER, threeMade INTEGER, PostGP INTEGER, PostGS INTEGER, PostMinutes INTEGER, PostPoints INTEGER, PostoRebounds INTEGER, PostdRebounds INTEGER, PostRebounds INTEGER, PostAssists INTEGER, PostSteals INTEGER, PostBlocks INTEGER, PostTurnovers INTEGER, PostPF INTEGER, PostfgAttempted INTEGER, PostfgMade INTEGER, PostftAttempted INTEGER, PostftMade INTEGER, PostthreeAttempted INTEGER, PostthreeMade INTEGER, note TEXT, foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE "series_post" ( id INTEGER primary key autoincrement, year INTEGER, round TEXT, series TEXT, tmIDWinner TEXT, lgIDWinner TEXT, tmIDLoser TEXT, lgIDLoser TEXT, W INTEGER, L INTEGER, foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade, foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade )
na
2,808
2,808
CREATE TABLE `coaches` ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, primary key coachID, year, tmID, foreign key tmID, year references teams tmID, year on update cascade on delete cascade ) CREATE TABLE `teams` ( year INTEGER not null, tmID TEXT not null, divID TEXT null, -- bbtmID varchar255 null, primary key year, tmID ) CREATE TABLE `awards_coaches` ( CREATE TABLE "awards_coaches" id INTEGER primary key autoincrement, year INTEGER, coachID TEXT, award TEXT, lgID TEXT, foreign key coachID, year references coaches coachID, year on update cascade on delete cascade )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
11
medium
{ "case_1": [ 463 ], "case_2": [ 463 ], "case_3": [ 10, 39, 62, 169, 241, 278, 318, 364, 414, 463, 482, 838, 927, 998, 1051, 1060, 1072, 1109 ], "case_4": [ 10, 39, 62, 169, 241, 278, 285, 318, 364, 399, 414, 463, 482, 622, 656, 838, 927, 998, 1004, 1051, 1060, 1072, 1109 ], "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 ] }
professional_basketball
Which coach of the Chicago Bulls during the year 1981 won the NBA Coach of the Year award in the 1970s?
"Chicago Bull" is the name of team; during the year 1981 refers to year = 1981; 'NBA Coach of the Year' is the award; in the 1970s refers to year between 1970 to 1979
SELECT DISTINCT T2.coachID FROM coaches AS T1 INNER JOIN awards_coaches AS T2 ON T1.coachID = T2.coachID INNER JOIN teams AS T3 ON T3.tmID = T1.tmID WHERE T2.award = 'NBA Coach of the Year' AND T2.year BETWEEN 1970 AND 1979 AND T1.year = 1981 AND T3.name = 'Chicago Bulls'
CREATE TABLE coaches ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, lgID TEXT null, stint INTEGER not null, won INTEGER null, lost INTEGER null, post_wins INTEGER null, post_losses INTEGER null, primary key (coachID, year, tmID, stint), foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) ) CREATE TABLE "awards_coaches" ( id INTEGER primary key autoincrement, year INTEGER, coachID TEXT, award TEXT, lgID TEXT, note TEXT, foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade )
CREATE TABLE awards_players ( playerID TEXT not null, award TEXT not null, year INTEGER not null, lgID TEXT null, note TEXT null, pos TEXT null, primary key (playerID, year, award), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE coaches ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, lgID TEXT null, stint INTEGER not null, won INTEGER null, lost INTEGER null, post_wins INTEGER null, post_losses INTEGER null, primary key (coachID, year, tmID, stint), foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE draft ( id INTEGER default 0 not null primary key, draftYear INTEGER null, draftRound INTEGER null, draftSelection INTEGER null, draftOverall INTEGER null, tmID TEXT null, firstName TEXT null, lastName TEXT null, suffixName TEXT null, playerID TEXT null, draftFrom TEXT null, lgID TEXT null, foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE player_allstar ( playerID TEXT not null, last_name TEXT null, first_name TEXT null, season_id INTEGER not null, conference TEXT null, league_id TEXT null, games_played INTEGER null, minutes INTEGER null, points INTEGER null, o_rebounds INTEGER null, d_rebounds INTEGER null, rebounds INTEGER null, assists INTEGER null, steals INTEGER null, blocks INTEGER null, turnovers INTEGER null, personal_fouls INTEGER null, fg_attempted INTEGER null, fg_made INTEGER null, ft_attempted INTEGER null, ft_made INTEGER null, three_attempted INTEGER null, three_made INTEGER null, primary key (playerID, season_id), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE players ( playerID TEXT not null primary key, useFirst TEXT null, firstName TEXT null, middleName TEXT null, lastName TEXT null, nameGiven TEXT null, fullGivenName TEXT null, nameSuffix TEXT null, nameNick TEXT null, pos TEXT null, firstseason INTEGER null, lastseason INTEGER null, height REAL null, weight INTEGER null, college TEXT null, collegeOther TEXT null, birthDate DATE null, birthCity TEXT null, birthState TEXT null, birthCountry TEXT null, highSchool TEXT null, hsCity TEXT null, hsState TEXT null, hsCountry TEXT null, deathDate DATE null, race TEXT null ) CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) ) CREATE TABLE "awards_coaches" ( id INTEGER primary key autoincrement, year INTEGER, coachID TEXT, award TEXT, lgID TEXT, note TEXT, foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade ) CREATE TABLE sqlite_sequence(name,seq) CREATE TABLE "players_teams" ( id INTEGER primary key autoincrement, playerID TEXT not null references players on update cascade on delete cascade, year INTEGER, stint INTEGER, tmID TEXT, lgID TEXT, GP INTEGER, GS INTEGER, minutes INTEGER, points INTEGER, oRebounds INTEGER, dRebounds INTEGER, rebounds INTEGER, assists INTEGER, steals INTEGER, blocks INTEGER, turnovers INTEGER, PF INTEGER, fgAttempted INTEGER, fgMade INTEGER, ftAttempted INTEGER, ftMade INTEGER, threeAttempted INTEGER, threeMade INTEGER, PostGP INTEGER, PostGS INTEGER, PostMinutes INTEGER, PostPoints INTEGER, PostoRebounds INTEGER, PostdRebounds INTEGER, PostRebounds INTEGER, PostAssists INTEGER, PostSteals INTEGER, PostBlocks INTEGER, PostTurnovers INTEGER, PostPF INTEGER, PostfgAttempted INTEGER, PostfgMade INTEGER, PostftAttempted INTEGER, PostftMade INTEGER, PostthreeAttempted INTEGER, PostthreeMade INTEGER, note TEXT, foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE "series_post" ( id INTEGER primary key autoincrement, year INTEGER, round TEXT, series TEXT, tmIDWinner TEXT, lgIDWinner TEXT, tmIDLoser TEXT, lgIDLoser TEXT, W INTEGER, L INTEGER, foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade, foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade )
na
2,809
2,809
CREATE TABLE `coaches` ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, primary key coachID, year, tmID, foreign key tmID, year references teams tmID, year on update cascade on delete cascade ) CREATE TABLE `teams` ( year INTEGER not null, tmID TEXT not null, name TEXT null, -- bbtmID varchar255 null, primary key year, tmID ) CREATE TABLE `awards_coaches` ( CREATE TABLE "awards_coaches" id INTEGER primary key autoincrement, year INTEGER, coachID TEXT, award TEXT, lgID TEXT, foreign key coachID, year references coaches coachID, year on update cascade on delete cascade )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "BETWEEN", "FROM" ]
14
medium
{ "case_1": [ 463 ], "case_2": [ 463 ], "case_3": [ 10, 39, 62, 169, 241, 278, 318, 364, 399, 414, 463, 482, 656, 838, 927, 998, 1051, 1060, 1072, 1109 ], "case_4": [ 10, 39, 62, 169, 241, 278, 285, 318, 364, 399, 414, 463, 482, 622, 656, 838, 927, 998, 1004, 1051, 1060, 1072, 1109 ], "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 ] }
professional_basketball
What is the nickname of the NBA player whose team competed in the Western Conference in the season 2006 and who had a total of two blocks?
completed in the Western conference refers to conference = 'West'; in season 2006 refers to season_id = 2006; total of two blocks refers to blocks = 2; nickname refers to nameNick
SELECT T2.nameNick FROM player_allstar AS T1 INNER JOIN players AS T2 ON T1.playerID = T2.playerID WHERE T1.blocks = 2 AND T1.conference = 'West' AND T1.season_id = 2006
CREATE TABLE player_allstar ( playerID TEXT not null, last_name TEXT null, first_name TEXT null, season_id INTEGER not null, conference TEXT null, league_id TEXT null, games_played INTEGER null, minutes INTEGER null, points INTEGER null, o_rebounds INTEGER null, d_rebounds INTEGER null, rebounds INTEGER null, assists INTEGER null, steals INTEGER null, blocks INTEGER null, turnovers INTEGER null, personal_fouls INTEGER null, fg_attempted INTEGER null, fg_made INTEGER null, ft_attempted INTEGER null, ft_made INTEGER null, three_attempted INTEGER null, three_made INTEGER null, primary key (playerID, season_id), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE players ( playerID TEXT not null primary key, useFirst TEXT null, firstName TEXT null, middleName TEXT null, lastName TEXT null, nameGiven TEXT null, fullGivenName TEXT null, nameSuffix TEXT null, nameNick TEXT null, pos TEXT null, firstseason INTEGER null, lastseason INTEGER null, height REAL null, weight INTEGER null, college TEXT null, collegeOther TEXT null, birthDate DATE null, birthCity TEXT null, birthState TEXT null, birthCountry TEXT null, highSchool TEXT null, hsCity TEXT null, hsState TEXT null, hsCountry TEXT null, deathDate DATE null, race TEXT null )
CREATE TABLE awards_players ( playerID TEXT not null, award TEXT not null, year INTEGER not null, lgID TEXT null, note TEXT null, pos TEXT null, primary key (playerID, year, award), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE coaches ( coachID TEXT not null, year INTEGER not null, tmID TEXT not null, lgID TEXT null, stint INTEGER not null, won INTEGER null, lost INTEGER null, post_wins INTEGER null, post_losses INTEGER null, primary key (coachID, year, tmID, stint), foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE draft ( id INTEGER default 0 not null primary key, draftYear INTEGER null, draftRound INTEGER null, draftSelection INTEGER null, draftOverall INTEGER null, tmID TEXT null, firstName TEXT null, lastName TEXT null, suffixName TEXT null, playerID TEXT null, draftFrom TEXT null, lgID TEXT null, foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE player_allstar ( playerID TEXT not null, last_name TEXT null, first_name TEXT null, season_id INTEGER not null, conference TEXT null, league_id TEXT null, games_played INTEGER null, minutes INTEGER null, points INTEGER null, o_rebounds INTEGER null, d_rebounds INTEGER null, rebounds INTEGER null, assists INTEGER null, steals INTEGER null, blocks INTEGER null, turnovers INTEGER null, personal_fouls INTEGER null, fg_attempted INTEGER null, fg_made INTEGER null, ft_attempted INTEGER null, ft_made INTEGER null, three_attempted INTEGER null, three_made INTEGER null, primary key (playerID, season_id), foreign key (playerID) references players (playerID) on update cascade on delete cascade ) CREATE TABLE players ( playerID TEXT not null primary key, useFirst TEXT null, firstName TEXT null, middleName TEXT null, lastName TEXT null, nameGiven TEXT null, fullGivenName TEXT null, nameSuffix TEXT null, nameNick TEXT null, pos TEXT null, firstseason INTEGER null, lastseason INTEGER null, height REAL null, weight INTEGER null, college TEXT null, collegeOther TEXT null, birthDate DATE null, birthCity TEXT null, birthState TEXT null, birthCountry TEXT null, highSchool TEXT null, hsCity TEXT null, hsState TEXT null, hsCountry TEXT null, deathDate DATE null, race TEXT null ) CREATE TABLE teams ( year INTEGER not null, lgID TEXT null, tmID TEXT not null, franchID TEXT null, confID TEXT null, divID TEXT null, `rank` INTEGER null, confRank INTEGER null, playoff TEXT null, name TEXT null, o_fgm INTEGER null, -- o_fga int null, o_ftm INTEGER null, -- o_fta int null, -- o_3pm int null, -- o_3pa int null, -- o_oreb int null, -- o_dreb int null, -- o_reb int null, -- o_asts int null, -- o_pf int null, -- o_stl int null, -- o_to int null, -- o_blk int null, o_pts INTEGER null, -- d_fgm int null, -- d_fga int null, -- d_ftm int null, -- d_fta int null, -- d_3pm int null, -- d_3pa int null, -- d_oreb int null, -- d_dreb int null, -- d_reb int null, -- d_asts int null, -- d_pf int null, -- d_stl int null, -- d_to int null, -- d_blk int null, d_pts INTEGER null, -- o_tmRebound int null, -- d_tmRebound int null, homeWon INTEGER null, homeLost INTEGER null, awayWon INTEGER null, awayLost INTEGER null, -- neutWon int null, -- neutLoss int null, -- confWon int null, -- confLoss int null, -- divWon int null, -- divLoss int null, -- pace int null, won INTEGER null, lost INTEGER null, games INTEGER null, -- min int null, arena TEXT null, -- attendance int null, -- bbtmID varchar(255) null, primary key (year, tmID) ) CREATE TABLE "awards_coaches" ( id INTEGER primary key autoincrement, year INTEGER, coachID TEXT, award TEXT, lgID TEXT, note TEXT, foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade ) CREATE TABLE sqlite_sequence(name,seq) CREATE TABLE "players_teams" ( id INTEGER primary key autoincrement, playerID TEXT not null references players on update cascade on delete cascade, year INTEGER, stint INTEGER, tmID TEXT, lgID TEXT, GP INTEGER, GS INTEGER, minutes INTEGER, points INTEGER, oRebounds INTEGER, dRebounds INTEGER, rebounds INTEGER, assists INTEGER, steals INTEGER, blocks INTEGER, turnovers INTEGER, PF INTEGER, fgAttempted INTEGER, fgMade INTEGER, ftAttempted INTEGER, ftMade INTEGER, threeAttempted INTEGER, threeMade INTEGER, PostGP INTEGER, PostGS INTEGER, PostMinutes INTEGER, PostPoints INTEGER, PostoRebounds INTEGER, PostdRebounds INTEGER, PostRebounds INTEGER, PostAssists INTEGER, PostSteals INTEGER, PostBlocks INTEGER, PostTurnovers INTEGER, PostPF INTEGER, PostfgAttempted INTEGER, PostfgMade INTEGER, PostftAttempted INTEGER, PostftMade INTEGER, PostthreeAttempted INTEGER, PostthreeMade INTEGER, note TEXT, foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade ) CREATE TABLE "series_post" ( id INTEGER primary key autoincrement, year INTEGER, round TEXT, series TEXT, tmIDWinner TEXT, lgIDWinner TEXT, tmIDLoser TEXT, lgIDLoser TEXT, W INTEGER, L INTEGER, foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade, foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade )
na
2,810
2,810
CREATE TABLE `player_allstar` ( playerID TEXT not null, season_id INTEGER not null, conference TEXT null, blocks INTEGER null, primary key playerID, season_id, foreign key playerID references players playerID on update cascade on delete cascade ) CREATE TABLE `players` ( playerID TEXT not null primary key, nameNick TEXT null )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
8
simple
{ "case_1": [ 241, 318, 1060 ], "case_2": [ 39, 62, 241, 318, 1060 ], "case_3": [ 10, 39, 62, 169, 241, 278, 318, 364, 414, 463, 482, 838, 927, 998, 1051, 1060, 1072, 1109 ], "case_4": [ 10, 39, 62, 169, 241, 278, 285, 318, 364, 399, 414, 463, 482, 622, 656, 838, 927, 998, 1004, 1051, 1060, 1072, 1109 ], "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 ] }