1sf/bird-sql-train-with-schema huggingface dataset:
Database: retails
Tables: customer, lineitem, nation, orders, part, partsupp, region, supplier
Columns (table index, column name): -1, *, 0, c_custkey, 0, c_mktsegment, 0, c_nationkey, 0, c_name, 0, c_address, 0, c_phone, 0, c_acctbal, 0, c_comment, 1, l_shipdate, 1, l_orderkey, 1, l_discount, 1, l_extendedprice, 1, l_suppkey, 1, l_quantity, 1, l_returnflag, 1, l_partkey, 1, l_linestatus, 1, l_tax, 1, l_commitdate, 1, l_receiptdate, 1, l_shipmode, 1, l_linenumber, 1, l_shipinstruct, 1, l_comment, 2, n_nationkey, 2, n_name, 2, n_regionkey, 2, n_comment, 3, o_orderdate, 3, o_orderkey, 3, o_custkey, 3, o_orderpriority, 3, o_shippriority, 3, o_clerk, 3, o_orderstatus, 3, o_totalprice, 3, o_comment, 4, p_partkey, 4, p_type, 4, p_size, 4, p_brand, 4, p_name, 4, p_container, 4, p_mfgr, 4, p_retailprice, 4, p_comment, 5, ps_partkey, 5, ps_suppkey, 5, ps_supplycost, 5, ps_availqty, 5, ps_comment, 6, r_regionkey, 6, r_name, 6, r_comment, 7, s_suppkey, 7, s_nationkey, 7, s_comment, 7, s_name, 7, s_address, 7, s_phone, 7, s_acctbal
Question: Among the suppliers in the European region, what percentage have a below-average account balance?
Evidence: DIVIDE(COUNT(s_acctbal < AVG(s_acctbal)), COUNT(s_suppkey)) as percentage where r_name = 'EUROPE';
SQL: 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'
Database: retails
Tables: customer, lineitem, nation, orders, part, partsupp, region, supplier
Columns (table index, column name): -1, *, 0, c_custkey, 0, c_mktsegment, 0, c_nationkey, 0, c_name, 0, c_address, 0, c_phone, 0, c_acctbal, 0, c_comment, 1, l_shipdate, 1, l_orderkey, 1, l_discount, 1, l_extendedprice, 1, l_suppkey, 1, l_quantity, 1, l_returnflag, 1, l_partkey, 1, l_linestatus, 1, l_tax, 1, l_commitdate, 1, l_receiptdate, 1, l_shipmode, 1, l_linenumber, 1, l_shipinstruct, 1, l_comment, 2, n_nationkey, 2, n_name, 2, n_regionkey, 2, n_comment, 3, o_orderdate, 3, o_orderkey, 3, o_custkey, 3, o_orderpriority, 3, o_shippriority, 3, o_clerk, 3, o_orderstatus, 3, o_totalprice, 3, o_comment, 4, p_partkey, 4, p_type, 4, p_size, 4, p_brand, 4, p_name, 4, p_container, 4, p_mfgr, 4, p_retailprice, 4, p_comment, 5, ps_partkey, 5, ps_suppkey, 5, ps_supplycost, 5, ps_availqty, 5, ps_comment, 6, r_regionkey, 6, r_name, 6, r_comment, 7, s_suppkey, 7, s_nationkey, 7, s_comment, 7, s_name, 7, s_address, 7, s_phone, 7, s_acctbal
Question: Calculate the difference in the average number of low-priority orders shipped by truck in each month of 1995 and 1996.
Evidence: SUBTRACT(DIVIDE(SUM(l_orderkey where year(l_shipdate) = 1995), 12), DIVIDE(SUM(l_orderkey where year(l_shipdate) = 1996), 12)) where o_orderpriority = '5-LOW';
SQL: 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'
Database: retails
Tables: customer, lineitem, nation, orders, part, partsupp, region, supplier
Columns (table index, column name): -1, *, 0, c_custkey, 0, c_mktsegment, 0, c_nationkey, 0, c_name, 0, c_address, 0, c_phone, 0, c_acctbal, 0, c_comment, 1, l_shipdate, 1, l_orderkey, 1, l_discount, 1, l_extendedprice, 1, l_suppkey, 1, l_quantity, 1, l_returnflag, 1, l_partkey, 1, l_linestatus, 1, l_tax, 1, l_commitdate, 1, l_receiptdate, 1, l_shipmode, 1, l_linenumber, 1, l_shipinstruct, 1, l_comment, 2, n_nationkey, 2, n_name, 2, n_regionkey, 2, n_comment, 3, o_orderdate, 3, o_orderkey, 3, o_custkey, 3, o_orderpriority, 3, o_shippriority, 3, o_clerk, 3, o_orderstatus, 3, o_totalprice, 3, o_comment, 4, p_partkey, 4, p_type, 4, p_size, 4, p_brand, 4, p_name, 4, p_container, 4, p_mfgr, 4, p_retailprice, 4, p_comment, 5, ps_partkey, 5, ps_suppkey, 5, ps_supplycost, 5, ps_availqty, 5, ps_comment, 6, r_regionkey, 6, r_name, 6, r_comment, 7, s_suppkey, 7, s_nationkey, 7, s_comment, 7, s_name, 7, s_address, 7, s_phone, 7, s_acctbal
Question: List by their id all customers who have a debit balance in their accounts.
Evidence: customers who have a debt balance refer to c_custkey where c_acctbal < 0;
SQL: SELECT c_custkey FROM customer WHERE c_acctbal < 0
Database: retails
Tables: customer, lineitem, nation, orders, part, partsupp, region, supplier
Columns (table index, column name): -1, *, 0, c_custkey, 0, c_mktsegment, 0, c_nationkey, 0, c_name, 0, c_address, 0, c_phone, 0, c_acctbal, 0, c_comment, 1, l_shipdate, 1, l_orderkey, 1, l_discount, 1, l_extendedprice, 1, l_suppkey, 1, l_quantity, 1, l_returnflag, 1, l_partkey, 1, l_linestatus, 1, l_tax, 1, l_commitdate, 1, l_receiptdate, 1, l_shipmode, 1, l_linenumber, 1, l_shipinstruct, 1, l_comment, 2, n_nationkey, 2, n_name, 2, n_regionkey, 2, n_comment, 3, o_orderdate, 3, o_orderkey, 3, o_custkey, 3, o_orderpriority, 3, o_shippriority, 3, o_clerk, 3, o_orderstatus, 3, o_totalprice, 3, o_comment, 4, p_partkey, 4, p_type, 4, p_size, 4, p_brand, 4, p_name, 4, p_container, 4, p_mfgr, 4, p_retailprice, 4, p_comment, 5, ps_partkey, 5, ps_suppkey, 5, ps_supplycost, 5, ps_availqty, 5, ps_comment, 6, r_regionkey, 6, r_name, 6, r_comment, 7, s_suppkey, 7, s_nationkey, 7, s_comment, 7, s_name, 7, s_address, 7, s_phone, 7, s_acctbal
Question: List by order number the 3 items with the lowest price after applying the discount.
Evidence: order number refers to l_orderkey; the lowest price after applying the discount refers to MIN(MULTIPLY(l_extendedprice), SUBTRACT(1, l_discount));
SQL: SELECT l_orderkey FROM lineitem ORDER BY l_extendedprice * (1 - l_discount) LIMIT 3
Database: retails
Tables: customer, lineitem, nation, orders, part, partsupp, region, supplier
Columns (table index, column name): -1, *, 0, c_custkey, 0, c_mktsegment, 0, c_nationkey, 0, c_name, 0, c_address, 0, c_phone, 0, c_acctbal, 0, c_comment, 1, l_shipdate, 1, l_orderkey, 1, l_discount, 1, l_extendedprice, 1, l_suppkey, 1, l_quantity, 1, l_returnflag, 1, l_partkey, 1, l_linestatus, 1, l_tax, 1, l_commitdate, 1, l_receiptdate, 1, l_shipmode, 1, l_linenumber, 1, l_shipinstruct, 1, l_comment, 2, n_nationkey, 2, n_name, 2, n_regionkey, 2, n_comment, 3, o_orderdate, 3, o_orderkey, 3, o_custkey, 3, o_orderpriority, 3, o_shippriority, 3, o_clerk, 3, o_orderstatus, 3, o_totalprice, 3, o_comment, 4, p_partkey, 4, p_type, 4, p_size, 4, p_brand, 4, p_name, 4, p_container, 4, p_mfgr, 4, p_retailprice, 4, p_comment, 5, ps_partkey, 5, ps_suppkey, 5, ps_supplycost, 5, ps_availqty, 5, ps_comment, 6, r_regionkey, 6, r_name, 6, r_comment, 7, s_suppkey, 7, s_nationkey, 7, s_comment, 7, s_name, 7, s_address, 7, s_phone, 7, s_acctbal
Question: How many orders of more than 10 items have been returned?
Evidence: more than 10 items have been returned refer to l_returnflag = 'R' where l_quantity > 10; orders refer to l_orderkey;
SQL: SELECT COUNT(l_linenumber) FROM lineitem WHERE l_quantity > 10 AND l_returnflag = 'R'
Database: retails
Tables: customer, lineitem, nation, orders, part, partsupp, region, supplier
Columns (table index, column name): -1, *, 0, c_custkey, 0, c_mktsegment, 0, c_nationkey, 0, c_name, 0, c_address, 0, c_phone, 0, c_acctbal, 0, c_comment, 1, l_shipdate, 1, l_orderkey, 1, l_discount, 1, l_extendedprice, 1, l_suppkey, 1, l_quantity, 1, l_returnflag, 1, l_partkey, 1, l_linestatus, 1, l_tax, 1, l_commitdate, 1, l_receiptdate, 1, l_shipmode, 1, l_linenumber, 1, l_shipinstruct, 1, l_comment, 2, n_nationkey, 2, n_name, 2, n_regionkey, 2, n_comment, 3, o_orderdate, 3, o_orderkey, 3, o_custkey, 3, o_orderpriority, 3, o_shippriority, 3, o_clerk, 3, o_orderstatus, 3, o_totalprice, 3, o_comment, 4, p_partkey, 4, p_type, 4, p_size, 4, p_brand, 4, p_name, 4, p_container, 4, p_mfgr, 4, p_retailprice, 4, p_comment, 5, ps_partkey, 5, ps_suppkey, 5, ps_supplycost, 5, ps_availqty, 5, ps_comment, 6, r_regionkey, 6, r_name, 6, r_comment, 7, s_suppkey, 7, s_nationkey, 7, s_comment, 7, s_name, 7, s_address, 7, s_phone, 7, s_acctbal
Question: What is the total price charged for orders shipped by air without shipping instructions?
Evidence: SUM(MULTIPLY(MULTIPLY(l_extendedprice, SUBTRACT(1, l_discount)), SUM(1, l_tax))) where l_shipmode = 'AIR' and l_shipinstruct = 'NONE';
SQL: SELECT l_extendedprice * (1 - l_discount) * (1 + l_tax) AS totalprice FROM lineitem WHERE l_shipmode = 'AIR' AND l_shipinstruct = 'NONE'
Database: retails
Tables: customer, lineitem, nation, orders, part, partsupp, region, supplier
Columns (table index, column name): -1, *, 0, c_custkey, 0, c_mktsegment, 0, c_nationkey, 0, c_name, 0, c_address, 0, c_phone, 0, c_acctbal, 0, c_comment, 1, l_shipdate, 1, l_orderkey, 1, l_discount, 1, l_extendedprice, 1, l_suppkey, 1, l_quantity, 1, l_returnflag, 1, l_partkey, 1, l_linestatus, 1, l_tax, 1, l_commitdate, 1, l_receiptdate, 1, l_shipmode, 1, l_linenumber, 1, l_shipinstruct, 1, l_comment, 2, n_nationkey, 2, n_name, 2, n_regionkey, 2, n_comment, 3, o_orderdate, 3, o_orderkey, 3, o_custkey, 3, o_orderpriority, 3, o_shippriority, 3, o_clerk, 3, o_orderstatus, 3, o_totalprice, 3, o_comment, 4, p_partkey, 4, p_type, 4, p_size, 4, p_brand, 4, p_name, 4, p_container, 4, p_mfgr, 4, p_retailprice, 4, p_comment, 5, ps_partkey, 5, ps_suppkey, 5, ps_supplycost, 5, ps_availqty, 5, ps_comment, 6, r_regionkey, 6, r_name, 6, r_comment, 7, s_suppkey, 7, s_nationkey, 7, s_comment, 7, s_name, 7, s_address, 7, s_phone, 7, s_acctbal
Question: Of the orders with a lower delivery priority, how many have an urgent priority order?
Evidence: an urgent priority order refers to o_orderkey where o_orderpriority = '1-URGENT'; earlier orderdate have higher priority in delivery; lower delivery priority refers to MAX(o_orderdate);
SQL: SELECT COUNT(o_orderkey) FROM orders WHERE o_orderpriority = '1-URGENT' GROUP BY o_orderdate ORDER BY o_orderdate DESC LIMIT 1
Database: retails
Tables: customer, lineitem, nation, orders, part, partsupp, region, supplier
Columns (table index, column name): -1, *, 0, c_custkey, 0, c_mktsegment, 0, c_nationkey, 0, c_name, 0, c_address, 0, c_phone, 0, c_acctbal, 0, c_comment, 1, l_shipdate, 1, l_orderkey, 1, l_discount, 1, l_extendedprice, 1, l_suppkey, 1, l_quantity, 1, l_returnflag, 1, l_partkey, 1, l_linestatus, 1, l_tax, 1, l_commitdate, 1, l_receiptdate, 1, l_shipmode, 1, l_linenumber, 1, l_shipinstruct, 1, l_comment, 2, n_nationkey, 2, n_name, 2, n_regionkey, 2, n_comment, 3, o_orderdate, 3, o_orderkey, 3, o_custkey, 3, o_orderpriority, 3, o_shippriority, 3, o_clerk, 3, o_orderstatus, 3, o_totalprice, 3, o_comment, 4, p_partkey, 4, p_type, 4, p_size, 4, p_brand, 4, p_name, 4, p_container, 4, p_mfgr, 4, p_retailprice, 4, p_comment, 5, ps_partkey, 5, ps_suppkey, 5, ps_supplycost, 5, ps_availqty, 5, ps_comment, 6, r_regionkey, 6, r_name, 6, r_comment, 7, s_suppkey, 7, s_nationkey, 7, s_comment, 7, s_name, 7, s_address, 7, s_phone, 7, s_acctbal
Question: How many suppliers from Egypt have a debit balance?
Evidence: suppliers refer to s_suppkey; Egypt is the name of the nation which refers to n_name = 'EGYPT'; the balance is in debt if s_acctbal < 0;
SQL: 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'
Database: retails
Tables: customer, lineitem, nation, orders, part, partsupp, region, supplier
Columns (table index, column name): -1, *, 0, c_custkey, 0, c_mktsegment, 0, c_nationkey, 0, c_name, 0, c_address, 0, c_phone, 0, c_acctbal, 0, c_comment, 1, l_shipdate, 1, l_orderkey, 1, l_discount, 1, l_extendedprice, 1, l_suppkey, 1, l_quantity, 1, l_returnflag, 1, l_partkey, 1, l_linestatus, 1, l_tax, 1, l_commitdate, 1, l_receiptdate, 1, l_shipmode, 1, l_linenumber, 1, l_shipinstruct, 1, l_comment, 2, n_nationkey, 2, n_name, 2, n_regionkey, 2, n_comment, 3, o_orderdate, 3, o_orderkey, 3, o_custkey, 3, o_orderpriority, 3, o_shippriority, 3, o_clerk, 3, o_orderstatus, 3, o_totalprice, 3, o_comment, 4, p_partkey, 4, p_type, 4, p_size, 4, p_brand, 4, p_name, 4, p_container, 4, p_mfgr, 4, p_retailprice, 4, p_comment, 5, ps_partkey, 5, ps_suppkey, 5, ps_supplycost, 5, ps_availqty, 5, ps_comment, 6, r_regionkey, 6, r_name, 6, r_comment, 7, s_suppkey, 7, s_nationkey, 7, s_comment, 7, s_name, 7, s_address, 7, s_phone, 7, s_acctbal
Question: How many items shipped by REG AIR were ordered on March 22, 1995?
Evidence: items shipped by REG AIR refer to l_linenumber where l_shipmode = 'REG AIR'; ordered on March 22, 1995 refers to o_orderdate = '1995-03-22';
SQL: 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'
Database: retails
Tables: customer, lineitem, nation, orders, part, partsupp, region, supplier
Columns (table index, column name): -1, *, 0, c_custkey, 0, c_mktsegment, 0, c_nationkey, 0, c_name, 0, c_address, 0, c_phone, 0, c_acctbal, 0, c_comment, 1, l_shipdate, 1, l_orderkey, 1, l_discount, 1, l_extendedprice, 1, l_suppkey, 1, l_quantity, 1, l_returnflag, 1, l_partkey, 1, l_linestatus, 1, l_tax, 1, l_commitdate, 1, l_receiptdate, 1, l_shipmode, 1, l_linenumber, 1, l_shipinstruct, 1, l_comment, 2, n_nationkey, 2, n_name, 2, n_regionkey, 2, n_comment, 3, o_orderdate, 3, o_orderkey, 3, o_custkey, 3, o_orderpriority, 3, o_shippriority, 3, o_clerk, 3, o_orderstatus, 3, o_totalprice, 3, o_comment, 4, p_partkey, 4, p_type, 4, p_size, 4, p_brand, 4, p_name, 4, p_container, 4, p_mfgr, 4, p_retailprice, 4, p_comment, 5, ps_partkey, 5, ps_suppkey, 5, ps_supplycost, 5, ps_availqty, 5, ps_comment, 6, r_regionkey, 6, r_name, 6, r_comment, 7, s_suppkey, 7, s_nationkey, 7, s_comment, 7, s_name, 7, s_address, 7, s_phone, 7, s_acctbal
Question: How many European suppliers are there?
Evidence: European suppliers refer to s_suppkey where r_name = 'EUROPE';
SQL: 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'
Database: retails
Tables: customer, lineitem, nation, orders, part, partsupp, region, supplier
Columns (table index, column name): -1, *, 0, c_custkey, 0, c_mktsegment, 0, c_nationkey, 0, c_name, 0, c_address, 0, c_phone, 0, c_acctbal, 0, c_comment, 1, l_shipdate, 1, l_orderkey, 1, l_discount, 1, l_extendedprice, 1, l_suppkey, 1, l_quantity, 1, l_returnflag, 1, l_partkey, 1, l_linestatus, 1, l_tax, 1, l_commitdate, 1, l_receiptdate, 1, l_shipmode, 1, l_linenumber, 1, l_shipinstruct, 1, l_comment, 2, n_nationkey, 2, n_name, 2, n_regionkey, 2, n_comment, 3, o_orderdate, 3, o_orderkey, 3, o_custkey, 3, o_orderpriority, 3, o_shippriority, 3, o_clerk, 3, o_orderstatus, 3, o_totalprice, 3, o_comment, 4, p_partkey, 4, p_type, 4, p_size, 4, p_brand, 4, p_name, 4, p_container, 4, p_mfgr, 4, p_retailprice, 4, p_comment, 5, ps_partkey, 5, ps_suppkey, 5, ps_supplycost, 5, ps_availqty, 5, ps_comment, 6, r_regionkey, 6, r_name, 6, r_comment, 7, s_suppkey, 7, s_nationkey, 7, s_comment, 7, s_name, 7, s_address, 7, s_phone, 7, s_acctbal
Question: To which segment belongs the customer that made the most orders in April 1994?
Evidence: segment refers to c_mktsegment; customer made the most orders in April 1994 refers to c_custkey where o_orderdate LIKE '1994-04-%' and MAX(COUNT(o_orderkey));
SQL: 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
Database: retails
Tables: customer, lineitem, nation, orders, part, partsupp, region, supplier
Columns (table index, column name): -1, *, 0, c_custkey, 0, c_mktsegment, 0, c_nationkey, 0, c_name, 0, c_address, 0, c_phone, 0, c_acctbal, 0, c_comment, 1, l_shipdate, 1, l_orderkey, 1, l_discount, 1, l_extendedprice, 1, l_suppkey, 1, l_quantity, 1, l_returnflag, 1, l_partkey, 1, l_linestatus, 1, l_tax, 1, l_commitdate, 1, l_receiptdate, 1, l_shipmode, 1, l_linenumber, 1, l_shipinstruct, 1, l_comment, 2, n_nationkey, 2, n_name, 2, n_regionkey, 2, n_comment, 3, o_orderdate, 3, o_orderkey, 3, o_custkey, 3, o_orderpriority, 3, o_shippriority, 3, o_clerk, 3, o_orderstatus, 3, o_totalprice, 3, o_comment, 4, p_partkey, 4, p_type, 4, p_size, 4, p_brand, 4, p_name, 4, p_container, 4, p_mfgr, 4, p_retailprice, 4, p_comment, 5, ps_partkey, 5, ps_suppkey, 5, ps_supplycost, 5, ps_availqty, 5, ps_comment, 6, r_regionkey, 6, r_name, 6, r_comment, 7, s_suppkey, 7, s_nationkey, 7, s_comment, 7, s_name, 7, s_address, 7, s_phone, 7, s_acctbal
Question: Lists all parts supplied by Supplier#000000034.
Evidence: part refers to p_name; Supplier#000000034 refers to s_name = 'Supplier#000000034'
SQL: 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'
Database: retails
Tables: customer, lineitem, nation, orders, part, partsupp, region, supplier
Columns (table index, column name): -1, *, 0, c_custkey, 0, c_mktsegment, 0, c_nationkey, 0, c_name, 0, c_address, 0, c_phone, 0, c_acctbal, 0, c_comment, 1, l_shipdate, 1, l_orderkey, 1, l_discount, 1, l_extendedprice, 1, l_suppkey, 1, l_quantity, 1, l_returnflag, 1, l_partkey, 1, l_linestatus, 1, l_tax, 1, l_commitdate, 1, l_receiptdate, 1, l_shipmode, 1, l_linenumber, 1, l_shipinstruct, 1, l_comment, 2, n_nationkey, 2, n_name, 2, n_regionkey, 2, n_comment, 3, o_orderdate, 3, o_orderkey, 3, o_custkey, 3, o_orderpriority, 3, o_shippriority, 3, o_clerk, 3, o_orderstatus, 3, o_totalprice, 3, o_comment, 4, p_partkey, 4, p_type, 4, p_size, 4, p_brand, 4, p_name, 4, p_container, 4, p_mfgr, 4, p_retailprice, 4, p_comment, 5, ps_partkey, 5, ps_suppkey, 5, ps_supplycost, 5, ps_availqty, 5, ps_comment, 6, r_regionkey, 6, r_name, 6, r_comment, 7, s_suppkey, 7, s_nationkey, 7, s_comment, 7, s_name, 7, s_address, 7, s_phone, 7, s_acctbal
Question: What are the cost prices of large burnished copper?
Evidence: cost price refers to ps_supplycost; large burnished copper refers to p_type = 'LARGE BURNISHED COPPER'
SQL: 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'
Database: retails
Tables: customer, lineitem, nation, orders, part, partsupp, region, supplier
Columns (table index, column name): -1, *, 0, c_custkey, 0, c_mktsegment, 0, c_nationkey, 0, c_name, 0, c_address, 0, c_phone, 0, c_acctbal, 0, c_comment, 1, l_shipdate, 1, l_orderkey, 1, l_discount, 1, l_extendedprice, 1, l_suppkey, 1, l_quantity, 1, l_returnflag, 1, l_partkey, 1, l_linestatus, 1, l_tax, 1, l_commitdate, 1, l_receiptdate, 1, l_shipmode, 1, l_linenumber, 1, l_shipinstruct, 1, l_comment, 2, n_nationkey, 2, n_name, 2, n_regionkey, 2, n_comment, 3, o_orderdate, 3, o_orderkey, 3, o_custkey, 3, o_orderpriority, 3, o_shippriority, 3, o_clerk, 3, o_orderstatus, 3, o_totalprice, 3, o_comment, 4, p_partkey, 4, p_type, 4, p_size, 4, p_brand, 4, p_name, 4, p_container, 4, p_mfgr, 4, p_retailprice, 4, p_comment, 5, ps_partkey, 5, ps_suppkey, 5, ps_supplycost, 5, ps_availqty, 5, ps_comment, 6, r_regionkey, 6, r_name, 6, r_comment, 7, s_suppkey, 7, s_nationkey, 7, s_comment, 7, s_name, 7, s_address, 7, s_phone, 7, s_acctbal
Question: How many clients from Mozambique required orders with a low priority order?
Evidence: Mozambique refers to n_name = 'MOZAMBIQUE'; low priority order refers to o_orderpriority = '5-LOW'
SQL: 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'
Database: retails
Tables: customer, lineitem, nation, orders, part, partsupp, region, supplier
Columns (table index, column name): -1, *, 0, c_custkey, 0, c_mktsegment, 0, c_nationkey, 0, c_name, 0, c_address, 0, c_phone, 0, c_acctbal, 0, c_comment, 1, l_shipdate, 1, l_orderkey, 1, l_discount, 1, l_extendedprice, 1, l_suppkey, 1, l_quantity, 1, l_returnflag, 1, l_partkey, 1, l_linestatus, 1, l_tax, 1, l_commitdate, 1, l_receiptdate, 1, l_shipmode, 1, l_linenumber, 1, l_shipinstruct, 1, l_comment, 2, n_nationkey, 2, n_name, 2, n_regionkey, 2, n_comment, 3, o_orderdate, 3, o_orderkey, 3, o_custkey, 3, o_orderpriority, 3, o_shippriority, 3, o_clerk, 3, o_orderstatus, 3, o_totalprice, 3, o_comment, 4, p_partkey, 4, p_type, 4, p_size, 4, p_brand, 4, p_name, 4, p_container, 4, p_mfgr, 4, p_retailprice, 4, p_comment, 5, ps_partkey, 5, ps_suppkey, 5, ps_supplycost, 5, ps_availqty, 5, ps_comment, 6, r_regionkey, 6, r_name, 6, r_comment, 7, s_suppkey, 7, s_nationkey, 7, s_comment, 7, s_name, 7, s_address, 7, s_phone, 7, s_acctbal
Question: Indicate the name of the product that is close to being sold out and that has the lowest cost price.
Evidence: name of the product refers to p_name; close to being sold out refers to ps_availqty < 10; the lowest cost price refers to min(ps_supplycost)
SQL: 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
Database: retails
Tables: customer, lineitem, nation, orders, part, partsupp, region, supplier
Columns (table index, column name): -1, *, 0, c_custkey, 0, c_mktsegment, 0, c_nationkey, 0, c_name, 0, c_address, 0, c_phone, 0, c_acctbal, 0, c_comment, 1, l_shipdate, 1, l_orderkey, 1, l_discount, 1, l_extendedprice, 1, l_suppkey, 1, l_quantity, 1, l_returnflag, 1, l_partkey, 1, l_linestatus, 1, l_tax, 1, l_commitdate, 1, l_receiptdate, 1, l_shipmode, 1, l_linenumber, 1, l_shipinstruct, 1, l_comment, 2, n_nationkey, 2, n_name, 2, n_regionkey, 2, n_comment, 3, o_orderdate, 3, o_orderkey, 3, o_custkey, 3, o_orderpriority, 3, o_shippriority, 3, o_clerk, 3, o_orderstatus, 3, o_totalprice, 3, o_comment, 4, p_partkey, 4, p_type, 4, p_size, 4, p_brand, 4, p_name, 4, p_container, 4, p_mfgr, 4, p_retailprice, 4, p_comment, 5, ps_partkey, 5, ps_suppkey, 5, ps_supplycost, 5, ps_availqty, 5, ps_comment, 6, r_regionkey, 6, r_name, 6, r_comment, 7, s_suppkey, 7, s_nationkey, 7, s_comment, 7, s_name, 7, s_address, 7, s_phone, 7, s_acctbal
Question: How many different clerks have served the customer with the address uFTe2u518et8Q8UC?
Evidence: clerk who have served the customer refers to o_clerk

