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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
car_retails
|
On what date did the customer with the lowest credit limit serviced by sales representative Barry Jones make payments for his/her orders?
|
SELECT T3.paymentDate FROM employees AS T1 INNER JOIN customers AS T2 ON T1.employeeNumber = T2.salesRepEmployeeNumber INNER JOIN payments AS T3 ON T2.customerNumber = T3.customerNumber WHERE T1.firstName = 'Barry' AND T1.lastName = 'Jones' AND T1.jobTitle = 'Sales Rep' ORDER BY T2.creditLimit ASC LIMIT 1
|
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,601 | 1,601 |
CREATE TABLE `employees`
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
jobTitle TEXT not null,
foreign key reportsTo references employeesemployeeNumber
)
CREATE TABLE `customers`
(
customerNumber INTEGER not null
primary key,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key salesRepEmployeeNumber references employeesemployeeNumber
)
CREATE TABLE `payments`
(
customerNumber INTEGER not null,
paymentDate DATE not null,
primary key customerNumber,
foreign key customerNumber references customerscustomerNumber
)
|
[
"AS",
"AND",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"ASC",
"FROM"
] | 14 |
medium
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
10,
11,
12,
14,
16,
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,
80,
81,
82,
83,
84,
85,
86,
88,
89,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
713,
714,
715,
717,
719,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1010,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1024,
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
]
}
|
|
car_retails
|
To whom does the employee have to inform that is the sales representative of the French customer?
|
inform refers to reportsTo; 'reportsTO' is the leader of the 'employeeNumber'; France is a country; country = 'France';
|
SELECT T1.reportsTo FROM employees AS T1 INNER JOIN customers AS T2 ON T1.employeeNumber = T2.salesRepEmployeeNumber WHERE T2.country = 'France'
|
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,602 | 1,602 |
CREATE TABLE `employees`
(
employeeNumber INTEGER not null
primary key,
reportsTo INTEGER,
foreign key reportsTo references employeesemployeeNumber
)
CREATE TABLE `customers`
(
country TEXT not null,
salesRepEmployeeNumber INTEGER,
foreign key salesRepEmployeeNumber references employeesemployeeNumber
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
What is the full address of the customer who commented that DHL be used for the order that was shipped on April 4, 2005?
|
full address = addressLine1+addressLine2; shippedDate = '2005-04-04';
|
SELECT T1.addressLine1, T1.addressLine2 FROM customers AS T1 INNER JOIN orders AS T2 ON T1.customerNumber = T2.customerNumber WHERE T2.shippedDate = '2005-04-04' AND T2.status = 'Shipped'
|
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,603 | 1,603 |
CREATE TABLE `customers`
(
customerNumber INTEGER not null
primary key,
addressLine1 TEXT not null,
addressLine2 TEXT
)
CREATE TABLE `orders`
(
shippedDate DATE,
status TEXT not null,
customerNumber INTEGER not null,
foreign key customerNumber references customerscustomerNumber
)
|
[
"AS",
"AND",
"SELECT",
"-",
"INNER JOIN",
"ON",
"FROM"
] | 9 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
864,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
What is the full address of the office where the employee who is a sales representative for the customer whose business is located in the city of New York works?
|
full address = addressLine1 + addressLine2; NYC is a shortname of New York City.
|
SELECT T2.addressLine1, T2.addressLine2 FROM employees AS T1 INNER JOIN customers AS T2 ON T1.employeeNumber = T2.salesRepEmployeeNumber INNER JOIN offices AS T3 ON T1.officeCode = T3.officeCode WHERE T2.city = 'NYC' AND T1.jobTitle = 'Sales Rep'
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,604 | 1,604 |
CREATE TABLE `offices`
(
officeCode TEXT not null
primary key,
city TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT
)
CREATE TABLE `employees`
(
employeeNumber INTEGER not null
primary key,
officeCode TEXT not null,
jobTitle TEXT not null,
foreign key officeCode references officesofficeCode,
foreign key reportsTo references employeesemployeeNumber
)
CREATE TABLE `customers`
(
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
salesRepEmployeeNumber INTEGER,
foreign key salesRepEmployeeNumber references employeesemployeeNumber
)
|
[
"AS",
"AND",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 10 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
What is the full address of the office where 4 people work and one of them is Sales Representation?
|
full address = addressLine1+addressLine2; Sales Manager is a job title;
|
SELECT T1.addressLine1, T1.addressLine2 FROM customers AS T1 INNER JOIN employees AS T2 ON T1.salesRepEmployeeNumber = T2.employeeNumber WHERE T2.jobTitle = 'Sales Rep'
|
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,605 | 1,605 |
CREATE TABLE `employees`
(
employeeNumber INTEGER not null
primary key,
jobTitle TEXT not null,
foreign key reportsTo references employeesemployeeNumber
)
CREATE TABLE `customers`
(
addressLine1 TEXT not null,
addressLine2 TEXT,
salesRepEmployeeNumber INTEGER,
foreign key salesRepEmployeeNumber references employeesemployeeNumber
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
What profit can the seller Carousel DieCast Legends make from the sale of the product described as "The perfect holiday or anniversary gift for executives"?
|
seller and product vendor are synonyms; Carousel DieCast Legends is a product vendor; profit = SUM(SUBTRACT(msrp, buyPrice));
|
SELECT SUM(T2.MSRP - T2.buyPrice) FROM productlines AS T1 INNER JOIN products AS T2 ON T1.productLine = T2.productLine WHERE T2.productVendor = 'Carousel DieCast Legends' AND T1.textDescription LIKE '%perfect holiday or anniversary gift for executives%'
|
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,606 | 1,606 |
CREATE TABLE `productlines`
(
productLine TEXT not null
primary key,
textDescription TEXT
)
CREATE TABLE `products`
(
productLine TEXT not null,
productVendor TEXT not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key productLine references productlinesproductLine
)
|
[
"AS",
"AND",
"SELECT",
"SUM",
"or",
"LIKE",
"INNER JOIN",
"ON",
"FROM"
] | 10 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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,
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,
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,
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,
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,
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
]
}
|
car_retails
|
Of the clients whose businesses are located in the city of Boston, calculate which of them has a higher average amount of payment.
|
average amount payment = AVG(amount);
|
SELECT T1.customerNumber FROM customers AS T1 INNER JOIN payments AS T2 ON T1.customerNumber = T2.customerNumber WHERE T1.city = 'Boston' GROUP BY T1.customerNumber ORDER BY SUM(T2.amount) / COUNT(T2.paymentDate) DESC LIMIT 1
|
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,607 | 1,607 |
CREATE TABLE `customers`
(
customerNumber INTEGER not null
primary key,
city TEXT not null
)
CREATE TABLE `payments`
(
customerNumber INTEGER not null,
paymentDate DATE not null,
amount REAL not null,
primary key customerNumber,
foreign key customerNumber references customerscustomerNumber
)
|
[
"GROUP BY",
"AS",
"SELECT",
"SUM",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"COUNT",
"FROM"
] | 12 |
medium
|
{
"case_1": [
-1
],
"case_2": [
609
],
"case_3": [
16,
379,
470,
609,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"case_5": [
0,
1,
4,
6,
10,
11,
13,
15,
16,
20,
22,
24,
27,
28,
29,
30,
36,
37,
39,
42,
47,
49,
51,
53,
55,
59,
62,
63,
64,
68,
69,
71,
73,
74,
75,
77,
78,
81,
82,
83,
86,
88,
89,
91,
93,
94,
96,
98,
106,
108,
112,
113,
115,
117,
118,
119,
120,
121,
125,
126,
127,
129,
131,
138,
140,
141,
142,
143,
146,
148,
150,
152,
153,
155,
159,
160,
162,
163,
164,
167,
169,
170,
173,
175,
179,
183,
184,
185,
186,
187,
188,
189,
190,
191,
195,
196,
197,
199,
200,
201,
202,
206,
207,
212,
213,
214,
219,
225,
226,
227,
228,
229,
233,
234,
236,
239,
243,
244,
247,
248,
252,
254,
256,
261,
262,
264,
267,
268,
269,
275,
276,
277,
278,
279,
281,
285,
286,
291,
299,
300,
301,
304,
309,
311,
313,
314,
316,
317,
319,
320,
323,
324,
325,
329,
330,
334,
335,
336,
338,
339,
341,
342,
344,
345,
347,
348,
349,
352,
353,
354,
356,
358,
359,
360,
363,
364,
365,
370,
371,
373,
374,
375,
378,
379,
381,
382,
383,
384,
385,
391,
392,
394,
395,
401,
402,
403,
406,
409,
411,
412,
415,
416,
417,
424,
426,
427,
428,
429,
434,
435,
436,
438,
444,
445,
448,
450,
451,
452,
454,
460,
462,
464,
465,
467,
469,
470,
471,
473,
476,
477,
478,
482,
483,
484,
486,
487,
488,
490,
493,
495,
497,
500,
505,
509,
515,
516,
518,
519,
520,
526,
530,
532,
535,
536,
537,
538,
540,
542,
544,
547,
548,
550,
552,
558,
559,
560,
563,
564,
566,
567,
571,
573,
575,
578,
579,
580,
581,
582,
584,
586,
590,
592,
595,
596,
597,
606,
608,
609,
611,
612,
613,
620,
621,
623,
625,
626,
627,
628,
630,
632,
633,
634,
637,
638,
640,
641,
645,
646,
649,
650,
651,
654,
657,
658,
659,
662,
663,
664,
665,
666,
668,
669,
671,
676,
681,
682,
686,
687,
688,
690,
691,
694,
695,
696,
698,
701,
703,
705,
710,
712,
714,
717,
719,
720,
721,
723,
727,
733,
734,
735,
736,
739,
740,
743,
744,
745,
747,
748,
749,
750,
751,
752,
753,
756,
759,
760,
762,
768,
769,
772,
776,
777,
778,
779,
787,
788,
790,
796,
797,
799,
800,
802,
803,
804,
808,
810,
812,
813,
814,
818,
819,
823,
824,
825,
827,
830,
832,
838,
839,
841,
848,
849,
850,
851,
853,
857,
861,
866,
867,
868,
869,
870,
871,
874,
876,
877,
882,
886,
888,
889,
891,
893,
894,
896,
897,
898,
901,
902,
909,
911,
912,
915,
917,
918,
922,
923,
924,
926,
927,
929,
930,
932,
934,
935,
943,
944,
950,
951,
953,
954,
956,
958,
959,
961,
962,
963,
966,
967,
969,
970,
972,
973,
975,
977,
981,
983,
985,
986,
987,
993,
994,
996,
1004,
1005,
1006,
1010,
1012,
1013,
1015,
1017,
1022,
1023,
1025,
1027,
1030,
1031,
1034,
1037,
1038,
1042,
1043,
1047,
1049,
1050,
1051,
1056,
1057,
1058,
1062,
1064,
1065,
1067,
1068,
1071,
1072,
1076,
1077,
1078,
1082,
1084,
1086,
1087,
1091,
1092,
1094,
1098,
1100,
1101,
1103,
1104,
1106,
1112,
1119,
1123,
1124,
1128,
1131,
1133,
1134,
1135,
1137
]
}
|
car_retails
|
Calculate the total quantity ordered for 18th Century Vintage Horse Carriage and the average price.
|
18th Century Vintage Horse Carriage is a product name; average price = AVG(priceEach);
|
SELECT SUM(T2.quantityOrdered) , SUM(T2.quantityOrdered * T2.priceEach) / SUM(T2.quantityOrdered) FROM products AS T1 INNER JOIN orderdetails AS T2 ON T1.productCode = T2.productCode WHERE T1.productName = '18th Century Vintage Horse Carriage'
|
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,608 | 1,608 |
CREATE TABLE `products`
(
productCode TEXT not null
primary key,
productName TEXT not null
)
CREATE TABLE `orderdetails`
(
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null, productCode
)
|
[
"AS",
"SELECT",
"SUM",
"INNER JOIN",
"ON",
"FROM"
] | 9 |
simple
|
{
"case_1": [
-1
],
"case_2": [
1038
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
506,
507,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
car_retails
|
How many kinds of products did order No. 10252 contain?
|
Products refer to productCode;
|
SELECT COUNT(t.productCode) FROM orderdetails t WHERE t.orderNumber = '10252'
|
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,609 | 1,609 |
CREATE TABLE `orderdetails`
(
CREATE TABLE "orderdetails"
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
primary key orderNumber, productCode
)
|
[
"COUNT",
"SELECT",
"FROM"
] | 3 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
Who is the sales representative that made the order which was sent to 25 Maiden Lane, Floor No. 4?
|
Sales representative is an employee;
|
SELECT T2.firstName, T2.lastName FROM customers AS T1 INNER JOIN employees AS T2 ON T1.salesRepEmployeeNumber = T2.employeeNumber WHERE T1.addressLine1 = '25 Maiden Lane' AND T1.addressLine2 = 'Floor No. 4'
|
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,610 | 1,610 |
CREATE TABLE `employees`
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
foreign key reportsTo references employeesemployeeNumber
)
CREATE TABLE `customers`
(
addressLine1 TEXT not null,
addressLine2 TEXT,
salesRepEmployeeNumber INTEGER,
foreign key salesRepEmployeeNumber references employeesemployeeNumber
)
|
[
"AS",
"AND",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 7 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
Where's Foon Yue Tseng's office located at? Give the detailed address.
|
Detailed address comprises addressLine1 and addressLine2;
|
SELECT T1.addressLine1, T1.addressLine2 FROM offices AS T1 INNER JOIN employees AS T2 ON T1.officeCode = T2.officeCode WHERE T2.firstName = 'Foon Yue' AND T2.lastName = 'Tseng'
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,611 | 1,611 |
CREATE TABLE `offices`
(
officeCode TEXT not null
primary key,
addressLine1 TEXT not null,
addressLine2 TEXT
)
CREATE TABLE `employees`
(
lastName TEXT not null,
firstName TEXT not null,
officeCode TEXT not null,
foreign key officeCode references officesofficeCode
)
|
[
"AS",
"AND",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 7 |
simple
|
{
"case_1": [
8,
648
],
"case_2": [
8,
16,
648
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
Compared with the orders happened on 2005-04-08 and two days later, which day's order had a higher value?
|
2005-04-08 and two days later refer to orderDate = '2005-04-08' and orderDate = '2005-04-10'; order with a higher value refers to MAX(Total price) = MULTIPLY(quantityOrdered, priceEach);
|
SELECT T2.orderDate FROM orderdetails AS T1 INNER JOIN orders AS T2 ON T1.orderNumber = T2.orderNumber WHERE STRFTIME('%Y-%m-%d', T2.orderDate) = '2005-04-08' OR STRFTIME('%Y-%m-%d', T2.orderDate) = '2005-04-10' ORDER BY T1.quantityOrdered * T1.priceEach DESC LIMIT 1
|
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,612 | 1,612 |
CREATE TABLE `orders`
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null
)
CREATE TABLE `orderdetails`
(
CREATE TABLE "orderdetails"
orderNumber INTEGER not null
references orders,
quantityOrdered INTEGER not null,
priceEach REAL not null,
primary key orderNumber
)
|
[
"OR",
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"-",
"INNER JOIN",
"ON",
"DESC",
"STRFTIME",
"FROM"
] | 16 |
challenging
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
379,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"case_5": [
1,
3,
10,
11,
20,
21,
29,
34,
36,
39,
42,
45,
49,
51,
55,
59,
62,
69,
73,
74,
75,
85,
86,
89,
96,
97,
98,
105,
112,
115,
121,
125,
128,
135,
138,
141,
148,
150,
154,
158,
159,
162,
163,
167,
172,
173,
179,
180,
183,
184,
187,
188,
189,
197,
199,
200,
202,
206,
213,
214,
228,
229,
233,
239,
240,
244,
247,
262,
272,
275,
276,
278,
281,
286,
296,
300,
309,
311,
313,
314,
319,
320,
322,
324,
325,
329,
334,
336,
339,
341,
342,
345,
349,
353,
356,
359,
364,
365,
368,
373,
378,
379,
381,
382,
383,
385,
391,
392,
393,
394,
395,
403,
409,
411,
416,
425,
428,
429,
434,
435,
436,
444,
445,
446,
448,
451,
454,
460,
462,
469,
482,
489,
495,
496,
497,
498,
503,
505,
507,
509,
514,
520,
522,
529,
530,
532,
536,
537,
538,
542,
544,
548,
550,
552,
559,
560,
562,
566,
567,
578,
579,
580,
584,
586,
590,
592,
595,
611,
621,
624,
625,
626,
634,
637,
638,
643,
645,
647,
649,
654,
657,
659,
660,
664,
665,
669,
675,
677,
681,
684,
688,
690,
691,
693,
695,
701,
733,
735,
746,
752,
754,
756,
758,
759,
760,
768,
777,
778,
788,
790,
803,
805,
810,
818,
823,
825,
827,
829,
830,
835,
838,
850,
851,
858,
861,
866,
870,
876,
878,
882,
886,
889,
891,
893,
901,
905,
911,
918,
922,
925,
927,
929,
930,
934,
943,
950,
951,
953,
954,
956,
959,
962,
963,
966,
967,
970,
973,
974,
975,
977,
980,
981,
985,
993,
994,
1001,
1004,
1005,
1006,
1010,
1013,
1017,
1025,
1031,
1034,
1037,
1038,
1044,
1047,
1049,
1050,
1051,
1052,
1056,
1057,
1064,
1065,
1067,
1068,
1074,
1078,
1087,
1092,
1094,
1101,
1111,
1123,
1124,
1128,
1132,
1137
]
}
|
car_retails
|
How many products with the highest expected profits were sold in total?
|
Products refer to productCode; Expected profits = SUBTRACT(MSRP, buyPrice);
|
SELECT SUM(t2.quantityOrdered) FROM orderdetails AS t2 INNER JOIN ( SELECT t1.productCode FROM products AS t1 ORDER BY t1.MSRP - t1.buyPrice DESC LIMIT 1 ) AS t3 ON t2.productCode = t3.productCode
|
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,613 | 1,613 |
CREATE TABLE `products`
(
productCode TEXT not null
primary key,
buyPrice REAL not null,
MSRP REAL not null
)
CREATE TABLE `orderdetails`
(
productCode TEXT not null
references products,
quantityOrdered INTEGER not null, productCode
)
|
[
"AS",
"SELECT",
"SUM",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"FROM"
] | 13 |
medium
|
{
"case_1": [
1038
],
"case_2": [
1038
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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,
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,
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
]
}
|
car_retails
|
How much did Petit Auto pay on 2004-08-09?
|
Petit Auto is name of customer; paymentDate = '2004-08-09';
|
SELECT t1.amount FROM payments AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t2.customerName = 'Petit Auto' AND t1.paymentDate = '2004-08-09'
|
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,614 | 1,614 |
CREATE TABLE `customers`
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null
)
CREATE TABLE `payments`
(
customerNumber INTEGER not null,
paymentDate DATE not null,
amount REAL not null,
primary key customerNumber,
foreign key customerNumber references customerscustomerNumber
)
|
[
"AS",
"AND",
"SELECT",
"-",
"INNER JOIN",
"ON",
"FROM"
] | 9 |
simple
|
{
"case_1": [
523,
609
],
"case_2": [
523,
609
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
864,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
What was the contact name for the check "NR157385"?
|
Contact name refers to customerName;
|
SELECT t2.contactFirstName, t2.contactLastName FROM payments AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t1.checkNumber = 'NR157385'
|
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,615 | 1,615 |
CREATE TABLE `customers`
(
customerNumber INTEGER not null
primary key,
contactLastName TEXT not null,
contactFirstName TEXT not null
)
CREATE TABLE `payments`
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
primary key customerNumber, checkNumber,
foreign key customerNumber references customerscustomerNumber
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
523,
609
],
"case_2": [
523,
609
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
Which customer made the order No. 10160? Give the contact name.
|
SELECT t2.contactFirstName, t2.contactLastName FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t1.orderNumber = '10160'
|
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,616 | 1,616 |
CREATE TABLE `customers`
(
customerNumber INTEGER not null
primary key,
contactLastName TEXT not null,
contactFirstName TEXT not null
)
CREATE TABLE `orders`
(
orderNumber INTEGER not null
primary key,
customerNumber INTEGER not null,
foreign key customerNumber references customerscustomerNumber
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
|
car_retails
|
Where was the order No. 10383 shipped to? Show me the address.
|
Address comprises addressLine1 and addressLine2;
|
SELECT t2.addressLine1, t2.addressLine2 FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t1.orderNumber = '10383'
|
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,617 | 1,617 |
CREATE TABLE `customers`
(
customerNumber INTEGER not null
primary key,
addressLine1 TEXT not null,
addressLine2 TEXT
)
CREATE TABLE `orders`
(
orderNumber INTEGER not null
primary key,
customerNumber INTEGER not null,
foreign key customerNumber references customerscustomerNumber
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
For the productline where the product No.S18_2949 was produced, what's the text description for that product line?
|
SELECT t1.textDescription FROM productlines AS t1 INNER JOIN products AS t2 ON t1.productLine = t2.productLine WHERE t2.productCode = 'S18_2949'
|
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,618 | 1,618 |
CREATE TABLE `productlines`
(
productLine TEXT not null
primary key,
textDescription TEXT
)
CREATE TABLE `products`
(
productCode TEXT not null
primary key,
productLine TEXT not null,
foreign key productLine references productlinesproductLine
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
|
car_retails
|
If Dragon Souveniers, Ltd. aren't satisfied with their order and want to send a complain e-mail, which e-mail address should they send to?
|
E-mail address belongs to employee; customerName = 'Dragon Souveniers, Ltd.';
|
SELECT t2.email FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t1.customerName = 'Dragon Souveniers, Ltd.'
|
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,619 | 1,619 |
CREATE TABLE `employees`
(
employeeNumber INTEGER not null
primary key,
email TEXT not null,
foreign key reportsTo references employeesemployeeNumber
)
CREATE TABLE `customers`
(
customerName TEXT not null,
salesRepEmployeeNumber INTEGER,
foreign key salesRepEmployeeNumber references employeesemployeeNumber
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
How many French customers does Gerard Hernandez take care of?
|
Gerakd Hermandez is an employee; French customer refers to customer from France where country = 'France'
|
SELECT COUNT(t1.customerNumber) FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t1.country = 'France' AND t2.firstName = 'Gerard' AND t2.lastName = 'Hernandez'
|
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,620 | 1,620 |
CREATE TABLE `employees`
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
foreign key reportsTo references employeesemployeeNumber
)
CREATE TABLE `customers`
(
customerNumber INTEGER not null
primary key,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
foreign key salesRepEmployeeNumber references employeesemployeeNumber
)
|
[
"AS",
"AND",
"SELECT",
"INNER JOIN",
"ON",
"COUNT",
"FROM"
] | 9 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
718,
730,
798,
843,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
What was the latest order that customer No.114 made? Give the name of the product.
|
The latest refers to the most recent orderDate;
|
SELECT t3.productName FROM orderdetails AS t1 INNER JOIN orders AS t2 ON t1.orderNumber = t2.orderNumber INNER JOIN products AS t3 ON t1.productCode = t3.productCode WHERE t2.customerNumber = '114' ORDER BY t2.orderDate DESC LIMIT 1
|
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,621 | 1,621 |
CREATE TABLE `orders`
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
customerNumber INTEGER not null,
foreign key customerNumber references customerscustomerNumber
)
CREATE TABLE `products`
(
productCode TEXT not null
primary key,
productName TEXT not null
)
CREATE TABLE `orderdetails`
(
CREATE TABLE "orderdetails"
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
primary key orderNumber, productCode
)
|
[
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"FROM"
] | 12 |
medium
|
{
"case_1": [
-1
],
"case_2": [
379
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
For the product No. S18_3482 in the Order No.10108, how much discount did the customer have?
|
DIVIDE(SUBTRACT(MSRP, priceEach)), MSRP); product No. S18_3482 refers to productCode = 'S18_3482'
|
SELECT (t1.MSRP - t2.priceEach) / t1.MSRP FROM products AS t1 INNER JOIN orderdetails AS t2 ON t1.productCode = t2.productCode WHERE t1.productCode = 'S18_3482' AND t2.orderNumber = '10108'
|
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,622 | 1,622 |
CREATE TABLE `products`
(
productCode TEXT not null
primary key,
MSRP REAL not null
)
CREATE TABLE `orderdetails`
(
CREATE TABLE "orderdetails"
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
priceEach REAL not null,
primary key orderNumber, productCode
)
|
[
"AS",
"AND",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 7 |
simple
|
{
"case_1": [
-1
],
"case_2": [
1038
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
To whom does Steve Patterson report? Please give his or her full name.
|
reportsTO' is the leader of the 'employeeNumber';
|
SELECT t2.firstName, t2.lastName FROM employees AS t1 INNER JOIN employees AS t2 ON t2.employeeNumber = t1.reportsTo WHERE t1.firstName = 'Steve' AND t1.lastName = 'Patterson'
|
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,623 | 1,623 |
CREATE TABLE `employees`
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
reportsTo INTEGER,
foreign key reportsTo references employeesemployeeNumber
)
|
[
"AS",
"AND",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 7 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
How do I contact the President of the company?
|
President refers to the jobTitle;
|
SELECT t.email FROM employees t WHERE t.jobTitle = 'President'
|
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,624 | 1,624 |
CREATE TABLE `employees`
(
email TEXT not null,
jobTitle TEXT not null
)
|
[
"SELECT",
"FROM"
] | 2 |
simple
|
{
"case_1": [
843
],
"case_2": [
843
],
"case_3": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
Who is the sales representitive of Muscle Machine Inc? Please give the employee's full name.
|
Sales representative refers to jobTitle = 'Sales Rep'; Muscle Machine Inc is name of customer;
|
SELECT t2.firstName, t2.lastName FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t1.customerName = 'Muscle Machine Inc'
|
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,625 | 1,625 |
CREATE TABLE `employees`
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
foreign key reportsTo references employeesemployeeNumber
)
CREATE TABLE `customers`
(
customerName TEXT not null,
salesRepEmployeeNumber INTEGER,
foreign key salesRepEmployeeNumber references employeesemployeeNumber
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
If I'm from the Muscle Machine Inc, to which e-mail adress should I write a letter if I want to reach the superior of my sales representitive?
|
Muscle Machine Inc is name of customer; superior refers to 'reportsTO', who is the leader of the 'employeeNumber'
|
SELECT t2.email FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t1.customerName = 'Muscle Machine Inc'
|
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,626 | 1,626 |
CREATE TABLE `employees`
(
employeeNumber INTEGER not null
primary key,
email TEXT not null,
foreign key reportsTo references employeesemployeeNumber
)
CREATE TABLE `customers`
(
customerName TEXT not null,
salesRepEmployeeNumber INTEGER,
foreign key salesRepEmployeeNumber references employeesemployeeNumber
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
Please list all the customers that have Steve Patterson as their sales representitive.
|
Steve Patterson is an employee;
|
SELECT t1.customerName FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t2.firstName = 'Steve' AND t2.lastName = 'Patterson'
|
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,627 | 1,627 |
CREATE TABLE `employees`
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
foreign key reportsTo references employeesemployeeNumber
)
CREATE TABLE `customers`
(
customerName TEXT not null,
salesRepEmployeeNumber INTEGER,
foreign key salesRepEmployeeNumber references employeesemployeeNumber
)
|
[
"AS",
"AND",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 7 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
How many customers have an employee who reports to William Patterson as their sales representitive?
|
reportsTO' is the leader of the 'employeeNumber';
|
SELECT COUNT(t1.customerNumber) FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t2.firstName = 'William' AND t2.lastName = 'Patterson'
|
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,628 | 1,628 |
CREATE TABLE `employees`
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
foreign key reportsTo references employeesemployeeNumber
)
CREATE TABLE `customers`
(
customerNumber INTEGER not null
primary key,
salesRepEmployeeNumber INTEGER,
foreign key salesRepEmployeeNumber references employeesemployeeNumber
)
|
[
"AS",
"AND",
"SELECT",
"INNER JOIN",
"ON",
"COUNT",
"FROM"
] | 8 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
718,
730,
798,
843,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
Please list the phone numbers of the top 3 customers that have the highest credit limit and have Leslie Jennings as their sales representitive.
|
SELECT t1.phone FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t2.firstName = 'Leslie' AND t2.lastName = 'Jennings' ORDER BY t1.creditLimit DESC LIMIT 3
|
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,629 | 1,629 |
CREATE TABLE `employees`
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
foreign key reportsTo references employeesemployeeNumber
)
CREATE TABLE `customers`
(
phone TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key salesRepEmployeeNumber references employeesemployeeNumber
)
|
[
"AS",
"AND",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"FROM"
] | 10 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
|
car_retails
|
How many sales representitives are based in the offices in the USA?
|
Sales representative refers to jobTitle = 'Sales Rep'; country = 'USA';
|
SELECT COUNT(t1.employeeNumber) FROM employees AS t1 INNER JOIN offices AS t2 ON t1.officeCode = t2.officeCode WHERE t2.country = 'USA' AND t1.jobTitle = 'Sales Rep'
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,630 | 1,630 |
CREATE TABLE `offices`
(
officeCode TEXT not null
primary key,
country TEXT not null
)
CREATE TABLE `employees`
(
employeeNumber INTEGER not null
primary key,
officeCode TEXT not null,
jobTitle TEXT not null,
foreign key officeCode references officesofficeCode,
foreign key reportsTo references employeesemployeeNumber
)
|
[
"AS",
"AND",
"SELECT",
"INNER JOIN",
"ON",
"COUNT",
"FROM"
] | 8 |
simple
|
{
"case_1": [
8,
648
],
"case_2": [
8,
16,
648
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
718,
730,
798,
843,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
Where can I find the office of the President of the company?
|
Where can I find the office refers to address, comprising of addressLine1 and addressLine2; President is a jobTitle
|
SELECT t2.addressLine1, t2.addressLine2 FROM employees AS t1 INNER JOIN offices AS t2 ON t1.officeCode = t2.officeCode WHERE t1.jobTitle = 'President'
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,631 | 1,631 |
CREATE TABLE `offices`
(
officeCode TEXT not null
primary key,
addressLine1 TEXT not null,
addressLine2 TEXT
)
CREATE TABLE `employees`
(
officeCode TEXT not null,
jobTitle TEXT not null,
foreign key officeCode references officesofficeCode
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
8,
648
],
"case_2": [
8,
16,
648
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
What's the postal code of the office the VP Sales is at?
|
VP Sales refers to jobTitle
|
SELECT t2.postalCode FROM employees AS t1 INNER JOIN offices AS t2 ON t1.officeCode = t2.officeCode WHERE t1.jobTitle = 'VP Sales'
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,632 | 1,632 |
CREATE TABLE `offices`
(
officeCode TEXT not null
primary key,
postalCode TEXT not null
)
CREATE TABLE `employees`
(
officeCode TEXT not null,
jobTitle TEXT not null,
foreign key officeCode references officesofficeCode
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
8,
648
],
"case_2": [
8,
16,
648
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
What is the total price of the order made by Cruz & Sons Co. on 2003/3/3?
|
SUM(MULTIPLY(quantityOrdered, priceEach)) where orderDate = '2003-03-03'; customerName = 'Cruz & Sons Co.'
|
SELECT SUM(t1.priceEach * t1.quantityOrdered) FROM orderdetails AS t1 INNER JOIN orders AS t2 ON t1.orderNumber = t2.orderNumber INNER JOIN customers AS t3 ON t2.customerNumber = t3.customerNumber WHERE t3.customerName = 'Cruz & Sons Co.' AND t2.orderDate = '2003-03-03'
|
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,633 | 1,633 |
CREATE TABLE `customers`
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null
)
CREATE TABLE `orders`
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
customerNumber INTEGER not null,
foreign key customerNumber references customerscustomerNumber
)
CREATE TABLE `orderdetails`
(
CREATE TABLE "orderdetails"
orderNumber INTEGER not null
references orders,
quantityOrdered INTEGER not null,
priceEach REAL not null,
primary key orderNumber
)
|
[
"AS",
"AND",
"SELECT",
"SUM",
"-",
"INNER JOIN",
"ON",
"FROM"
] | 13 |
medium
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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,
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,
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,
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,
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,
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
]
}
|
car_retails
|
Which product did Cruz & Sons Co. order on 2003/3/3?
|
Cruz & Sons Co. is name of customer; 2003/3/3 refers to orderDate;
|
SELECT t4.productName FROM orderdetails AS t1 INNER JOIN orders AS t2 ON t1.orderNumber = t2.orderNumber INNER JOIN customers AS t3 ON t2.customerNumber = t3.customerNumber INNER JOIN products AS t4 ON t1.productCode = t4.productCode WHERE t3.customerName = 'Cruz & Sons Co.' AND t2.orderDate = '2003-03-03'
|
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,634 | 1,634 |
CREATE TABLE `customers`
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null
)
CREATE TABLE `orders`
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
customerNumber INTEGER not null,
foreign key customerNumber references customerscustomerNumber
)
CREATE TABLE `products`
(
productCode TEXT not null
primary key,
productName TEXT not null
)
CREATE TABLE `orderdetails`
(
CREATE TABLE "orderdetails"
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
primary key orderNumber, productCode
)
|
[
"AS",
"AND",
"SELECT",
"-",
"INNER JOIN",
"ON",
"FROM"
] | 15 |
medium
|
{
"case_1": [
470
],
"case_2": [
470
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
864,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
Which product did Cruz & Sons Co. ask for the biggest amount in a single order?
|
Cruz & Sons Co. is name of customer; the biggest amount refers to MAX(quantityOrdered).
|
SELECT t4.productName FROM orderdetails AS t1 INNER JOIN orders AS t2 ON t1.orderNumber = t2.orderNumber INNER JOIN customers AS t3 ON t2.customerNumber = t3.customerNumber INNER JOIN products AS t4 ON t1.productCode = t4.productCode WHERE t3.customerName = 'Cruz & Sons Co.' ORDER BY t1.priceEach * t1.quantityOrdered DESC LIMIT 1
|
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,635 | 1,635 |
CREATE TABLE `customers`
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null
)
CREATE TABLE `orders`
(
orderNumber INTEGER not null
primary key,
customerNumber INTEGER not null,
foreign key customerNumber references customerscustomerNumber
)
CREATE TABLE `products`
(
productCode TEXT not null
primary key,
productName TEXT not null
)
CREATE TABLE `orderdetails`
(
CREATE TABLE "orderdetails"
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
primary key orderNumber, productCode
)
|
[
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"FROM"
] | 15 |
medium
|
{
"case_1": [
470
],
"case_2": [
470
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
When were the products ordered by Cruz & Sons Co. on 2003-03-03 shipped?
|
Cruz & Sons Co. is name of customer; ordered on 2003-03-03 refers to orderDate;
|
SELECT t1.shippedDate FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t2.customerName = 'Cruz & Sons Co.' AND t1.orderDate = '2003-03-03'
|
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,636 | 1,636 |
CREATE TABLE `customers`
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null
)
CREATE TABLE `orders`
(
orderDate DATE not null,
shippedDate DATE,
customerNumber INTEGER not null,
foreign key customerNumber references customerscustomerNumber
)
|
[
"AS",
"AND",
"SELECT",
"-",
"INNER JOIN",
"ON",
"FROM"
] | 9 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
864,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
What is the amount of customers of 1957 Chevy Pickup by customers in a month?
|
SELECT COUNT(T2.customerNumber) FROM orderdetails AS T1 INNER JOIN orders AS T2 ON T1.orderNumber = T2.orderNumber WHERE T1.productCode IN ( SELECT productCode FROM products WHERE productName = '1957 Chevy Pickup' )
|
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,637 | 1,637 |
CREATE TABLE `orders`
(
orderNumber INTEGER not null
primary key,
customerNumber INTEGER not null,
foreign key customerNumber references customerscustomerNumber
)
CREATE TABLE `products`
(
productCode TEXT not null
primary key,
productName TEXT not null
)
CREATE TABLE `orderdetails`
(
CREATE TABLE "orderdetails"
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
primary key orderNumber, productCode
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"IN",
"ON",
"COUNT",
"FROM"
] | 10 |
simple
|
{
"case_1": [
-1
],
"case_2": [
379
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
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,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
399,
401,
402,
403,
405,
406,
407,
408,
409,
410,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
507,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
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,
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,
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,
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,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
|
car_retails
|
Name the product from the 'Classic Cars' production line that has the greatest expected profit.
|
The greatest expected profit refers to MAX(SUBTRACT(MSRP, buyPrice);
|
SELECT t.productName, t.MSRP - t.buyPrice FROM products AS t WHERE t.productLine = 'Classic Cars' ORDER BY t.MSRP - t.buyPrice DESC LIMIT 1
|
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,638 | 1,638 |
CREATE TABLE `products`
(
productName TEXT not null,
productLine TEXT not null,
MSRP REAL not null,
foreign key productLine references productlinesproductLine
)
|
[
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"DESC",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
379,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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,
1075,
1076,
1077,
1083,
1094,
1124,
1137,
1139,
1141
]
}
|
car_retails
|
List all the name of customers who have orders that are still processing.
|
Still processing refers to status = 'In Process';
|
SELECT t2.customerName FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t1.status = 'In Process'
|
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,639 | 1,639 |
CREATE TABLE `customers`
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null
)
CREATE TABLE `orders`
(
status TEXT not null,
customerNumber INTEGER not null,
foreign key customerNumber references customerscustomerNumber
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"In",
"FROM"
] | 7 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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,
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,
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
]
}
|
car_retails
|
Among all orders shipped, calculate the percentage of orders shipped at least 3 days before the required date.
|
Orders shipped refer to status = 'Shipped'; at least 3 days before the required date refers to SUBTRACT(shippedDate, requiredDate)>3; DIVIDE(COUNT(orderNumber where SUBTRACT(shippedDate, requiredDate)>3), (COUNT(orderNumber) as percentage;
|
SELECT COUNT(CASE WHEN JULIANDAY(t1.shippeddate) - JULIANDAY(t1.requireddate) > 3 THEN T1.customerNumber ELSE NULL END) FROM orders AS T1 INNER JOIN orderdetails AS T2 ON T1.orderNumber = T2.orderNumber WHERE T1.status = 'Shipped'
|
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,640 | 1,640 |
CREATE TABLE `orders`
(
orderNumber INTEGER not null
primary key,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
customerNumber INTEGER not null,
foreign key customerNumber references customerscustomerNumber
)
CREATE TABLE `orderdetails`
(
CREATE TABLE "orderdetails"
orderNumber INTEGER not null
references orders,
primary key orderNumber
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"CASE",
"NULL",
"INNER JOIN",
"ON",
"COUNT",
"FROM"
] | 10 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
Find the customer who made the highest payment in 2005.
|
The highest payment refers to max(amount); 2005 refers to year(paymentDate);
|
SELECT t2.customerName FROM payments AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE STRFTIME('%Y', t1.paymentDate) = '2005' GROUP BY t2.customerNumber, t2.customerName ORDER BY SUM(t1.amount) DESC LIMIT 1
|
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,641 | 1,641 |
CREATE TABLE `customers`
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null
)
CREATE TABLE `payments`
(
customerNumber INTEGER not null,
paymentDate DATE not null,
amount REAL not null,
primary key customerNumber,
foreign key customerNumber references customerscustomerNumber
)
|
[
"GROUP BY",
"AS",
"SELECT",
"SUM",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"STRFTIME",
"FROM"
] | 12 |
medium
|
{
"case_1": [
-1
],
"case_2": [
609
],
"case_3": [
379,
470,
609,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"case_5": [
1,
6,
10,
11,
13,
15,
20,
22,
24,
28,
29,
36,
39,
42,
49,
51,
55,
59,
62,
64,
69,
71,
73,
75,
77,
78,
81,
83,
86,
89,
93,
94,
96,
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,
197,
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,
276,
278,
279,
281,
285,
286,
300,
304,
309,
311,
313,
314,
316,
317,
319,
320,
322,
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,
1001,
1004,
1005,
1006,
1010,
1012,
1013,
1017,
1023,
1025,
1027,
1030,
1031,
1034,
1037,
1038,
1043,
1044,
1047,
1049,
1050,
1051,
1056,
1057,
1064,
1065,
1067,
1068,
1076,
1077,
1078,
1082,
1087,
1091,
1092,
1094,
1098,
1100,
1106,
1124,
1135,
1137
]
}
|
car_retails
|
Which is the most ordered quantity product? What is its expected profit margin per piece?
|
The most ordered quantity product refers to productName where Max(quantityOrdered); SUBTRACT(MSRP, buyPrice);
|
SELECT productName, MSRP - buyPrice FROM products WHERE productCode = ( SELECT productCode FROM orderdetails ORDER BY quantityOrdered DESC LIMIT 1 )
|
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,642 | 1,642 |
CREATE TABLE `products`
(
productCode TEXT not null
primary key,
productName TEXT not null,
MSRP REAL not null
)
CREATE TABLE `orderdetails`
(
productCode TEXT not null
references products,
quantityOrdered INTEGER not null, productCode
)
|
[
"SELECT",
"ORDER BY",
"LIMIT",
"FROM",
"DESC"
] | 7 |
simple
|
{
"case_1": [
-1
],
"case_2": [
1038
],
"case_3": [
379,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
For the order has the most product ordered, name the customer who placed the order.
|
The largest order in terms of total price refers to MAX(SUM(MULTIPLY(quantityOrdered, priceEach)).
|
SELECT T2.firstName, T2.lastName FROM offices AS T1 INNER JOIN employees AS T2 ON T1.officeCode = T2.officeCode WHERE T2.employeeNumber = ( SELECT MAX(employeeNumber) FROM employees )
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,643 | 1,643 |
CREATE TABLE `offices`
(
officeCode TEXT not null
primary key
)
CREATE TABLE `employees`
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
officeCode TEXT not null,
foreign key officeCode references officesofficeCode,
foreign key reportsTo references employeesemployeeNumber
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM",
"MAX"
] | 9 |
simple
|
{
"case_1": [
8,
648
],
"case_2": [
8,
16,
648
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1005,
1006,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
car_retails
|
List all customer names with orders that are disputed.
|
Orders that are disputed refer to status = 'Disputed'; the sales representative means employees; names refers to firstName, lastName.
|
SELECT t3.firstName, t3.lastName FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber INNER JOIN employees AS t3 ON t2.salesRepEmployeeNumber = t3.employeeNumber WHERE t1.status = 'Disputed'
|
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,644 | 1,644 |
CREATE TABLE `employees`
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
foreign key reportsTo references employeesemployeeNumber
)
CREATE TABLE `customers`
(
customerNumber INTEGER not null
primary key,
salesRepEmployeeNumber INTEGER,
foreign key salesRepEmployeeNumber references employeesemployeeNumber
)
CREATE TABLE `orders`
(
status TEXT not null,
customerNumber INTEGER not null,
foreign key customerNumber references customerscustomerNumber
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 9 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
What is the percentage of employees are in Paris office?
|
DIVIDE(COUNT(employeeNumber) when city = 'Paris'), (COUNT(employeeNumber)) as percentage;
|
SELECT CAST(COUNT(CASE WHEN t1.city = 'Paris' THEN t2.employeeNumber ELSE NULL END) AS REAL) * 100 / COUNT(t2.employeeNumber) FROM offices AS t1 INNER JOIN employees AS t2 ON t1.officeCode = t2.officeCode
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,645 | 1,645 |
CREATE TABLE `offices`
(
officeCode TEXT not null
primary key,
city TEXT not null
)
CREATE TABLE `employees`
(
employeeNumber INTEGER not null
primary key,
officeCode TEXT not null,
foreign key officeCode references officesofficeCode,
foreign key reportsTo references employeesemployeeNumber
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"CASE",
"NULL",
"INNER JOIN",
"ON",
"CAST",
"COUNT",
"FROM"
] | 13 |
medium
|
{
"case_1": [
16
],
"case_2": [
16
],
"case_3": [
16,
798
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"case_5": [
0,
1,
4,
6,
11,
16,
22,
24,
27,
30,
36,
37,
42,
47,
51,
53,
55,
61,
62,
63,
64,
68,
69,
71,
73,
74,
75,
77,
81,
82,
86,
88,
91,
93,
96,
98,
106,
113,
115,
117,
118,
119,
120,
121,
125,
126,
127,
129,
131,
138,
140,
142,
143,
146,
148,
150,
152,
153,
155,
158,
159,
160,
164,
167,
169,
170,
171,
175,
179,
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,
243,
244,
247,
248,
254,
256,
258,
261,
264,
267,
268,
269,
271,
276,
277,
278,
279,
298,
299,
300,
301,
303,
304,
311,
314,
316,
317,
319,
320,
322,
323,
325,
330,
334,
335,
336,
338,
339,
341,
344,
345,
347,
349,
354,
358,
360,
364,
370,
373,
374,
375,
382,
383,
384,
391,
392,
393,
394,
395,
398,
401,
402,
403,
406,
409,
411,
412,
415,
416,
417,
423,
424,
426,
427,
436,
438,
443,
444,
445,
448,
451,
452,
453,
454,
458,
460,
462,
464,
465,
467,
469,
471,
473,
476,
477,
478,
479,
483,
484,
485,
486,
487,
488,
490,
493,
500,
504,
505,
508,
509,
514,
515,
516,
517,
518,
519,
520,
522,
526,
528,
532,
533,
535,
536,
537,
538,
540,
544,
547,
548,
550,
552,
558,
559,
560,
563,
564,
566,
571,
573,
575,
580,
581,
582,
589,
595,
596,
597,
606,
608,
611,
613,
620,
623,
627,
628,
630,
632,
633,
634,
637,
640,
641,
645,
646,
649,
654,
658,
659,
662,
663,
665,
666,
668,
669,
671,
672,
676,
681,
682,
686,
687,
688,
690,
694,
696,
705,
706,
710,
712,
714,
721,
723,
724,
727,
733,
734,
735,
736,
739,
740,
743,
744,
747,
749,
750,
752,
753,
756,
760,
762,
768,
769,
772,
776,
778,
779,
787,
788,
790,
795,
796,
797,
798,
799,
800,
802,
804,
805,
808,
810,
812,
813,
814,
818,
819,
824,
827,
830,
832,
837,
838,
839,
841,
844,
848,
849,
851,
853,
857,
866,
867,
868,
870,
871,
874,
876,
877,
880,
886,
888,
893,
894,
896,
897,
898,
901,
902,
909,
911,
912,
915,
917,
918,
922,
923,
924,
926,
927,
930,
934,
935,
941,
943,
944,
950,
951,
954,
956,
958,
959,
961,
963,
969,
975,
977,
981,
985,
986,
993,
996,
998,
1005,
1006,
1008,
1010,
1012,
1013,
1015,
1022,
1023,
1036,
1037,
1042,
1043,
1047,
1048,
1050,
1051,
1058,
1062,
1064,
1066,
1067,
1069,
1071,
1072,
1078,
1082,
1084,
1086,
1087,
1092,
1094,
1098,
1100,
1101,
1103,
1104,
1106,
1112,
1119,
1123,
1124,
1128,
1129,
1131,
1133,
1134,
1135,
1137
]
}
|
car_retails
|
Name the Sales Manager of Europe, Middle East, and Africa region. In which office does he/she report to?
|
Sales Manager refers to jobTitle; Europe, Middle East, and Africa region refers to territory = 'EMEA';
|
SELECT t2.firstName, t2.lastName FROM offices AS t1 INNER JOIN employees AS t2 ON t1.officeCode = t2.officeCode WHERE t2.jobTitle = 'Sale Manager (EMEA)'
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,646 | 1,646 |
CREATE TABLE `offices`
(
officeCode TEXT not null
primary key
)
CREATE TABLE `employees`
(
lastName TEXT not null,
firstName TEXT not null,
officeCode TEXT not null,
jobTitle TEXT not null,
foreign key officeCode references officesofficeCode
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
8,
648
],
"case_2": [
8,
16,
648
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
List the name of employees in Japan office and who are they reporting to.
|
Japan is the name of the country; 'reportsTO' is the leader of the 'employeeNumber';
|
SELECT t2.firstName, t2.lastName, t2.reportsTo FROM offices AS t1 INNER JOIN employees AS t2 ON t1.officeCode = t2.officeCode WHERE t1.country = 'Japan'
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,647 | 1,647 |
CREATE TABLE `offices`
(
officeCode TEXT not null
primary key,
country TEXT not null
)
CREATE TABLE `employees`
(
lastName TEXT not null,
firstName TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
foreign key officeCode references officesofficeCode,
foreign key reportsTo references employeesemployeeNumber
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
8,
648
],
"case_2": [
8,
16,
648
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
Which customer ordered 1939 'Chevrolet Deluxe Coupe' at the highest price?
|
1939 'Chevrolet Deluxe Coupe' refers to productName; the highest price refers to MAX(priceEach)
|
SELECT t4.customerName FROM products AS t1 INNER JOIN orderdetails AS t2 ON t1.productCode = t2.productCode INNER JOIN orders AS t3 ON t2.orderNumber = t3.orderNumber INNER JOIN customers AS t4 ON t3.customerNumber = t4.customerNumber WHERE t1.productName = '1939 Chevrolet Deluxe Coupe' ORDER BY t2.priceEach DESC LIMIT 1
|
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,648 | 1,648 |
CREATE TABLE `customers`
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null
)
CREATE TABLE `orders`
(
orderNumber INTEGER not null
primary key,
customerNumber INTEGER not null,
foreign key customerNumber references customerscustomerNumber
)
CREATE TABLE `products`
(
productCode TEXT not null
primary key,
productName TEXT not null
)
CREATE TABLE `orderdetails`
(
CREATE TABLE "orderdetails"
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
priceEach REAL not null,
primary key orderNumber, productCode
)
|
[
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"FROM"
] | 15 |
medium
|
{
"case_1": [
470
],
"case_2": [
470
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
What is the percentage of the payment amount in 2004 was made by Atelier graphique?
|
DIVIDE(SUM(amount) where customerName = 'Atelier graphique'), (SUM(amount)) as percentage where year(paymentDate) = 2004;
|
SELECT SUM(CASE WHEN t1.customerName = 'Atelier graphique' THEN t2.amount ELSE 0 END) * 100 / SUM(t2.amount) FROM customers AS t1 INNER JOIN payments AS t2 ON t1.customerNumber = t2.customerNumber WHERE STRFTIME('%Y', t2.paymentDate) = '2004'
|
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,649 | 1,649 |
CREATE TABLE `customers`
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null
)
CREATE TABLE `payments`
(
customerNumber INTEGER not null,
paymentDate DATE not null,
amount REAL not null,
primary key customerNumber,
foreign key customerNumber references customerscustomerNumber
)
|
[
"CASE WHEN",
"AS",
"SELECT",
"SUM",
"CASE",
"INNER JOIN",
"ON",
"STRFTIME",
"FROM"
] | 11 |
medium
|
{
"case_1": [
-1
],
"case_2": [
523,
609
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
54,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
122,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
173,
175,
176,
177,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
205,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
245,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
507,
508,
509,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
709,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
872,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
939,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
979,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1093,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1110,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
car_retails
|
Calculate the actual profit for order number 10100.
|
SUM(MULTIPLY(quantityOrdered (SUBTRACT (priceEach, buyPrice));
|
SELECT SUM((t1.priceEach - t2.buyPrice) * t1.quantityOrdered) FROM orderdetails AS t1 INNER JOIN products AS t2 ON t1.productCode = t2.productCode WHERE t1.orderNumber = '10100'
|
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,650 | 1,650 |
CREATE TABLE `products`
(
productCode TEXT not null
primary key,
buyPrice REAL not null
)
CREATE TABLE `orderdetails`
(
CREATE TABLE "orderdetails"
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
primary key orderNumber, productCode
)
|
[
"AS",
"SELECT",
"SUM",
"INNER JOIN",
"ON",
"FROM"
] | 7 |
simple
|
{
"case_1": [
-1
],
"case_2": [
1038
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
506,
507,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
car_retails
|
How much did customer 103 pay in total?
|
Pay in total refers to SUM(amount);
|
SELECT SUM(t.amount) FROM payments t WHERE t.customerNumber = '103'
|
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,651 | 1,651 |
CREATE TABLE `payments`
(
customerNumber INTEGER not null,
amount REAL not null,
primary key customerNumber,
foreign key customerNumber references customerscustomerNumber
)
|
[
"SUM",
"SELECT",
"FROM"
] | 3 |
simple
|
{
"case_1": [
864
],
"case_2": [
718,
864
],
"case_3": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
What is the total price of the order 10100?
|
SUM(MULTIPLY(quantityOrdered, priceEach)
|
SELECT SUM(t.priceEach * t.quantityOrdered) FROM orderdetails t WHERE t.orderNumber = '10100'
|
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,652 | 1,652 |
CREATE TABLE `orderdetails`
(
CREATE TABLE "orderdetails"
orderNumber INTEGER not null
references orders,
quantityOrdered INTEGER not null,
priceEach REAL not null,
primary key orderNumber
)
|
[
"SUM",
"SELECT",
"FROM"
] | 3 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
Please list the top three product names with the highest unit price.
|
The highest unit price refers to MAX(priceEach)
|
SELECT t1.productName FROM products AS t1 INNER JOIN orderdetails AS t2 ON t1.productCode = t2.productCode ORDER BY t2.priceEach DESC LIMIT 3
|
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,653 | 1,653 |
CREATE TABLE `products`
(
productCode TEXT not null
primary key,
productName TEXT not null
)
CREATE TABLE `orderdetails`
(
productCode TEXT not null
references products,
priceEach REAL not null, productCode
)
|
[
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"FROM"
] | 9 |
simple
|
{
"case_1": [
-1
],
"case_2": [
1038
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
Among the customers of empolyee 1370, who has the highest credit limit?Please list the full name of the contact person.
|
Employee 1370 refers to employeeNumber = '1370';
|
SELECT t2.contactFirstName, t2.contactLastName FROM employees AS t1 INNER JOIN customers AS t2 ON t1.employeeNumber = t2.salesRepEmployeeNumber WHERE t1.employeeNumber = '1370' ORDER BY t2.creditLimit DESC LIMIT 1
|
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,654 | 1,654 |
CREATE TABLE `employees`
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
foreign key reportsTo references employeesemployeeNumber
)
CREATE TABLE `customers`
(
contactLastName TEXT not null,
contactFirstName TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key salesRepEmployeeNumber references employeesemployeeNumber
)
|
[
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"FROM"
] | 9 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
How many 2003 Harley-Davidson Eagle Drag Bikes were ordered?
|
2003 Harley-Davidson Eagle Drag Bikes refers to productName; how many ordered refers to COUNT(quantityOrdered);
|
SELECT SUM(t2.quantityOrdered) FROM products AS t1 INNER JOIN orderdetails AS t2 ON t1.productCode = t2.productCode WHERE t1.productName = '2003 Harley-Davidson Eagle Drag Bike'
|
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,655 | 1,655 |
CREATE TABLE `products`
(
productCode TEXT not null
primary key,
productName TEXT not null
)
CREATE TABLE `orderdetails`
(
productCode TEXT not null
references products,
quantityOrdered INTEGER not null, productCode
)
|
[
"AS",
"SELECT",
"SUM",
"-",
"INNER JOIN",
"ON",
"FROM"
] | 8 |
simple
|
{
"case_1": [
-1
],
"case_2": [
1038
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
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,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
506,
507,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
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,
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,
979,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1093,
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
]
}
|
car_retails
|
When was the product with the highest unit price shipped?
|
The highest unit price refers to MAX(priceEach); when shipped refers to shippedDate;
|
SELECT t1.shippedDate FROM orders AS t1 INNER JOIN orderdetails AS t2 ON t1.orderNumber = t2.orderNumber ORDER BY t2.priceEach DESC LIMIT 1
|
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,656 | 1,656 |
CREATE TABLE `orders`
(
orderNumber INTEGER not null
primary key,
shippedDate DATE
)
CREATE TABLE `orderdetails`
(
CREATE TABLE "orderdetails"
orderNumber INTEGER not null
references orders,
priceEach REAL not null,
primary key orderNumber
)
|
[
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"FROM"
] | 9 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
How many motorcycles have been ordered in 2004?
|
Motorcycles refer to productLine = 'motorcycles'; ordered in 2004 refers to year(orderDate) = 2004;
|
SELECT SUM(t2.quantityOrdered) FROM orders AS t1 INNER JOIN orderdetails AS t2 ON t1.orderNumber = t2.orderNumber INNER JOIN products AS t3 ON t2.productCode = t3.productCode WHERE t3.productLine = 'motorcycles' AND STRFTIME('%Y', t1.orderDate) = '2004'
|
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,657 | 1,657 |
CREATE TABLE `orders`
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null
)
CREATE TABLE `products`
(
productCode TEXT not null
primary key,
productLine TEXT not null,
foreign key productLine references productlinesproductLine
)
CREATE TABLE `orderdetails`
(
CREATE TABLE "orderdetails"
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
primary key orderNumber, productCode
)
|
[
"AS",
"AND",
"SELECT",
"SUM",
"INNER JOIN",
"ON",
"STRFTIME",
"FROM"
] | 12 |
medium
|
{
"case_1": [
-1
],
"case_2": [
379
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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,
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,
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,
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,
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,
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
]
}
|
car_retails
|
Please list the order number of the customer whose credit card has a limit of 45300.
|
Credit card does not have a limit refers to creditLimit = 45300;
|
SELECT t1.orderNumber FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t2.creditLimit = 45300
|
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,658 | 1,658 |
CREATE TABLE `customers`
(
customerNumber INTEGER not null
primary key,
creditLimit REAL
)
CREATE TABLE `orders`
(
orderNumber INTEGER not null
primary key,
customerNumber INTEGER not null,
foreign key customerNumber references customerscustomerNumber
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
For Which order was the most profitable, please list the customer name of the order and the profit of the order.
|
Most profitable order can be computed as MAX(MULTIPLY(quantityOrdered, SUBTRACT(priceEach, buyPrice)).
|
SELECT t3.customerName, (t1.priceEach - t4.buyPrice) * t1.quantityOrdered FROM orderdetails AS t1 INNER JOIN orders AS t2 ON t1.orderNumber = t2.orderNumber INNER JOIN customers AS t3 ON t2.customerNumber = t3.customerNumber INNER JOIN products AS t4 ON t1.productCode = t4.productCode GROUP BY t3.customerName, t1.priceEach, t4.buyPrice, t1.quantityOrdered ORDER BY (t1.priceEach - t4.buyPrice) * t1.quantityOrdered DESC LIMIT 1
|
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,659 | 1,659 |
CREATE TABLE `customers`
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null
)
CREATE TABLE `orders`
(
orderNumber INTEGER not null
primary key,
customerNumber INTEGER not null,
foreign key customerNumber references customerscustomerNumber
)
CREATE TABLE `products`
(
productCode TEXT not null
primary key,
buyPrice REAL not null
)
CREATE TABLE `orderdetails`
(
CREATE TABLE "orderdetails"
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
primary key orderNumber, productCode
)
|
[
"GROUP BY",
"AS",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"FROM"
] | 16 |
challenging
|
{
"case_1": [
-1
],
"case_2": [
470
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
How many transactions payment made by customer that is lower than 10000. Group the result by year.
|
Transactions payment lower than 10000 refer to COUNT(amount) < 1000; by year refers to YEAR(paymentDate)
|
SELECT STRFTIME('%Y', t1.paymentDate), COUNT(t1.customerNumber) FROM payments AS t1 WHERE t1.amount < 10000 GROUP BY STRFTIME('%Y', t1.paymentDate)
|
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,660 | 1,660 |
CREATE TABLE `payments`
(
customerNumber INTEGER not null,
paymentDate DATE not null,
amount REAL not null,
primary key customerNumber,
foreign key customerNumber references customerscustomerNumber
)
|
[
"GROUP BY",
"AS",
"SELECT",
"STRFTIME",
"COUNT",
"FROM"
] | 7 |
simple
|
{
"case_1": [
-1
],
"case_2": [
718
],
"case_3": [
16,
379,
718,
798
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"case_5": [
0,
1,
2,
4,
6,
11,
13,
15,
16,
20,
22,
27,
28,
30,
35,
36,
37,
47,
51,
53,
55,
61,
62,
63,
68,
69,
73,
74,
75,
77,
78,
82,
86,
87,
88,
89,
91,
93,
96,
98,
106,
108,
113,
115,
117,
118,
119,
121,
125,
126,
131,
140,
142,
143,
146,
148,
152,
159,
160,
164,
167,
169,
170,
173,
175,
179,
182,
183,
184,
187,
188,
189,
190,
191,
192,
196,
197,
199,
202,
206,
212,
213,
214,
225,
226,
227,
229,
233,
234,
243,
244,
247,
252,
254,
256,
261,
267,
268,
269,
271,
276,
277,
286,
299,
301,
303,
311,
313,
314,
316,
317,
319,
320,
322,
323,
325,
330,
334,
335,
336,
338,
339,
341,
344,
345,
348,
349,
352,
354,
356,
358,
359,
360,
364,
365,
370,
371,
373,
374,
375,
378,
379,
380,
381,
382,
383,
384,
391,
392,
394,
401,
403,
406,
409,
411,
412,
416,
417,
423,
424,
426,
436,
443,
444,
445,
447,
448,
453,
454,
458,
460,
462,
464,
465,
466,
467,
469,
471,
473,
476,
477,
478,
481,
484,
485,
487,
488,
490,
493,
500,
504,
505,
509,
510,
515,
516,
517,
519,
520,
526,
532,
535,
536,
537,
538,
542,
544,
547,
548,
552,
558,
559,
560,
563,
564,
566,
573,
579,
580,
581,
582,
586,
595,
596,
597,
606,
608,
611,
613,
620,
627,
630,
632,
633,
634,
638,
641,
645,
646,
649,
651,
654,
658,
659,
661,
662,
663,
664,
665,
668,
669,
671,
681,
687,
688,
690,
694,
696,
698,
701,
703,
705,
712,
714,
718,
719,
720,
721,
727,
733,
734,
735,
736,
739,
740,
743,
748,
749,
750,
751,
752,
753,
756,
760,
762,
768,
769,
772,
778,
779,
787,
790,
795,
796,
797,
798,
799,
800,
802,
804,
810,
812,
813,
814,
817,
818,
819,
823,
824,
825,
827,
830,
838,
839,
841,
849,
851,
853,
857,
866,
867,
869,
870,
874,
876,
877,
882,
886,
888,
889,
893,
894,
896,
897,
898,
901,
902,
909,
911,
912,
913,
915,
917,
918,
922,
923,
924,
926,
927,
929,
930,
932,
934,
935,
941,
943,
950,
951,
954,
956,
958,
961,
962,
963,
969,
972,
973,
975,
977,
981,
985,
986,
993,
996,
1001,
1005,
1006,
1008,
1010,
1011,
1013,
1015,
1022,
1023,
1025,
1030,
1037,
1042,
1043,
1044,
1047,
1050,
1051,
1057,
1058,
1062,
1064,
1067,
1069,
1070,
1071,
1072,
1075,
1076,
1077,
1078,
1082,
1084,
1086,
1087,
1091,
1094,
1100,
1101,
1103,
1104,
1106,
1112,
1113,
1119,
1121,
1123,
1124,
1128,
1131,
1133,
1134,
1135,
1137
]
}
|
car_retails
|
List out 3 best seller products during year 2003 with their total quantity sold during 2003.
|
Best selling products refer to products with MAX(quantityOrdered); 2003 refers to year(orderDate) = 2003;
|
SELECT t3.productName, SUM(t2.quantityOrdered) FROM orders AS t1 INNER JOIN orderdetails AS t2 ON t1.orderNumber = t2.orderNumber INNER JOIN products AS t3 ON t2.productCode = t3.productCode WHERE STRFTIME('%Y', t1.orderDate) = '2003' GROUP BY t3.productName ORDER BY SUM(t2.quantityOrdered) DESC LIMIT 3
|
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,661 | 1,661 |
CREATE TABLE `orders`
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null
)
CREATE TABLE `products`
(
productCode TEXT not null
primary key,
productName TEXT not null
)
CREATE TABLE `orderdetails`
(
CREATE TABLE "orderdetails"
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
primary key orderNumber, productCode
)
|
[
"GROUP BY",
"AS",
"SELECT",
"SUM",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"DESC",
"STRFTIME",
"FROM"
] | 16 |
challenging
|
{
"case_1": [
379
],
"case_2": [
379
],
"case_3": [
379,
470,
609,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"case_5": [
1,
6,
10,
11,
13,
15,
20,
22,
24,
28,
29,
36,
39,
42,
49,
51,
55,
59,
62,
64,
69,
71,
73,
75,
77,
78,
81,
83,
86,
89,
93,
94,
96,
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,
197,
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,
276,
278,
279,
281,
285,
286,
300,
304,
309,
311,
313,
314,
316,
317,
319,
320,
322,
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,
1001,
1004,
1005,
1006,
1010,
1012,
1013,
1017,
1023,
1025,
1027,
1030,
1031,
1034,
1037,
1038,
1043,
1044,
1047,
1049,
1050,
1051,
1056,
1057,
1064,
1065,
1067,
1068,
1076,
1077,
1078,
1082,
1087,
1091,
1092,
1094,
1098,
1100,
1106,
1124,
1135,
1137
]
}
|
car_retails
|
List out sale rep that has sold 1969 Harley Davidson Ultimate Chopper. List out their names and quantity sold throughout the year.
|
1969 Harley Davidson Ultimate Chopper refers to the name of the product; sale rep refers to employee; 2003 refers to year(orderDate) = 2003; quantity sold refers to quantityOrdered; their names refer to the name of customers;
|
SELECT t5.firstName, t5.lastName, SUM(t2.quantityOrdered) FROM products AS t1 INNER JOIN orderdetails AS t2 ON t1.productCode = t2.productCode INNER JOIN orders AS t3 ON t2.orderNumber = t3.orderNumber INNER JOIN customers AS t4 ON t3.customerNumber = t4.customerNumber INNER JOIN employees AS t5 ON t4.salesRepEmployeeNumber = t5.employeeNumber WHERE t1.productName = '1969 Harley Davidson Ultimate Chopper' GROUP BY t5.lastName, t5.firstName
|
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,662 | 1,662 |
CREATE TABLE `employees`
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
foreign key reportsTo references employeesemployeeNumber
)
CREATE TABLE `customers`
(
customerNumber INTEGER not null
primary key,
salesRepEmployeeNumber INTEGER,
foreign key salesRepEmployeeNumber references employeesemployeeNumber
)
CREATE TABLE `orders`
(
orderNumber INTEGER not null
primary key,
customerNumber INTEGER not null,
foreign key customerNumber references customerscustomerNumber
)
CREATE TABLE `products`
(
productCode TEXT not null
primary key,
productName TEXT not null
)
CREATE TABLE `orderdetails`
(
CREATE TABLE "orderdetails"
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
primary key orderNumber, productCode
)
|
[
"GROUP BY",
"AS",
"SELECT",
"SUM",
"INNER JOIN",
"ON",
"FROM"
] | 17 |
challenging
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
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,
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,
285,
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,
453,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
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,
542,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
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,
987,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
car_retails
|
Who are the sales representatives in New York City? List their full names.
|
New York City refers to city = 'NYC'; sales representative refers to jobTitle = 'Sales Rep';
|
SELECT t1.lastName, t1.firstName FROM employees AS t1 INNER JOIN offices AS t2 ON t1.officeCode = t2.officeCode WHERE t2.city = 'NYC' AND t1.jobTitle = 'Sales Rep'
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,663 | 1,663 |
CREATE TABLE `offices`
(
officeCode TEXT not null
primary key,
city TEXT not null
)
CREATE TABLE `employees`
(
lastName TEXT not null,
firstName TEXT not null,
officeCode TEXT not null,
jobTitle TEXT not null,
foreign key officeCode references officesofficeCode
)
|
[
"AS",
"AND",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 7 |
simple
|
{
"case_1": [
8,
648
],
"case_2": [
8,
16,
648
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
car_retails
|
Identify the customer and list down the country with the check number GG31455.
|
SELECT t2.customerName, t2.country FROM payments AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t1.checkNumber = 'GG31455'
|
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,664 | 1,664 |
CREATE TABLE `customers`
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
country TEXT not null
)
CREATE TABLE `payments`
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
primary key customerNumber, checkNumber,
foreign key customerNumber references customerscustomerNumber
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
523,
609
],
"case_2": [
523,
609
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
|
car_retails
|
How many 2001 Ferrari Enzo were ordered?
|
2001 Ferrari Enzo refers to productName;
|
SELECT SUM(t1.orderNumber) FROM orderdetails AS t1 INNER JOIN products AS t2 ON t1.productCode = t2.productCode WHERE t2.productName = '2001 Ferrari Enzo'
|
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,665 | 1,665 |
CREATE TABLE `products`
(
productCode TEXT not null
primary key,
productName TEXT not null
)
CREATE TABLE `orderdetails`
(
CREATE TABLE "orderdetails"
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
primary key orderNumber, productCode
)
|
[
"AS",
"SELECT",
"SUM",
"INNER JOIN",
"ON",
"FROM"
] | 7 |
simple
|
{
"case_1": [
-1
],
"case_2": [
1038
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
104,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
506,
507,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
car_retails
|
Which 5 products has the lowest amount of orders? List the product names.
|
The lowest amount of orders refers to MIN(quantityOrdered);
|
SELECT t2.productName FROM orderdetails AS t1 INNER JOIN products AS t2 ON t1.productCode = t2.productCode GROUP BY t2.productName ORDER BY SUM(t1.quantityOrdered) ASC LIMIT 5
|
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,666 | 1,666 |
CREATE TABLE `products`
(
productCode TEXT not null
primary key,
productName TEXT not null
)
CREATE TABLE `orderdetails`
(
productCode TEXT not null
references products,
quantityOrdered INTEGER not null, productCode
)
|
[
"GROUP BY",
"AS",
"SELECT",
"SUM",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"ASC",
"FROM"
] | 11 |
medium
|
{
"case_1": [
1038
],
"case_2": [
1038
],
"case_3": [
379,
470,
609,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"case_5": [
1,
6,
11,
20,
22,
24,
28,
29,
36,
39,
42,
49,
55,
59,
62,
64,
69,
71,
73,
75,
77,
81,
83,
86,
89,
93,
94,
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,
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,
349,
353,
356,
360,
363,
364,
365,
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,
665,
666,
669,
676,
681,
682,
686,
688,
690,
691,
695,
696,
701,
710,
717,
720,
721,
723,
733,
735,
740,
743,
744,
745,
747,
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,
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,
973,
975,
977,
981,
987,
993,
994,
1005,
1006,
1010,
1012,
1013,
1017,
1023,
1025,
1027,
1031,
1034,
1037,
1038,
1043,
1047,
1049,
1050,
1051,
1056,
1064,
1065,
1067,
1068,
1078,
1082,
1087,
1091,
1092,
1094,
1098,
1100,
1106,
1124,
1135,
1137
]
}
|
car_retails
|
List down the customer names with a disputed order status.
|
SELECT t1.customerName FROM customers AS t1 INNER JOIN orders AS t2 ON t1.customerNumber = t2.customerNumber WHERE t2.status = 'Disputed'
|
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,667 | 1,667 |
CREATE TABLE `customers`
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null
)
CREATE TABLE `orders`
(
status TEXT not null,
customerNumber INTEGER not null,
foreign key customerNumber references customerscustomerNumber
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
|
car_retails
|
How many countries from the USA have an In Process order status?
|
country = 'USA'
|
SELECT COUNT(t2.orderNumber) FROM customers AS t1 INNER JOIN orders AS t2 ON t1.customerNumber = t2.customerNumber WHERE t2.status = 'On Hold' AND t1.country = 'USA'
|
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,668 | 1,668 |
CREATE TABLE `customers`
(
customerNumber INTEGER not null
primary key,
country TEXT not null
)
CREATE TABLE `orders`
(
orderNumber INTEGER not null
primary key,
status TEXT not null,
customerNumber INTEGER not null,
foreign key customerNumber references customerscustomerNumber
)
|
[
"AS",
"AND",
"SELECT",
"INNER JOIN",
"ON",
"On",
"COUNT",
"FROM"
] | 9 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
510,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
car_retails
|
Calculate the total price of shipped orders belonging to Land of Toys Inc. under the classic car line of products.
|
SUM(MULTIPLY(quantityOrdered, priceEach)) where productLine = 'Classic Cars'; status = 'Shipped'; customername = 'Land of Toys Inc';
|
SELECT SUM(t3.priceEach * t3.quantityOrdered) FROM customers AS t1 INNER JOIN orders AS t2 ON t1.customerNumber = t2.customerNumber INNER JOIN orderdetails AS t3 ON t2.orderNumber = t3.orderNumber INNER JOIN products AS t4 ON t3.productCode = t4.productCode WHERE t4.productLine = 'Classic Cars' AND t1.customerName = 'Land of Toys Inc.' AND t2.status = 'Shipped'
|
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
)
CREATE TABLE employees
(
employeeNumber INTEGER not null
primary key,
lastName TEXT not null,
firstName TEXT not null,
extension TEXT not null,
email TEXT not null,
officeCode TEXT not null,
reportsTo INTEGER,
jobTitle TEXT not null,
foreign key (officeCode) references offices(officeCode),
foreign key (reportsTo) references employees(employeeNumber)
)
CREATE TABLE customers
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null,
contactLastName TEXT not null,
contactFirstName TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
city TEXT not null,
state TEXT,
postalCode TEXT,
country TEXT not null,
salesRepEmployeeNumber INTEGER,
creditLimit REAL,
foreign key (salesRepEmployeeNumber) references employees(employeeNumber)
)
CREATE TABLE orders
(
orderNumber INTEGER not null
primary key,
orderDate DATE not null,
requiredDate DATE not null,
shippedDate DATE,
status TEXT not null,
comments TEXT,
customerNumber INTEGER not null,
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE payments
(
customerNumber INTEGER not null,
checkNumber TEXT not null,
paymentDate DATE not null,
amount REAL not null,
primary key (customerNumber, checkNumber),
foreign key (customerNumber) references customers(customerNumber)
)
CREATE TABLE productlines
(
productLine TEXT not null
primary key,
textDescription TEXT,
htmlDescription TEXT,
image BLOB
)
CREATE TABLE products
(
productCode TEXT not null
primary key,
productName TEXT not null,
productLine TEXT not null,
productScale TEXT not null,
productVendor TEXT not null,
productDescription TEXT not null,
quantityInStock INTEGER not null,
buyPrice REAL not null,
MSRP REAL not null,
foreign key (productLine) references productlines(productLine)
)
CREATE TABLE "orderdetails"
(
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
orderLineNumber INTEGER not null,
primary key (orderNumber, productCode)
)
|
na
| 1,669 | 1,669 |
CREATE TABLE `customers`
(
customerNumber INTEGER not null
primary key,
customerName TEXT not null
)
CREATE TABLE `orders`
(
orderNumber INTEGER not null
primary key,
status TEXT not null,
customerNumber INTEGER not null,
foreign key customerNumber references customerscustomerNumber
)
CREATE TABLE `products`
(
productCode TEXT not null
primary key,
productLine TEXT not null,
foreign key productLine references productlinesproductLine
)
CREATE TABLE `orderdetails`
(
CREATE TABLE "orderdetails"
orderNumber INTEGER not null
references orders,
productCode TEXT not null
references products,
quantityOrdered INTEGER not null,
priceEach REAL not null,
primary key orderNumber, productCode
)
|
[
"AS",
"AND",
"SELECT",
"SUM",
"INNER JOIN",
"ON",
"FROM"
] | 15 |
medium
|
{
"case_1": [
470
],
"case_2": [
470
],
"case_3": [
8,
16,
379,
470,
523,
609,
648,
798,
1038
],
"case_4": [
8,
16,
168,
379,
470,
523,
609,
648,
718,
730,
798,
843,
864,
1038
],
"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
]
}
|
restaurant
|
How many restaurants have not obtained a minimum of 3 in their reviews?
|
have not obtained a minimum of 3 in review refers to review < 3
|
SELECT COUNT(id_restaurant) FROM generalinfo WHERE review < 3
|
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,670 | 1,670 |
CREATE TABLE `generalinfo`
(
id_restaurant INTEGER not null
primary key,
review REAL null
)
|
[
"COUNT",
"SELECT",
"FROM"
] | 3 |
simple
|
{
"case_1": [
1073
],
"case_2": [
1073
],
"case_3": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"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
]
}
|
restaurant
|
What types of food are served at the 4 top-reviewed restaurants?
|
top-reviewed refers to review = 4; type of food refers to food_type
|
SELECT food_type FROM generalinfo WHERE review = ( SELECT MAX(review) FROM generalinfo ) LIMIT 4
|
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,671 | 1,671 |
CREATE TABLE `generalinfo`
(
food_type TEXT null,
review REAL null
)
|
[
"LIMIT",
"SELECT",
"FROM",
"MAX"
] | 6 |
simple
|
{
"case_1": [
1073
],
"case_2": [
1073
],
"case_3": [
275,
311,
334,
590,
669,
886,
934,
972,
981,
1073
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"case_5": [
1,
10,
11,
13,
15,
17,
20,
28,
29,
31,
35,
36,
38,
49,
55,
59,
62,
69,
72,
73,
75,
78,
86,
89,
108,
109,
110,
119,
121,
123,
125,
133,
138,
150,
159,
162,
163,
167,
173,
174,
179,
181,
185,
187,
188,
199,
200,
202,
206,
208,
213,
229,
233,
239,
241,
247,
252,
262,
270,
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,
386,
394,
395,
400,
403,
404,
409,
410,
411,
428,
429,
434,
435,
444,
445,
451,
454,
460,
462,
466,
469,
482,
495,
497,
498,
505,
529,
530,
532,
534,
536,
538,
542,
548,
552,
555,
557,
560,
565,
566,
567,
576,
578,
579,
583,
584,
586,
590,
592,
595,
611,
619,
621,
625,
626,
633,
634,
637,
638,
642,
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,
820,
823,
827,
830,
836,
842,
845,
850,
851,
856,
861,
866,
869,
876,
886,
889,
891,
893,
901,
911,
918,
927,
929,
932,
934,
946,
950,
951,
953,
954,
956,
962,
963,
966,
967,
970,
972,
973,
975,
977,
981,
983,
984,
987,
989,
994,
1004,
1005,
1006,
1010,
1013,
1017,
1024,
1025,
1026,
1028,
1030,
1034,
1037,
1038,
1047,
1049,
1050,
1051,
1056,
1057,
1065,
1067,
1068,
1073,
1075,
1076,
1077,
1083,
1094,
1118,
1124,
1137,
1138,
1139,
1141
]
}
|
restaurant
|
How many restaurants in the city of Richmond serve Mediterranean food?
|
Mediterranean food refers to food_type = 'mediterranean'
|
SELECT COUNT(id_restaurant) FROM generalinfo WHERE food_type = 'mediterranean' AND city = 'richmond'
|
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,672 | 1,672 |
CREATE TABLE `generalinfo`
(
id_restaurant INTEGER not null
primary key,
food_type TEXT null,
city TEXT null,
foreign key city references geographiccity
on update cascade on delete cascade
)
|
[
"COUNT",
"AND",
"SELECT",
"FROM"
] | 4 |
simple
|
{
"case_1": [
1073
],
"case_2": [
1073
],
"case_3": [
275,
311,
316,
334,
524,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"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
]
}
|
restaurant
|
List all the cities in Sonoma County.
|
SELECT city FROM geographic WHERE county = 'sonoma county'
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,673 | 1,673 |
CREATE TABLE `geographic`
(
city TEXT not null
primary key,
county TEXT null
)
|
[
"SELECT",
"FROM"
] | 2 |
simple
|
{
"case_1": [
332,
972
],
"case_2": [
332,
972
],
"case_3": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"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
]
}
|
|
restaurant
|
What counties are not in the Bay Area Region?
|
not in the Bay Area region refers to region ! = 'bay area'
|
SELECT DISTINCT county FROM geographic WHERE region != 'bay area'
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,674 | 1,674 |
CREATE TABLE `geographic`
(
county TEXT null,
region TEXT null
)
|
[
"SELECT",
"FROM"
] | 2 |
simple
|
{
"case_1": [
332,
972
],
"case_2": [
332,
972
],
"case_3": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"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
]
}
|
restaurant
|
List all cities in the Northern California Region.
|
SELECT city FROM geographic WHERE region = 'northern california'
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,675 | 1,675 |
CREATE TABLE `geographic`
(
city TEXT not null
primary key,
region TEXT null
)
|
[
"SELECT",
"FROM"
] | 2 |
simple
|
{
"case_1": [
332,
972
],
"case_2": [
332,
972
],
"case_3": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"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
]
}
|
|
restaurant
|
List by its ID number all restaurants on 11th Street in Oakland.
|
11th Street refers to street_name = '11th street'; Oakland refers to city = 'oakland'; ID number of restaurant refers to id_restaurant
|
SELECT id_restaurant FROM location WHERE city = 'oakland' AND street_name = '11th street'
|
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,676 | 1,676 |
CREATE TABLE `location`
(
id_restaurant INTEGER not null
primary key,
street_name TEXT null,
city TEXT null,
foreign key city references geographic city
on update cascade on delete cascade,
foreign key id_restaurant references generalinfo id_restaurant
on update cascade on delete cascade
)
|
[
"AND",
"SELECT",
"FROM"
] | 3 |
simple
|
{
"case_1": [
442,
603
],
"case_2": [
442,
603
],
"case_3": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"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
]
}
|
restaurant
|
How many restaurants can we find at number 871 on its street?
|
number 871 on its street refers to street_num = 871
|
SELECT COUNT(id_restaurant) FROM location WHERE street_num = 871
|
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,677 | 1,677 |
CREATE TABLE `location`
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
foreign key id_restaurant references generalinfo id_restaurant
on update cascade on delete cascade
)
|
[
"COUNT",
"SELECT",
"FROM"
] | 3 |
simple
|
{
"case_1": [
442,
603
],
"case_2": [
442,
603
],
"case_3": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"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
]
}
|
restaurant
|
At what numbers on 9th Avenue of San Francisco there are restaurants?
|
9th Avenue refers to street_name = '9th avenue'; San Francisco refers to City = 'san francisco'
|
SELECT id_restaurant FROM location WHERE City = 'san francisco' AND street_name = '9th avenue'
|
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,678 | 1,678 |
CREATE TABLE `location`
(
id_restaurant INTEGER not null
primary key,
street_name TEXT null,
city TEXT null,
foreign key city references geographic city
on update cascade on delete cascade,
foreign key id_restaurant references generalinfo id_restaurant
on update cascade on delete cascade
)
|
[
"AND",
"SELECT",
"FROM"
] | 3 |
simple
|
{
"case_1": [
442,
603
],
"case_2": [
442,
603
],
"case_3": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"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
]
}
|
restaurant
|
What type of food is there in the restaurants on Adeline Street in Berkeley city?
|
Adeline Street refers to street_name = 'adeline st'; type of food refers to food_type
|
SELECT T1.food_type FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.street_name = 'adeline st' AND T2.city = 'berkeley'
|
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,679 | 1,679 |
CREATE TABLE `generalinfo`
(
id_restaurant INTEGER not null
primary key,
food_type TEXT null,
city TEXT null,
foreign key city references geographiccity
on update cascade on delete cascade
)
CREATE TABLE `location`
(
id_restaurant INTEGER not null
primary key,
street_name TEXT null,
city TEXT null,
foreign key city references geographic city
on update cascade on delete cascade,
foreign key id_restaurant references generalinfo id_restaurant
on update cascade on delete cascade
)
|
[
"AS",
"AND",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 7 |
simple
|
{
"case_1": [
217,
275,
524,
590,
799,
895
],
"case_2": [
217,
275,
524,
590,
799,
886,
895
],
"case_3": [
217,
275,
311,
316,
334,
524,
590,
597,
669,
799,
886,
895,
934,
981
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"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
]
}
|
restaurant
|
In which regions are there no African food restaurants?
|
no African food restaurants refers to food_type <> 'african'
|
SELECT DISTINCT T2.region FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.food_type != 'african'
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,680 | 1,680 |
CREATE TABLE `geographic`
(
city TEXT not null
primary key,
region TEXT null
)
CREATE TABLE `generalinfo`
(
food_type TEXT null,
city TEXT null,
foreign key city references geographiccity
on update cascade on delete cascade
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
316
],
"case_2": [
316,
334,
669,
934,
981
],
"case_3": [
217,
275,
311,
316,
334,
524,
590,
597,
669,
799,
886,
895,
934,
981
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"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
]
}
|
restaurant
|
In which counties are there A&W Root Beer Restaurants?
|
A&W Root Beer Restaurant refers to label = 'a & w root beer'
|
SELECT DISTINCT T2.county FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.label = 'a & w root beer'
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,681 | 1,681 |
CREATE TABLE `geographic`
(
city TEXT not null
primary key,
county TEXT null
)
CREATE TABLE `generalinfo`
(
label TEXT null,
city TEXT null,
foreign key city references geographiccity
on update cascade on delete cascade
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
316
],
"case_2": [
316,
334,
669,
934,
981
],
"case_3": [
217,
275,
311,
316,
334,
524,
590,
597,
669,
799,
886,
895,
934,
981
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"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
]
}
|
restaurant
|
Indicate street and number of the Adelitas Taqueria Restaurants.
|
street refers to street_name; number refers to street_num; Adelitas Taqueria Restaurant refers to label = 'adelitas taqueria'
|
SELECT T1.street_name, T1.street_num FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.label = 'adelitas taqueria'
|
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,682 | 1,682 |
CREATE TABLE `generalinfo`
(
id_restaurant INTEGER not null
primary key,
label TEXT null
)
CREATE TABLE `location`
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
foreign key id_restaurant references generalinfo id_restaurant
on update cascade on delete cascade
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
217,
275,
524,
590,
799,
895
],
"case_2": [
217,
275,
524,
590,
799,
886,
895
],
"case_3": [
217,
275,
311,
316,
334,
524,
590,
597,
669,
799,
886,
895,
934,
981
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"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
]
}
|
restaurant
|
What type of food is served at the restaurant located at 3140, Alpine Road at San Mateo County?
|
3140 Alpine Road at San Mateo County refers to street_num = 3140 AND street_name = 'alpine rd' AND County = 'san mateo county'; type of food refers to food_type
|
SELECT T2.food_type FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant INNER JOIN geographic AS T3 ON T2.city = T3.city WHERE T3.County = 'san mateo county' AND T1.street_name = 'alpine rd' AND T1.street_num = 3140
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,683 | 1,683 |
CREATE TABLE `geographic`
(
city TEXT not null
primary key,
county TEXT null
)
CREATE TABLE `generalinfo`
(
id_restaurant INTEGER not null
primary key,
food_type TEXT null,
city TEXT null,
foreign key city references geographiccity
on update cascade on delete cascade
)
CREATE TABLE `location`
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key city references geographic city
on update cascade on delete cascade,
foreign key id_restaurant references generalinfo id_restaurant
on update cascade on delete cascade
)
|
[
"AS",
"AND",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 11 |
medium
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
217,
275,
311,
316,
334,
524,
590,
597,
669,
799,
886,
895,
934,
981
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"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
]
}
|
restaurant
|
In which streets of the city of San Francisco are there restaurants that serve seafood?
|
street refers to street_name; seafood refers to food_type = 'seafood'
|
SELECT T1.street_name FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'san francisco' AND T2.food_type = 'seafood' AND street_name IS NOT NULL
|
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,684 | 1,684 |
CREATE TABLE `generalinfo`
(
id_restaurant INTEGER not null
primary key,
food_type TEXT null,
city TEXT null,
foreign key city references geographiccity
on update cascade on delete cascade
)
CREATE TABLE `location`
(
id_restaurant INTEGER not null
primary key,
street_name TEXT null,
city TEXT null,
foreign key city references geographic city
on update cascade on delete cascade,
foreign key id_restaurant references generalinfo id_restaurant
on update cascade on delete cascade
)
|
[
"AS",
"AND",
"SELECT",
"NULL",
"INNER JOIN",
"ON",
"NOT",
"IS",
"FROM"
] | 11 |
medium
|
{
"case_1": [
886
],
"case_2": [
217,
275,
524,
590,
799,
886,
895
],
"case_3": [
217,
275,
311,
316,
334,
524,
590,
597,
669,
799,
886,
895,
934,
981
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
67,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
294,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
508,
509,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
601,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
965,
966,
967,
969,
970,
971,
973,
974,
975,
977,
978,
980,
981,
982,
985,
986,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1005,
1006,
1010,
1012,
1013,
1014,
1015,
1016,
1017,
1019,
1020,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1056,
1058,
1059,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
restaurant
|
List all counties where there is no Bakers Square Restaurant & Pie Shop.
|
no Bakers Square Restaurant & Pie Shop refers to label <> 'bakers square restaurant & pie shop'
|
SELECT DISTINCT T2.county FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.label != 'bakers square restaurant & pie shop'
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,685 | 1,685 |
CREATE TABLE `geographic`
(
city TEXT not null
primary key,
county TEXT null
)
CREATE TABLE `generalinfo`
(
label TEXT null,
city TEXT null,
foreign key city references geographiccity
on update cascade on delete cascade
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
316
],
"case_2": [
316,
334,
669,
934,
981
],
"case_3": [
217,
275,
311,
316,
334,
524,
590,
597,
669,
799,
886,
895,
934,
981
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"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
]
}
|
restaurant
|
In how many counties is there a street called Appian Way?
|
a street called Appian Way refers to street_name = 'appian way'
|
SELECT COUNT(DISTINCT T2.county) FROM location AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.street_name = 'appian way'
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,686 | 1,686 |
CREATE TABLE `geographic`
(
city TEXT not null
primary key,
county TEXT null
)
CREATE TABLE `location`
(
street_name TEXT null,
city TEXT null,
foreign key city references geographic city
on update cascade on delete cascade
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"COUNT",
"FROM"
] | 7 |
simple
|
{
"case_1": [
597
],
"case_2": [
311,
597
],
"case_3": [
217,
275,
311,
316,
334,
524,
590,
597,
669,
799,
886,
895,
934,
981
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
466,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
507,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
661,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1113,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
restaurant
|
What is the rating of each restaurant reviews on Atlantic Ave?
|
Atlantic Ave refers to street_name = 'atlantic ave'; rating refers to review
|
SELECT T1.review FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.street_name = 'atlantic ave'
|
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,687 | 1,687 |
CREATE TABLE `generalinfo`
(
id_restaurant INTEGER not null
primary key,
review REAL null
)
CREATE TABLE `location`
(
id_restaurant INTEGER not null
primary key,
street_name TEXT null,
foreign key id_restaurant references generalinfo id_restaurant
on update cascade on delete cascade
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
217,
275,
524,
590,
799,
895
],
"case_2": [
217,
275,
524,
590,
799,
886,
895
],
"case_3": [
217,
275,
311,
316,
334,
524,
590,
597,
669,
799,
886,
895,
934,
981
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"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
]
}
|
restaurant
|
Identify all restaurants in Contra Costa County by id.
|
SELECT T1.id_restaurant FROM location AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'contra costa county'
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,688 | 1,688 |
CREATE TABLE `geographic`
(
city TEXT not null
primary key,
county TEXT null
)
CREATE TABLE `location`
(
id_restaurant INTEGER not null
primary key,
city TEXT null,
foreign key city references geographic city
on update cascade on delete cascade,
foreign key id_restaurant references generalinfo id_restaurant
on update cascade on delete cascade
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
597
],
"case_2": [
311,
597
],
"case_3": [
217,
275,
311,
316,
334,
524,
590,
597,
669,
799,
886,
895,
934,
981
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"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
]
}
|
|
restaurant
|
Identify all the restaurants in Yolo County by their label.
|
SELECT T1.id_restaurant, T1.label FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'yolo county'
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,689 | 1,689 |
CREATE TABLE `geographic`
(
city TEXT not null
primary key,
county TEXT null
)
CREATE TABLE `generalinfo`
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
city TEXT null,
foreign key city references geographiccity
on update cascade on delete cascade
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
316
],
"case_2": [
316,
334,
669,
934,
981
],
"case_3": [
217,
275,
311,
316,
334,
524,
590,
597,
669,
799,
886,
895,
934,
981
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"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
]
}
|
|
restaurant
|
What restaurant on Drive Street in San Rafael doesn't serve American food?
|
Drive Street refers to street_name = 'drive'; San Rafael refers to city = 'san rafael'; American food refers to food_type <> 'american'
|
SELECT T1.label FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.street_name = 'drive' AND T1.food_type != 'american' AND T2.city = 'san rafael'
|
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,690 | 1,690 |
CREATE TABLE `generalinfo`
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
foreign key city references geographiccity
on update cascade on delete cascade
)
CREATE TABLE `location`
(
id_restaurant INTEGER not null
primary key,
street_name TEXT null,
city TEXT null,
foreign key city references geographic city
on update cascade on delete cascade,
foreign key id_restaurant references generalinfo id_restaurant
on update cascade on delete cascade
)
|
[
"AS",
"AND",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 8 |
simple
|
{
"case_1": [
217,
275,
524,
590,
799,
895
],
"case_2": [
217,
275,
524,
590,
799,
886,
895
],
"case_3": [
217,
275,
311,
316,
334,
524,
590,
597,
669,
799,
886,
895,
934,
981
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"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
]
}
|
restaurant
|
On which streets in the city of San Francisco are there restaurants with a review of 1.7?
|
street refers to street_name; review of 1.7 refers to review = 1.7
|
SELECT T2.street_name FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'san francisco' AND T1.review = 1.7
|
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,691 | 1,691 |
CREATE TABLE `generalinfo`
(
id_restaurant INTEGER not null
primary key,
city TEXT null,
review REAL null,
foreign key city references geographiccity
on update cascade on delete cascade
)
CREATE TABLE `location`
(
id_restaurant INTEGER not null
primary key,
street_name TEXT null,
city TEXT null,
foreign key city references geographic city
on update cascade on delete cascade,
foreign key id_restaurant references generalinfo id_restaurant
on update cascade on delete cascade
)
|
[
"AS",
"AND",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 7 |
simple
|
{
"case_1": [
217,
275,
524,
590,
799,
895
],
"case_2": [
217,
275,
524,
590,
799,
886,
895
],
"case_3": [
217,
275,
311,
316,
334,
524,
590,
597,
669,
799,
886,
895,
934,
981
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"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
]
}
|
restaurant
|
Which restaurant on the street Alameda de las Pulgas in the city of Menlo Park is the worst rated?
|
restaurant refers to label; street Alameda de las Pulgas refers to street_name = 'avenida de las pulgas'; the worst rated refers to min(review)
|
SELECT T2.label FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.street_name = 'avenida de las pulgas' AND T2.city = 'menlo park' ORDER BY review LIMIT 1
|
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,692 | 1,692 |
CREATE TABLE `generalinfo`
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
city TEXT null,
review REAL null,
foreign key city references geographiccity
on update cascade on delete cascade
)
CREATE TABLE `location`
(
id_restaurant INTEGER not null
primary key,
street_name TEXT null,
city TEXT null,
foreign key city references geographic city
on update cascade on delete cascade,
foreign key id_restaurant references generalinfo id_restaurant
on update cascade on delete cascade
)
|
[
"AS",
"AND",
"SELECT",
"ORDER BY",
"LIMIT",
"INNER JOIN",
"ON",
"FROM"
] | 9 |
simple
|
{
"case_1": [
217,
275,
524,
590,
799,
895
],
"case_2": [
217,
275,
524,
590,
799,
886,
895
],
"case_3": [
217,
275,
311,
316,
334,
524,
590,
597,
669,
799,
886,
895,
934,
981
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"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,
38,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
89,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
286,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
542,
544,
547,
548,
550,
552,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
719,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
934,
935,
936,
937,
938,
940,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1004,
1005,
1006,
1010,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
restaurant
|
On what street in Tuolumne County is Good Heavens restaurant located?
|
street refers to street_name; Good Heavens restaurant refers to label = 'good heavens'
|
SELECT T1.street_name FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant INNER JOIN geographic AS T3 ON T2.city = T3.city WHERE T2.label = 'good heavens' AND T3.county = 'tuolumne county'
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,693 | 1,693 |
CREATE TABLE `geographic`
(
city TEXT not null
primary key,
county TEXT null
)
CREATE TABLE `generalinfo`
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
city TEXT null,
foreign key city references geographiccity
on update cascade on delete cascade
)
CREATE TABLE `location`
(
id_restaurant INTEGER not null
primary key,
street_name TEXT null,
city TEXT null,
foreign key city references geographic city
on update cascade on delete cascade,
foreign key id_restaurant references generalinfo id_restaurant
on update cascade on delete cascade
)
|
[
"AS",
"AND",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 10 |
simple
|
{
"case_1": [
-1
],
"case_2": [
-1
],
"case_3": [
217,
275,
311,
316,
334,
524,
590,
597,
669,
799,
886,
895,
934,
981
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"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
]
}
|
restaurant
|
Indicate the street numbers where Aux Delices Vietnamese Restaurant are located.
|
street numbers refers to street_num; Aux Delices Vietnamese Restaurant refers to label = 'aux delices vietnamese restaurant'
|
SELECT DISTINCT T1.street_num FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.label = 'aux delices vietnamese restaurant'
|
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,694 | 1,694 |
CREATE TABLE `generalinfo`
(
id_restaurant INTEGER not null
primary key,
label TEXT null
)
CREATE TABLE `location`
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
foreign key id_restaurant references generalinfo id_restaurant
on update cascade on delete cascade
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
217,
275,
524,
590,
799,
895
],
"case_2": [
217,
275,
524,
590,
799,
886,
895
],
"case_3": [
217,
275,
311,
316,
334,
524,
590,
597,
669,
799,
886,
895,
934,
981
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"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
]
}
|
restaurant
|
Identify all the restaurants in Marin County by their id.
|
SELECT T1.id_restaurant FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'marin county'
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,695 | 1,695 |
CREATE TABLE `geographic`
(
city TEXT not null
primary key,
county TEXT null
)
CREATE TABLE `generalinfo`
(
id_restaurant INTEGER not null
primary key,
city TEXT null,
foreign key city references geographiccity
on update cascade on delete cascade
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 6 |
simple
|
{
"case_1": [
316
],
"case_2": [
316,
334,
669,
934,
981
],
"case_3": [
217,
275,
311,
316,
334,
524,
590,
597,
669,
799,
886,
895,
934,
981
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"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
]
}
|
|
restaurant
|
In which regions are there no pizza restaurants?
|
no pizza restaurants refers to food_type = 'pizza'
|
SELECT DISTINCT T2.region FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.food_type = 'pizza' AND T2.region != 'unknown'
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,696 | 1,696 |
CREATE TABLE `geographic`
(
city TEXT not null
primary key,
region TEXT null
)
CREATE TABLE `generalinfo`
(
food_type TEXT null,
city TEXT null,
foreign key city references geographiccity
on update cascade on delete cascade
)
|
[
"AS",
"AND",
"SELECT",
"INNER JOIN",
"ON",
"FROM"
] | 7 |
simple
|
{
"case_1": [
316
],
"case_2": [
316,
334,
669,
934,
981
],
"case_3": [
217,
275,
311,
316,
334,
524,
590,
597,
669,
799,
886,
895,
934,
981
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"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
]
}
|
restaurant
|
Calculate the average rating of reviews for restaurants in Santa Cruz County.
|
average rating = divide(sum(review where county = 'santa cruz county'), count(id_restaurant where county = 'santa cruz county'))
|
SELECT AVG(T2.review) FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.county = 'santa cruz county'
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,697 | 1,697 |
CREATE TABLE `geographic`
(
city TEXT not null
primary key,
county TEXT null
)
CREATE TABLE `generalinfo`
(
city TEXT null,
review REAL null,
foreign key city references geographiccity
on update cascade on delete cascade
)
|
[
"AS",
"SELECT",
"INNER JOIN",
"ON",
"AVG",
"FROM"
] | 7 |
simple
|
{
"case_1": [
316
],
"case_2": [
316,
334,
669,
934,
981
],
"case_3": [
217,
275,
311,
316,
334,
524,
590,
597,
669,
799,
886,
895,
934,
981
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
178,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
217,
218,
219,
220,
221,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
454,
455,
456,
457,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
505,
507,
509,
511,
514,
515,
516,
518,
519,
520,
521,
522,
523,
524,
526,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
786,
787,
788,
790,
792,
793,
796,
797,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
999,
1000,
1001,
1003,
1005,
1006,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
restaurant
|
What percentage of restaurants in Monterey County have Mexican food?
|
Mexican food refers to food_type = 'mexican'; percentage = divide(count(id_restaurant where food_type = 'mexican'), count(id_restaurant)) where county = 'monterey county' * 100%
|
SELECT CAST(SUM(IIF(T2.food_type = 'mexican', 1, 0)) AS REAL) * 100 / COUNT(T2.id_restaurant) FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.county = 'monterey county'
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,698 | 1,698 |
CREATE TABLE `geographic`
(
city TEXT not null
primary key,
county TEXT null
)
CREATE TABLE `generalinfo`
(
id_restaurant INTEGER not null
primary key,
food_type TEXT null,
city TEXT null,
foreign key city references geographiccity
on update cascade on delete cascade
)
|
[
"AS",
"SELECT",
"SUM",
"INNER JOIN",
"ON",
"CAST",
"COUNT",
"FROM"
] | 10 |
simple
|
{
"case_1": [
316
],
"case_2": [
316,
334,
669,
934,
981
],
"case_3": [
217,
275,
311,
316,
334,
524,
590,
597,
669,
799,
886,
895,
934,
981
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
507,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
661,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
restaurant
|
What percentage of streets named 11th Street are in Alameda County?
|
street named 11th Street refers to street_name = '11th st'; percentage = divide(count(street_name = '11th st' and County = 'alameda county'), count(street_name where County = 'alameda county')) * 100%
|
SELECT CAST(SUM(IIF(T1.street_name = '11th st', 1, 0)) AS REAL) * 100 / COUNT(T1.id_restaurant) FROM location AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.County = 'alameda county'
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,699 | 1,699 |
CREATE TABLE `geographic`
(
city TEXT not null
primary key,
county TEXT null
)
CREATE TABLE `location`
(
id_restaurant INTEGER not null
primary key,
street_name TEXT null,
city TEXT null,
foreign key city references geographic city
on update cascade on delete cascade,
foreign key id_restaurant references generalinfo id_restaurant
on update cascade on delete cascade
)
|
[
"AS",
"SELECT",
"SUM",
"INNER JOIN",
"ON",
"CAST",
"COUNT",
"FROM"
] | 10 |
simple
|
{
"case_1": [
597
],
"case_2": [
311,
597
],
"case_3": [
217,
275,
311,
316,
334,
524,
590,
597,
669,
799,
886,
895,
934,
981
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"case_5": [
0,
1,
3,
4,
5,
6,
7,
8,
11,
12,
14,
16,
18,
19,
20,
21,
22,
23,
24,
26,
27,
29,
30,
33,
34,
35,
36,
37,
39,
41,
42,
44,
45,
46,
47,
48,
49,
51,
52,
53,
55,
57,
58,
59,
61,
62,
63,
64,
65,
66,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
80,
81,
82,
83,
84,
85,
86,
87,
88,
90,
91,
93,
94,
95,
96,
97,
98,
99,
101,
102,
105,
106,
107,
111,
112,
113,
115,
116,
117,
118,
119,
120,
121,
125,
126,
127,
128,
129,
130,
131,
132,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
148,
150,
151,
152,
153,
154,
155,
158,
159,
160,
162,
163,
164,
165,
166,
167,
169,
170,
171,
172,
175,
176,
177,
179,
180,
183,
184,
186,
187,
188,
189,
190,
191,
192,
194,
195,
196,
197,
199,
200,
201,
202,
206,
207,
211,
212,
213,
214,
215,
217,
218,
219,
220,
221,
223,
225,
226,
227,
228,
229,
232,
233,
234,
235,
236,
239,
240,
241,
242,
243,
244,
246,
247,
248,
250,
254,
256,
257,
258,
260,
261,
262,
264,
265,
266,
267,
268,
269,
271,
272,
275,
276,
277,
278,
279,
280,
281,
282,
284,
287,
289,
290,
292,
295,
296,
297,
298,
299,
300,
301,
302,
304,
307,
308,
309,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
329,
330,
333,
334,
335,
336,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
349,
353,
354,
356,
357,
358,
360,
361,
363,
364,
365,
368,
369,
370,
373,
374,
375,
376,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
398,
401,
402,
403,
405,
406,
407,
408,
409,
411,
412,
413,
414,
415,
416,
417,
419,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
440,
441,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
462,
463,
464,
465,
467,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
493,
494,
495,
496,
497,
498,
499,
500,
501,
503,
504,
505,
507,
509,
510,
511,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
526,
527,
528,
529,
530,
532,
533,
535,
536,
537,
538,
539,
540,
541,
544,
547,
548,
550,
552,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
569,
570,
571,
572,
573,
574,
575,
577,
578,
579,
580,
581,
582,
584,
586,
587,
588,
589,
590,
592,
593,
595,
596,
597,
600,
602,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
620,
621,
623,
624,
625,
626,
627,
628,
630,
631,
632,
633,
634,
636,
637,
638,
639,
640,
641,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
654,
655,
657,
658,
659,
660,
661,
662,
663,
665,
666,
668,
669,
670,
671,
672,
674,
675,
676,
677,
678,
681,
682,
683,
684,
685,
686,
687,
688,
690,
691,
693,
694,
695,
696,
697,
699,
700,
701,
702,
704,
705,
706,
710,
711,
712,
714,
715,
717,
720,
721,
722,
723,
724,
725,
726,
727,
728,
733,
734,
735,
736,
739,
740,
741,
742,
743,
744,
745,
746,
747,
749,
750,
751,
752,
753,
754,
755,
756,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
782,
783,
784,
786,
787,
788,
790,
792,
793,
795,
796,
797,
798,
799,
800,
802,
803,
804,
805,
806,
807,
808,
809,
810,
812,
813,
814,
818,
819,
822,
823,
824,
825,
827,
828,
829,
830,
832,
833,
834,
835,
837,
838,
839,
841,
844,
845,
846,
848,
849,
850,
851,
852,
853,
854,
857,
858,
859,
860,
861,
862,
863,
866,
867,
868,
870,
871,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
885,
886,
887,
888,
889,
891,
892,
893,
894,
895,
896,
897,
898,
900,
901,
902,
904,
905,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
922,
923,
924,
925,
926,
927,
928,
930,
931,
932,
934,
935,
936,
937,
938,
940,
941,
943,
944,
949,
950,
951,
952,
953,
954,
956,
958,
959,
961,
962,
963,
964,
966,
967,
969,
970,
971,
973,
974,
975,
977,
980,
981,
985,
986,
988,
991,
993,
994,
996,
997,
998,
999,
1000,
1001,
1003,
1005,
1006,
1008,
1010,
1011,
1012,
1013,
1015,
1016,
1017,
1019,
1022,
1023,
1025,
1027,
1029,
1031,
1033,
1034,
1035,
1037,
1038,
1039,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1049,
1050,
1051,
1052,
1056,
1058,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1074,
1078,
1080,
1082,
1084,
1085,
1086,
1087,
1089,
1091,
1092,
1094,
1095,
1098,
1099,
1100,
1101,
1103,
1104,
1105,
1106,
1109,
1111,
1112,
1114,
1115,
1116,
1118,
1119,
1121,
1122,
1123,
1124,
1128,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137
]
}
|
restaurant
|
Please list all of the restaurants that serve European food.
|
restaurant refers to label; European food refers to food_type = 'european'
|
SELECT label FROM generalinfo WHERE food_type = 'european'
|
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
|
CREATE TABLE geographic
(
city TEXT not null
primary key,
county TEXT null,
region TEXT null
)
CREATE TABLE generalinfo
(
id_restaurant INTEGER not null
primary key,
label TEXT null,
food_type TEXT null,
city TEXT null,
review REAL null,
foreign key (city) references geographic(city)
on update cascade on delete cascade
)
CREATE TABLE location
(
id_restaurant INTEGER not null
primary key,
street_num INTEGER null,
street_name TEXT null,
city TEXT null,
foreign key (city) references geographic (city)
on update cascade on delete cascade,
foreign key (id_restaurant) references generalinfo (id_restaurant)
on update cascade on delete cascade
)
|
na
| 1,700 | 1,700 |
CREATE TABLE `generalinfo`
(
label TEXT null,
food_type TEXT null
)
|
[
"SELECT",
"FROM"
] | 2 |
simple
|
{
"case_1": [
1073
],
"case_2": [
1073
],
"case_3": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"case_4": [
217,
275,
311,
316,
332,
334,
442,
524,
590,
597,
603,
669,
799,
886,
895,
934,
972,
981,
1073
],
"case_5": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53,
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65,
66,
67,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
78,
79,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
100,
101,
102,
103,
104,
105,
106,
107,
108,
109,
110,
111,
112,
113,
114,
115,
116,
117,
118,
119,
120,
121,
122,
123,
124,
125,
126,
127,
128,
129,
130,
131,
132,
133,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
147,
148,
149,
150,
151,
152,
153,
154,
155,
156,
157,
158,
159,
160,
161,
162,
163,
164,
165,
166,
167,
168,
169,
170,
171,
172,
173,
174,
175,
176,
177,
178,
179,
180,
181,
182,
183,
184,
185,
186,
187,
188,
189,
190,
191,
192,
193,
194,
195,
196,
197,
198,
199,
200,
201,
202,
203,
204,
205,
206,
207,
208,
209,
210,
211,
212,
213,
214,
215,
216,
217,
218,
219,
220,
221,
222,
223,
224,
225,
226,
227,
228,
229,
230,
231,
232,
233,
234,
235,
236,
237,
238,
239,
240,
241,
242,
243,
244,
245,
246,
247,
248,
249,
250,
251,
252,
253,
254,
255,
256,
257,
258,
259,
260,
261,
262,
263,
264,
265,
266,
267,
268,
269,
270,
271,
272,
273,
274,
275,
276,
277,
278,
279,
280,
281,
282,
283,
284,
285,
286,
287,
288,
289,
290,
291,
292,
293,
294,
295,
296,
297,
298,
299,
300,
301,
302,
303,
304,
305,
306,
307,
308,
309,
310,
311,
312,
313,
314,
315,
316,
317,
318,
319,
320,
321,
322,
323,
324,
325,
326,
327,
328,
329,
330,
331,
332,
333,
334,
335,
336,
337,
338,
339,
340,
341,
342,
343,
344,
345,
346,
347,
348,
349,
350,
351,
352,
353,
354,
355,
356,
357,
358,
359,
360,
361,
362,
363,
364,
365,
366,
367,
368,
369,
370,
371,
372,
373,
374,
375,
376,
377,
378,
379,
380,
381,
382,
383,
384,
385,
386,
387,
388,
389,
390,
391,
392,
393,
394,
395,
396,
397,
398,
399,
400,
401,
402,
403,
404,
405,
406,
407,
408,
409,
410,
411,
412,
413,
414,
415,
416,
417,
418,
419,
420,
421,
422,
423,
424,
425,
426,
427,
428,
429,
430,
431,
432,
433,
434,
435,
436,
437,
438,
439,
440,
441,
442,
443,
444,
445,
446,
447,
448,
449,
450,
451,
452,
453,
454,
455,
456,
457,
458,
459,
460,
461,
462,
463,
464,
465,
466,
467,
468,
469,
470,
471,
472,
473,
474,
475,
476,
477,
478,
479,
480,
481,
482,
483,
484,
485,
486,
487,
488,
489,
490,
491,
492,
493,
494,
495,
496,
497,
498,
499,
500,
501,
502,
503,
504,
505,
506,
507,
508,
509,
510,
511,
512,
513,
514,
515,
516,
517,
518,
519,
520,
521,
522,
523,
524,
525,
526,
527,
528,
529,
530,
531,
532,
533,
534,
535,
536,
537,
538,
539,
540,
541,
542,
543,
544,
545,
546,
547,
548,
549,
550,
551,
552,
553,
554,
555,
556,
557,
558,
559,
560,
561,
562,
563,
564,
565,
566,
567,
568,
569,
570,
571,
572,
573,
574,
575,
576,
577,
578,
579,
580,
581,
582,
583,
584,
585,
586,
587,
588,
589,
590,
591,
592,
593,
594,
595,
596,
597,
598,
599,
600,
601,
602,
603,
604,
605,
606,
607,
608,
609,
610,
611,
612,
613,
614,
615,
616,
617,
618,
619,
620,
621,
622,
623,
624,
625,
626,
627,
628,
629,
630,
631,
632,
633,
634,
635,
636,
637,
638,
639,
640,
641,
642,
643,
644,
645,
646,
647,
648,
649,
650,
651,
652,
653,
654,
655,
656,
657,
658,
659,
660,
661,
662,
663,
664,
665,
666,
667,
668,
669,
670,
671,
672,
673,
674,
675,
676,
677,
678,
679,
680,
681,
682,
683,
684,
685,
686,
687,
688,
689,
690,
691,
692,
693,
694,
695,
696,
697,
698,
699,
700,
701,
702,
703,
704,
705,
706,
707,
708,
709,
710,
711,
712,
713,
714,
715,
716,
717,
718,
719,
720,
721,
722,
723,
724,
725,
726,
727,
728,
729,
730,
731,
732,
733,
734,
735,
736,
737,
738,
739,
740,
741,
742,
743,
744,
745,
746,
747,
748,
749,
750,
751,
752,
753,
754,
755,
756,
757,
758,
759,
760,
761,
762,
763,
764,
765,
766,
767,
768,
769,
770,
771,
772,
773,
774,
775,
776,
777,
778,
779,
780,
781,
782,
783,
784,
785,
786,
787,
788,
789,
790,
791,
792,
793,
794,
795,
796,
797,
798,
799,
800,
801,
802,
803,
804,
805,
806,
807,
808,
809,
810,
811,
812,
813,
814,
815,
816,
817,
818,
819,
820,
821,
822,
823,
824,
825,
826,
827,
828,
829,
830,
831,
832,
833,
834,
835,
836,
837,
838,
839,
840,
841,
842,
843,
844,
845,
846,
847,
848,
849,
850,
851,
852,
853,
854,
855,
856,
857,
858,
859,
860,
861,
862,
863,
864,
865,
866,
867,
868,
869,
870,
871,
872,
873,
874,
875,
876,
877,
878,
879,
880,
881,
882,
883,
884,
885,
886,
887,
888,
889,
890,
891,
892,
893,
894,
895,
896,
897,
898,
899,
900,
901,
902,
903,
904,
905,
906,
907,
908,
909,
910,
911,
912,
913,
914,
915,
916,
917,
918,
919,
920,
921,
922,
923,
924,
925,
926,
927,
928,
929,
930,
931,
932,
933,
934,
935,
936,
937,
938,
939,
940,
941,
942,
943,
944,
945,
946,
947,
948,
949,
950,
951,
952,
953,
954,
955,
956,
957,
958,
959,
960,
961,
962,
963,
964,
965,
966,
967,
968,
969,
970,
971,
972,
973,
974,
975,
976,
977,
978,
979,
980,
981,
982,
983,
984,
985,
986,
987,
988,
989,
990,
991,
992,
993,
994,
995,
996,
997,
998,
999,
1000,
1001,
1002,
1003,
1004,
1005,
1006,
1007,
1008,
1009,
1010,
1011,
1012,
1013,
1014,
1015,
1016,
1017,
1018,
1019,
1020,
1021,
1022,
1023,
1024,
1025,
1026,
1027,
1028,
1029,
1030,
1031,
1032,
1033,
1034,
1035,
1036,
1037,
1038,
1039,
1040,
1041,
1042,
1043,
1044,
1045,
1046,
1047,
1048,
1049,
1050,
1051,
1052,
1053,
1054,
1055,
1056,
1057,
1058,
1059,
1060,
1061,
1062,
1063,
1064,
1065,
1066,
1067,
1068,
1069,
1070,
1071,
1072,
1073,
1074,
1075,
1076,
1077,
1078,
1079,
1080,
1081,
1082,
1083,
1084,
1085,
1086,
1087,
1088,
1089,
1090,
1091,
1092,
1093,
1094,
1095,
1096,
1097,
1098,
1099,
1100,
1101,
1102,
1103,
1104,
1105,
1106,
1107,
1108,
1109,
1110,
1111,
1112,
1113,
1114,
1115,
1116,
1117,
1118,
1119,
1120,
1121,
1122,
1123,
1124,
1125,
1126,
1127,
1128,
1129,
1130,
1131,
1132,
1133,
1134,
1135,
1136,
1137,
1138,
1139,
1140,
1141
]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.