db_id stringclasses 69
values | schema stringclasses 69
values | m_schema stringclasses 69
values | question stringlengths 24 325 | sql stringlengths 23 804 | evidence stringlengths 0 673 |
|---|---|---|---|---|---|
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Please list any three line item numbers that have 10% off. | SELECT l_linenumber FROM lineitem WHERE l_discount = 0.1 LIMIT 3 | line item number refers to l_linenumber; 10% off refers to l_discount = 0.1 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | How many of the line items that have a quantity greater than 40 have been shipped by air? | SELECT COUNT(l_linenumber) FROM lineitem WHERE l_quantity > 40 AND l_shipmode = 'AIR' | quantity greater than 40 refers to l_quantity > 40; shipped by air refers to l_shipmode = 'AIR' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Which ship mode has more "deliver in person" instructions, rail or mail? | SELECT IIF(SUM(IIF(l_shipmode = 'RAIL', 1, 0)) - SUM(IIF(l_shipmode = 'MAIL', 1, 0)), 'RAIL', 'MAIL') AS result FROM lineitem WHERE l_shipinstruct = 'DELIVER IN PERSON' | ship mode refers to l_shipmode; "deliver in person" instruction refers to l_shipinstruct = 'DELIVER IN PERSON' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What is the total price and the order priority of order number 33? | SELECT o_totalprice, o_orderpriority FROM orders WHERE o_orderkey = 33 | total price refers to o_totalprice; order priority refers to o_orderpriority; order number 33 refers to o_orderkey = 33 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | How many orders in 1998 had a total price under 950? | SELECT COUNT(o_orderkey) AS countorders FROM orders WHERE STRFTIME('%Y', o_orderdate) = '1998' AND o_totalprice < 950 | 1998 refers to year(o_orderdate) = '1998'; a total price under 950 refers to o_totalprice < 950 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Please list any three customers with debt. | SELECT c_name FROM customer WHERE c_acctbal < 0 LIMIT 3 | customer refers to c_name; with debt refers to c_acctbal < 0 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What is the discounted price of line item number 1? | SELECT l_extendedprice * (1 - l_discount) FROM lineitem WHERE l_linenumber = 1 | discounted price refers to multiply(l_extendedprice, subtract(1, l_discount)); line item number 1 refers to l_linenumber = 1 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What is the difference between the number of returned items and not returned items with the full price of under 16947.7? | SELECT SUM(IIF(l_returnflag = 'A', 1, 0)) - SUM(IIF(l_returnflag = 'N', 1, 0)) AS diff FROM lineitem WHERE l_extendedprice < 16947.7 | full price of under 16947.7 refers to l_extendedprice < 16947.7; returned item refers to l_returnflag = 'R'; not returned item refers to l_returnflag = 'A' OR l_returnflag = 'N'; difference = subtract(count(l_linenumber where l_returnflag = 'A' OR l_returnflag = 'N'), count(l_linenumber where l_returnflag = 'R')) where... |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What is the supply cost of large plated tin? | SELECT T2.ps_supplycost FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey WHERE T1.p_type = 'large plated tin' | supply cost refers to ps_supplycost; large plated tin refers to p_type = 'large plated tin' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Please name any three parts that have an available quantity of more than 9998. | SELECT T1.p_name FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey WHERE T2.ps_availqty > 9998 LIMIT 3 | part name refers to p_name; an available quantity of more than 9998 refers to ps_availqty > 9998 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Please list any two parts that come with the wrap bag container and have a supply cost of under 10. | SELECT T1.p_name FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey WHERE T2.ps_supplycost < 10 AND T1.p_container = 'WRAP BAG' LIMIT 2 | part name refers to p_name; wrap bag container refers to p_container = 'WRAP BAG'; supply cost of under 10 refers to ps_supplycost < 10 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What is the nationality of supplier number 1? | SELECT T2.n_name FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_suppkey = 1 | nationality refers to n_name; supplier number 1 refers to s_suppkey = 1 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What are the countries that belong to Africa? | SELECT T2.n_name FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey WHERE T1.r_name = 'Africa' | country is nation name which refers to n_name; Africa is region name refers to r_name = 'Africa' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Which region has the lowest number of countries? | SELECT T.r_name FROM ( SELECT T1.r_name, COUNT(T2.n_name) AS num FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey GROUP BY T1.r_name ) AS T ORDER BY T.num LIMIT 1 | region refers to has r_name; the lowest number of countries refers to min(count(n_name)) |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | How many customers from the furniture segments come from Iraq? | SELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_mktsegment = 'FURNITURE' AND T2.n_name = 'IRAQ' | furniture segment refers to c_mktsegment = 'FURNITURE'; Iraq refers to n_name = 'Iraq' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What is the name of the customer number 93697 with the total order price of 191918.92? | SELECT T2.c_name FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T1.o_totalprice = 191918.92 AND T1.o_custkey = 93697 | customer name refers to c_name; number 93697 refers to o_custkey = 93697; total order price of 191918.92 refers to o_totalprice = 191918.92 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Which nation and region does the Customer#000000008 come from? | SELECT T1.n_name, T3.r_name FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN region AS T3 ON T1.n_regionkey = T3.r_regionkey WHERE T2.c_name = 'Customer#000000008' | nation refers to n_name; region refers to r_name; Customer#000000008 refers to c_name = 'Customer#000000008' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What is the delivery time and the clerk of order number 6? | SELECT JULIANDAY(T2.l_receiptdate) - JULIANDAY(T2.l_commitdate), T1.o_clerk FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_orderkey = 6 | delivery time = subtract(l_receiptdate, l_commitdate); clerk refers to o_clerk; order number 6 refers to o_orderkey = 6 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | How many Japanese suppliers have their accounts in debt? | SELECT COUNT(T1.s_suppkey) FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_acctbal < 0 AND T2.n_name = 'JAPAN' | Japanese refers to n_name = 'Japan'; have accounts in debt refers to s_acctbal < 0 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Which customer is the most in debt? | SELECT c_name FROM customer WHERE c_acctbal = ( SELECT MIN(c_acctbal) FROM customer ) | customer refers to c_name; the most in debt refers to max(c_acctbal) |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | List all the dates of the urgent orders. | SELECT o_orderdate FROM orders WHERE o_orderpriority = '1-URGENT' | date refers to o_orderdate; urgent order refers to o_orderpriority = '1-URGENT' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | How many of the items are instructed to be delivered in person? | SELECT COUNT(l_linenumber) FROM lineitem WHERE l_shipinstruct = 'DELIVER IN PERSON' | instructed to be delivered in person refers to l_shipinstruct = 'DELIVER IN PERSON' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What is the largest supplier's account balance? | SELECT MAX(s_acctbal) FROM supplier | the largest supplier's account balance refers to max(s_acctbal) |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | How many part supplies are close to being out of stock? | SELECT COUNT(ps_suppkey) FROM partsupp WHERE ps_availqty < 10 | close to being out of stock refers to ps_availqty < 10 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | List all the nations in Europe. | SELECT T2.n_name FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey WHERE T1.r_name = 'EUROPE' | nation refers to n_name; Europe refers to r_name = 'EUROPE' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What is the supply cost for the part "violet olive rose ivory sandy"? | SELECT T2.ps_supplycost FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey WHERE T1.p_name = 'violet olive rose ivory sandy' | supply cost refers to ps_supplycost; part "violet olive rose ivory sandy" refers to p_name = 'violet olive rose ivory sandy' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | List all the customers' phone numbers from Ethiopia. | SELECT T1.c_phone FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'Ethiopia' | phone number refers to c_phone; Ethiopia refers to n_name = 'Ethiopia' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What is the total price of all orders from the customer with the phone number "627-220-3983"? | SELECT SUM(T1.o_totalprice) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_phone = '627-220-3983' | total price = sum(o_totalprice); phone number "627-220-3983" refers to c_phone = '627-220-3983' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What are the shipping methods for the orders on 12/31/1994? | SELECT DISTINCT T2.l_shipmode FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_orderdate = '1994-12-31' | shipping method refers to l_shipmode; order on 12/31/1994 refers to o_orderdate = '1994-12-31' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What is the account balance of the supplier with the most parts? | SELECT T.s_acctbal FROM ( SELECT T1.s_acctbal, COUNT(T2.ps_suppkey) AS num FROM supplier AS T1 INNER JOIN partsupp AS T2 ON T1.s_suppkey = T2.ps_suppkey GROUP BY T1.s_suppkey ) AS T ORDER BY T.num DESC LIMIT 1 | account balance refers to s_acctbal; the most parts refers to max(count(ps_suppkey)) |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Which nation does the supplier with the account balance of "4393.04" belong to? | SELECT T2.n_name FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_acctbal = 4393.04 | nation refers to n_name; account balance of "4393.04" refers to s_acctbal = 4393.04 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What is the region with the most customers? | SELECT T.r_name FROM ( SELECT T3.r_name, COUNT(T2.c_custkey) AS num FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN region AS T3 ON T1.n_regionkey = T3.r_regionkey GROUP BY T3.r_name ) AS T ORDER BY T.num DESC LIMIT 1 | region refers to r_name; the most customers refers to max(count(c_custkey)) |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | List the phone number of the customer who placed orders with a total price of more than $300,000. | SELECT T2.c_phone FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T1.o_totalprice > 300000 | phone number refers to c_phone; a total price of more than $300,000 refers to o_totalprice > 300000 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What are the clerks of orders with line items shipped by mail? | SELECT T1.o_clerk FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T2.l_shipmode = 'MAIL' | clerk refers to o_clerk; shipped by mail refers to l_shipmode = 'MAIL' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What are the top 5 nations of suppliers with the lowest account balance? | SELECT T2.n_name FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey ORDER BY T1.s_acctbal LIMIT 1 | nation refers to n_name; the lowest account balance refers to min(s_acctbal) |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | List all the addresses for the suppliers of the biggest parts. | SELECT T2.s_address FROM partsupp AS T1 INNER JOIN supplier AS T2 ON T1.ps_suppkey = T2.s_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey ORDER BY T3.p_size DESC LIMIT 1 | addresses refers to s_address; the biggest part refers to max(p_size) |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Which part and supplier have the most profit? | SELECT T3.p_name, T4.s_name FROM partsupp AS T1 INNER JOIN lineitem AS T2 ON T1.ps_suppkey = T2.l_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey INNER JOIN supplier AS T4 ON T1.ps_suppkey = T4.s_suppkey ORDER BY T2.l_extendedprice * (1 - T2.l_discount) - T1.ps_supplycost * T2.l_quantity DESC LIMIT 1 | part refers to p_name; supplier refers to s_name; the most profit refers to max(subtract(multiply(l_extendedprice, subtract(1, l_discount)), multiply(ps_supplycost, l_quantity))) |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What proportion of suppliers are from Asia? | SELECT CAST(SUM(IIF(T1.r_name = 'ASIA', 1, 0)) AS REAL) * 100 / COUNT(T1.r_regionkey) FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey INNER JOIN supplier AS T3 ON T2.n_nationkey = T3.s_nationkey | Asia refers to r_name = 'ASIA'; proportion = divide(count(s_name where r_name = 'ASIA'), count(s_name)) * 100% |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Please indicate the total price of order key 32. | SELECT o_totalprice FROM orders WHERE o_orderkey = 32 | total price refers to o_totalprice; order key 32 refers to o_orderkey = 32 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | How many order keys are not applied for the discount? | SELECT COUNT(l_orderkey) FROM lineitem WHERE l_discount = 0 | order key refers to l_orderkey; not applied for the discount refers to l_discount = 0 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | List line items shipped by truck with delivery time before 1997. | SELECT l_linenumber FROM lineitem WHERE STRFTIME('%Y', l_shipdate) < 1997 AND l_shipmode = 'truck' | line item refers to l_linenumber; shipped by truck refers to l_shipmode = 'truck'; delivery time before 1997 refers to year(l_shipdate) < 1997 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | How many line items were returned in 1998? | SELECT l_linenumber FROM lineitem WHERE STRFTIME('%Y', l_shipdate) < 1997 AND l_shipmode = 'TRUCK' | line item refers to l_linenumber; returned refers to returnflag = 'R'; in 1998 refers to year(l_shipdate) = 1998 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Which line item with the highest quantity is shipped by air? | SELECT l_linenumber FROM lineitem WHERE l_shipmode = 'AIR' ORDER BY l_quantity DESC LIMIT 1 | line item refers to l_linenumber; the highest quantity refers to max(l_quantity); shipped by air refers to l_shipmode = 'AIR' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | List the names of customers whose accounts are in debt. | SELECT c_name FROM customer WHERE c_acctbal < 0 | name of customer refers to c_name; account in debt refers to c_acctbal < 0 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | How many customers belong to the household segment in 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' | household segment refers to c_mktsegment = 'household'; Germany refers to n_name = 'Germany' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | List the phone numbers of customers whose order priority is 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' | phone number refers to c_phone; order priority is urgent refers to o_orderpriority = '1-URGENT' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Name of customer whose order is applied with the highest 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 | customer name refers to c_name; the highest discount refers to max(l_discount) |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | List the 5 orders with the highest total price, indicating the delivery date. | 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 | order refers to o_orderkey; the highest total price refers to max(o_totalprice); delivery date refers to l_shipdate |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | List the comments describing orders from customers in the furniture segment. | 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' | comment refers to o_comment; furniture segment refers to c_mktsegment = 'FURNITURE' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Please indicate the names of the customers whose order with a total price over $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 | customer name refers to c_name; a total price over $300000 refers to o_totalprice > 300000 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Name customers in India with account balances over $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' | customer name refers to c_name; India refers to n_name = 'INDIA'; account balance over $5000 refers to c_acctbal > 5000 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | List the phone numbers of suppliers from 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' | phone number refers to s_phone; Japan refers to n_name = 'JAPAN' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Among the providers in Argentina, which supplier has an account that is in debt? | 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' | Argentina refers to n_name = 'ARGENTINA'; supplier refers to s_name; an account in debt refers to s_acctbal < 0 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | How many countries belong to the Algeria region? | 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' | the algeria region refers to r_name = 'ALGERIA' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Please indicate the names of customers whose orders are eligible for 10% discount with order dates between 1/1/1994 and 1/1/1995. | SELECT T3.c_name FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey INNER JOIN customer AS T3 ON T1.o_custkey = T3.c_custkey WHERE T2.l_discount = 0.1 AND STRFTIME('%Y', T1.o_orderdate) BETWEEN 1994 AND 1995 | customer name refers to c_name; 10% discount refers to l_discount = 0.1; order dates between 1/1/1994 and 1/1/1995 refers to year(o_orderdate) = 1994 OR o_orderdate = '1995-01-01' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Calculate the percentage of countries that belong to the American region. | SELECT CAST(SUM(IIF(T1.r_name = 'America', 1, 0)) AS REAL) * 100 / COUNT(T2.n_name) FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey | the American region refers to r_name = 'America'; percentage = divide(count(n_name where r_name = 'America'), count(n_name)) * 100% |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Calculate percentage of household segment in Indonesia. | SELECT CAST(SUM(IIF(T1.c_mktsegment = 'HOUSEHOLD', 1, 0)) AS REAL) * 100 / COUNT(T1.c_mktsegment) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'INDONESIA' | household segment refers to c_mktsegment = 'HOUSEHOLD'; Indonesia refers to n_name = 'Indonesia'; percentage = divide(count(c_mktsegment = 'HOUSEHOLD'), count(c_mktsegment)) where n_name = 'Indonesia' * 100% |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Please list the names of all the products under the type "promo brushed steel". | SELECT p_name FROM part WHERE p_type = 'PROMO BRUSHED STEEL' | product name refers to p_name; type "promo brushed steel" refers to p_type = 'PROMO BRUSHED STEEL' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What is the comment of the product "burlywood plum powder puff mint"? | SELECT p_comment FROM part WHERE p_name = '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' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | How many parts have a retail price of over 1900? | SELECT COUNT(p_partkey) FROM part WHERE p_retailprice > 1900 | a retail price of over 1900 refers to p_retailprice > 1900 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Among the products under the type "promo brushed steel", how many of them are manufactured by Manufacturer#5? | SELECT COUNT(p_partkey) FROM part WHERE p_type = 'PROMO BRUSHED STEEL' AND p_mfgr = 'Manufacturer#5' | type "promo brushed steel" refers to p_type = 'PROMO BRUSHED STEEL'; Manufacturer#5 refers to p_mfgr = 'Manufacturer#5' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Please list all the brands that contain a part under the type "promo brushed steel". | SELECT p_brand FROM part WHERE p_type = 'PROMO BRUSHED STEEL' | brand refers to p_brand; type "promo brushed steel" refers to p_type = 'PROMO BRUSHED STEEL' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What is the name of the product with the highest retail price? | SELECT p_name FROM part WHERE p_retailprice = ( SELECT MAX(p_retailprice) FROM part ) | name of the product refers to p_name; the highest retail price refers to p_retailprice |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Which part has a bigger size, "pink powder drab lawn cyan" or "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 | 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') |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | How many parts have a jumbo case container? | SELECT COUNT(p_partkey) FROM part WHERE p_container = 'JUMBO CASE' | jumbo case container refers to p_container = 'JUMBO CASE' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What is the size of the smallest part in a jumbo case container? | SELECT MIN(p_size) FROM part WHERE p_container = 'JUMBO CASE' | size refers to p_size; the smallest part refers to min(p_size); jumbo case container refers to p_container = 'JUMBO CASE' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | How many suppliers have their accounts in debt? | SELECT COUNT(s_suppkey) FROM supplier WHERE s_acctbal < 0 | account in debt refers to s_acctbal < 0 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Please list the names of the top 3 suppliers with the most amount of money in their accounts. | SELECT s_name FROM supplier ORDER BY s_acctbal DESC LIMIT 3 | supplier name refers to s_name; the most amount of money refers to max(s_acctbal) |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Please list the phone numbers of all the suppliers in Germany. | SELECT T1.s_phone FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T2.n_name = 'Germany' | phone number refers to s_phone; Germany refers to n_name = 'Germany' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Please list the names of all the suppliers for the part "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' | supplier name refers to s_name; part "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What is the lowest supply cost for the part "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' | the lowest supply cost refers to min(ps_supplycost); part "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What is the name of the supplier that provides the part "hot spring dodger dim light" with the lowest supply cost? | 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 | 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) |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What is the total quantity available by all suppliers for the part "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' | total quantity available refers to sum(ps_availqty); part "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Which supplier can provide the most number of "hot spring dodger dim light"? Please give the supplier's phone number. | 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 | 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 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Please list the names of all the suppliers for the part with the highest retail price. | 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 | supplier name refers to s_name; the highest retail price refers to max(p_retailprice) |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | How many suppliers for the part "hot spring dodger dim light" are in 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' | part "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light'; Vietnam refers to n_name = 'VIETNAM' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Among the suppliers providing parts under the type "promo brushed steel", how many of them are in debt? | 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' | type "promo brushed steel" refers to p_type = 'PROMO BRUSHED STEEL'; in debt refers to s_acctbal < 0 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Please list the names of all the suppliers for parts under 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' | supplier name refers to s_name; Brand#55 refers to p_brand = 'Brand#55' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | 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? | 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 | type "promo brushed steel" refers to p_type = 'PROMO BRUSHED STEEL'; a total available quantity of under 5000 refers to sum(ps_availqty) < 5000 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | The part "hot spring dodger dim light" is ordered in how many orders? | 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' | part "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What is the total quantity of the part "hot spring dodger dim light" ordered in all orders? | 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' | total quantity refers to sum(l_quantity); part "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Please list the order keys of all the orders that have more than 2 parts with a jumbo case container. | 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 | 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 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Among all the suppliers in debt, how many of them are in 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 | in debt refers to s_acctbal < 0; Europe refers to r_name = 'EUROPE' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Among all the suppliers providing the part "hot spring dodger dim light", how many of them are in 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' | part "hot spring dodger dim light" refers to p_name = hot spring dodger dim light; Europe refers to r_name = 'EUROPE' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Please list the phone numbers of all the suppliers for the parts ordered in order no.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 | phone number refers to s_phone; order no.1 refers to l_orderkey = 1 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Among the suppliers for the parts ordered in order no.4, how many of them are in debt? | 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 | order no.4 refers to l_orderkey = 4; in debt refers to s_acctbal < 0 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Among the parts that are returned, how many of them are provided by a supplier in debt? | 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 | returned refers to l_returnflag = 'R'; in debt refers to s_acctbal < 0 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | On which date was the part "burnished seashell gainsboro navajo chocolate" in order no.1 shipped? | 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' | 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 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What is the quantity of the part "burnished seashell gainsboro navajo chocolate" ordered in order no.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' | 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 |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Which part is ordered in a bigger amount in order no.1, "burnished seashell gainsboro navajo chocolate" or "salmon white grey tan navy"? | SELECT T.p_name FROM ( SELECT T2.p_name, SUM(T1.l_quantity) AS num FROM lineitem AS T1 INNER JOIN part AS T2 ON T1.l_partkey = T2.p_partkey WHERE T2.p_name IN ('salmon white grey tan navy', 'burnished seashell gainsboro navajo chocolate') GROUP BY T1.l_partkey ) AS T ORDER BY T.num DESC LIMIT 1 | amount refers to sum(l_quantity); order no.1 refers to l_orderkey = 1; "burnished seashell gainsboro navajo chocolate" or "salmon white grey tan navy" refers to p_name IN ('salmon white grey tan navy', 'burnished seashell gainsboro navajo chocolate') |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What is the biggest discount among all orders for the part "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' | the biggest discount refers to max(l_discount); part "burnished seashell gainsboro navajo chocolate" refers to p_name = 'burnished seashell gainsboro navajo chocolate' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Please list all the modes of shipping for the part "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' | mode of shipping refers to l_shipmode; part "burnished seashell gainsboro navajo chocolate" refers to p_name = 'burnished seashell gainsboro navajo chocolate' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What is the average supply cost for the part "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' | average supply cost refers to avg(ps_supplycost); part "hot spring dodger dim light" refers to p_name = 'hot spring dodger dim light' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | How much higher in percentage is the highest supply cost of the part "hot spring dodger dim light" than the lowest supply cost? | 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' | 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% |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What is the profit for part no.98768 in order no.1? | 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 | 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)) |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | What is the discounted price of the part "burnished seashell gainsboro navajo chocolate" in order no.1? | 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 | 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)) |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Which market segment does the customer with the highest amount of debt belongs to? | SELECT c_mktsegment FROM customer WHERE c_acctbal = ( SELECT MIN(c_acctbal) FROM customer ) | market segment refers to c_mktsegment; the highest amount of debt refers to max(c_acctbal) |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | In 1997, how many orders were shipped via mail? | SELECT COUNT(l_orderkey) FROM lineitem WHERE STRFTIME('%Y', l_shipdate) = '1997' AND l_shipmode = 'MAIL' | 1997 refers to year(l_shipdate) = 1997; shipped via mail refers to l_shipmode = 'MAIL' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | How many customers are in the furniture segment? | SELECT COUNT(c_custkey) FROM customer WHERE c_mktsegment = 'FURNITURE' | furniture segment refers to c_mktsegment = 'FURNITURE' |
retails | CREATE TABLE `customer` (
`c_custkey` INTEGER NOT NULL,
`c_mktsegment` TEXT DEFAULT NULL,
`c_nationkey` INTEGER DEFAULT NULL,
`c_name` TEXT DEFAULT NULL,
`c_address` TEXT DEFAULT NULL,
`c_phone` TEXT DEFAULT NULL,
`c_acctbal` REAL DEFAULT NULL,
`c_comment` TEXT DEFAULT NULL,
PRIMARY KEY (`c_custkey`),... | 【DB_ID】 retails
【Schema】
# Table: main.customer
[
(c_custkey:INTEGER, Primary Key, Examples: [1, 2, 3]),
(c_mktsegment:TEXT, Examples: [BUILDING, MACHINERY, FURNITURE]),
(c_nationkey:INTEGER, Examples: [8, 16, 11]),
(c_name:TEXT, Examples: [Customer#000000001, Customer#000000002, Customer#000000003]),
(c_address:TEXT, ... | Among the items shipped in 1994 via truck, how many items were returned? | SELECT COUNT(l_orderkey) FROM lineitem WHERE STRFTIME('%Y', l_shipdate) = '1994' AND l_returnflag = 'R' AND l_shipmode = 'TRUCK' | 1994 refers to year(l_shipdate) = 1994; via truck refers to l_shipmode = 'TRUCK'; returned refers to l_returnflag = 'R' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.