SQL: 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'
Database: retails
Tables: customer, lineitem, nation, orders, part, partsupp, region, supplier
Columns (table index, column name): -1, *, 0, c_custkey, 0, c_mktsegment, 0, c_nationkey, 0, c_name, 0, c_address, 0, c_phone, 0, c_acctbal, 0, c_comment, 1, l_shipdate, 1, l_orderkey, 1, l_discount, 1, l_extendedprice, 1, l_suppkey, 1, l_quantity, 1, l_returnflag, 1, l_partkey, 1, l_linestatus, 1, l_tax, 1, l_commitdate, 1, l_receiptdate, 1, l_shipmode, 1, l_linenumber, 1, l_shipinstruct, 1, l_comment, 2, n_nationkey, 2, n_name, 2, n_regionkey, 2, n_comment, 3, o_orderdate, 3, o_orderkey, 3, o_custkey, 3, o_orderpriority, 3, o_shippriority, 3, o_clerk, 3, o_orderstatus, 3, o_totalprice, 3, o_comment, 4, p_partkey, 4, p_type, 4, p_size, 4, p_brand, 4, p_name, 4, p_container, 4, p_mfgr, 4, p_retailprice, 4, p_comment, 5, ps_partkey, 5, ps_suppkey, 5, ps_supplycost, 5, ps_availqty, 5, ps_comment, 6, r_regionkey, 6, r_name, 6, r_comment, 7, s_suppkey, 7, s_nationkey, 7, s_comment, 7, s_name, 7, s_address, 7, s_phone, 7, s_acctbal
Question: Indicate the name of the parts without discount.
Evidence: name of the part refers to p_name; without discount refers to l_discount = 0.0000
SQL: 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