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: How many suppliers from Germany have left a comment with 'carefully regular packages'?
Evidence: Germany is nation name which refers to n_name = 'GERMANY'; comment with 'carefully regular packages' refers to s_comment LIKE 'carefully regular packages%'
SQL: 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%'
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 products shipped on 19/11/1994 were ordered on 21/09/1994?
Evidence: shipped on 19/11/1994 refers to l_shipdate = '1994-11-19'; ordered on 21/09/1994 refers to o_orderdate = '1994-09-21'
SQL: 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'
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 average profit of prom brushed steel products.
Evidence: prom brushed steel refers to p_type = 'PROMO BRUSHED STEEL'; average profit = divide(sum(subtract(multiply(l_extendedprice, subtract(1, l_discount)), multiply(ps_supplycost, l_quantity))), count(ps_partkey))
SQL: 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'
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 percentage of customers engaged in the household segment are from Iran?
Evidence: the household segment refers to c_mktsegment = 'HOUSEHOLD'; Iran is nation name which refers to n_name = 'IRAN'; percentage = divide(count(c_custkey where n_name = 'IRAN'), count(c_custkey)) where c_mktsegment = 'HOUSEHOLD' * 100%
SQL: 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'
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: Please state the segment, the name, the address, and the phone number of customer number 3.
Evidence: segment refers to c_mktsegment; name refers to c_name; address refers to c_address; phone number refers to c_phone; customer number 3 refers to c_custkey = 3
SQL: SELECT c_mktsegment, c_name, c_address, c_phone FROM customer WHERE c_custkey = 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: Please list any three line item numbers that have 10% off.
Evidence: line item number refers to l_linenumber; 10% off refers to l_discount = 0.1
SQL: SELECT l_linenumber FROM lineitem WHERE l_discount = 0.1 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 of the line items that have a quantity greater than 40 have been shipped by air?
Evidence: quantity greater than 40 refers to l_quantity > 40; shipped by air refers to l_shipmode = 'AIR'
SQL: SELECT COUNT(l_linenumber) FROM lineitem WHERE l_quantity > 40 AND l_shipmode = 'AIR'
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: Which ship mode has more "deliver in person" instructions, rail or mail?
Evidence: ship mode refers to l_shipmode; "deliver in person" instruction refers to l_shipinstruct = 'DELIVER IN PERSON'
SQL: 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'
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 and the order priority of order number 33?
Evidence: total price refers to o_totalprice; order priority refers to o_orderpriority; order number 33 refers to o_orderkey = 33
SQL: SELECT o_totalprice, o_orderpriority FROM orders WHERE o_orderkey = 33
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 in 1998 had a total price under 950?
Evidence: 1998 refers to year(o_orderdate) = '1998'; a total price under 950 refers to o_totalprice < 950
SQL: SELECT COUNT(o_orderkey) AS countorders FROM orders WHERE STRFTIME('%Y', o_orderdate) = '1998' AND o_totalprice < 950
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: Please list any three customers with debt.
Evidence: customer refers to c_name; with debt refers to c_acctbal < 0
SQL: SELECT c_name FROM customer WHERE c_acctbal < 0 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: What is the discounted price of line item number 1?
Evidence: discounted price refers to multiply(l_extendedprice, subtract(1, l_discount)); line item number 1 refers to l_linenumber = 1
SQL: SELECT l_extendedprice * (1 - l_discount) FROM lineitem WHERE l_linenumber = 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: What is the difference between the number of returned items and not returned items with the full price of under 16947.7?
Evidence: full price of under 16947.7 refers to l_extendedprice < 16947.7; returned item refers to l_returnflag = 'R'; not returned item refers to l_returnflag = 'A' OR l_returnflag = 'N'; difference = subtract(count(l_linenumber where l_returnflag = 'A' OR l_returnflag = 'N'), count(l_linenumber where l_returnflag = 'R')) where l_extendedprice < 16947.7
SQL: SELECT SUM(IIF(l_returnflag = 'A', 1, 0)) - SUM(IIF(l_returnflag = 'N', 1, 0)) AS diff FROM lineitem WHERE l_extendedprice < 16947.7
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 supply cost of large plated tin?
Evidence: supply cost refers to ps_supplycost; large plated tin refers to p_type = 'large plated tin'
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 plated tin'
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: Please name any three parts that have an available quantity of more than 9998.
Evidence: part name refers to p_name; an available quantity of more than 9998 refers to ps_availqty > 9998
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 > 9998 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: Please list any two parts that come with the wrap bag container and have a supply cost of under 10.
Evidence: part name refers to p_name; wrap bag container refers to p_container = 'WRAP BAG'; supply cost of under 10 refers to ps_supplycost < 10
SQL: 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
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 nationality of supplier number 1?
Evidence: nationality refers to n_name; supplier number 1 refers to s_suppkey = 1
SQL: 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