Chinastark/bird_dataset huggingface dataset:
Database: retails
Question: Which customer is the most in debt?
Evidence: customer refers to c_name; the most in debt refers to max(c_acctbal)
SQL: SELECT c_name FROM customer WHERE c_acctbal = ( SELECT MIN(c_acctbal) FROM customer )
Database: retails
Question: List all the dates of the urgent orders.
Evidence: date refers to o_orderdate; urgent order refers to o_orderpriority = '1-URGENT'
SQL: SELECT o_orderdate FROM orders WHERE o_orderpriority = '1-URGENT'
Database: retails
Question: How many of the items are instructed to be delivered in person?
Evidence: instructed to be delivered in person refers to l_shipinstruct = 'DELIVER IN PERSON'
SQL: SELECT COUNT(l_linenumber) FROM lineitem WHERE l_shipinstruct = 'DELIVER IN PERSON'
Database: retails
Question: What is the largest supplier's account balance?
Evidence: the largest supplier's account balance refers to max(s_acctbal)
SQL: SELECT MAX(s_acctbal) FROM supplier
Database: retails
Question: How many part supplies are close to being out of stock?
Evidence: close to being out of stock refers to ps_availqty < 10
SQL: SELECT COUNT(ps_suppkey) FROM partsupp WHERE ps_availqty < 10
Database: retails
Question: List all the nations in Europe.
Evidence: nation refers to n_name; Europe refers to r_name = 'EUROPE'
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 = 'EUROPE'
Database: retails
Question: What is the supply cost for the part "violet olive rose ivory sandy"?
Evidence: supply cost refers to ps_supplycost; part "violet olive rose ivory sandy" refers to p_name = 'violet olive rose ivory sandy'
SQL: SELECT T2.ps_supplycost FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey WHERE T1.p_name = 'violet olive rose ivory sandy'
Database: retails
Question: List all the customers' phone numbers from Ethiopia.
Evidence: phone number refers to c_phone; Ethiopia refers to n_name = 'Ethiopia'
SQL: SELECT T1.c_phone FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'Ethiopia'
Database: retails
Question: What is the total price of all orders from the customer with the phone number "627-220-3983"?
Evidence: total price = sum(o_totalprice); phone number "627-220-3983" refers to c_phone = '627-220-3983'
SQL: SELECT SUM(T1.o_totalprice) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_phone = '627-220-3983'
Database: retails
Question: What are the shipping methods for the orders on 12/31/1994?
Evidence: shipping method refers to l_shipmode; order on 12/31/1994 refers to o_orderdate = '1994-12-31'
SQL: SELECT DISTINCT T2.l_shipmode FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_orderdate = '1994-12-31'
Database: retails
Question: What is the account balance of the supplier with the most parts?
Evidence: account balance refers to s_acctbal; the most parts refers to max(count(ps_suppkey))
SQL: SELECT T.s_acctbal FROM ( SELECT T1.s_acctbal, COUNT(T2.ps_suppkey) AS num FROM supplier AS T1 INNER JOIN partsupp AS T2 ON T1.s_suppkey = T2.ps_suppkey GROUP BY T1.s_suppkey ) AS T ORDER BY T.num DESC LIMIT 1
Database: retails
Question: Which nation does the supplier with the account balance of "4393.04" belong to?
Evidence: nation refers to n_name; account balance of "4393.04" refers to s_acctbal = 4393.04
SQL: SELECT T2.n_name FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_acctbal = 4393.04
Database: retails
Question: What is the region with the most customers?
Evidence: region refers to r_name; the most customers refers to max(count(c_custkey))
SQL: SELECT T.r_name FROM ( SELECT T3.r_name, COUNT(T2.c_custkey) AS num FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN region AS T3 ON T1.n_regionkey = T3.r_regionkey GROUP BY T3.r_name ) AS T ORDER BY T.num DESC LIMIT 1
Database: retails
Question: List the phone number of the customer who placed orders with a total price of more than $300,000.
Evidence: phone number refers to c_phone; a total price of more than $300,000 refers to o_totalprice > 300000
SQL: SELECT T2.c_phone FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T1.o_totalprice > 300000
Database: retails
Question: What are the clerks of orders with line items shipped by mail?
Evidence: clerk refers to o_clerk; shipped by mail refers to l_shipmode = 'MAIL'
SQL: SELECT T1.o_clerk FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T2.l_shipmode = 'MAIL'
Database: retails
Question: What are the top 5 nations of suppliers with the lowest account balance?
Evidence: nation refers to n_name; the lowest account balance refers to min(s_acctbal)
SQL: SELECT T2.n_name FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey ORDER BY T1.s_acctbal LIMIT 1
Database: retails
Question: List all the addresses for the suppliers of the biggest parts.
Evidence: addresses refers to s_address; the biggest part refers to max(p_size)
SQL: SELECT T2.s_address FROM partsupp AS T1 INNER JOIN supplier AS T2 ON T1.ps_suppkey = T2.s_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey ORDER BY T3.p_size DESC LIMIT 1
Database: retails
Question: Which part and supplier have the most profit?
Evidence: part refers to p_name; supplier refers to s_name; the most profit refers to max(subtract(multiply(l_extendedprice, subtract(1, l_discount)), multiply(ps_supplycost, l_quantity)))
SQL: SELECT T3.p_name, T4.s_name FROM partsupp AS T1 INNER JOIN lineitem AS T2 ON T1.ps_suppkey = T2.l_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey INNER JOIN supplier AS T4 ON T1.ps_suppkey = T4.s_suppkey ORDER BY T2.l_extendedprice * (1 - T2.l_discount) - T1.ps_supplycost * T2.l_quantity DESC LIMIT 1
Database: retails
Question: What proportion of suppliers are from Asia?
Evidence: Asia refers to r_name = 'ASIA'; proportion = divide(count(s_name where r_name = 'ASIA'), count(s_name)) * 100%
SQL: SELECT CAST(SUM(IIF(T1.r_name = 'ASIA', 1, 0)) AS REAL) * 100 / COUNT(T1.r_regionkey) FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey INNER JOIN supplier AS T3 ON T2.n_nationkey = T3.s_nationkey
Database: retails
Question: Please indicate the total price of order key 32.
Evidence: total price refers to o_totalprice; order key 32 refers to o_orderkey = 32
SQL: SELECT o_totalprice FROM orders WHERE o_orderkey = 32
Database: retails
Question: How many order keys are not applied for the discount?
Evidence: order key refers to l_orderkey; not applied for the discount refers to l_discount = 0
SQL: SELECT COUNT(l_orderkey) FROM lineitem WHERE l_discount = 0
Database: retails
Question: List line items shipped by truck with delivery time before 1997.
Evidence: line item refers to l_linenumber; shipped by truck refers to l_shipmode = 'truck'; delivery time before 1997 refers to year(l_shipdate) < 1997
SQL: SELECT l_linenumber FROM lineitem WHERE STRFTIME('%Y', l_shipdate) < 1997 AND l_shipmode = 'truck'
Database: retails
Question: How many line items were returned in 1998?
Evidence: line item refers to l_linenumber; returned refers to returnflag = 'R'; in 1998 refers to year(l_shipdate) = 1998
SQL: SELECT l_linenumber FROM lineitem WHERE STRFTIME('%Y', l_shipdate) < 1997 AND l_shipmode = 'TRUCK'
Database: retails
Question: Which line item with the highest quantity is shipped by air?
Evidence: line item refers to l_linenumber; the highest quantity refers to max(l_quantity); shipped by air refers to l_shipmode = 'AIR'
SQL: SELECT l_linenumber FROM lineitem WHERE l_shipmode = 'AIR' ORDER BY l_quantity DESC LIMIT 1
Database: retails
Question: List the names of customers whose accounts are in debt.
Evidence: name of customer refers to c_name; account in debt refers to c_acctbal < 0
SQL: SELECT c_name FROM customer WHERE c_acctbal < 0
Database: retails
Question: How many customers belong to the household segment in Germany?
Evidence: household segment refers to c_mktsegment = 'household'; Germany refers to n_name = 'Germany'
SQL: SELECT COUNT(T1.c_name) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_mktsegment = 'HOUSEHOLD' AND T2.n_name = 'GERMANY'
Database: retails
Question: List the phone numbers of customers whose order priority is urgent.
Evidence: phone number refers to c_phone; order priority is urgent refers to o_orderpriority = '1-URGENT'
SQL: SELECT T2.c_phone FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T1.o_orderpriority = '1-URGENT'
Database: retails
Question: Name of customer whose order is applied with the highest discount.
Evidence: customer name refers to c_name; the highest discount refers to max(l_discount)
SQL: SELECT T3.c_name FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey INNER JOIN customer AS T3 ON T1.o_custkey = T3.c_custkey ORDER BY T2.l_discount DESC LIMIT 1
Database: retails
Question: List the 5 orders with the highest total price, indicating the delivery date.
Evidence: order refers to o_orderkey; the highest total price refers to max(o_totalprice); delivery date refers to l_shipdate
SQL: SELECT T1.o_orderkey, T2.l_shipdate FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey ORDER BY T1.o_totalprice DESC LIMIT 5
Database: retails
Question: List the comments describing orders from customers in the furniture segment.
Evidence: comment refers to o_comment; furniture segment refers to c_mktsegment = 'FURNITURE'
SQL: 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'
Database: retails
Question: Please indicate the names of the customers whose order with a total price over $300000.
Evidence: customer name refers to c_name; a total price over $300000 refers to o_totalprice > 300000
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 > 300000
Database: retails
Question: Name customers in India with account balances over $5000.
Evidence: customer name refers to c_name; India refers to n_name = 'INDIA'; account balance over $5000 refers to c_acctbal > 5000
SQL: SELECT T1.c_name FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_acctbal > 5000 AND T2.n_name = 'INDIA'
Database: retails
Question: List the phone numbers of suppliers from Japan.
Evidence: phone number refers to s_phone; Japan refers to n_name = 'JAPAN'
SQL: SELECT T1.s_phone FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T2.n_name = 'JAPAN'
Database: retails
Question: Among the providers in Argentina, which supplier has an account that is in debt?
Evidence: Argentina refers to n_name = 'ARGENTINA'; supplier refers to s_name; an account in debt refers to s_acctbal < 0
SQL: SELECT T1.s_name FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_acctbal < 0 AND T2.n_name = 'ARGENTINA'
Database: retails
Question: How many countries belong to the Algeria region?
Evidence: the algeria region refers to r_name = 'ALGERIA'
SQL: SELECT COUNT(T1.r_name) FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey WHERE T2.n_name = 'ALGERIA'
Database: retails
Question: Please indicate the names of customers whose orders are eligible for 10% discount with order dates between 1/1/1994 and 1/1/1995.
Evidence: customer name refers to c_name; 10% discount refers to l_discount = 0.1; order dates between 1/1/1994 and 1/1/1995 refers to year(o_orderdate) = 1994 OR o_orderdate = '1995-01-01'
SQL: SELECT T3.c_name FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey INNER JOIN customer AS T3 ON T1.o_custkey = T3.c_custkey WHERE T2.l_discount = 0.1 AND STRFTIME('%Y', T1.o_orderdate) BETWEEN 1994 AND 1995
Database: retails
Question: Calculate the percentage of countries that belong to the American region.
Evidence: the American region refers to r_name = 'America'; percentage = divide(count(n_name where r_name = 'America'), count(n_name)) * 100%
SQL: SELECT CAST(SUM(IIF(T1.r_name = 'America', 1, 0)) AS REAL) * 100 / COUNT(T2.n_name) FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey
Database: retails
Question: Calculate percentage of household segment in Indonesia.
Evidence: household segment refers to c_mktsegment = 'HOUSEHOLD'; Indonesia refers to n_name = 'Indonesia'; percentage = divide(count(c_mktsegment = 'HOUSEHOLD'), count(c_mktsegment)) where n_name = 'Indonesia' * 100%
SQL: SELECT CAST(SUM(IIF(T1.c_mktsegment = 'HOUSEHOLD', 1, 0)) AS REAL) * 100 / COUNT(T1.c_mktsegment) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'INDONESIA'
Database: retails
Question: Please list the names of all the products under the type "promo brushed steel".
Evidence: product name refers to p_name; type "promo brushed steel" refers to p_type = 'PROMO BRUSHED STEEL'
SQL: SELECT p_name FROM part WHERE p_type = 'PROMO BRUSHED STEEL'
Database: retails
Question: What is the comment of the product "burlywood plum powder puff mint"?
Evidence: comment refers to p_comment; product "burlywood plum powder puff mint" refers to p_name = 'burlywood plum powder puff mint'
SQL: SELECT p_comment FROM part WHERE p_name = 'burlywood plum powder puff mint'
Database: retails
Question: How many parts have a retail price of over 1900?
Evidence: a retail price of over 1900 refers to p_retailprice > 1900
SQL: SELECT COUNT(p_partkey) FROM part WHERE p_retailprice > 1900
Database: retails
Question: Among the products under the type "promo brushed steel", how many of them are manufactured by Manufacturer#5?
Evidence: type "promo brushed steel" refers to p_type = 'PROMO BRUSHED STEEL'; Manufacturer#5 refers to p_mfgr = 'Manufacturer#5'
SQL: SELECT COUNT(p_partkey) FROM part WHERE p_type = 'PROMO BRUSHED STEEL' AND p_mfgr = 'Manufacturer#5'
Database: retails
Question: Please list all the brands that contain a part under the type "promo brushed steel".
Evidence: brand refers to p_brand; type "promo brushed steel" refers to p_type = 'PROMO BRUSHED STEEL'
SQL: SELECT p_brand FROM part WHERE p_type = 'PROMO BRUSHED STEEL'
Database: retails
Question: What is the name of the product with the highest retail price?
Evidence: name of the product refers to p_name; the highest retail price refers to p_retailprice
SQL: SELECT p_name FROM part WHERE p_retailprice = ( SELECT MAX(p_retailprice) FROM part )
Database: retails
Question: Which part has a bigger size, "pink powder drab lawn cyan" or "cornflower sky burlywood green beige"?
Evidence: size refers to p_size; "pink powder drab lawn cyan" or "cornflower sky burlywood green beige" refers to p_name in ('pink powder drab lawn cyan', 'cornflower sky burlywood green beige')
SQL: SELECT T.p_name FROM ( SELECT p_name, p_size FROM part WHERE p_name IN ('pink powder drab lawn cyan', 'cornflower sky burlywood green beige') ) AS T ORDER BY p_size DESC LIMIT 1
Database: retails
Question: How many parts have a jumbo case container?
Evidence: jumbo case container refers to p_container = 'JUMBO CASE'
SQL: SELECT COUNT(p_partkey) FROM part WHERE p_container = 'JUMBO CASE'
Database: retails
Question: What is the size of the smallest part in a jumbo case container?
Evidence: size refers to p_size; the smallest part refers to min(p_size); jumbo case container refers to p_container = 'JUMBO CASE'
SQL: SELECT MIN(p_size) FROM part WHERE p_container = 'JUMBO CASE'
Database: retails
Question: How many suppliers have their accounts in debt?
Evidence: account in debt refers to s_acctbal < 0
SQL: SELECT COUNT(s_suppkey) FROM supplier WHERE s_acctbal < 0
Database: retails
Question: Please list the names of the top 3 suppliers with the most amount of money in their accounts.
Evidence: supplier name refers to s_name; the most amount of money refers to max(s_acctbal)
SQL: SELECT s_name FROM supplier ORDER BY s_acctbal DESC LIMIT 3
Database: retails
Question: Please list the phone numbers of all the suppliers in Germany.
Evidence: phone number refers to s_phone; Germany refers to n_name = 'Germany'
SQL: SELECT T1.s_phone FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T2.n_name = 'Germany'
Database: retails
Question: Please list the names of all the suppliers for the part "hot spring dodger dim light".
Evidence: supplier name refers to s_name; part "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light'
SQL: SELECT T2.s_name FROM partsupp AS T1 INNER JOIN supplier AS T2 ON T1.ps_suppkey = T2.s_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey WHERE T3.p_name = 'hot spring dodger dim light'
Database: retails
Question: What is the lowest supply cost for the part "hot spring dodger dim light"?
Evidence: the lowest supply cost refers to min(ps_supplycost); part "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light'
SQL: SELECT MIN(T1.ps_supplycost) FROM partsupp AS T1 INNER JOIN part AS T2 ON T1.ps_partkey = T2.p_partkey WHERE T2.p_name = 'hot spring dodger dim light'
Database: retails
Question: What is the name of the supplier that provides the part "hot spring dodger dim light" with the lowest supply cost?
Evidence: supplier name refers to s_name; part "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light'; the lowest supply cost refers to min(ps_supplycost)
SQL: SELECT T2.s_name FROM partsupp AS T1 INNER JOIN supplier AS T2 ON T1.ps_suppkey = T2.s_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey WHERE T3.p_name = 'hot spring dodger dim light' ORDER BY T1.ps_supplycost LIMIT 1
Database: retails
Question: What is the total quantity available by all suppliers for the part "hot spring dodger dim light"?
Evidence: total quantity available refers to sum(ps_availqty); part "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light'
SQL: SELECT SUM(T1.ps_availqty) FROM partsupp AS T1 INNER JOIN part AS T2 ON T1.ps_partkey = T2.p_partkey WHERE T2.p_name = 'hot spring dodger dim light'
Database: retails
Question: Which supplier can provide the most number of "hot spring dodger dim light"? Please give the supplier's phone number.
Evidence: the most number refers to max(ps_availqty); "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light'; phone number refers to s_phone
SQL: SELECT T3.s_phone FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN supplier AS T3 ON T2.ps_suppkey = T3.s_suppkey WHERE T1.p_name = 'hot spring dodger dim light' ORDER BY T2.ps_availqty DESC LIMIT 1
Database: retails
Question: Please list the names of all the suppliers for the part with the highest retail price.
Evidence: supplier name refers to s_name; the highest retail price refers to max(p_retailprice)
SQL: SELECT T3.s_phone FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN supplier AS T3 ON T2.ps_suppkey = T3.s_suppkey WHERE T1.p_name = 'hot spring dodger dim light' ORDER BY T1.p_size DESC LIMIT 1
Database: retails
Question: How many suppliers for the part "hot spring dodger dim light" are in Vietnam?
Evidence: part "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light'; Vietnam refers to n_name = 'VIETNAM'
SQL: SELECT COUNT(T3.s_name) FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN supplier AS T3 ON T2.ps_suppkey = T3.s_suppkey INNER JOIN nation AS T4 ON T3.s_nationkey = T4.n_nationkey WHERE T1.p_name = 'hot spring dodger dim light' AND T4.n_name = 'VIETNAM'
Database: retails
Question: Among the suppliers providing parts under the type "promo brushed steel", how many of them are in debt?
Evidence: type "promo brushed steel" refers to p_type = 'PROMO BRUSHED STEEL'; in debt refers to s_acctbal < 0
SQL: SELECT COUNT(T3.s_name) FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN supplier AS T3 ON T2.ps_suppkey = T3.s_suppkey WHERE T3.s_acctbal < 0 AND T1.p_type = 'PROMO BRUSHED STEEL'
Database: retails
Question: Please list the names of all the suppliers for parts under Brand#55.
Evidence: supplier name refers to s_name; Brand#55 refers to p_brand = 'Brand#55'
SQL: SELECT T3.s_name FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN supplier AS T3 ON T2.ps_suppkey = T3.s_suppkey WHERE T1.p_brand = 'Brand#55'
Database: retails
Question: Among all the parts under the type "promo brushed steel", how many of them have a total available quantity from all suppliers of under 5000?
Evidence: type "promo brushed steel" refers to p_type = 'PROMO BRUSHED STEEL'; a total available quantity of under 5000 refers to sum(ps_availqty) < 5000
SQL: SELECT SUM(num) FROM ( SELECT COUNT(T3.s_name) AS num FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN supplier AS T3 ON T2.ps_suppkey = T3.s_suppkey WHERE T1.p_type = 'PROMO BRUSHED STEEL' GROUP BY T2.ps_partkey HAVING SUM(T2.ps_availqty) < 5000 ) T
Database: retails
Question: The part "hot spring dodger dim light" is ordered in how many orders?
Evidence: part "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light'
SQL: SELECT COUNT(T1.p_partkey) FROM part AS T1 INNER JOIN lineitem AS T2 ON T1.p_partkey = T2.l_partkey WHERE T1.p_name = 'hot spring dodger dim light'
Database: retails
Question: What is the total quantity of the part "hot spring dodger dim light" ordered in all orders?
Evidence: total quantity refers to sum(l_quantity); part "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light'
SQL: SELECT SUM(T1.p_partkey) FROM part AS T1 INNER JOIN lineitem AS T2 ON T1.p_partkey = T2.l_partkey WHERE T1.p_name = 'hot spring dodger dim light'
Database: retails
Question: Please list the order keys of all the orders that have more than 2 parts with a jumbo case container.
Evidence: order key refers to l_orderkey; jumbo case container refers to p_container = 'JUMBO CASE'; more than 2 parts refers to count(l_partkey) > 2
SQL: SELECT T.l_orderkey FROM ( SELECT T2.l_orderkey, COUNT(T2.l_partkey) AS num FROM part AS T1 INNER JOIN lineitem AS T2 ON T1.p_partkey = T2.l_partkey WHERE T1.p_container = 'JUMBO CASE' GROUP BY T2.l_orderkey ) AS T WHERE T.num > 2
Database: retails
Question: Among all the suppliers in debt, how many of them are in Europe?
Evidence: in debt refers to s_acctbal < 0; Europe refers to 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' AND T3.s_acctbal < 0
Database: retails
Question: Among all the suppliers providing the part "hot spring dodger dim light", how many of them are in Europe?
Evidence: part "hot spring dodger dim light" refers to p_name = hot spring dodger dim light; Europe refers to r_name = 'EUROPE'
SQL: SELECT COUNT(T1.r_regionkey) FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey INNER JOIN supplier AS T3 ON T2.n_nationkey = T3.s_nationkey WHERE T1.r_name = 'EUROPE'
Database: retails
Question: Please list the phone numbers of all the suppliers for the parts ordered in order no.1.
Evidence: phone number refers to s_phone; order no.1 refers to l_orderkey = 1
SQL: SELECT T2.s_phone FROM lineitem AS T1 INNER JOIN supplier AS T2 ON T1.l_suppkey = T2.s_suppkey WHERE T1.l_orderkey = 1
Database: retails
Question: Among the suppliers for the parts ordered in order no.4, how many of them are in debt?
Evidence: order no.4 refers to l_orderkey = 4; in debt refers to s_acctbal < 0
SQL: SELECT COUNT(T1.l_linenumber) FROM lineitem AS T1 INNER JOIN supplier AS T2 ON T1.l_suppkey = T2.s_suppkey WHERE T1.l_orderkey = 4 AND T2.s_acctbal < 0
Database: retails
Question: Among the parts that are returned, how many of them are provided by a supplier in debt?
Evidence: returned refers to l_returnflag = 'R'; in debt refers to s_acctbal < 0
SQL: SELECT COUNT(T1.l_partkey) FROM lineitem AS T1 INNER JOIN supplier AS T2 ON T1.l_suppkey = T2.s_suppkey WHERE T1.l_returnflag = 'R' AND T2.s_acctbal < 0