input
stringlengths
358
16.1k
output
stringlengths
24
805
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT l_linenumber FROM lineitem WHERE l_discount = 0.1 LIMIT 3;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT COUNT(l_linenumber) FROM lineitem WHERE l_quantity > 40 AND l_shipmode = 'AIR';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT IIF(SUM(IIF(l_shipmode = 'RAIL', 1, 0)) - SUM(IIF(l_shipmode = 'MAIL', 1, 0)), 'RAIL', 'MAIL') AS result FROM lineitem WHERE l_shipinstruct = 'DELIVER IN PERSON';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT o_totalprice, o_orderpriority FROM orders WHERE o_orderkey = 33;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT COUNT(o_orderkey) AS countorders FROM orders WHERE STRFTIME('%Y', o_orderdate) = '1998' AND o_totalprice < 950;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT c_name FROM customer WHERE c_acctbal < 0 LIMIT 3;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT l_extendedprice * (1 - l_discount) FROM lineitem WHERE l_linenumber = 1;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT SUM(IIF(l_returnflag = 'A', 1, 0)) - SUM(IIF(l_returnflag = 'N', 1, 0)) AS diff FROM lineitem WHERE l_extendedprice < 16947.7;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T2.ps_supplycost FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey WHERE T1.p_type = 'large plated tin';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T1.p_name FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey WHERE T2.ps_availqty > 9998 LIMIT 3;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T1.p_name FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey WHERE T2.ps_supplycost < 10 AND T1.p_container = 'WRAP BAG' LIMIT 2;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T2.n_name FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_suppkey = 1;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T2.n_name FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey WHERE T1.r_name = 'Africa';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T.r_name FROM ( SELECT T1.r_name, COUNT(T2.n_name) AS num FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey GROUP BY T1.r_name ) AS T ORDER BY T.num LIMIT 1;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_mktsegment = 'FURNITURE' AND T2.n_name = 'IRAQ';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T2.c_name FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T1.o_totalprice = 191918.92 AND T1.o_custkey = 93697;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T1.n_name, T3.r_name FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN region AS T3 ON T1.n_regionkey = T3.r_regionkey WHERE T2.c_name = 'Customer#000000008';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT JULIANDAY(T2.l_receiptdate) - JULIANDAY(T2.l_commitdate), T1.o_clerk FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_orderkey = 6;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT COUNT(T1.s_suppkey) FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_acctbal < 0 AND T2.n_name = 'JAPAN';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT c_name FROM customer WHERE c_acctbal = ( SELECT MIN(c_acctbal) FROM customer );
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT o_orderdate FROM orders WHERE o_orderpriority = '1-URGENT';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT COUNT(l_linenumber) FROM lineitem WHERE l_shipinstruct = 'DELIVER IN PERSON';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT MAX(s_acctbal) FROM supplier;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT COUNT(ps_suppkey) FROM partsupp WHERE ps_availqty < 10;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T2.n_name FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey WHERE T1.r_name = 'EUROPE';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T2.ps_supplycost FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey WHERE T1.p_name = 'violet olive rose ivory sandy';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T1.c_phone FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'Ethiopia';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT SUM(T1.o_totalprice) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_phone = '627-220-3983';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT DISTINCT T2.l_shipmode FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_orderdate = '1994-12-31';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T.s_acctbal FROM ( SELECT T1.s_acctbal, COUNT(T2.ps_suppkey) AS num FROM supplier AS T1 INNER JOIN partsupp AS T2 ON T1.s_suppkey = T2.ps_suppkey GROUP BY T1.s_suppkey ) AS T ORDER BY T.num DESC LIMIT 1;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T2.n_name FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_acctbal = 4393.04;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T.r_name FROM ( SELECT T3.r_name, COUNT(T2.c_custkey) AS num FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN region AS T3 ON T1.n_regionkey = T3.r_regionkey GROUP BY T3.r_name ) AS T ORDER BY T.num DESC LIMIT 1;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T2.c_phone FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T1.o_totalprice > 300000;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T1.o_clerk FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T2.l_shipmode = 'MAIL';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T2.n_name FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey ORDER BY T1.s_acctbal LIMIT 1;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T2.s_address FROM partsupp AS T1 INNER JOIN supplier AS T2 ON T1.ps_suppkey = T2.s_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey ORDER BY T3.p_size DESC LIMIT 1;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T3.p_name, T4.s_name FROM partsupp AS T1 INNER JOIN lineitem AS T2 ON T1.ps_suppkey = T2.l_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey INNER JOIN supplier AS T4 ON T1.ps_suppkey = T4.s_suppkey ORDER BY T2.l_extendedprice * (1 - T2.l_discount) - T1.ps_supplycost * T2.l_quantity DESC LIMIT 1;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT CAST(SUM(IIF(T1.r_name = 'ASIA', 1, 0)) AS REAL) * 100 / COUNT(T1.r_regionkey) FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey INNER JOIN supplier AS T3 ON T2.n_nationkey = T3.s_nationkey;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT o_totalprice FROM orders WHERE o_orderkey = 32;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT COUNT(l_orderkey) FROM lineitem WHERE l_discount = 0;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT l_linenumber FROM lineitem WHERE STRFTIME('%Y', l_shipdate) < 1997 AND l_shipmode = 'truck';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT l_linenumber FROM lineitem WHERE STRFTIME('%Y', l_shipdate) < 1997 AND l_shipmode = 'TRUCK';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT l_linenumber FROM lineitem WHERE l_shipmode = 'AIR' ORDER BY l_quantity DESC LIMIT 1;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT c_name FROM customer WHERE c_acctbal < 0;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT COUNT(T1.c_name) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_mktsegment = 'HOUSEHOLD' AND T2.n_name = 'GERMANY';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T2.c_phone FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T1.o_orderpriority = '1-URGENT';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T3.c_name FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey INNER JOIN customer AS T3 ON T1.o_custkey = T3.c_custkey ORDER BY T2.l_discount DESC LIMIT 1;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T1.o_orderkey, T2.l_shipdate FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey ORDER BY T1.o_totalprice DESC LIMIT 5;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T1.o_comment FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_mktsegment = 'FURNITURE';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T2.c_name FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T1.o_totalprice > 300000;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T1.c_name FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_acctbal > 5000 AND T2.n_name = 'INDIA';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T1.s_phone FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T2.n_name = 'JAPAN';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T1.s_name FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_acctbal < 0 AND T2.n_name = 'ARGENTINA';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT COUNT(T1.r_name) FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey WHERE T2.n_name = 'ALGERIA';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T3.c_name FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey INNER JOIN customer AS T3 ON T1.o_custkey = T3.c_custkey WHERE T2.l_discount = 0.1 AND STRFTIME('%Y', T1.o_orderdate) BETWEEN 1994 AND 1995;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT CAST(SUM(IIF(T1.r_name = 'America', 1, 0)) AS REAL) * 100 / COUNT(T2.n_name) FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT CAST(SUM(IIF(T1.c_mktsegment = 'HOUSEHOLD', 1, 0)) AS REAL) * 100 / COUNT(T1.c_mktsegment) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'INDONESIA';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT p_name FROM part WHERE p_type = 'PROMO BRUSHED STEEL';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT p_comment FROM part WHERE p_name = 'burlywood plum powder puff mint';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT COUNT(p_partkey) FROM part WHERE p_retailprice > 1900;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT COUNT(p_partkey) FROM part WHERE p_type = 'PROMO BRUSHED STEEL' AND p_mfgr = 'Manufacturer#5';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT p_brand FROM part WHERE p_type = 'PROMO BRUSHED STEEL';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT p_name FROM part WHERE p_retailprice = ( SELECT MAX(p_retailprice) FROM part );
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T.p_name FROM ( SELECT p_name, p_size FROM part WHERE p_name IN ('pink powder drab lawn cyan', 'cornflower sky burlywood green beige') ) AS T ORDER BY p_size DESC LIMIT 1;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT COUNT(p_partkey) FROM part WHERE p_container = 'JUMBO CASE';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT MIN(p_size) FROM part WHERE p_container = 'JUMBO CASE';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT COUNT(s_suppkey) FROM supplier WHERE s_acctbal < 0;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT s_name FROM supplier ORDER BY s_acctbal DESC LIMIT 3;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T1.s_phone FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T2.n_name = 'Germany';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T2.s_name FROM partsupp AS T1 INNER JOIN supplier AS T2 ON T1.ps_suppkey = T2.s_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey WHERE T3.p_name = 'hot spring dodger dim light';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT MIN(T1.ps_supplycost) FROM partsupp AS T1 INNER JOIN part AS T2 ON T1.ps_partkey = T2.p_partkey WHERE T2.p_name = 'hot spring dodger dim light';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T2.s_name FROM partsupp AS T1 INNER JOIN supplier AS T2 ON T1.ps_suppkey = T2.s_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey WHERE T3.p_name = 'hot spring dodger dim light' ORDER BY T1.ps_supplycost LIMIT 1;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT SUM(T1.ps_availqty) FROM partsupp AS T1 INNER JOIN part AS T2 ON T1.ps_partkey = T2.p_partkey WHERE T2.p_name = 'hot spring dodger dim light';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T3.s_phone FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN supplier AS T3 ON T2.ps_suppkey = T3.s_suppkey WHERE T1.p_name = 'hot spring dodger dim light' ORDER BY T2.ps_availqty DESC LIMIT 1;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T3.s_phone FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN supplier AS T3 ON T2.ps_suppkey = T3.s_suppkey WHERE T1.p_name = 'hot spring dodger dim light' ORDER BY T1.p_size DESC LIMIT 1;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT COUNT(T3.s_name) FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN supplier AS T3 ON T2.ps_suppkey = T3.s_suppkey INNER JOIN nation AS T4 ON T3.s_nationkey = T4.n_nationkey WHERE T1.p_name = 'hot spring dodger dim light' AND T4.n_name = 'VIETNAM';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT COUNT(T3.s_name) FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN supplier AS T3 ON T2.ps_suppkey = T3.s_suppkey WHERE T3.s_acctbal < 0 AND T1.p_type = 'PROMO BRUSHED STEEL';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T3.s_name FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN supplier AS T3 ON T2.ps_suppkey = T3.s_suppkey WHERE T1.p_brand = 'Brand#55';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT SUM(num) FROM ( SELECT COUNT(T3.s_name) AS num FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN supplier AS T3 ON T2.ps_suppkey = T3.s_suppkey WHERE T1.p_type = 'PROMO BRUSHED STEEL' GROUP BY T2.ps_partkey HAVING SUM(T2.ps_availqty) < 5000 ) T;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT COUNT(T1.p_partkey) FROM part AS T1 INNER JOIN lineitem AS T2 ON T1.p_partkey = T2.l_partkey WHERE T1.p_name = 'hot spring dodger dim light';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT SUM(T1.p_partkey) FROM part AS T1 INNER JOIN lineitem AS T2 ON T1.p_partkey = T2.l_partkey WHERE T1.p_name = 'hot spring dodger dim light';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T.l_orderkey FROM ( SELECT T2.l_orderkey, COUNT(T2.l_partkey) AS num FROM part AS T1 INNER JOIN lineitem AS T2 ON T1.p_partkey = T2.l_partkey WHERE T1.p_container = 'JUMBO CASE' GROUP BY T2.l_orderkey ) AS T WHERE T.num > 2;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT COUNT(T1.n_nationkey) FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey INNER JOIN supplier AS T3 ON T1.n_nationkey = T3.s_nationkey WHERE T2.r_name = 'EUROPE' AND T3.s_acctbal < 0;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT COUNT(T1.r_regionkey) FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey INNER JOIN supplier AS T3 ON T2.n_nationkey = T3.s_nationkey WHERE T1.r_name = 'EUROPE';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T2.s_phone FROM lineitem AS T1 INNER JOIN supplier AS T2 ON T1.l_suppkey = T2.s_suppkey WHERE T1.l_orderkey = 1;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT COUNT(T1.l_linenumber) FROM lineitem AS T1 INNER JOIN supplier AS T2 ON T1.l_suppkey = T2.s_suppkey WHERE T1.l_orderkey = 4 AND T2.s_acctbal < 0;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT COUNT(T1.l_partkey) FROM lineitem AS T1 INNER JOIN supplier AS T2 ON T1.l_suppkey = T2.s_suppkey WHERE T1.l_returnflag = 'R' AND T2.s_acctbal < 0;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T1.l_shipdate FROM lineitem AS T1 INNER JOIN part AS T2 ON T1.l_partkey = T2.p_partkey WHERE T1.l_orderkey = 1 AND T2.p_name = 'burnished seashell gainsboro navajo chocolate';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T1.l_quantity FROM lineitem AS T1 INNER JOIN part AS T2 ON T1.l_partkey = T2.p_partkey WHERE T1.l_orderkey = 1 AND T2.p_name = 'burnished seashell gainsboro navajo chocolate';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T.p_name FROM ( SELECT T2.p_name, SUM(T1.l_quantity) AS num FROM lineitem AS T1 INNER JOIN part AS T2 ON T1.l_partkey = T2.p_partkey WHERE T2.p_name IN ('salmon white grey tan navy', 'burnished seashell gainsboro navajo chocolate') GROUP BY T1.l_partkey ) AS T ORDER BY T.num DESC LIMIT 1;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT MAX(T1.l_discount) FROM lineitem AS T1 INNER JOIN part AS T2 ON T1.l_partkey = T2.p_partkey WHERE T2.p_name = 'burnished seashell gainsboro navajo chocolate';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT DISTINCT T1.l_shipmode FROM lineitem AS T1 INNER JOIN part AS T2 ON T1.l_partkey = T2.p_partkey WHERE T2.p_name = 'burnished seashell gainsboro navajo chocolate';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT AVG(T1.ps_supplycost) FROM partsupp AS T1 INNER JOIN supplier AS T2 ON T1.ps_suppkey = T2.s_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey WHERE T3.p_name = 'hot spring dodger dim light';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT CAST((MAX(T1.ps_supplycost) - MIN(T1.ps_supplycost)) AS REAL) * 100 / MIN(T1.ps_supplycost) FROM partsupp AS T1 INNER JOIN supplier AS T2 ON T1.ps_suppkey = T2.s_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey WHERE T3.p_name = 'hot spring dodger dim light';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T1.l_extendedprice * (1 - T1.l_discount) - T2.ps_supplycost * T1.l_quantity FROM lineitem AS T1 INNER JOIN partsupp AS T2 ON T1.l_suppkey = T2.ps_suppkey WHERE T1.l_orderkey = 1 AND T1.l_partkey = 98768;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT T1.l_extendedprice * (1 - T1.l_discount) FROM lineitem AS T1 INNER JOIN part AS T2 ON T1.l_partkey = T2.p_partkey WHERE T2.p_name = 'burnished seashell gainsboro navajo chocolate' AND T1.l_orderkey = 1;
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT c_mktsegment FROM customer WHERE c_acctbal = ( SELECT MIN(c_acctbal) FROM customer );
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT COUNT(l_orderkey) FROM lineitem WHERE STRFTIME('%Y', l_shipdate) = '1997' AND l_shipmode = 'MAIL';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT COUNT(c_custkey) FROM customer WHERE c_mktsegment = 'FURNITURE';
[INST] Here is a database schema: customer : c_custkey [ INTEGER ] primary_key c_mktsegment [ TEXT ] c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey c_name [ TEXT ] c_address [ TEXT ] c_phone [ TEXT ] c_acctbal [ REAL ] c_comment [ TEXT ] lineitem : l_shipdate [ DATE ] l_orderkey [ INTEGER ] lineitem...
SELECT COUNT(l_orderkey) FROM lineitem WHERE STRFTIME('%Y', l_shipdate) = '1994' AND l_returnflag = 'R' AND l_shipmode = 'TRUCK';