db_id stringclasses 68 values | question stringlengths 24 325 | evidence stringlengths 0 580 | SQL stringlengths 23 728 |
|---|---|---|---|
retails | Please indicate the total price of order key 32. | total price refers to o_totalprice; order key 32 refers to o_orderkey = 32 | SELECT o_totalprice FROM orders WHERE o_orderkey = 32 |
retails | How many order keys are not applied for the discount? | order key refers to l_orderkey; not applied for the discount refers to l_discount = 0 | SELECT COUNT(l_orderkey) FROM lineitem WHERE l_discount = 0 |
retails | Which line item with the highest quantity is shipped by air? | line item refers to l_linenumber; the highest quantity refers to max(l_quantity); shipped by air refers to l_shipmode = 'AIR' | SELECT l_linenumber FROM lineitem WHERE l_shipmode = 'AIR' ORDER BY l_quantity DESC LIMIT 1 |
retails | List the names of customers whose accounts are in debt. | name of customer refers to c_name; account in debt refers to c_acctbal < 0 | SELECT c_name FROM customer WHERE c_acctbal < 0 |
retails | How many customers belong to the household segment in Germany? | household segment refers to c_mktsegment = 'household'; Germany refers to n_name = 'Germany' | 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' |
retails | List the phone numbers of customers whose order priority is urgent. | phone number refers to c_phone; order priority is urgent refers to o_orderpriority = '1-URGENT' | 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' |
retails | Name of customer whose order is applied with the highest discount. | customer name refers to c_name; the highest discount refers to max(l_discount) | 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 |
retails | List the 5 orders with the highest total price, indicating the delivery date. | order refers to o_orderkey; the highest total price refers to max(o_totalprice); delivery date refers to l_shipdate | 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 |
retails | List the comments describing orders from customers in the furniture segment. | comment refers to o_comment; furniture segment refers to c_mktsegment = 'FURNITURE' | 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' |
retails | Please indicate the names of the customers whose order with a total price over $300000. | customer name refers to c_name; a total price over $300000 refers to o_totalprice > 300000 | 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 |
retails | Name customers in India with account balances over $5000. | customer name refers to c_name; India refers to n_name = 'INDIA'; account balance over $5000 refers to c_acctbal > 5000 | 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' |
retails | List the phone numbers of suppliers from Japan. | phone number refers to s_phone; Japan refers to n_name = 'JAPAN' | 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' |
retails | Among the providers in Argentina, which supplier has an account that is in debt? | Argentina refers to n_name = 'ARGENTINA'; supplier refers to s_name; an account in debt refers to s_acctbal < 0 | 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' |
retails | How many countries belong to the Algeria region? | the algeria region refers to r_name = 'ALGERIA' | 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' |
retails | Please list the names of all the products under the type "promo brushed steel". | product name refers to p_name; type "promo brushed steel" refers to p_type = 'PROMO BRUSHED STEEL' | SELECT p_name FROM part WHERE p_type = 'PROMO BRUSHED STEEL' |
retails | What is the comment of the product "burlywood plum powder puff mint"? | comment refers to p_comment; product "burlywood plum powder puff mint" refers to p_name = 'burlywood plum powder puff mint' | SELECT p_comment FROM part WHERE p_name = 'burlywood plum powder puff mint' |
retails | How many parts have a retail price of over 1900? | a retail price of over 1900 refers to p_retailprice > 1900 | SELECT COUNT(p_partkey) FROM part WHERE p_retailprice > 1900 |
retails | Among the products under the type "promo brushed steel", how many of them are manufactured by Manufacturer#5? | type "promo brushed steel" refers to p_type = 'PROMO BRUSHED STEEL'; Manufacturer#5 refers to p_mfgr = 'Manufacturer#5' | SELECT COUNT(p_partkey) FROM part WHERE p_type = 'PROMO BRUSHED STEEL' AND p_mfgr = 'Manufacturer#5' |
retails | Please list all the brands that contain a part under the type "promo brushed steel". | brand refers to p_brand; type "promo brushed steel" refers to p_type = 'PROMO BRUSHED STEEL' | SELECT p_brand FROM part WHERE p_type = 'PROMO BRUSHED STEEL' |
retails | What is the name of the product with the highest retail price? | name of the product refers to p_name; the highest retail price refers to p_retailprice | SELECT p_name FROM part WHERE p_retailprice = ( SELECT MAX(p_retailprice) FROM part ) |
retails | Which part has a bigger size, "pink powder drab lawn cyan" or "cornflower sky burlywood green beige"? | 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') | 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 |
retails | How many parts have a jumbo case container? | jumbo case container refers to p_container = 'JUMBO CASE' | SELECT COUNT(p_partkey) FROM part WHERE p_container = 'JUMBO CASE' |
retails | What is the size of the smallest part in a jumbo case container? | size refers to p_size; the smallest part refers to min(p_size); jumbo case container refers to p_container = 'JUMBO CASE' | SELECT MIN(p_size) FROM part WHERE p_container = 'JUMBO CASE' |
retails | How many suppliers have their accounts in debt? | account in debt refers to s_acctbal < 0 | SELECT COUNT(s_suppkey) FROM supplier WHERE s_acctbal < 0 |
retails | Please list the names of the top 3 suppliers with the most amount of money in their accounts. | supplier name refers to s_name; the most amount of money refers to max(s_acctbal) | SELECT s_name FROM supplier ORDER BY s_acctbal DESC LIMIT 3 |
retails | Please list the names of all the suppliers for the part "hot spring dodger dim light". | supplier name refers to s_name; part "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light' | 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' |
retails | What is the lowest supply cost for the part "hot spring dodger dim light"? | the lowest supply cost refers to min(ps_supplycost); part "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light' | 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' |
retails | What is the name of the supplier that provides the part "hot spring dodger dim light" with the lowest supply cost? | 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) | 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 |
retails | What is the total quantity available by all suppliers for the part "hot spring dodger dim light"? | total quantity available refers to sum(ps_availqty); part "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light' | 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' |
retails | Which supplier can provide the most number of "hot spring dodger dim light"? Please give the supplier's phone number. | 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 | 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 |
retails | Please list the names of all the suppliers for the part with the highest retail price. | supplier name refers to s_name; the highest retail price refers to max(p_retailprice) | 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 |
retails | How many suppliers for the part "hot spring dodger dim light" are in Vietnam? | part "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light'; Vietnam refers to n_name = 'VIETNAM' | 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' |
retails | Among the suppliers providing parts under the type "promo brushed steel", how many of them are in debt? | type "promo brushed steel" refers to p_type = 'PROMO BRUSHED STEEL'; in debt refers to s_acctbal < 0 | 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' |
retails | Please list the names of all the suppliers for parts under Brand#55. | supplier name refers to s_name; Brand#55 refers to p_brand = 'Brand#55' | 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' |
retails | 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? | type "promo brushed steel" refers to p_type = 'PROMO BRUSHED STEEL'; a total available quantity of under 5000 refers to sum(ps_availqty) < 5000 | 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 |
retails | The part "hot spring dodger dim light" is ordered in how many orders? | part "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light' | 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' |
retails | What is the total quantity of the part "hot spring dodger dim light" ordered in all orders? | total quantity refers to sum(l_quantity); part "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light' | 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' |
retails | Please list the order keys of all the orders that have more than 2 parts with a jumbo case container. | 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 | 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 |
retails | Among all the suppliers in debt, how many of them are in Europe? | in debt refers to s_acctbal < 0; Europe refers to r_name = 'EUROPE' | 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 |
retails | Among all the suppliers providing the part "hot spring dodger dim light", how many of them are in Europe? | part "hot spring dodger dim light" refers to p_name = hot spring dodger dim light; Europe refers to r_name = 'EUROPE' | 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' |
retails | Please list the phone numbers of all the suppliers for the parts ordered in order no.1. | phone number refers to s_phone; order no.1 refers to l_orderkey = 1 | 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 |
retails | Among the suppliers for the parts ordered in order no.4, how many of them are in debt? | order no.4 refers to l_orderkey = 4; in debt refers to s_acctbal < 0 | 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 |
retails | Among the parts that are returned, how many of them are provided by a supplier in debt? | returned refers to l_returnflag = 'R'; in debt refers to s_acctbal < 0 | 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 |
retails | On which date was the part "burnished seashell gainsboro navajo chocolate" in order no.1 shipped? | date refers to l_shipdate; part "burnished seashell gainsboro navajo chocolate" refers to p_name = 'burnished seashell gainsboro navajo chocolate'; order no.1 refers to l_orderkey = 1 | SELECT T1.l_shipdate FROM lineitem AS T1 INNER JOIN part AS T2 ON T1.l_partkey = T2.p_partkey WHERE T1.l_orderkey = 1 AND T2.p_name = 'burnished seashell gainsboro navajo chocolate' |
retails | What is the quantity of the part "burnished seashell gainsboro navajo chocolate" ordered in order no.1? | quantity refers to l_quantity; part "burnished seashell gainsboro navajo chocolate" refers to p_name = 'burnished seashell gainsboro navajo chocolate'; order no.1 refers to l_orderkey = 1 | SELECT T1.l_quantity FROM lineitem AS T1 INNER JOIN part AS T2 ON T1.l_partkey = T2.p_partkey WHERE T1.l_orderkey = 1 AND T2.p_name = 'burnished seashell gainsboro navajo chocolate' |
retails | What is the biggest discount among all orders for the part "burnished seashell gainsboro navajo chocolate"? | the biggest discount refers to max(l_discount); part "burnished seashell gainsboro navajo chocolate" refers to p_name = 'burnished seashell gainsboro navajo chocolate' | SELECT MAX(T1.l_discount) FROM lineitem AS T1 INNER JOIN part AS T2 ON T1.l_partkey = T2.p_partkey WHERE T2.p_name = 'burnished seashell gainsboro navajo chocolate' |
retails | Please list all the modes of shipping for the part "burnished seashell gainsboro navajo chocolate". | mode of shipping refers to l_shipmode; part "burnished seashell gainsboro navajo chocolate" refers to p_name = 'burnished seashell gainsboro navajo chocolate' | SELECT DISTINCT T1.l_shipmode FROM lineitem AS T1 INNER JOIN part AS T2 ON T1.l_partkey = T2.p_partkey WHERE T2.p_name = 'burnished seashell gainsboro navajo chocolate' |
retails | What is the average supply cost for the part "hot spring dodger dim light"? | average supply cost refers to avg(ps_supplycost); part "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light' | SELECT AVG(T1.ps_supplycost) 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' |
retails | How much higher in percentage is the highest supply cost of the part "hot spring dodger dim light" than the lowest supply cost? | part "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light'; percentage = divide(subtract(max(ps_supplycost), min(ps_supplycost)), min(ps_supplycost)) * 100% | SELECT CAST((MAX(T1.ps_supplycost) - MIN(T1.ps_supplycost)) AS REAL) * 100 / MIN(T1.ps_supplycost) 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' |
retails | What is the profit for part no.98768 in order no.1? | part no.98768 refers to l_partkey = 98768; order no.1 refers to l_orderkey = 1; profit = subtract(multiply(l_extendedprice, subtract(1, l_discount)), multiply(ps_supplycost, l_quantity)) | 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_orderkey = 1 AND T1.l_partkey = 98768 |
retails | What is the discounted price of the part "burnished seashell gainsboro navajo chocolate" in order no.1? | part "burnished seashell gainsboro navajo chocolate" refers to p_name = 'burnished seashell gainsboro navajo chocolate'; order no.1 refers to l_orderkey = 1; discounted price refers to multiply(l_extendedprice, subtract(1, l_discount)) | SELECT T1.l_extendedprice * (1 - T1.l_discount) FROM lineitem AS T1 INNER JOIN part AS T2 ON T1.l_partkey = T2.p_partkey WHERE T2.p_name = 'burnished seashell gainsboro navajo chocolate' AND T1.l_orderkey = 1 |
retails | Which market segment does the customer with the highest amount of debt belongs to? | market segment refers to c_mktsegment; the highest amount of debt refers to max(c_acctbal) | SELECT c_mktsegment FROM customer WHERE c_acctbal = ( SELECT MIN(c_acctbal) FROM customer ) |
retails | How many customers are in the furniture segment? | furniture segment refers to c_mktsegment = 'FURNITURE' | SELECT COUNT(c_custkey) FROM customer WHERE c_mktsegment = 'FURNITURE' |
retails | How many customers in the machinery segment are in debt? | machinery segment refers to c_mktsegment = 'MACHINERY'; in debt refers to c_acctbal < 0 | SELECT COUNT(c_custkey) FROM customer WHERE c_acctbal < 0 AND c_mktsegment = 'MACHINERY' |
retails | How much is the total price of all the orders shipped to customers in Argentina? | total price = sum(o_totalprice); Argentina refers to n_name = 'Argentina' | SELECT SUM(T3.o_totalprice) 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 = 'ARGENTINA' |
retails | How many customers in the building segments have orders with a total price of no less than 50,000? | building segment refers to c_mktsegment = 'BUILDING'; a total price of no less than 50,000 refers to o_totalprice > 50000 | SELECT COUNT(T2.c_name) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_mktsegment = 'BUILDING' AND T1.o_totalprice > 50000 |
retails | How much is the part supply cost for the medium metallic grey dodger linen? | part supply cost refers to ps_supplycost; medium metallic grey dodger linen refers to p_name = 'medium metallic grey dodger linen' | SELECT T2.ps_supplycost FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey WHERE T1.p_name = 'medium metallic grey dodger linen' |
retails | What is the name of the country of the supplier with the highest debt? | name of the country refers to n_name; the highest debt refers to min(s_acctbal) | SELECT T2.n_name FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey ORDER BY T1.s_suppkey DESC LIMIT 1 |
retails | Who is the clerk in charge of handling the item with the highest amount of extended price? | clerk refers to o_clerk; the highest amount of extended price refers to max(l_extendedprice) | SELECT T1.o_clerk FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey ORDER BY T2.l_extendedprice DESC LIMIT 1 |
retails | What are the total quantities of the items ordered by customer 101660 on 10/5/1995? | total quantity refers to sum(l_quantity); customer 101660 refers to o_custkey = 101660; on 10/5/1995 refers to o_orderdate = '1995-10-05' | SELECT SUM(T2.l_quantity) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_orderdate = '1995-10-05' AND T1.o_custkey = 101660 |
retails | What is the total amount of tax charged for the order placed by customer 88931 on 7/13/994? | total amount of tax refers to sum(multiply(multiply(l_extendedprice, subtract(1, l_discount)), add(1, l_tax))); customer 88931 refers to o_custkey = 88931; on 7/13/1994 refers to o_orderdate = '1994-07-13' | SELECT SUM(T2.l_extendedprice * (1 - T2.l_discount) * (1 + T2.l_tax)) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_custkey = 88931 AND T1.o_orderdate = '1994-07-13' |
retails | What are the names of the parts that were ordered by customer 110942? | name of the part refers to p_name; customer 110942 refers to o_custkey = 110942 | SELECT T3.p_name FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey INNER JOIN part AS T3 ON T2.l_partkey = T3.p_partkey WHERE T1.o_custkey = 110942 |
retails | How much is the discounted price of every item that customer 111511 ordered in order 53159? List the names of the parts of every item. | discounted price refers to multiply(l_extendedprice, subtract(1, l_discount)); customer 111511 refers to o_custkey = 111511; order 53159 refers to o_orderkey = 53159; name of the part refers to p_name | SELECT T2.l_extendedprice * (1 - T2.l_discount), T3.p_name FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey INNER JOIN part AS T3 ON T2.l_partkey = T3.p_partkey WHERE T1.o_custkey = 111511 AND T1.o_orderkey = 53159 |
ice_hockey_draft | Among the players with a height of over 6'2" inches, how many of them were born in Sweden? | height of over 6'2" inches refers to height_in_inch > '6''2"'; born in Sweden refers to nation = 'Sweden' ; | SELECT COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T2.height_in_inch > '6''2"' AND T1.nation = 'Sweden' |
ice_hockey_draft | How many players weigh more than 90 kg? | weigh more than 90 kg refers to weight_in_kg > 90; | SELECT COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90 |
ice_hockey_draft | Among the players that weigh more than 90 kg, how many of them have a position of defense? | weigh more than 90 kg refers to weight_in_kg > 90; position of defense refers to position_info = 'D' ; | SELECT COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90 AND T1.position_info = 'D' |
ice_hockey_draft | Among all the players that are right-shooted, how many of them weigh over 90 kg? | right-shooted refers to shoots = 'R'; weigh over 90 kg refers to weight_in_kg > 90; | SELECT COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90 AND T1.shoots = 'R' |
ice_hockey_draft | How many right-shooted players have a height of 5'7''? | right-shooted players refers to shoots = 'R'; height of 5'7'' refers to height_in_inch = '5''7"'; | SELECT COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T2.height_in_inch = '5''7"' AND T1.shoots = 'R' |
ice_hockey_draft | How many players, who were drafted by Anaheim Ducks in 2008, have played for U.S. National U18 Team? | drafted by Anaheim Ducks refers to overallby = 'Anaheim Ducks'; in 2008 refers to draftyear = 2008; played for U.S. National U18 Team refers to TEAM = 'U.S. National U18 Team'; | SELECT COUNT(DISTINCT T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.overallby = 'Anaheim Ducks' AND T1.draftyear = 2008 AND T2.TEAM = 'U.S. National U18 Team' |
ice_hockey_draft | Among the players who played 72 games, how many are left-shooters? | played 72 games refers to GP = 72; left-shooters refers to shoots = 'L'; | SELECT COUNT(T2.ELITEID) FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.GP = 72 AND T2.shoots = 'L' |
ice_hockey_draft | Among all the teams that made the playoffs in the 2007-2008 season, identify the percentage that played over 20 games. | playoffs refers to GAMETYPE = 'Playoffs'; percentage = MULTIPLY(DIVIDE(SUM(GP > 20), COUNT(ELITEID)), 100); played over 20 games refers to GP > 20; 2007-2008 season refers to SEASON = '2007-2008'; | SELECT CAST(COUNT(CASE WHEN GP > 20 THEN TEAM ELSE NULL END) AS REAL) * 100 / COUNT(TEAM) FROM SeasonStatus WHERE SEASON = '2007-2008' AND GAMETYPE = 'Playoffs' |
ice_hockey_draft | How many players who were drafted by the Toronto Maple Leafs have played over 300 games in their first 7 years of the NHL career? | drafted by the Toronto Maple Leafs refers to overallby = 'Toronto Maple Leafs'; played over 300 games in their first 7 years of the NHL career refers to sum_7yr_GP > 300; | SELECT COUNT(ELITEID) FROM PlayerInfo WHERE overallby = 'Toronto Maple Leafs' AND sum_7yr_GP > 300 |
ice_hockey_draft | How many players were drafted by Arizona Coyotes whose height reaches 195 centimeters? | drafted by Arizona Coyotes refers to overallby = 'Arizona Coyotes'; height reaches 195 centimeters refers to height_in_cm = 195; | SELECT COUNT(T2.ELITEID) FROM height_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.height_id = T2.height WHERE T2.overallby = 'Arizona Coyotes' AND T1.height_in_cm = 195 |
image_and_language | How many object samples are there in image no.1? | object samples refers to OBJ_SAMPLE_ID; image no.1 refers to IMG_ID = 1 | SELECT COUNT(OBJ_SAMPLE_ID) FROM IMG_OBJ WHERE IMG_ID = 1 |
image_and_language | How many images have over 20 object samples? | over 20 object samples refers to COUNT(OBJ_SAMPLE_ID) > 20 | SELECT COUNT(T1.IMG_ID) FROM ( SELECT IMG_ID FROM IMG_OBJ GROUP BY IMG_ID HAVING COUNT(OBJ_SAMPLE_ID) > 20 ) T1 |
image_and_language | What is the ID of the image with the most number of object samples? | ID of the image refers to IMG_ID; most number of object samples refers to max(count(OBJ_SAMPLE_ID)) | SELECT IMG_ID FROM IMG_OBJ GROUP BY IMG_ID ORDER BY COUNT(OBJ_SAMPLE_ID) DESC LIMIT 1 |
image_and_language | Please list the IDs of the object samples in class no. 297 in image no.1. | IDs of the object samples refers to OBJ_SAMPLE_ID; class no. 297 in image no.1 refers to IMG_ID = 1 and OBJ_CLASS_ID = 297 | SELECT OBJ_SAMPLE_ID FROM IMG_OBJ WHERE IMG_ID = 1 AND OBJ_CLASS_ID = 297 |
image_and_language | How many self-relations are there between the object samples in image no.5? | self-relations refers to OBJ1_SAMPLE_ID = OBJ2_SAMPLE_ID; image no.5 refers to IMG_ID = 5 | SELECT SUM(CASE WHEN IMG_ID = 5 THEN 1 ELSE 0 END) FROM IMG_REL WHERE OBJ1_SAMPLE_ID = OBJ2_SAMPLE_ID |
image_and_language | What is the bounding box of the object sample in image no.5 that has a self-relation? | bounding box of the object sample refers to (x, y, W, H); image no.5 refers to IMG_ID = 5; has a self-relation refers to OBJ1_SAMPLE_ID = OBJ2_SAMPLE_ID | SELECT T2.X, T2.Y, T2.W, T2.H FROM IMG_REL AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.IMG_ID = T2.IMG_ID WHERE T1.IMG_ID = 5 AND T1.OBJ1_SAMPLE_ID = T1.OBJ2_SAMPLE_ID |
image_and_language | How many object samples in image no.1 are in the class of "man"? | object samples refers to OBJ_CLASS_ID; image no.1 refers to IMG_ID = 1; in the class of "man" refers to OBJ_CLASS = 'man' | SELECT SUM(CASE WHEN T1.OBJ_CLASS = 'man' THEN 1 ELSE 0 END) FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 1 |
image_and_language | How many images have at least one object sample in the class of "man"? | have at least one object sample in the class of "man" refers to count(IMG_ID where OBJ_CLASS = 'man') > = 1 | SELECT COUNT(T.IMG_ID) FROM ( SELECT T2.IMG_ID FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.OBJ_CLASS = 'man' GROUP BY T2.IMG_ID ) T |
image_and_language | Please list the classes of all the object samples in image no.1. | classes of all the object samples refers to OBJ_CLASS; image no.1 refers to IMG_ID = 1 | SELECT T1.OBJ_CLASS FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 1 GROUP BY T1.OBJ_CLASS |
image_and_language | What is the relation between object sample no.8 and object sample no.4 in image no.1? | relation refers to PRED_CLASS; object sample no.8 and object sample no.4 refers to OBJ1_SAMPLE_ID = 8 AND OBJ2_SAMPLE_ID = 4; image no.1 refers to IMG_ID = 1 | SELECT T1.PRED_CLASS FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.IMG_ID = 1 AND T2.OBJ1_SAMPLE_ID = 8 AND T2.OBJ2_SAMPLE_ID = 4 |
image_and_language | How many pairs of object samples in image no.1 have the relation of "parked on"? | pairs of object samples refers to OBJ1_SAMPLE_ID and OBJ2_SAMPLE_ID; image no.1 refers to IMG_ID = 1; relation of "parked on" refers to PRED_CLASS = 'parked on' | SELECT SUM(CASE WHEN T1.PRED_CLASS = 'parked on' THEN 1 ELSE 0 END) FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.IMG_ID = 1 AND T2.OBJ1_SAMPLE_ID != OBJ2_SAMPLE_ID |
image_and_language | Please list all the predicted relation classes of object sample no.14 in image no.1. | predicted relation classes refers to PRED_CLASS; object sample no.14 in image no.1 refers to OBJ1_SAMPLE_ID = 14 AND OBJ2_SAMPLE_ID = 14 and IMG_ID = 1 | SELECT T1.PRED_CLASS FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.OBJ1_SAMPLE_ID = 14 AND T2.OBJ2_SAMPLE_ID = 14 |
image_and_language | How many images have at least one pair of object samples with the relation "parked on"? | How many images have at least one pair of object samples with the relation "parked on" refers to count(IMG_ID) where OBJ1_SAMPLE_ID ! = OBJ2_SAMPLE_ID and PRED_CLASS = 'parked on' | SELECT SUM(CASE WHEN T1.PRED_CLASS = 'parked on' THEN 1 ELSE 0 END) FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.OBJ1_SAMPLE_ID != T2.OBJ2_SAMPLE_ID |
image_and_language | Please list the IDs of all the images with more than 2 pairs of object samples with the relation "parked on". | IDs of all the images refers to IMG_ID; relation "parked on" refers to PRED_CLASS = 'parked on'; more than 2 pairs refers to count(IMG_ID) where OBJ1_SAMPLE_ID ! = OBJ2_SAMPLE_ID | SELECT T2.IMG_ID FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T1.PRED_CLASS = 'parked on' AND T2.OBJ1_SAMPLE_ID != T2.OBJ2_SAMPLE_ID GROUP BY T2.IMG_ID HAVING COUNT(T2.IMG_ID) > 2 |
image_and_language | To which predicted relation class does the self-relation of the object sample in image no.5 belong? | predicted relation class refers to PRED_CLASS; self-relations refers to OBJ1_SAMPLE_ID = OBJ2_SAMPLE_ID; image no.5 refers to IMG_ID = 5 | SELECT T1.PRED_CLASS FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.IMG_ID = 5 AND T2.OBJ1_SAMPLE_ID = T2.OBJ2_SAMPLE_ID |
image_and_language | What are the bounding boxes of the object samples with a predicted relation class of "by" in image no.1? | bounding boxes of the object samples refers to (x, y, W, H); predicted relation class of "by" refers to PRED_CLASS = 'by'; image no.1 refers to IMG_ID = 1 | SELECT T3.X, T3.Y, T3.W, T3.H FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.OBJ1_SAMPLE_ID = T3.OBJ_CLASS_ID WHERE T2.IMG_ID = 1 AND T1.PRED_CLASS = 'by' |
image_and_language | What is the average difference in the y coordinate of 2 object samples with the relation "parked on" in image no.1? | relation "parked on" refers to PRED_CLASS = 'parked on'; image no.1 refers to IMG_ID = 1; average difference in the y coordinate = divide(sum(Y), count(PRED_CLASS)) where OBJ1_SAMPLE_ID ! = OBJ2_SAMPLE_ID | SELECT CAST(SUM(T3.Y) AS REAL) / COUNT(CASE WHEN T1.PRED_CLASS = 'parked on' THEN 1 ELSE NULL END) FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.OBJ1_SAMPLE_ID = T3.OBJ_CLASS_ID WHERE T2.IMG_ID = 1 AND T2.OBJ1_SAMPLE_ID != T2.OBJ2_SAMPLE_ID |
image_and_language | What is the percentage of the object samples in the class of "man" in image no.1? | object samples refers to OBJ_SAMPLE_ID; class of "man" refers to OBJ_CLASS = 'man'; image no.1 refers to IMG_ID = 1; percentage = divide(count(OBJ_SAMPLE_ID)when OBJ_CLASS = 'man', count(OBJ_SAMPLE_ID)) as percentage | SELECT CAST(COUNT(CASE WHEN T1.OBJ_CLASS = 'man' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.OBJ_CLASS_ID) FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 1 |
image_and_language | State the total number of the attribute classes. | attribute classes refers to ATT_CLASS | SELECT COUNT(ATT_CLASS_ID) FROM ATT_CLASSES |
image_and_language | How many object classes are there in the database? | object classes refers to OBJ_CLASS | SELECT COUNT(OBJ_CLASS_ID) FROM OBJ_CLASSES |
image_and_language | Provide the number of predicted classes. | predicted classes refers to PRED_CLASS | SELECT COUNT(PRED_CLASS_ID) FROM PRED_CLASSES |
image_and_language | Give the bounding box of the kite in image no.2324765. | bounding box refers to (x, y, W, H); kite refers to OBJ_CLASS = 'kite'; image no.2324765 refers to IMG_ID = 2324765 | SELECT T2.X, T2.Y, T2.W, T2.H FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 2324765 AND T1.OBJ_CLASS = 'kite' |
image_and_language | How many white objects are there in image no.2347915? | white objects refers to ATT_CLASS = 'white'; image no.2347915 refers to IMG_ID = 2347915 | SELECT SUM(CASE WHEN T2.ATT_CLASS = 'white' THEN 1 ELSE 0 END) FROM IMG_OBJ_ATT AS T1 INNER JOIN ATT_CLASSES AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T1.IMG_ID = 2347915 |
image_and_language | Give the number of samples in image no.2377985 whose attribute is electrical. | number of samples refers to OBJ_SAMPLE_ID; image no.2377985 refers to IMG_ID = 2377985; attribute is electrical refers to ATT_CLASS = 'electrical' | SELECT SUM(CASE WHEN T2.ATT_CLASS = 'white' THEN 1 ELSE 0 END) FROM IMG_OBJ_ATT AS T1 INNER JOIN ATT_CLASSES AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T1.IMG_ID = 2347915 |
image_and_language | What is the relationship between object sample no.12 and no.8 of image no.2345511? | relationship refers to PRED_CLASS; object sample no.12 and no.8 of image no.2345511 refers to IMG_ID = 2345511 AND OBJ1_SAMPLE_ID = 12 AND OBJ2_SAMPLE_ID = 8 | SELECT T1.PRED_CLASS FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.IMG_ID = 2345511 AND T2.OBJ1_SAMPLE_ID = 12 AND T2.OBJ2_SAMPLE_ID = 8 |
image_and_language | Give the object number of the sample which has the relationship of "lying on" with object sample no.1 from image no.2345524. | object number of the sample refers to OBJ1_SAMPLE_ID; object sample no.1 from image no.2345524 refers to OBJ2_SAMPLE_ID = 1 and IMG_ID = 2345524 | SELECT T2.OBJ1_SAMPLE_ID FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.IMG_ID = 2345524 AND T1.PRED_CLASS = 'lying on' AND T2.OBJ2_SAMPLE_ID = 1 |
image_and_language | How many samples of food object are there in image no.6? | samples of food object refers to OBJ_CLASS = 'food'; image no.6 refers to IMG_ID = 6 | SELECT COUNT(T2.OBJ_SAMPLE_ID) FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 6 AND T1.OBJ_CLASS = 'food' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.