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 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_suppkey = 7414 AND T1.l_orderkey = 817154;
[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.n_name FROM ( SELECT T2.n_name, SUM(T1.s_acctbal) AS num FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_acctbal < 0 GROUP BY T2.n_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 CAST(SUM(IIF(T2.r_name = 'EUROPE', 1, 0)) AS REAL) * 100 / COUNT(T1.n_name) FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_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(T2.n_name = 'JAPAN', 1, 0)) AS REAL) * 100 / COUNT(T1.s_name) FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.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 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 COUNT(l_orderkey) FROM lineitem WHERE STRFTIME('%Y', l_shipdate) = '1998';
[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_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(l_linenumber) FROM lineitem WHERE l_returnflag = 'R' AND l_shipmode = 'AIR' AND STRFTIME('%Y', l_shipdate) = '1994';
[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 = 'AUTOMOBILE';
[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_orderkey FROM lineitem ORDER BY l_extendedprice DESC 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.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 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 T.n_name FROM ( SELECT T2.n_name, COUNT(T1.c_custkey) AS num FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey GROUP BY T2.n_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 COUNT(T2.o_orderkey) FROM lineitem AS T1 INNER JOIN orders AS T2 ON T2.o_orderkey = T1.l_orderkey WHERE JULIANDAY(T1.l_shipdate) - JULIANDAY(T2.o_orderdate) = 1 AND T2.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(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_acctbal < 0 AND T1.c_mktsegment = 'HOUSEHOLD' AND T2.n_name = 'RUSSIA';
[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 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 COUNT(T1.o_orderkey) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T2.l_shipmode = 'SHIP' AND T1.o_orderpriority = '3-MEDIUM';
[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.c_mktsegment FROM ( SELECT T1.c_mktsegment, COUNT(T1.c_custkey) AS num FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'UNITED STATES' GROUP BY T1.c_mktsegment ) 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 T1.n_name FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey WHERE T2.r_name = 'ASIA';
[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.p_name FROM partsupp AS T1 INNER JOIN part AS T2 ON T1.ps_partkey = T2.p_partkey WHERE T1.ps_supplycost = 1000 AND T2.p_mfgr = 'Manufacturer#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(T1.n_nationkey) FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey WHERE T2.r_comment = 'asymptotes sublate after the r';
[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.ps_partkey) 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 WHERE T3.p_mfgr = 'Manufacturer#5' AND T3.p_retailprice < 1000 AND T2.l_shipmode = 'RAIL';
[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 AS num FROM lineitem AS T1 INNER JOIN partsupp AS T2 ON T1.l_suppkey = T2.ps_suppkey INNER JOIN part AS T3 ON T2.ps_partkey = T3.p_partkey WHERE T1.l_receiptdate = '1996-05-07' AND T1.l_shipinstruct = 'DELIVER IN PERSON' AND T3.p_name = ...
[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(T2.l_extendedprice) / 10 FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey ORDER BY T1.o_totalprice DESC LIMIT 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 T.c_name, T.res FROM ( SELECT T2.c_name, SUM(T1.o_totalprice) / COUNT(T1.o_orderkey) AS res , COUNT(T1.o_orderkey) AS num FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey GROUP BY T1.o_custkey ) AS T ORDER BY T.num 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 COUNT(l_linenumber) FROM lineitem WHERE l_shipdate = '1993-12-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 o_orderdate FROM orders WHERE o_totalprice = ( SELECT MAX(o_totalprice) FROM orders );
[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(c_acctbal < 0, 1, 0)) AS REAL) * 100 / COUNT(c_custkey) 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(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 CAST(SUM(IIF(p_mfgr = 'Manufacturer#3', 1, 0)) AS REAL) * 100 / COUNT(p_partkey) 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 p_name FROM part WHERE p_type = 'MEDIUM PLATED BRASS' 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 COUNT(T1.o_orderkey) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T2.l_shipmode = 'AIR' AND T1.o_orderpriority = '1-URGENT' AND SUBSTR(T2.l_shipdate, 1, 7) = '1998-11';
[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 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 COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_acctbal < 0 AND T2.n_name = 'MOROCCO';
[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, T1.n_nationkey FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey WHERE T2.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 SUM(T1.o_totalprice) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_name = 'Customer#000000013';
[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(T2.o_orderkey), SUM(T3.l_extendedprice * (1 - T3.l_discount) * (1 + T3.l_tax)) FROM customer AS T1 INNER JOIN orders AS T2 ON T1.c_custkey = T2.o_custkey INNER JOIN lineitem AS T3 ON T2.o_orderkey = T3.l_orderkey WHERE T1.c_name = 'Customer#000021159' GROUP BY T3.l_linenumber;
[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(T3.l_extendedprice * (1 - T3.l_discount) - T2.ps_supplycost * T3.l_quantity) FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN lineitem AS T3 ON T2.ps_partkey = T3.l_partkey AND T2.ps_suppkey = T3.l_suppkey WHERE T1.p_name = 'chocolate floral blue coral cyan';
[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(T2.n_name = 'GERMANY', 1, 0)) AS REAL) * 100 / 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;
[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_name = 'smoke red pale saddle plum';
[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 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 T3.s_acctbal < 0 AND T1.r_name = 'MIDDLE EAST';
[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.p_name FROM partsupp AS T1 INNER JOIN part AS T2 ON T1.ps_partkey = T2.p_partkey INNER JOIN lineitem AS T3 ON T1.ps_partkey = T3.l_partkey WHERE T3.l_discount = 0.1 AND T3.l_shipdate = '1995-12-01' AND T3.l_shipmode = 'RAIL';
[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.p_name FROM partsupp AS T1 INNER JOIN part AS T2 ON T1.ps_partkey = T2.p_partkey INNER JOIN supplier AS T3 ON T1.ps_suppkey = T3.s_suppkey WHERE T1.ps_supplycost > 900 AND T3.s_name = 'Supplier#000000018';
[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';
[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 < 30 AND l_shipmode = 'RAIL';
[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' AND c_nationkey = 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_phone FROM customer ORDER BY c_acctbal 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 o_orderpriority FROM orders WHERE o_totalprice = ( SELECT MAX(o_totalprice) FROM orders );
[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.o_orderkey) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey INNER JOIN nation AS T3 ON T2.c_nationkey = T3.n_nationkey WHERE T3.n_name = 'UNITED STATES';
[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 = 'AUTOMOBILE' AND T2.n_name = 'BRAZIL';
[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' 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.n_name FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey WHERE T2.r_name = 'ASIA';
[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 FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey WHERE T2.r_comment = 'furiously express accounts wake sly';
[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 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 COUNT(T1.n_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_acctbal < 0 AND T3.r_name = 'ASIA';
[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 ORDER BY T1.o_totalprice 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(T1.ps_suppkey) 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 WHERE T3.p_retailprice > 1000 AND T2.l_shipmode = 'SHIP';
[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, T2.c_mktsegment FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T1.o_totalprice = 199180.63;
[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_address = 'wH55UnX7 VI';
[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 T2.n_name = 'BRAZIL' AND T1.c_acctbal < 1000;
[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 customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey INNER JOIN ( SELECT AVG(c_acctbal) * 0.8 AS avg_acctbal FROM customer ) AS T3 WHERE T1.c_acctbal > T3.avg_acctbal;
[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(T2.n_name = 'United States', 1, 0)) AS REAL) * 100 / COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_acctbal < 4000;
[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, c_phone FROM customer WHERE c_acctbal > 9000;
[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(l_linenumber) FROM lineitem WHERE l_shipdate BETWEEN '1994-01-01' AND '1994-01-30';
[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_orderkey FROM orders WHERE o_totalprice BETWEEN 200000 AND 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 p_partkey FROM part WHERE p_retailprice > ( SELECT AVG(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 CAST(SUM(IIF(ps_supplycost > 500, 1, 0)) AS REAL) * 100 / COUNT(ps_suppkey) FROM partsupp;
[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_suppkey, s_acctbal FROM supplier ORDER BY s_acctbal DESC LIMIT 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 COUNT(T2.c_custkey) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_acctbal > 0 AND 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 T1.c_name, T1.c_phone FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_acctbal > ( SELECT AVG(c_acctbal) FROM customer ) ORDER BY T1.c_name;
[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_partkey FROM supplier AS T1 INNER JOIN partsupp AS T2 ON T1.s_suppkey = T2.ps_suppkey WHERE T1.s_name = 'Supplier#000000654' ORDER BY T2.ps_supplycost 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 CAST(SUM(IIF(T1.c_mktsegment = 'AUTOMOBILE', 1, 0)) AS REAL) * 100 / COUNT(T1.c_name) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'FRANCE';
[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 T3.p_name , T2.l_extendedprice * (1 - T2.l_discount) - T1.ps_supplycost * T2.l_quantity AS num 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 ) 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 customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey GROUP BY T2.n_name HAVING COUNT(T1.c_name) > ( SELECT COUNT(customer.c_name) / COUNT(DISTINCT nation.n_name) FROM customer INNER JOIN nation ON customer.c_nationkey = nation.n_nationkey ) ORDER BY COUNT(T1.c_name);
[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(T2.r_name = 'AFRICA', 1, 0)) AS REAL) * 100 / COUNT(T1.n_nationkey) FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey INNER JOIN customer AS T3 ON T1.n_nationkey = T3.c_nationkey WHERE T3.c_mktsegment = 'HOUSEHOLD';
[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 ORDER BY T2.ps_availqty DESC LIMIT 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 (CAST(SUM(IIF(T3.l_shipmode = 'SHIP', T1.p_retailprice, 0)) AS REAL) / SUM(IIF(T3.l_shipmode = 'SHIP', 1, 0))) - (CAST(SUM(IIF(T3.l_shipmode = 'AIR', T1.p_retailprice, 0)) AS REAL) / SUM(IIF(T3.l_shipmode = 'AIR', 1, 0))) FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN lineit...
[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(T3.l_discount) FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN lineitem AS T3 ON T2.ps_suppkey = T3.l_suppkey WHERE T1.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 COUNT(T2.l_partkey) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T2.l_shipmode = 'RAIL' AND T1.o_orderpriority = '3-MEDIUM';
[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(T3.s_acctbal < ( SELECT AVG(supplier.s_acctbal) FROM supplier ), 1, 0)) AS REAL) * 100 / 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';
[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(STRFTIME('%Y', T2.l_shipdate) = 1995, 1, 0)) AS REAL) / 12) - (CAST(SUM(IIF(STRFTIME('%Y', T2.l_shipdate) = 1996, 1, 0)) AS REAL) / 12) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_orderpriority = '5-LOW' AND T2.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 c_custkey 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 l_orderkey FROM lineitem ORDER BY l_extendedprice * (1 - l_discount) 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 > 10 AND l_returnflag = 'R';
[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) * (1 + l_tax) AS totalprice FROM lineitem WHERE l_shipmode = 'AIR' AND l_shipinstruct = 'NONE';
[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) FROM orders WHERE o_orderpriority = '1-URGENT' GROUP BY o_orderdate ORDER BY o_orderdate 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(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 = 'EGYPT';
[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.o_orderkey) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T2.l_shipmode = 'REG AIR' AND T1.o_orderdate = '1995-03-22';
[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';
[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.c_mktsegment FROM ( SELECT T2.c_mktsegment, COUNT(T1.o_orderkey) AS num FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T1.o_orderdate LIKE '1994-04-%' GROUP BY T1.o_custkey ) 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 T3.p_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 T2.s_name = 'Supplier#000000034';
[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 BURNISHED COPPER';
[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 INNER JOIN orders AS T3 ON T1.c_custkey = T3.o_custkey WHERE T2.n_name = 'MOZAMBIQUE' AND T3.o_orderpriority = '5-LOW';
[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 < 10 ORDER BY T2.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 COUNT(T1.o_clerk) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_address = 'uFTe2u518et8Q8UC';
[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 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 WHERE T2.l_discount = 0.0000;
[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 T2.n_name = 'GERMANY' AND T1.s_comment LIKE '%carefully regular packages%';
[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(T2.l_partkey) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_orderdate = '1994-09-21' AND T2.l_shipdate = '1994-11-19';
[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(T2.l_extendedprice * (1 - T2.l_discount) - T1.ps_supplycost * T2.l_quantity) / COUNT(T1.ps_partkey) 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 WHERE T3.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 CAST(SUM(IIF(T2.n_name = 'IRAN', 1, 0)) AS REAL) * 100 / COUNT(T2.n_name) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_mktsegment = 'HOUSEHOLD';
[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, c_name, c_address, c_phone FROM customer WHERE c_custkey = 3;