Chinastark/bird_dataset huggingface dataset:
Database: retails
Question: For the order with the total price of 218195.43, which supplier handled the returned item? Give the supplier id.
Evidence: returned item refers to l_returnflag = 'R'; supplier id refers to l_suppkey; order with the total price of 218195.43 refers to o_totalprice = 218195.43;
SQL: SELECT T2.l_suppkey FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_totalprice = 218195.43 AND T2.l_returnflag = 'R'
Database: retails
Question: Clerk#000000936 dealt with a "Not Specified" order on 1995/3/13, what was the charge for the part of the order shipped by truck?
Evidence: MULTIPLY(MULTIPLY(l_extendedprice, SUBTRACT(1, l_discount)), SUM(1, l_tax)) WHERE o_clerk = 'Clerk#000000936', o_orderstatus = '4-NOT SPECIFIED', o_orderdate = '1995-03-13' AND l_shipmode = 'TRUCK';
SQL: SELECT T2.l_extendedprice * (1 - T2.l_discount) * (1 + T2.l_tax) AS num FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_clerk = 'Clerk#000000936' AND T2.l_shipmode = 'TRUCK' AND T1.o_orderstatus = '4-NOT SPECIFIED' AND T1.o_orderdate = '1995-03-13'
Database: retails
Question: Customer No.129301 made an order on 1996/7/27, what was the delivery time for the first part of that order?
Evidence: SUBTRACT(l_receiptdate, l_commitdate) WHERE o_orderdate = '1996-07-27' AND o_custkey = '129301';
SQL: SELECT JULIANDAY(T2.l_receiptdate) - JULIANDAY(T2.l_commitdate) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_custkey = '129301' AND T1.o_orderdate = '1996-07-27'
Database: retails
Question: Give the name of the customer who made an order with Clerk#000000803 on 1997/12/10.
Evidence: name of the customer refers to c_name; o_clerk = 'Clerk#000000803'; order on 1997/12/10 refers to o_orderdate = '1997-12-10';
SQL: SELECT T2.c_name FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T1.o_orderdate = '1997-12-10' AND T1.o_clerk = 'Clerk#000000803'
Database: retails
Question: Calculates the profit processed by Supplier No. 7414 on order No. 817154.
Evidence: SUBTRACT(MULTIPLY(l_extendedprice, (SUBTRACT(1, l_discount)), MULTIPLY(ps_supplycost, l_quantity))) WHERE l_suppkey = 7414 AND l_orderkey = 817154;
SQL: SELECT T1.l_extendedprice * (1 - T1.l_discount) - T2.ps_supplycost * T1.l_quantity FROM lineitem AS T1 INNER JOIN partsupp AS T2 ON T1.l_suppkey = T2.ps_suppkey WHERE T1.l_suppkey = 7414 AND T1.l_orderkey = 817154
Database: retails
Question: Which country has the most number of suppliers whose account is in debt?
Evidence: country refers to n_name; the most number of suppliers whose account is in debt refers to MAX(SUM(s_acctbal < 0));
SQL: SELECT T.n_name FROM ( SELECT T2.n_name, SUM(T1.s_acctbal) AS num FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_acctbal < 0 GROUP BY T2.n_name ) AS T ORDER BY T.num LIMIT 1
Database: retails
Question: What is the percentage of the European countries among the given countries?
Evidence: DIVIDE(COUNT(n_name where r_name = 'EUROPE'), COUNT(n_name)) as percentage;
SQL: SELECT CAST(SUM(IIF(T2.r_name = 'EUROPE', 1, 0)) AS REAL) * 100 / COUNT(T1.n_name) FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey
Database: retails
Question: Give the percentage of Japanese suppliers whose account is in debt.
Evidence: account is in debt if s_acctbal < 0; DIVIDE(COUNT(s_acctbal < 0 where n_name = 'JAPAN'), COUNT(s_name where n_name = 'JAPAN')) as percentage;
SQL: SELECT CAST(SUM(IIF(T2.n_name = 'JAPAN', 1, 0)) AS REAL) * 100 / COUNT(T1.s_name) FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_acctbal < 0
Database: retails
Question: What is the name of the customer with the highest amount of debt?
Evidence: customer with the highest amount of debt refers to c_name where MIN(c_acctbal);
SQL: SELECT c_name FROM customer WHERE c_acctbal = ( SELECT MIN(c_acctbal) FROM customer )
Database: retails
Question: How many orders were shipped in 1998?
Evidence: orders refer to l_orderkey; shipped in 1998 refers to year(l_shipdate) = 1998;
SQL: SELECT COUNT(l_orderkey) FROM lineitem WHERE STRFTIME('%Y', l_shipdate) = '1998'
Database: retails
Question: How many customers are in debt?
Evidence: customers are in debt refer to c_custkey where c_acctbal < 0;
SQL: SELECT COUNT(c_custkey) FROM customer WHERE c_acctbal < 0
Database: retails
Question: How many items that were shipped via air were returned in 1994?
Evidence: items refer to l_linenumber; shipped via air in 1994 refers to year(l_shipdate) = 1994 where l_shipmode = 'AIR'; returned refer to l_returnflag = 'R';
SQL: SELECT COUNT(l_linenumber) FROM lineitem WHERE l_returnflag = 'R' AND l_shipmode = 'AIR' AND STRFTIME('%Y', l_shipdate) = '1994'
Database: retails
Question: How many customers are in the automobile market segment?
Evidence: automobile market segment refers to c_mktsegment = 'AUTOMOBILE';
SQL: SELECT COUNT(c_custkey) FROM customer WHERE c_mktsegment = 'AUTOMOBILE'
Database: retails
Question: What are the top 2 order keys of the item with the highest amount of extended price?
Evidence: the highest amount of extended price refers to MAX(l_extendedprice);
SQL: SELECT l_orderkey FROM lineitem ORDER BY l_extendedprice DESC LIMIT 2
Database: retails
Question: When was the order with the highest amount of total price shipped?
Evidence: when shipped refers to l_shipdate; the highest amount of total price refers to MAX(o_totalprice);
SQL: SELECT T2.l_shipdate FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey ORDER BY T1.o_totalprice DESC LIMIT 1
Database: retails
Question: In which country do most of the customers come from?
Evidence: country refers to n_name; most of the customers refer to MAX(COUNT(c_custkey));
SQL: SELECT T.n_name FROM ( SELECT T2.n_name, COUNT(T1.c_custkey) AS num FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey GROUP BY T2.n_name ) AS T ORDER BY T.num DESC LIMIT 1
Database: retails
Question: How many urgent orders were shipped the next day?
Evidence: the order is urgent if o_orderpriority = '1-URGENT'; shipped the next day refers to SUBTRACT(l_shipdate, o_orderdate) = 1;
SQL: SELECT COUNT(T2.o_orderkey) FROM lineitem AS T1 INNER JOIN orders AS T2 ON T2.o_orderkey = T1.l_orderkey WHERE JULIANDAY(T1.l_shipdate) - JULIANDAY(T2.o_orderdate) = 1 AND T2.o_orderpriority = '1-URGENT'
Database: retails
Question: How many in debt customers in the household market segment are from Russia?
Evidence: in debt customers refer to c_custkey where c_acctbal < 0; c_mktsegment = 'HOUSEHOLD'; Russian is the name of the nation which refers to n_name = 'RUSSIA';
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_acctbal < 0 AND T1.c_mktsegment = 'HOUSEHOLD' AND T2.n_name = 'RUSSIA'
Database: retails
Question: How many suppliers are from Japan?
Evidence: suppliers refer to s_nationkey; Japan is the name of the nation which refers to n_name = 'JAPAN';
SQL: SELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'JAPAN'
Database: retails
Question: How many orders shipped via ship have a medium priority?
Evidence: orders shipped via ship refer to o_orderkey where l_shipmode = 'SHIP'; medium priority refers to o_orderpriority = '3-MEDIUM';
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 = 'SHIP' AND T1.o_orderpriority = '3-MEDIUM'
Database: retails
Question: Among the customers from the United States, which market segment has the highest number of customers?
Evidence: the highest number of customers refer to MAX(COUNT(c_custkey)); the United States is the name of the nation which refers to n_name = 'UNITED STATES'; market segment refers to c_mktsegment;
SQL: SELECT T.c_mktsegment FROM ( SELECT T1.c_mktsegment, COUNT(T1.c_custkey) AS num FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'UNITED STATES' GROUP BY T1.c_mktsegment ) AS T ORDER BY T.num DESC LIMIT 1
Database: retails
Question: What are the countries in the region of Asia?
Evidence: countries in the region of Asia refer to n_name where r_name = 'ASIA';
SQL: SELECT T1.n_name FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey WHERE T2.r_name = 'ASIA'
Database: retails
Question: What are the names of the parts manufactured by manufacturer 3 that have a supply cost of 1,000?
Evidence: names of the parts refer to p_name; manufacturer 3 refers to p_mfgr = 'Manufacturer#3'; ps_supplycost = 1000;
SQL: SELECT T2.p_name FROM partsupp AS T1 INNER JOIN part AS T2 ON T1.ps_partkey = T2.p_partkey WHERE T1.ps_supplycost = 1000 AND T2.p_mfgr = 'Manufacturer#3'
Database: retails
Question: How many countries are there in the region whose comment description is "asymptotes sublate after the r."
Evidence: r_comment = 'asymptotes sublate after the r'; countries refer to n_nationkey;
SQL: SELECT COUNT(T1.n_nationkey) FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey WHERE T2.r_comment = 'asymptotes sublate after the r'
Database: retails
Question: Among the products manufactured by manufacturer 5 that have a retail price of no more than 1,000, how many products were shipped via rail?
Evidence: manufacturer 5 refers to p_mfgr = 'Manufacturer#5'; retail price of no more than 1,000 refers to p_retailprice < 1000; shipped via rail refers to shipmode = 'RAIL';
SQL: SELECT COUNT(T1.ps_partkey) FROM partsupp AS T1 INNER JOIN lineitem AS T2 ON T1.ps_suppkey = T2.l_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey WHERE T3.p_mfgr = 'Manufacturer#5' AND T3.p_retailprice < 1000 AND T2.l_shipmode = 'RAIL'
Database: retails
Question: How much is the profit for smoke turquoise purple blue salmon that was delivered in person on 5/7/1996?
Evidence: SUBTRACT(MULTIPLY(l_extendedprice, (SUBTRACT(1, l_discount)), MULTIPLY(ps_supplycost, l_quantity))) where p_name = 'smoke turquoise purple blue salmon' and l_receiptdate = '1996-05-07' and l_shipinstruct = 'DELIVER IN PERSON';
SQL: SELECT T1.l_extendedprice * (1 - T1.l_discount) - T2.ps_supplycost * T1.l_quantity AS num FROM lineitem AS T1 INNER JOIN partsupp AS T2 ON T1.l_suppkey = T2.ps_suppkey INNER JOIN part AS T3 ON T2.ps_partkey = T3.p_partkey WHERE T1.l_receiptdate = '1996-05-07' AND T1.l_shipinstruct = 'DELIVER IN PERSON' AND T3.p_name = 'smoke turquoise purple blue salmon'
Database: retails
Question: What is the average price before discount of the top 10 orders with the highest total price?
Evidence: DIVIDE(SUM(l_extendedprice), 10) where MAX(o_totalprice);
SQL: SELECT SUM(T2.l_extendedprice) / 10 FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey ORDER BY T1.o_totalprice DESC LIMIT 10
Database: retails
Question: Identify the names of the top 3 customers with the highest number of orders of all time and calculate for the average total price per order of each customers.
Evidence: customers with the highest number of orders refer to c_name where MAX(COUNT(o_orderkey)); DIVIDE(SUM(o_totalprice), COUNT(o_orderkey));
SQL: SELECT T.c_name, T.res FROM ( SELECT T2.c_name, SUM(T1.o_totalprice) / COUNT(T1.o_orderkey) AS res , COUNT(T1.o_orderkey) AS num FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey GROUP BY T1.o_custkey ) AS T ORDER BY T.num DESC LIMIT 3
Database: retails
Question: How many items were shipped on 4th December, 1993?
Evidence: items shipped on 4th December, 1993 refer to l_linenumber where l_shipdate = '1993-12-04';
SQL: SELECT COUNT(l_linenumber) FROM lineitem WHERE l_shipdate = '1993-12-04'
Database: retails
Question: What was the order date of items with the highest total price?
Evidence: the highest total price refers to MAX(o_totalprice);
SQL: SELECT o_orderdate FROM orders WHERE o_totalprice = ( SELECT MAX(o_totalprice) FROM orders )
Database: retails
Question: Calculate the percentage of customers' accounts in debt.
Evidence: DIVIDE(COUNT(c_custkey where c_acctbal < 0), COUNT(c_custkey)) as percentage;
SQL: SELECT CAST(SUM(IIF(c_acctbal < 0, 1, 0)) AS REAL) * 100 / COUNT(c_custkey) FROM customer
Database: retails
Question: How many part supplies were nearly out of stock?
Evidence: supplies nearly out of stock refer to ps_partkey where ps_availqty < 10;
SQL: SELECT COUNT(ps_suppkey) FROM partsupp WHERE ps_availqty < 10
Database: retails
Question: Calculate the percentage of manufactured parts by Manufacturer#3.
Evidence: DIVIDE(COUNT(p_partkey where p_mfgr = 'Manufacturer#3'), COUNT(p_partkey)) as percentage;
SQL: SELECT CAST(SUM(IIF(p_mfgr = 'Manufacturer#3', 1, 0)) AS REAL) * 100 / COUNT(p_partkey) FROM part
Database: retails
Question: List any five parts name in Medium Plated Brass.
Evidence: p_type = 'MEDIUM PLATED BRASS'; parts name refer to p_name;
SQL: SELECT p_name FROM part WHERE p_type = 'MEDIUM PLATED BRASS' LIMIT 5
Database: retails
Question: Among the orders shipped in November, 1998 by air, how many orders were urgent?
Evidence: orders shipped in November, 1998 refer to o_orderkey where l_shipdate LIKE '1998-11-%'; by air refers to l_shipmode = 'AIR'; the order is urgent if o_orderpriority = '1-URGENT' ;
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 = 'AIR' AND T1.o_orderpriority = '1-URGENT' AND SUBSTR(T2.l_shipdate, 1, 7) = '1998-11'
Database: retails
Question: How many customers are there in India?
Evidence: customers refer to c_custkey; India is the name of the nation which refers to n_name = 'INDIA';
SQL: SELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'INDIA'
Database: retails
Question: Among the customers from Morocco, how many customers were in debt?
Evidence: customers refer to c_custkey; Morocco is the name of the nation which refers to n_name = 'MOROCCO'; in debt refers to c_acctbal < 0;
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_acctbal < 0 AND T2.n_name = 'MOROCCO'
Database: retails
Question: List down the nation keys and names in Africa.
Evidence: Africa refers to r_name = 'Africa';
SQL: SELECT T1.n_name, T1.n_nationkey FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey WHERE T2.r_name = 'AFRICA'
Database: retails
Question: Calculate the total price of orders by Customer#000000013.
Evidence: Customer#000000013 is the name of the customer which refers to c_name;
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_name = 'Customer#000000013'
Database: retails
Question: How many items did Customer#000021159 order? Calculate those items total charges.
Evidence: items Customer#000021159 order refer to l_linenumber where c_name = 'Customer#000021159'; SUM(MULTIPLY(MULTIPLY(l_extendedprice, SUBTRACT(1, l_discount)), SUM(1, l_tax))) where c_name = 'Customer#000021159';
SQL: SELECT COUNT(T2.o_orderkey), SUM(T3.l_extendedprice * (1 - T3.l_discount) * (1 + T3.l_tax)) FROM customer AS T1 INNER JOIN orders AS T2 ON T1.c_custkey = T2.o_custkey INNER JOIN lineitem AS T3 ON T2.o_orderkey = T3.l_orderkey WHERE T1.c_name = 'Customer#000021159' GROUP BY T3.l_linenumber
Database: retails
Question: Calculate the total profit made by chocolate floral blue coral cyan.
Evidence: SUBTRACT(MULTIPLY(l_extendedprice, (SUBTRACT(1, l_discount)), MULTIPLY(ps_supplycost, l_quantity))) where p_name = 'chocolate floral blue coral cyan';
SQL: SELECT SUM(T3.l_extendedprice * (1 - T3.l_discount) - T2.ps_supplycost * T3.l_quantity) FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN lineitem AS T3 ON T2.ps_partkey = T3.l_partkey AND T2.ps_suppkey = T3.l_suppkey WHERE T1.p_name = 'chocolate floral blue coral cyan'
Database: retails
Question: Calculate the percentage of suppliers in Germany.
Evidence: DIVIDE(COUNT(s_suppkey where n_name = 'GERMANY'), COUNT(s_suppkey)) as percentage;
SQL: SELECT CAST(SUM(IIF(T2.n_name = 'GERMANY', 1, 0)) AS REAL) * 100 / COUNT(T1.s_suppkey) FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_acctbal < 0
Database: retails
Question: List the suppliers' names which supplied smoke red pale saddle plum.
Evidence: p_name = 'smoke red pale saddle plum'; the suppliers' names refer to s_name;
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_name = 'smoke red pale saddle plum'
Database: retails
Question: Among the suppliers from Middle East region, how many suppliers were in debt?
Evidence: suppliers from Middle East region refer to s_name where r_name = 'MIDDLE EAST'; in debt refers to s_acctbal < 0;
SQL: SELECT COUNT(T3.s_name) FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey INNER JOIN supplier AS T3 ON T2.n_nationkey = T3.s_nationkey WHERE T3.s_acctbal < 0 AND T1.r_name = 'MIDDLE EAST'
Database: retails
Question: Among the parts shipped by rail on 1st December, 1995, list part names with 10% discount.
Evidence: shipped by rail on 1st December, 1995 refers to l_shipmode = 'RAIL' where l_shipdate = '1995-12-01'; part names with 10% discount refer to p_name where l_discount = 0.1;
SQL: SELECT T2.p_name FROM partsupp AS T1 INNER JOIN part AS T2 ON T1.ps_partkey = T2.p_partkey INNER JOIN lineitem AS T3 ON T1.ps_partkey = T3.l_partkey WHERE T3.l_discount = 0.1 AND T3.l_shipdate = '1995-12-01' AND T3.l_shipmode = 'RAIL'
Database: retails
Question: Among the parts supplied by Supplier#000000018, provide parts names which had supply costs above 900.
Evidence: Supplier#000000018 is the name of supplier which refers to s_name; supply costs above 900 refer to ps_supplycost > 900;
SQL: SELECT T2.p_name FROM partsupp AS T1 INNER JOIN part AS T2 ON T1.ps_partkey = T2.p_partkey INNER JOIN supplier AS T3 ON T1.ps_suppkey = T3.s_suppkey WHERE T1.ps_supplycost > 900 AND T3.s_name = 'Supplier#000000018'
Database: retails
Question: How many orders were shipped in 1994?
Evidence: orders shipped in 1994 refer to l_orderkey where year(l_shipdate) = 1994;
SQL: SELECT COUNT(l_orderkey) FROM lineitem WHERE STRFTIME('%Y', l_shipdate) = '1994'
Database: retails
Question: How many of the line items have been shipped by rail with a quantity less than 30?
Evidence: shipped by rail refers to l_shipmode = 'RAIL'; quantity less than 30 refers to l_quantity < 30;
SQL: SELECT COUNT(l_linenumber) FROM lineitem WHERE l_quantity < 30 AND l_shipmode = 'RAIL'
Database: retails
Question: Among the customers in the furniture market segment, how many of them have a nation key of 1?
Evidence: furniture market segment refers to c_mktsegment = 'FURNITURE';
SQL: SELECT COUNT(c_custkey) FROM customer WHERE c_mktsegment = 'FURNITURE' AND c_nationkey = 1
Database: retails
Question: Give the phone number of the customer with the highest account balance.
Evidence: phone number of the customer refers to c_phone; the highest account balance refers to MAX(c_acctbal);
SQL: SELECT c_phone FROM customer ORDER BY c_acctbal DESC LIMIT 1
Database: retails
Question: What is the order priority of the order with the highest total price?
Evidence: order with the highest total price refers to MAX(o_totalprice);
SQL: SELECT o_orderpriority FROM orders WHERE o_totalprice = ( SELECT MAX(o_totalprice) FROM orders )
Database: retails
Question: What is the total number of orders made by customers in United States?
Evidence: orders refer to o_orderkey; the United States is the name of the nation which refers to n_name = 'UNITED STATES';
SQL: SELECT COUNT(T1.o_orderkey) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey INNER JOIN nation AS T3 ON T2.c_nationkey = T3.n_nationkey WHERE T3.n_name = 'UNITED STATES'
Database: retails
Question: Among the customers from Brazil, how many customers are in automobile market segment?
Evidence: customers refer to c_custkey; Brazil is the name of the nation which refers to n_name = 'BRAZIL'; c_mktsegment = 'automobile';
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 = 'AUTOMOBILE' AND T2.n_name = 'BRAZIL'
Database: retails
Question: Provide the order comments for at least 5 orders made by customers in the furniture segment.
Evidence: order comments refer to o_comment; 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' LIMIT 5
Database: retails
Question: List down the countries that are located in Asia.
Evidence: countries in Asia refer to n_name where r_name = 'ASIA';
SQL: SELECT T1.n_name FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey WHERE T2.r_name = 'ASIA'
Database: retails
Question: Name the countries that belong in the region with comment description "furiously express accounts wake sly".
Evidence: r_comment = 'furiously express accounts wake sly';
SQL: SELECT T1.n_name FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey WHERE T2.r_comment = 'furiously express accounts wake sly'
Database: retails
Question: What is the total number of suppliers from Germany?
Evidence: suppliers refer to s_suppkey; Germany is the name of the nation which refers to n_name = 'GERMANY';
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'
Database: retails
Question: Among the customers in Asia, how many customers are in debt?
Evidence: customers in Asia refer to n_name where r_name = 'ASIA'; customers in debt refer to c_acctbal < 0;
SQL: SELECT COUNT(T1.n_name) FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN region AS T3 ON T1.n_regionkey = T3.r_regionkey WHERE T2.c_acctbal < 0 AND T3.r_name = 'ASIA'
Database: retails
Question: Provide the phone number of the customer with the highest total price in an order.
Evidence: phone number of the customer refers to c_phone; the highest total price refers to MAX(o_totalprice);
SQL: SELECT T2.c_phone FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey ORDER BY T1.o_totalprice DESC LIMIT 1
Database: retails
Question: Among the products that have a retail price greater than 1,000, how many products were shipped via ship?
Evidence: products refer to l_partkey; retail price greater than 1,000 refers to p_retailprice > 1000; shipped via ship refers to l_shipmode = 'SHIP';
SQL: SELECT COUNT(T1.ps_suppkey) FROM partsupp AS T1 INNER JOIN lineitem AS T2 ON T1.ps_suppkey = T2.l_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey WHERE T3.p_retailprice > 1000 AND T2.l_shipmode = 'SHIP'
Database: retails
Question: What is the name and marketing segment of the customer with the total order price of 199180.63?
Evidence: name of the customer refers to c_name; total order price of 199180.63 refers o_totalprice = 199180.63; marketing segment refers to c_mktsegment;
SQL: SELECT T2.c_name, T2.c_mktsegment FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T1.o_totalprice = 199180.63
Database: retails
Question: Provide the nation and region of the customer with the address of wH55UnX7 VI?
Evidence: nation refers to n_name; region refers to r_name; address of wH55UnX7 VI refers to c_address = 'wH55UnX7 VI';
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_address = 'wH55UnX7 VI'
Database: retails
Question: Among all the customers in Brazil, how many of them have an account balance of less than 1000?
Evidence: customers refer to c_custkey; Brazil is the name of the nation which refers to n_name = 'BRAZIL'; account balance of less than 1000 refers to c_acctbal < 1000;
SQL: SELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'BRAZIL' AND T1.c_acctbal < 1000