Chinastark/bird_dataset huggingface dataset:
Database: retails
Question: List the country name of the customers in the building marketing segment with an account balance greater than 80% of the average account balance of all customers.
Evidence: country name refers to n_name; building marketing segment refers to c_mktsegment = 'BUILDING'; account balance greater than 80% of the average account balance of all customers refers to c_acctbal > MULTIPLY(AVG(c_acctbal), 0.8);
SQL: 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
Database: retails
Question: Among the customers with an account balance lower than 4000, what is the percentage of the customers in the US?
Evidence: DIVIDE(COUNT(c_custkey where n_name = 'United States' and c_acctbal < 4000), COUNT(c_custkey where c_acctbal < 4000)) as percentage;
SQL: 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
Database: retails
Question: Give the name and phone number of the customers who have more than 9000 account balance.
Evidence: the name of the customer refers to c_name; phone number of the customer refers to c_phone; have more than 9000 account balance refers to c_acctbal > 9000;
SQL: SELECT c_name, c_phone FROM customer WHERE c_acctbal > 9000
Database: retails
Question: What is the average number of items shipped each day in April of 1994?
Evidence: AVG(l_linenumber) where l_shipdate between '1994-01-01' and '1994-01-30';
SQL: SELECT AVG(l_linenumber) FROM lineitem WHERE l_shipdate BETWEEN '1994-01-01' AND '1994-01-30'
Database: retails
Question: List the order key of the orders with a total price between 200000 and 300000.
Evidence: orders with a total price between 200000 and 300000 refer to o_totalprice between 200000 and 300000;
SQL: SELECT o_orderkey FROM orders WHERE o_totalprice BETWEEN 200000 AND 300000
Database: retails
Question: Find and list the part key of the parts which has an above-average retail price.
Evidence: part key of the parts which has an above-average retail price refer to p_partkey where p_retailprice > AVG(p_retailprice);
SQL: SELECT p_partkey FROM part WHERE p_retailprice > ( SELECT AVG(p_retailprice) FROM part )
Database: retails
Question: Calculate the percentage of part supply that costs more than 500.
Evidence: DIVIDE(COUNT(ps_suppkey where ps_supplycost > 500)), COUNT(ps_suppkey) as percentage;
SQL: SELECT CAST(SUM(IIF(ps_supplycost > 500, 1, 0)) AS REAL) * 100 / COUNT(ps_suppkey) FROM partsupp
Database: retails
Question: Find the supply key of the top ten suppliers with the most account balance, and list the supply key along with the account balance in descending order of account balance.
Evidence: supply key refers to s_suppkey; the most amount account balance refers to MAX(s_acctbal);
SQL: SELECT s_suppkey, s_acctbal FROM supplier ORDER BY s_acctbal DESC LIMIT 10
Database: retails
Question: How many customers who are not in debt ordered an urgent order?
Evidence: customers who are not in debt refer to c_custkey where c_acctbal > 0; the order is urgent if o_orderpriority = '1-URGENT' ;
SQL: 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'
Database: retails
Question: List the name and phone number of customers in India who have an above-average account balance.
Evidence: name of customer refers to c_name; phone number of customer refers to c_phone; customers in India who have an above-average account balance refer to n_name = 'INDIA' and c_acctbal > AVG(c_acctbal);
SQL: 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
Database: retails
Question: In the parts supply by Supplier#000000654, list the top five parts with the most supply cost in descending order of supply cost.
Evidence: Supplier#000000654 is the name of the supplier which refers to s_name; parts with the most supply cost refer to ps_partkey where MAX(ps_supplycost);
SQL: 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
Database: retails
Question: What percentage of customers from France is in the automobile segment?
Evidence: DIVIDE(COUNT(c_name where c_mktsegment = 'AUTOMOBILE' and n_name = 'FRANCE'), COUNT(c_name where n_name = 'FRANCE')) as percentage;
SQL: 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'
Database: retails
Question: Name the part which is most profitable.
Evidence: profit can be calculated as SUBTRACT(MULTIPLY(l_extendedprice, (SUBTRACT(1, l_discount)), MULTIPLY(ps_supplycost, l_quantity))); part which is most profitable refers to p_name where MAX(profit);
SQL: 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
Database: retails
Question: List the names of the countries with the below-average number of customers in ascending order of customer numbers.
Evidence: the names of countries with the below-average number of customers refer to n_name where COUNT(c_name) < DIVIDE(COUNT(c_name)), COUNT(n_name);
SQL: 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)
Database: retails
Question: What percentage of customers from the African region is in the household segment?
Evidence: DIVIDE(COUNT(c_custkey where c_mktsegment = 'HOUSEHOLD' and r_name = 'AFRICA'), COUNT(c_custkey where r_name = 'AFRICA')) as percentage;
SQL: 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'
Database: retails
Question: List the name of the top ten items with the most quantity available in the descending order of availability.
Evidence: items with the most quantity available refer to p_name where MAX(ps_availqty);
SQL: 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
Database: retails
Question: Calculate the difference in the average retail price of parts shipped via ship and air.
Evidence: SUBTRACT(DIVIDE(SUM(p_retailprice where l_shipmode = 'SHIP'), COUNT(l_shipmode = 'SHIP')), DIVIDE(SUM(p_retailprice where l_shipmode = 'AIR'), COUNT(l_shipmode = 'AIR')));
SQL: 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 lineitem AS T3 ON T2.ps_suppkey = T3.l_suppkey
Database: retails
Question: What is the average discount for the parts made by Manufacturer#5?
Evidence: DIVIDE(SUM(l_discount), COUNT(l_partkey)) where p_mfgr = 'Manufacturer#5';
SQL: 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'
Database: retails
Question: In the parts shipped by rail, how many are of medium priority?
Evidence: parts shipped by rail refer to l_partkey where l_shipmode = 'RAIL'; medium priority refers to o_orderpriority = '3-MEDIUM';
SQL: 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'
Database: retails
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Database: retails
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Database: retails
Question: What are the countries that belong to Africa?
Evidence: country is nation name which refers to n_name; Africa is region name refers to r_name = 'Africa'
SQL: SELECT T2.n_name FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey WHERE T1.r_name = 'Africa'
Database: retails
Question: Which region has the lowest number of countries?
Evidence: region refers to has r_name; the lowest number of countries refers to min(count(n_name))
SQL: SELECT T.r_name FROM ( SELECT T1.r_name, COUNT(T2.n_name) AS num FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey GROUP BY T1.r_name ) AS T ORDER BY T.num LIMIT 1
Database: retails
Question: How many customers from the furniture segments come from Iraq?
Evidence: furniture segment refers to c_mktsegment = 'FURNITURE'; Iraq refers to n_name = 'Iraq'
SQL: SELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_mktsegment = 'FURNITURE' AND T2.n_name = 'IRAQ'
Database: retails
Question: What is the name of the customer number 93697 with the total order price of 191918.92?
Evidence: customer name refers to c_name; number 93697 refers to o_custkey = 93697; total order price of 191918.92 refers to o_totalprice = 191918.92
SQL: SELECT T2.c_name FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T1.o_totalprice = 191918.92 AND T1.o_custkey = 93697
Database: retails
Question: Which nation and region does the Customer#000000008 come from?
Evidence: nation refers to n_name; region refers to r_name; Customer#000000008 refers to c_name = 'Customer#000000008'
SQL: SELECT T1.n_name, T3.r_name FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN region AS T3 ON T1.n_regionkey = T3.r_regionkey WHERE T2.c_name = 'Customer#000000008'
Database: retails
Question: What is the delivery time and the clerk of order number 6?
Evidence: delivery time = subtract(l_receiptdate, l_commitdate); clerk refers to o_clerk; order number 6 refers to o_orderkey = 6
SQL: SELECT JULIANDAY(T2.l_receiptdate) - JULIANDAY(T2.l_commitdate), T1.o_clerk FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_orderkey = 6
Database: retails
Question: How many Japanese suppliers have their accounts in debt?
Evidence: Japanese refers to n_name = 'Japan'; have accounts in debt refers to 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 = 'JAPAN'