db_id
stringlengths
4
31
SQL
stringlengths
18
1.45k
input_sequence
stringlengths
148
11k
question
stringlengths
16
325
retails
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
Question: calculates the profit processed by supplier no. 7414 on order no. 817154. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus,...
calculates the profit processed by supplier no. 7414 on order no. 817154.
retails
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
Question: which country has the most number of suppliers whose account is in debt? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, ...
which country has the most number of suppliers whose account is in debt?
retails
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
Question: what is the percentage of the european countries among the given countries? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatu...
what is the percentage of the european countries among the given countries?
retails
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
Question: give the percentage of japanese suppliers whose account is in debt. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax...
give the percentage of japanese suppliers whose account is in debt.
retails
select c_name from customer where c_acctbal = ( select min(c_acctbal) from customer )
Question: what is the name of the customer with the highest amount of debt? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, ...
what is the name of the customer with the highest amount of debt?
retails
select count(l_orderkey) from lineitem where strftime('%y', l_shipdate) = '1998'
Question: how many orders were shipped in 1998? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, l_receiptdate,...
how many orders were shipped in 1998?
retails
select count(c_custkey) from customer where c_acctbal < 0
Question: how many customers are in debt? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, l_receiptdate, l_shi...
how many customers are in debt?
retails
select count(l_linenumber) from lineitem where l_returnflag = 'r' and l_shipmode = 'air' and strftime('%y', l_shipdate) = '1994'
Question: how many items that were shipped via air were returned in 1994? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_...
how many items that were shipped via air were returned in 1994?
retails
select count(c_custkey) from customer where c_mktsegment = 'automobile'
Question: how many customers are in the automobile market segment? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitd...
how many customers are in the automobile market segment?
retails
select l_orderkey from lineitem order by l_extendedprice desc limit 2
Question: what are the top 2 order keys of the item with the highest amount of extended price? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_...
what are the top 2 order keys of the item with the highest amount of extended price?
retails
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
Question: when was the order with the highest amount of total price shipped? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax,...
when was the order with the highest amount of total price shipped?
retails
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
Question: in which country do most of the customers come from? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate,...
in which country do most of the customers come from?
retails
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'
Question: how many urgent orders were shipped the next day? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, l_...
how many urgent orders were shipped the next day?
retails
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'
Question: how many in debt customers in the household market segment are from russia? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatu...
how many in debt customers in the household market segment are from russia?
retails
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'
Question: how many suppliers are from japan? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, l_receiptdate, l_...
how many suppliers are from japan?
retails
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'
Question: how many orders shipped via ship have a medium priority? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitd...
how many orders shipped via ship have a medium priority?
retails
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
Question: among the customers from the united states, which market segment has the highest number of customers? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnfl...
among the customers from the united states, which market segment has the highest number of customers?
retails
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'
Question: what are the countries in the region of asia? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, l_rece...
what are the countries in the region of asia?
retails
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'
Question: what are the names of the parts manufactured by manufacturer 3 that have a supply cost of 1,000? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l...
what are the names of the parts manufactured by manufacturer 3 that have a supply cost of 1,000?
retails
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'
Question: how many countries are there in the region whose comment description is 'asymptotes sublate after the r.' | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_retu...
how many countries are there in the region whose comment description is 'asymptotes sublate after the r.'
retails
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'
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? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedpri...
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?
retails
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 = ...
Question: how much is the profit for smoke turquoise purple blue salmon that was delivered in person on 5/7/1996? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_return...
how much is the profit for smoke turquoise purple blue salmon that was delivered in person on 5/7/1996?
retails
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
Question: what is the average price before discount of the top 10 orders with the highest total price? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_par...
what is the average price before discount of the top 10 orders with the highest total price?
retails
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
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. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_dis...
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.
retails
select count(l_linenumber) from lineitem where l_shipdate = '1993-12-04'
Question: how many items were shipped on 4th december, 1993? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, l...
how many items were shipped on 4th december, 1993?
retails
select o_orderdate from orders where o_totalprice = ( select max(o_totalprice) from orders )
Question: what was the order date of items with the highest total price? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_c...
what was the order date of items with the highest total price?
retails
select cast(sum(iif(c_acctbal < 0, 1, 0)) as real) * 100 / count(c_custkey) from customer
Question: calculate the percentage of customers' accounts in debt. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitd...
calculate the percentage of customers' accounts in debt.
retails
select count(ps_suppkey) from partsupp where ps_availqty < 10
Question: how many part supplies were nearly out of stock? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, l_r...
how many part supplies were nearly out of stock?
retails
select cast(sum(iif(p_mfgr = 'manufacturer#3', 1, 0)) as real) * 100 / count(p_partkey) from part
Question: calculate the percentage of manufactured parts by manufacturer#3. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, ...
calculate the percentage of manufactured parts by manufacturer#3.
retails
select p_name from part where p_type = 'medium plated brass' limit 5
Question: list any five parts name in medium plated brass. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, l_r...
list any five parts name in medium plated brass.
retails
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'
Question: among the orders shipped in november, 1998 by air, how many orders were urgent? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_lines...
among the orders shipped in november, 1998 by air, how many orders were urgent?
retails
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'
Question: how many customers are there in india? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, l_receiptdate...
how many customers are there in india?
retails
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'
Question: among the customers from morocco, how many customers were in debt? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax,...
among the customers from morocco, how many customers were in debt?
retails
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'
Question: list down the nation keys and names in africa. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, l_rec...
list down the nation keys and names in africa.
retails
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'
Question: calculate the total price of orders by customer#000000013. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commi...
calculate the total price of orders by customer#000000013.
retails
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
Question: how many items did customer#000021159 order? calculate those items total charges. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_lin...
how many items did customer#000021159 order? calculate those items total charges.
retails
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'
Question: calculate the total profit made by chocolate floral blue coral cyan. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_ta...
calculate the total profit made by chocolate floral blue coral cyan.
retails
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
Question: calculate the percentage of suppliers in germany. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, l_...
calculate the percentage of suppliers in germany.
retails
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'
Question: list the suppliers' names which supplied smoke red pale saddle plum. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_ta...
list the suppliers' names which supplied smoke red pale saddle plum.
retails
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'
Question: among the suppliers from middle east region, how many suppliers were in debt? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linesta...
among the suppliers from middle east region, how many suppliers were in debt?
retails
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'
Question: among the parts shipped by rail on 1st december, 1995, list part names with 10% discount. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partke...
among the parts shipped by rail on 1st december, 1995, list part names with 10% discount.
retails
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'
Question: among the parts supplied by supplier#000000018, provide parts names which had supply costs above 900. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnfl...
among the parts supplied by supplier#000000018, provide parts names which had supply costs above 900.
retails
select count(l_orderkey) from lineitem where strftime('%y', l_shipdate) = '1994'
Question: how many orders were shipped in 1994? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, l_receiptdate,...
how many orders were shipped in 1994?
retails
select count(l_linenumber) from lineitem where l_quantity < 30 and l_shipmode = 'rail'
Question: how many of the line items have been shipped by rail with a quantity less than 30? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_li...
how many of the line items have been shipped by rail with a quantity less than 30?
retails
select count(c_custkey) from customer where c_mktsegment = 'furniture' and c_nationkey = 1
Question: among the customers in the furniture market segment, how many of them have a nation key of 1? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_pa...
among the customers in the furniture market segment, how many of them have a nation key of 1?
retails
select c_phone from customer order by c_acctbal desc limit 1
Question: give the phone number of the customer with the highest account balance. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l...
give the phone number of the customer with the highest account balance.
retails
select o_orderpriority from orders where o_totalprice = ( select max(o_totalprice) from orders )
Question: what is the order priority of the order with the highest total price? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_t...
what is the order priority of the order with the highest total price?
retails
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'
Question: what is the total number of orders made by customers in united states? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_...
what is the total number of orders made by customers in united states?
retails
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'
Question: among the customers from brazil, how many customers are in automobile market segment? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l...
among the customers from brazil, how many customers are in automobile market segment?
retails
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
Question: provide the order comments for at least 5 orders made by customers in the furniture segment. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_par...
provide the order comments for at least 5 orders made by customers in the furniture segment.
retails
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'
Question: list down the countries that are located in asia. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, l_...
list down the countries that are located in asia.
retails
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'
Question: name the countries that belong in the region with comment description 'furiously express accounts wake sly'. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_r...
name the countries that belong in the region with comment description 'furiously express accounts wake sly'.
retails
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'
Question: what is the total number of suppliers from germany? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, ...
what is the total number of suppliers from germany?
retails
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'
Question: among the customers in asia, how many customers are in debt? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_com...
among the customers in asia, how many customers are in debt?
retails
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
Question: provide the phone number of the customer with the highest total price in an order. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_li...
provide the phone number of the customer with the highest total price in an order.
retails
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'
Question: among the products that have a retail price greater than 1,000, how many products were shipped via ship? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_retur...
among the products that have a retail price greater than 1,000, how many products were shipped via ship?
retails
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
Question: what is the name and marketing segment of the customer with the total order price of 199180.63? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_...
what is the name and marketing segment of the customer with the total order price of 199180.63?
retails
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'
Question: provide the nation and region of the customer with the address of wh55unx7 vi? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linest...
provide the nation and region of the customer with the address of wh55unx7 vi?
retails
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
Question: among all the customers in brazil, how many of them have an account balance of less than 1000? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_p...
among all the customers in brazil, how many of them have an account balance of less than 1000?
retails
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
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. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l...
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.
retails
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
Question: among the customers with an account balance lower than 4000, what is the percentage of the customers in the us? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, ...
among the customers with an account balance lower than 4000, what is the percentage of the customers in the us?
retails
select c_name, c_phone from customer where c_acctbal > 9000
Question: give the name and phone number of the customers who have more than 9000 account balance. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey...
give the name and phone number of the customers who have more than 9000 account balance.
retails
select avg(l_linenumber) from lineitem where l_shipdate between '1994-01-01' and '1994-01-30'
Question: what is the average number of items shipped each day in april of 1994? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_...
what is the average number of items shipped each day in april of 1994?
retails
select o_orderkey from orders where o_totalprice between 200000 and 300000
Question: list the order key of the orders with a total price between 200000 and 300000. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linest...
list the order key of the orders with a total price between 200000 and 300000.
retails
select p_partkey from part where p_retailprice > ( select avg(p_retailprice) from part )
Question: find and list the part key of the parts which has an above-average retail price. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_line...
find and list the part key of the parts which has an above-average retail price.
retails
select cast(sum(iif(ps_supplycost > 500, 1, 0)) as real) * 100 / count(ps_suppkey) from partsupp
Question: calculate the percentage of part supply that costs more than 500. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, ...
calculate the percentage of part supply that costs more than 500.
retails
select s_suppkey, s_acctbal from supplier order by s_acctbal desc limit 10
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. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_ord...
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.
retails
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'
Question: how many customers who are not in debt ordered an urgent order? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_...
how many customers who are not in debt ordered an urgent order?
retails
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
Question: list the name and phone number of customers in india who have an above-average account balance. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_...
list the name and phone number of customers in india who have an above-average account balance.
retails
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
Question: in the parts supply by supplier#000000654, list the top five parts with the most supply cost in descending order of supply cost. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_supp...
in the parts supply by supplier#000000654, list the top five parts with the most supply cost in descending order of supply cost.
retails
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'
Question: what percentage of customers from france is in the automobile segment? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_...
what percentage of customers from france is in the automobile segment?
retails
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
Question: name the part which is most profitable. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, l_receiptdat...
name the part which is most profitable.
retails
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)
Question: list the names of the countries with the below-average number of customers in ascending order of customer numbers. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantit...
list the names of the countries with the below-average number of customers in ascending order of customer numbers.
retails
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'
Question: what percentage of customers from the african region is in the household segment? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_lin...
what percentage of customers from the african region is in the household segment?
retails
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
Question: list the name of the top ten items with the most quantity available in the descending order of availability. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_r...
list the name of the top ten items with the most quantity available in the descending order of availability.
retails
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 lineit...
Question: calculate the difference in the average retail price of parts shipped via ship and air. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey,...
calculate the difference in the average retail price of parts shipped via ship and air.
retails
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'
Question: what is the average discount for the parts made by manufacturer#5? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax,...
what is the average discount for the parts made by manufacturer#5?
retails
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'
Question: in the parts shipped by rail, how many are of medium priority? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_c...
in the parts shipped by rail, how many are of medium priority?
retails
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'
Question: among the suppliers in the european region, what percentage have a below-average account balance? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, ...
among the suppliers in the european region, what percentage have a below-average account balance?
retails
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'
Question: calculate the difference in the average number of low-priority orders shipped by truck in each month of 1995 and 1996. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_qua...
calculate the difference in the average number of low-priority orders shipped by truck in each month of 1995 and 1996.
retails
select c_custkey from customer where c_acctbal < 0
Question: list by their id all customers who have a debit balance in their accounts. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus...
list by their id all customers who have a debit balance in their accounts.
retails
select l_orderkey from lineitem order by l_extendedprice * (1 - l_discount) limit 3
Question: list by order number the 3 items with the lowest price after applying the discount. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_l...
list by order number the 3 items with the lowest price after applying the discount.
retails
select count(l_linenumber) from lineitem where l_quantity > 10 and l_returnflag = 'r'
Question: how many orders of more than 10 items have been returned? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commit...
how many orders of more than 10 items have been returned?
retails
select l_extendedprice * (1 - l_discount) * (1 + l_tax) as totalprice from lineitem where l_shipmode = 'air' and l_shipinstruct = 'none'
Question: what is the total price charged for orders shipped by air without shipping instructions? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey...
what is the total price charged for orders shipped by air without shipping instructions?
retails
select count(o_orderkey) from orders where o_orderpriority = '1-urgent' group by o_orderdate order by o_orderdate desc limit 1
Question: of the orders with a lower delivery priority, how many have an urgent priority order? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l...
of the orders with a lower delivery priority, how many have an urgent priority order?
retails
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'
Question: how many suppliers from egypt have a debit balance? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, ...
how many suppliers from egypt have a debit balance?
retails
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'
Question: how many items shipped by reg air were ordered on march 22, 1995? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, ...
how many items shipped by reg air were ordered on march 22, 1995?
retails
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'
Question: how many european suppliers are there? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, l_receiptdate...
how many european suppliers are there?
retails
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
Question: to which segment belongs the customer that made the most orders in april 1994? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linest...
to which segment belongs the customer that made the most orders in april 1994?
retails
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'
Question: lists all parts supplied by supplier#000000034. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, l_re...
lists all parts supplied by supplier#000000034.
retails
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'
Question: what are the cost prices of large burnished copper? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, ...
what are the cost prices of large burnished copper?
retails
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'
Question: how many clients from mozambique required orders with a low priority order? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatu...
how many clients from mozambique required orders with a low priority order?
retails
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
Question: indicate the name of the product that is close to being sold out and that has the lowest cost price. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnfla...
indicate the name of the product that is close to being sold out and that has the lowest cost price.
retails
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'
Question: how many different clerks have served the customer with the address ufte2u518et8q8uc? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l...
how many different clerks have served the customer with the address ufte2u518et8q8uc?
retails
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
Question: indicate the name of the parts without discount. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_commitdate, l_r...
indicate the name of the parts without discount.
retails
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%'
Question: how many suppliers from germany have left a comment with 'carefully regular packages'? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, ...
how many suppliers from germany have left a comment with 'carefully regular packages'?
retails
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'
Question: how many products shipped on 19/11/1994 were ordered on 21/09/1994? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax...
how many products shipped on 19/11/1994 were ordered on 21/09/1994?
retails
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'
Question: calculate the average profit of prom brushed steel products. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestatus, l_tax, l_com...
calculate the average profit of prom brushed steel products.
retails
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'
Question: what percentage of customers engaged in the household segment are from iran? | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_partkey, l_linestat...
what percentage of customers engaged in the household segment are from iran?
retails
select c_mktsegment, c_name, c_address, c_phone from customer where c_custkey = 3
Question: please state the segment, the name, the address, and the phone number of customer number 3. | Tables: customer -> c_custkey, c_mktsegment, c_nationkey, c_name, c_address, c_phone, c_acctbal, c_comment. lineitem -> l_shipdate, l_orderkey, l_discount, l_extendedprice, l_suppkey, l_quantity, l_returnflag, l_part...
please state the segment, the name, the address, and the phone number of customer number 3.