Chinastark/bird_dataset huggingface dataset:
Database: superstore
Note: received the highest discount refers to MAX(discount); customer refers to "customer name";
Question: Who is the customer from the West region that received the highest discount?
SQL: SELECT people.`customer name` FROM west_superstore INNER JOIN people ON west_superstore.`customer id` = people.`customer id` WHERE west_superstore.region = 'West' ORDER BY west_superstore.discount DESC LIMIT 1
Database: superstore
Note: names of the products refers to "product name";  profit greater than 98% of the average profit refers to profit > MULTIPLY(AVG(profit), 0.98);
Question: Provide the names of the products with a profit greater than 98% of the average profit of all products in the East region.
SQL: SELECT DISTINCT product.`product name` FROM east_superstore INNER JOIN product ON east_superstore.`product id` = product.`product id` WHERE product.region = 'East' AND east_superstore.profit > ( SELECT avg(profit) * 0.98 FROM east_superstore )
Database: superstore
Note: cost above 80000 refers to SUTRACT(MULTIPLY(DIVIDE(sales, SUTRACT(1, discount)), quantity), profit) > 80000;
Question: Name the customers from the Eastern region whose orders cost above 80000.
SQL: SELECT DISTINCT people.`customer name` FROM east_superstore INNER JOIN people ON east_superstore.`customer id` = people.`customer id` WHERE east_superstore.region = 'East' AND east_superstore.sales / (1 - east_superstore.discount) * east_superstore.quantity - east_superstore.profit > 80000
Database: superstore
Note: Maxwell Schwartz' is the "customer name"; in 2015 refers to strftime('%Y', "order date") = '2015';
Question: How many orders were made by Maxwell Schwartz in 2015?
SQL: SELECT count(DISTINCT east_superstore.`order id`) FROM east_superstore INNER JOIN people ON east_superstore.`customer id` = people.`customer id` WHERE people.`customer name` = 'Maxwell Schwartz' AND strftime('%Y', east_superstore.`order date`) = '2015'
Database: superstore
Note: Bush Mission Pointe Library' is the "product name";
Question: Who ordered the Bush Mission Pointe Library in the Central Region?
SQL: SELECT DISTINCT people.`customer name` FROM central_superstore INNER JOIN people ON central_superstore.`customer id` = people.`customer id` INNER JOIN product ON product.`product id` = central_superstore.`product id` WHERE product.`product name` = 'Bush Mission Pointe Library' AND product.region = 'Central'
Database: superstore
Note: Cisco SPA301' is the "product name"; all regions refers to central_superstore, south_superstore, west_superstore, east_superstore;
Question: Calculate the total profit by Cisco SPA301 for all regions.
SQL: SELECT sum(west_superstore.profit) + sum(east_superstore.profit) + sum(central_superstore.profit) + sum(south_superstore.profit) AS totalprofit FROM west_superstore INNER JOIN east_superstore ON west_superstore.`customer id` = east_superstore.`customer id` INNER JOIN central_superstore ON central_superstore.`customer id` = east_superstore.`customer id` INNER JOIN south_superstore ON south_superstore.`customer id` = central_superstore.`customer id` INNER JOIN product ON product.`product id` = south_superstore.`product id` WHERE product.`product name` = 'Cisco SPA301'
Database: superstore
Note: Anne McFarland' is the "customer name"; Western store refers to west_superstore; products refers to "product name";
Question: List the products that were ordered by Anne McFarland from the Western store.
SQL: SELECT DISTINCT product.`product name` FROM west_superstore INNER JOIN people ON west_superstore.`customer id` = people.`customer id` INNER JOIN product ON product.`product id` = west_superstore.`product id` WHERE people.`customer name` = 'Anne McFarland'
Database: superstore
Note: in Coachella refers to city = 'Coachella'; products refers to "product name";
Question: List the products ordered by customers in Coachella.
SQL: SELECT DISTINCT product.`product name` FROM west_superstore INNER JOIN people ON west_superstore.`customer id` = people.`customer id` INNER JOIN product ON product.`product id` = west_superstore.`product id` WHERE people.city = 'Coachella'
Database: superstore
Note: in 2015 refers to strftime('%Y', "order date") = '2015'; Eastern store refers to east_superstore; Western store refers west_superstore;
Question: Compare the numbers of orders between the Eastern and Western stores in 2015.
SQL: SELECT east, west FROM ( SELECT count(`order id`) AS east , ( SELECT count(`order id`) FROM west_superstore WHERE `order date` LIKE '2015%' ) AS west FROM east_superstore WHERE `order date` LIKE '2015%' )
Database: superstore
Note: ordered by Matt Abelman refers to "customer name" = 'Matt Abelman'; in 2013 refers to "order date" like '2013%';
Question: List the products ordered by Matt Abelman from the Western store in 2013.
SQL: SELECT DISTINCT product.`product name` FROM west_superstore INNER JOIN people ON west_superstore.`customer id` = people.`customer id` INNER JOIN product ON product.`product id` = west_superstore.`product id` WHERE people.`customer name` = 'Matt Abelman' AND strftime('%Y', west_superstore.`order date`) = '2013'
Database: superstore
Note: Brad Thomas is the "customer name"; in 2016 refers to strftime('%Y', "order date") = '2016'; total cost refers to SUM(SUTRACT(MULTIPLY(DIVIDE(sales, SUTRACT(1, discount)), quantity), profit));
Question: Calculate the total cost of the orders by Brad Thomas in 2016.
SQL: SELECT sum((east_superstore.sales / (1 - east_superstore.discount)) * east_superstore.quantity - east_superstore.profit) AS cost FROM east_superstore INNER JOIN people ON east_superstore.`customer id` = people.`customer id` INNER JOIN product ON east_superstore.`product id` = product.`product id` AND east_superstore.region = product.region WHERE east_superstore.region = 'East' AND people.`customer name` = 'Brad Thomas' AND strftime('%Y', east_superstore.`order date`) = '2016'
Database: superstore
Note: Plantronics Single Ear Headset' is the "product name"; name refers to "customer name";
Question: Provide the names, cities, and countries of the customers who ordered the Plantronics single ear headset.
SQL: SELECT DISTINCT people.`customer name`, people.city, people.country FROM west_superstore INNER JOIN people ON west_superstore.`customer id` = people.`customer id` INNER JOIN product ON product.`product id` = west_superstore.`product id` WHERE product.`product name` = 'Plantronics Single Ear Headset'
Database: superstore
Note: Gene Hale' refers to "customer name"; shipping date refers to "ship date"; products refers to "product name";
Question: Provide the shipping dates and products of the orders by Gene Hale.
SQL: SELECT DISTINCT central_superstore.`ship date`, product.`product name` FROM people INNER JOIN central_superstore ON people.`customer id` = central_superstore.`customer id` INNER JOIN product ON product.`product id` = central_superstore.`product id` WHERE people.`customer name` = 'Gene Hale'
Database: superstore
Note: fastest delivery refers to ship mode = 'First Class'; furniture refers to category = 'Furniture';
Question: How many orders in the south superstore with the fastest delivery are items of furniture?
SQL: SELECT count(south_superstore.`order id`) FROM south_superstore INNER JOIN product ON south_superstore.`product id` = product.`product id` WHERE south_superstore.`ship mode` = 'First Class' AND product.category = 'Furniture'
Database: superstore
Note: office supply refers to category = 'Office Supplies';
Question: How many office supply orders were made by Cindy Stewart in the south superstore?
SQL: SELECT count(*) FROM south_superstore INNER JOIN people ON south_superstore.`customer id` = people.`customer id` INNER JOIN product ON product.`product id` = south_superstore.`product id` WHERE product.category = 'Office Supplies' AND people.`customer name` = 'Cindy Stewart'
Database: superstore
Note: highest profit refers to MAX(profit);
Question: What product category got the highest profit in the south superstore?
SQL: SELECT product.category FROM south_superstore INNER JOIN product ON south_superstore.`product id` = product.`product id` ORDER BY south_superstore.profit DESC LIMIT 1
Database: superstore
Note: name of all products refers to product name; Cindy Stewart is the customer name;
Question: List the name of all products that Cindy Stewart ordered in the east superstore.
SQL: SELECT product.`product name` FROM south_superstore INNER JOIN people ON south_superstore.`customer id` = people.`customer id` INNER JOIN product ON product.`product id` = south_superstore.`product id` WHERE people.`customer name` = 'Cindy Stewart'
Database: superstore
Note: name of all products refers to product name; same-day shipment refers to "ship mode" = 'Same Day'; year 2013 refers to "ship date" BETWEEN '2013-01-01' AND '2013-12-31';
Question: List the name of all products in the west superstore that customers chose for same-day shipment in the year 2013.
SQL: SELECT product.`product name` FROM west_superstore INNER JOIN product ON west_superstore.`product id` = product.`product id` WHERE west_superstore.`ship mode` = 'Same Day' AND west_superstore.`ship date` LIKE '2013%'
Database: superstore
Question: What product category that Sam Craven ordered from the central and east superstore?
SQL: SELECT DISTINCT product.category FROM east_superstore INNER JOIN people ON east_superstore.`customer id` = people.`customer id` INNER JOIN product ON product.`product id` = east_superstore.`product id` LEFT JOIN central_superstore ON product.`product id` = central_superstore.`product id` WHERE people.`customer name` = 'Sam Craven'
Database: superstore
Note: Lexmark X 9575 Professional All-in-One Color Printer' is the "product name";
Question: What is the total quantity that Cindy Stewart order "Lexmark X 9575 Professional All-in-One Color Printer" in the south superstore?
SQL: SELECT sum(south_superstore.quantity) FROM south_superstore INNER JOIN people ON south_superstore.`customer id` = people.`customer id` INNER JOIN product ON product.`product id` = south_superstore.`product id` WHERE people.`customer name` = 'Cindy Stewart' AND product.`product name` = 'Lexmark X 9575 Professional All-in-One Color Printer'
Database: superstore
Note: name of all the products refers to product name; order quantities greater than or equal to 10 refers to COUNT("order id") >= 10; slowest delivery refers to "ship mode" = 'Standard Class';
Question: List the name of all the products with order quantities greater than or equal to 10 in the central superstore that has been shipped by the slowest delivery method.
SQL: SELECT DISTINCT product.`product name` FROM central_superstore INNER JOIN product ON central_superstore.`product id` = product.`product id` WHERE central_superstore.`ship mode` = 'Standard Class' AND central_superstore.quantity >= 10
Database: superstore
Note: least sales refers to sales = MIN(sales);
Question: What product category got the least sales in the west superstore?
SQL: SELECT product.category FROM west_superstore INNER JOIN product ON west_superstore.`product id` = product.`product id` ORDER BY west_superstore.sales LIMIT 1
Database: superstore
Note: "Memorix Froggy Flash Drive 8 GB" is the "product name";
Question: What is the total profit of "Memorex Froggy Flash Drive 8 GB in south superstore?
SQL: SELECT sum(south_superstore.profit) FROM south_superstore INNER JOIN product ON south_superstore.`product id` = product.`product id` GROUP BY product.`product name` = 'Memorix Froggy Flash Drive 8 GB'
Database: superstore
Note: furniture products refers to category = 'Furnitures'; in the year 2016 refers to "order date" BETWEEN '2016-01-01' AND '2016-12-31';
Question: What is the total sales of furniture products in the east superstore in the year 2016. 
SQL: SELECT sum(east_superstore.sales) FROM east_superstore INNER JOIN product ON east_superstore.`product id` = product.`product id` WHERE strftime('%Y', east_superstore.`order date`) = '2016' AND product.category = 'Furniture'
Database: superstore
Note: Sharp AL-1530CS Digital Copier' is the "product name"; average sales = AVG(sales);
Question: Calculate the average sales of ""Sharp AL-1530CS Digital Copier in the east and the west superstore.
SQL: SELECT avg(west_superstore.sales) FROM west_superstore INNER JOIN people ON west_superstore.`customer id` = people.`customer id` INNER JOIN product ON product.`product id` = west_superstore.`product id` WHERE product.`product name` = 'Sharp AL-1530CS Digital Copier'
Database: superstore
Note: office supplies products refers to category = 'Office Supplies'; central refers to region = 'Central'; south superstore refers to region = 'South'; percentage = divide(SUM(product id where category = 'Office Supplies'), count(product id)) * 100 where region = 'Central' OR region = 'South';
Question: Calculate the percentage of ordered office supplies products in the central and the south superstore.
SQL: SELECT cast(sum(CASE  WHEN product.category = 'Office Supplies' THEN 1 ELSE 0 END) AS REAL) * 100 / count(product.category) FROM people INNER JOIN central_superstore ON people.`customer id` = central_superstore.`customer id` INNER JOIN product ON product.`product id` = central_superstore.`product id`
Database: superstore
Note: live in Texas refers to state = 'Texas'; live in Indiana refers to state = 'Indiana'; Ratio = divide(sum(state = 'Texas'), sum(state = 'Indiana'));
Question: What is the ratio between customers who live in Texas and customers who live in Indiana?
SQL: SELECT cast(sum(CASE  WHEN state = 'Texas' THEN 1 ELSE 0 END) AS REAL) * 100 / sum(CASE  WHEN state = 'Indiana' THEN 1 ELSE 0 END) FROM people
Database: superstore
Note: art product refers to sub-category = 'Art'; the most refers to max(order_number);
Question: Among the orders in Central superstore, which art product were ordered the most?
SQL: SELECT product.`product name` FROM central_superstore INNER JOIN product ON central_superstore.`product id` = product.`product id` WHERE product.`sub-category` = 'Art' GROUP BY product.`product name` ORDER BY count(product.`product id`) DESC LIMIT 1
Database: superstore
Note: name of the customers refers to Customer_Name; in 2015 refers to "order date" BETWEEN '2015-01-01' AND '2015-12-31'; more than 3 times refers to count(Order_ID) > 3;
Question: Among the customers in South superstore, which customers ordered more than 3 times in 2015? State the name of the customers.
SQL: SELECT DISTINCT people.`customer name` FROM south_superstore INNER JOIN people ON south_superstore.`customer id` = people.`customer id` WHERE strftime('%Y', south_superstore.`order date`) = '2015' GROUP BY people.`customer name` HAVING count(people.`customer name`) > 3
Database: superstore
Note: highest profit refers to max(profit);
Question: State the highest profit made by Anna Chung's orders in the Central Superstore.
SQL: SELECT max(central_superstore.profit) FROM people INNER JOIN central_superstore ON people.`customer id` = central_superstore.`customer id` WHERE people.`customer name` = 'Anna Chung'
Database: superstore
Question: How many orders were made by Corey Roper in 2015?
SQL: SELECT count(central_superstore.`customer id`) FROM people INNER JOIN central_superstore ON people.`customer id` = central_superstore.`customer id` WHERE people.`customer name` = 'Corey Roper' AND strftime('%Y', central_superstore.`ship date`) = '2015'
Database: superstore
Note: East superstore refers to region = 'East'; West superstore refers to region = 'West'; difference = subtract(sum(sales) when region = 'East', sum(sales) when region = 'West');
Question: Calculate the difference between the total sales in the East superstore and the total sales in the West superstore.
SQL: SELECT sum(east_superstore.sales) - sum(west_superstore.sales) AS difference FROM east_superstore INNER JOIN west_superstore ON east_superstore.`customer id` = west_superstore.`customer id`
Database: superstore
Note: names of the ordered products refers to product name; deficiency refers to profit value is negative; profit > 0;
Question: What are the names of the ordered products that have profit deficiency in central superstore?
SQL: SELECT DISTINCT product.`product name` FROM central_superstore INNER JOIN product ON central_superstore.`product id` = product.`product id` WHERE product.region = 'Central' AND central_superstore.profit < 0
Database: superstore
Note: name refers to "product name"; shipping mode refers to ship mode; shortest shipment time refers to min(subtract(ship date, order date));
Question: In west superstore, what is the name and the shipping mode of the product that was ordered with the shortest shipment time?
SQL: SELECT DISTINCT product.`product name`, west_superstore.`ship mode` FROM west_superstore INNER JOIN product ON west_superstore.`product id` = product.`product id` WHERE product.region = 'West' ORDER BY west_superstore.`ship date` - west_superstore.`order date` LIMIT 1
Database: superstore
Note: 'O'Sullivan Cherrywood Estates Traditional Bookcase' is the "product name"; shipping mode with the fastest delivery speed refers to "ship mode" = 'First Class';
Question: How many orders of O'Sullivan Plantations 2-Door Library in Landvery Oak in central superstore were shipped through the shipping mode with the fastest delivery speed?
SQL: SELECT count(DISTINCT central_superstore.`order id`) FROM central_superstore INNER JOIN product ON central_superstore.`product id` = product.`product id` WHERE product.`product name` = 'O''Sullivan Plantations 2-Door Library in Landvery Oak' AND product.region = 'Central' AND central_superstore.`ship mode` = 'First Class'
Database: superstore
Note: corporate customer refers to segment = 'Corporate'; Rhode Island refers to state = 'Rhode Island'; in 2016 refers to "order date" BETWEEN '2016-01-01' AND '2016-12-31'; east superstore refers to region = 'East'; highest number of orders refers to max(order_number); name of corporate customer refers to "customer name";
Question: What is the name of the corporate customer from Rhode Island who had the highest number of orders in 2016 from the east superstore?
SQL: SELECT people.`customer name` FROM east_superstore INNER JOIN people ON east_superstore.`customer id` = people.`customer id` WHERE people.segment = 'Corporate' AND people.state = 'Rhode Island' AND people.region = 'East' AND strftime('%Y', east_superstore.`order date`) = '2016' GROUP BY people.`customer name` ORDER BY count(people.`customer name`) DESC LIMIT 1
Database: superstore
Note: customers in California refers to state = 'California'; orders with sales value of no less than 5,000 refers to sales >= 5,000;
Question: Among the orders with sales value of no less than 5,000 in west superstore, how many were bought by the customers in California?
SQL: SELECT count(DISTINCT west_superstore.`order id`) FROM west_superstore INNER JOIN product ON west_superstore.`product id` = product.`product id` INNER JOIN people ON people.`customer id` = west_superstore.`customer id` WHERE west_superstore.sales > 5000 AND people.state = 'California' AND product.region = 'West'
Database: superstore
Note: highest original price refers to max(divide(sales, subtract(1, discount)));
Question: In which segment does the customer who purchased the product from the east superstore with the highest original price belong?
SQL: SELECT people.segment FROM east_superstore INNER JOIN people ON east_superstore.`customer id` = people.`customer id` INNER JOIN product ON product.`product id` = east_superstore.`product id` WHERE east_superstore.region = 'East' ORDER BY (east_superstore.sales / (1 - east_superstore.discount)) DESC LIMIT 1
Database: superstore
Note: shipment duration = subtract("ship date", "order date"); order number CA-2011-134103 refers to "order id" = 'CA-2011-134103';
Question: What is the shipment duration for order number CA-2011-134103?
SQL: SELECT DISTINCT strftime('%J', `ship date`) - strftime('%J', `order date`) AS duration FROM central_superstore WHERE `order id` = 'CA-2011-134103'
Database: superstore
Note: orders with a quantity greater than 5 refers to quantity > 5; shipped by the fastest delivery method refers to ship mode = 'First Class';
Question: How many orders with a quantity greater than 5 have been shipped by the fastest delivery method?
SQL: SELECT count(DISTINCT `order id`) FROM central_superstore WHERE quantity > 5 AND `ship mode` = 'First Class'
Database: superstore
Note: caused a loss to the company refers to profit < 0;
Question: Please list any three orders that caused a loss to the company.
SQL: SELECT `order id` FROM central_superstore WHERE profit < 0 LIMIT 3
Database: superstore
Note: product refers to "product name";
Question: Which product did Phillina Ober buy?
SQL: SELECT DISTINCT product.`product name` FROM people INNER JOIN central_superstore ON people.`customer id` = central_superstore.`customer id` INNER JOIN product ON product.`product id` = central_superstore.`product id` WHERE people.`customer name` = 'Phillina Ober'
Database: superstore
Note: customer refers to "customer name"; “Hon Multipurpose Stacking Arm Chairs" is the "product name";
Question: Who was the customer in the South Region superstore who bought the most “Hon Multipurpose Stacking Arm Chairs"?
SQL: SELECT people.`customer name` FROM south_superstore INNER JOIN people ON south_superstore.`customer id` = people.`customer id` INNER JOIN product ON product.`product id` = south_superstore.`product id` WHERE product.`product name` = 'Hon Multipurpose Stacking Arm Chairs' GROUP BY people.`customer name` ORDER BY count(people.`customer name`) DESC LIMIT 1
Database: superstore
Note: "O'Sullivan Living Dimensions 2-Shelf Bookcases" refers to "product name";
Question: What is the profit from selling the "O'Sullivan Living Dimensions 2-Shelf Bookcases"?
SQL: SELECT DISTINCT central_superstore.profit FROM central_superstore INNER JOIN product ON central_superstore.`product id` = product.`product id` WHERE product.`product name` = 'O''Sullivan Living Dimensions 2-Shelf Bookcases'
Database: superstore
Note: Hon Pagoda Stacking Chairs' is the "product name"; west superstore refers to region = 'West';
Question: How many of the "Hon Pagoda Stacking Chairs" have been sold in total in the west superstore?
SQL: SELECT sum(west_superstore.quantity) FROM west_superstore INNER JOIN product ON west_superstore.`product id` = product.`product id` WHERE product.`product name` = 'Hon Pagoda Stacking Chairs'
Database: superstore
Note: slowest shipping speed refers to "ship mode" = 'Standard Class';
Question: How many orders purchased by Aaron Bergman have been delivered with the slowest shipping speed?
SQL: SELECT count(*) FROM people INNER JOIN central_superstore ON people.`customer id` = central_superstore.`customer id` WHERE people.`customer name` = 'Aaron Bergman' AND central_superstore.`ship mode` = 'Standard Class'
Database: superstore
Note: "Black Avery Flip-Chart Easel Binder" is the "product name"; original price = divide(sales, subtract(1, discount));
Question: What is the original price of the "Black Avery Flip-Chart Easel Binder"?
SQL: SELECT central_superstore.sales / (1 - central_superstore.discount) FROM central_superstore INNER JOIN product ON central_superstore.`product id` = product.`product id` WHERE product.`product name` = 'Blackstonian Pencils'
Database: superstore
Note: name of the product refers to "product name";
Question: What is the name of the product that Aimee Bixby bought?
SQL: SELECT DISTINCT product.`product name` FROM east_superstore INNER JOIN people ON east_superstore.`customer id` = people.`customer id` INNER JOIN product ON product.`product id` = east_superstore.`product id` WHERE people.`customer name` = 'Aimee Bixby'
Database: superstore
Note: Sauder Camden County Barrister Bookcase, Planked Cherry Finish' refers to "product name";
Question: Indicate the profit of product Sauder Camden County Barrister Bookcase, Planked Cherry Finish.
SQL: SELECT DISTINCT south_superstore.profit FROM south_superstore INNER JOIN product ON south_superstore.`product id` = product.`product id` WHERE product.`product name` = 'Sauder Camden County Barrister Bookcase, Planked Cherry Finish'