input
stringlengths 358
16.1k
| output
stringlengths 24
805
|
---|---|
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: Calculate the total cost of the orders by Brad Thomas in 2016. [/INST] | SELECT SUM((T1.Sales / (1 - T1.Discount)) * T1.Quantity - T1.Profit) AS cost FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T1.`Product ID` = T3.`Product ID` AND T1.Region = T3.Region WHERE T1.Region = 'East' AND T2.`Customer Name` = 'Brad Thomas' AND strftime('%Y', T1.`Order Date`) = '2016'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: Provide the names, cities, and countries of the customers who ordered the Plantronics single ear headset. [/INST] | SELECT DISTINCT T2.`Customer Name`, T2.City, T2.Country FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T3.`Product Name` = 'Plantronics Single Ear Headset'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: Provide the shipping dates and products of the orders by Gene Hale. [/INST] | SELECT DISTINCT T2.`Ship Date`, T3.`Product Name` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Gene Hale'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: How many orders in the south superstore with the fastest delivery are items of furniture? [/INST] | SELECT COUNT(T1.`Order ID`) FROM south_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Ship Mode` = 'First Class' AND T2.Category = 'Furniture'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: How many office supply orders were made by Cindy Stewart in the south superstore? [/INST] | SELECT COUNT(*) FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T3.Category = 'Office Supplies' AND T2.`Customer Name` = 'Cindy Stewart'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: What product category got the highest profit in the south superstore? [/INST] | SELECT T2.Category FROM south_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` ORDER BY T1.Profit DESC LIMIT 1; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: List the name of all products that Cindy Stewart ordered in the east superstore. [/INST] | SELECT T3.`Product Name` FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.`Customer Name` = 'Cindy Stewart'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: List the name of all products in the west superstore that customers chose for same-day shipment in the year 2013. [/INST] | SELECT T2.`Product Name` FROM west_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Ship Mode` = 'Same Day' AND T1.`Ship Date` LIKE '2013%'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: What product category that Sam Craven ordered from the central and east superstore? [/INST] | SELECT DISTINCT T3.Category FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` LEFT JOIN central_superstore AS T4 ON T3.`Product ID` = T4.`Product ID` WHERE T2.`Customer Name` = 'Sam Craven'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: What is the total quantity that Cindy Stewart order "Lexmark X 9575 Professional All-in-One Color Printer" in the south superstore? [/INST] | SELECT SUM(T1.Quantity) FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.`Customer Name` = 'Cindy Stewart' AND T3.`Product Name` = 'Lexmark X 9575 Professional All-in-One Color Printer'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following 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. [/INST] | SELECT DISTINCT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Ship Mode` = 'Standard Class' AND T1.Quantity >= 10; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: What product category got the least sales in the west superstore? [/INST] | SELECT T2.Category FROM west_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` ORDER BY T1.Sales LIMIT 1; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: What is the total profit of "Memorex Froggy Flash Drive 8 GB in south superstore? [/INST] | SELECT SUM(T1.Profit) FROM south_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` GROUP BY T2.`Product Name` = 'Memorix Froggy Flash Drive 8 GB'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: What is the total sales of furniture products in the east superstore in the year 2016.
[/INST] | SELECT SUM(T1.Sales) FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE STRFTIME('%Y', T1.`Order Date`) = '2016' AND T2.Category = 'Furniture'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: Calculate the average sales of ""Sharp AL-1530CS Digital Copier in the east and the west superstore. [/INST] | SELECT AVG(T1.Sales) FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T3.`Product Name` = 'Sharp AL-1530CS Digital Copier'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: Calculate the percentage of ordered office supplies products in the central and the south superstore. [/INST] | SELECT CAST(SUM(CASE WHEN T3.Category = 'Office Supplies' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.Category) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID`; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: What is the ratio between customers who live in Texas and customers who live in Indiana? [/INST] | 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; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: Among the orders in Central superstore, which art product were ordered the most? [/INST] | SELECT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Sub-Category` = 'Art' GROUP BY T2.`Product Name` ORDER BY COUNT(T2.`Product ID`) DESC LIMIT 1; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: Among the customers in South superstore, which customers ordered more than 3 times in 2015? State the name of the customers. [/INST] | SELECT DISTINCT T2.`Customer Name` FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE STRFTIME('%Y', T1.`Order Date`) = '2015' GROUP BY T2.`Customer Name` HAVING COUNT(T2.`Customer Name`) > 3; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: State the highest profit made by Anna Chung's orders in the Central Superstore. [/INST] | SELECT MAX(T2.Profit) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Anna Chung'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: How many orders were made by Corey Roper in 2015? [/INST] | SELECT COUNT(T2.`Customer ID`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Corey Roper' AND STRFTIME('%Y', T2.`Ship Date`) = '2015'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: Calculate the difference between the total sales in the East superstore and the total sales in the West superstore. [/INST] | SELECT SUM(T1.Sales) - SUM(T2.Sales) AS difference FROM east_superstore AS T1 INNER JOIN west_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID`; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: What are the names of the ordered products that have profit deficiency in central superstore? [/INST] | SELECT DISTINCT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Region = 'Central' AND T1.Profit < 0; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: In west superstore, what is the name and the shipping mode of the product that was ordered with the shortest shipment time? [/INST] | SELECT DISTINCT T2.`Product Name`, T1.`Ship Mode` FROM west_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Region = 'West' ORDER BY T1.`Ship Date` - T1.`Order Date` LIMIT 1; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following 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? [/INST] | SELECT COUNT(DISTINCT T1.`Order ID`) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'O''Sullivan Plantations 2-Door Library in Landvery Oak' AND T2.Region = 'Central' AND T1.`Ship Mode` = 'First Class'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following 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? [/INST] | SELECT T2.`Customer Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T2.Segment = 'Corporate' AND T2.State = 'Rhode Island' AND T2.Region = 'East' AND STRFTIME('%Y', T1.`Order Date`) = '2016' GROUP BY T2.`Customer Name` ORDER BY COUNT(T2.`Customer Name`) DESC LIMIT 1; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following 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? [/INST] | SELECT COUNT(DISTINCT T1.`Order ID`) FROM west_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` INNER JOIN people AS T3 ON T3.`Customer ID` = T1.`Customer ID` WHERE T1.Sales > 5000 AND T3.State = 'California' AND T2.Region = 'West'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: In which segment does the customer who purchased the product from the east superstore with the highest original price belong? [/INST] | SELECT T2.Segment FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T1.Region = 'East' ORDER BY (T1.Sales / (1 - T1.Discount)) DESC LIMIT 1; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: What is the shipment duration for order number CA-2011-134103? [/INST] | SELECT DISTINCT strftime('%J', `Ship Date`) - strftime('%J', `Order Date`) AS duration FROM central_superstore WHERE `Order ID` = 'CA-2011-134103'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: How many orders with a quantity greater than 5 have been shipped by the fastest delivery method? [/INST] | SELECT COUNT(DISTINCT `Order ID`) FROM central_superstore WHERE Quantity > 5 AND `Ship Mode` = 'First Class'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: Please list any three orders that caused a loss to the company. [/INST] | SELECT `Order ID` FROM central_superstore WHERE Profit < 0 LIMIT 3; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: Which product did Phillina Ober buy? [/INST] | SELECT DISTINCT T3.`Product Name` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Phillina Ober'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: Who was the customer in the South Region superstore who bought the most “Hon Multipurpose Stacking Arm Chairs"? [/INST] | SELECT T2.`Customer Name` FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T3.`Product Name` = 'Hon Multipurpose Stacking Arm Chairs' GROUP BY T2.`Customer Name` ORDER BY COUNT(T2.`Customer Name`) DESC LIMIT 1; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: What is the profit from selling the "O'Sullivan Living Dimensions 2-Shelf Bookcases"? [/INST] | SELECT DISTINCT T1.Profit FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'O''Sullivan Living Dimensions 2-Shelf Bookcases'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: How many of the "Hon Pagoda Stacking Chairs" have been sold in total in the west superstore? [/INST] | SELECT SUM(T1.Quantity) FROM west_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Hon Pagoda Stacking Chairs'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: How many orders purchased by Aaron Bergman have been delivered with the slowest shipping speed? [/INST] | SELECT COUNT(*) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Aaron Bergman' AND T2.`Ship Mode` = 'Standard Class'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: What is the original price of the "Black Avery Flip-Chart Easel Binder"? [/INST] | SELECT T1.Sales / (1 - T1.Discount) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Blackstonian Pencils'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: What is the name of the product that Aimee Bixby bought? [/INST] | SELECT DISTINCT T3.`Product Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.`Customer Name` = 'Aimee Bixby'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: Indicate the profit of product Sauder Camden County Barrister Bookcase, Planked Cherry Finish. [/INST] | SELECT DISTINCT T1.Profit FROM south_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Sauder Camden County Barrister Bookcase, Planked Cherry Finish'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: How many furniture products had been shipped by standard class in the East superstore? [/INST] | SELECT COUNT(T2.Category) FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Ship Mode` = 'Standard Class'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: What is the highest profit order in the East superstore of customers from Houston, Texas? [/INST] | SELECT T1.`Order ID` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T2.City = 'Houston' AND T2.State = 'Texas' ORDER BY T1.Profit DESC LIMIT 1; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: How many furniture products were ordered at central superstore? [/INST] | SELECT COUNT(*) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Category = 'Furniture'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: What are the names of the products that had been shipped in March 2013 at central superstore? [/INST] | SELECT DISTINCT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE strftime('%Y-%m', T1.`Ship Date`) = '2013-03'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: How many orders were made by customers who live in Texas at the Central superstore? [/INST] | SELECT COUNT(DISTINCT T2.`Order ID`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.State = 'Texas'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: How many orders were made by Alan Barnes in 2015 at the Central superstore? [/INST] | SELECT COUNT(DISTINCT T2.`Order ID`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Alan Barnes' AND STRFTIME('%Y', T2.`Order Date`) = '2015'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: What is the product name of order CA-2011-115791 in the East superstore? [/INST] | SELECT DISTINCT T2.`Product Name` FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Order ID` = 'CA-2011-141817'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: What is the percentage of orders with 0.2 discount in the Central superstore were purchased by customers who live in Texas? [/INST] | SELECT CAST(SUM(CASE WHEN T2.Discount = 0.2 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.State = 'Texas'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: What is the percentage of furniture orders that were shipped through first class in 2013 at the Central superstore? [/INST] | SELECT CAST(SUM(CASE WHEN T1.`Ship Mode` = 'First Class' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Category = 'Furniture' AND STRFTIME('%Y', T1.`Ship Date`) = '2013'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: Who order from the west region on August 12, 2013, and received a discount of 0.2? [/INST] | SELECT DISTINCT T2.`Customer Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Order Date` = '2013-08-12' AND T1.Discount = 0.2 AND T1.Region = 'West'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: What is the order ID of the security-Tint Envelopes product ordered on June 3, 2013, in the Central region? [/INST] | SELECT DISTINCT T1.`Order ID` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Security-Tint Envelopes' AND T1.`Order Date` = '2013-06-03'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: List the product's name bought by the customer named Bill Shonely from the Central region. [/INST] | SELECT DISTINCT T3.`Product Name` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Bill Shonely' AND T2.Region = 'Central'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: Please give the name of customers from the West region that bought exactly 8 items in their purchase. [/INST] | SELECT DISTINCT T2.`Customer Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.Quantity = 8 AND T1.Region = 'West'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: Among the customers from Houston, Texas, what is the total profit of their orders in the Central region? [/INST] | SELECT SUM(T2.Profit) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.City = 'Houston' AND T1.State = 'Texas' AND T2.Region = 'Central'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: Who is the customer with an order shipped on March 5, 2013, in the eastern region? [/INST] | SELECT DISTINCT T2.`Customer Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Ship Date` = '2013-03-05'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: Among the orders from 2016 in the Central region, what is the product with the lowest profit? [/INST] | SELECT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Region = 'Central' AND STRFTIME('%Y', T1.`Order Date`) = '2016' ORDER BY T1.Profit ASC LIMIT 1; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: Who ordered the order ID CA-2011-118976 from the East region? [/INST] | SELECT DISTINCT T2.`Customer Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Order ID` = 'CA-2011-118976' AND T2.Region = 'East'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: Provide the product's name of the product with the highest sales in the South region. [/INST] | SELECT T2.`Product Name` FROM south_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Region = 'South' ORDER BY T1.Sales DESC LIMIT 1; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: List down the sales, profit, and subcategories of the product ordered in the order ID US-2011-126571 in the East region. [/INST] | SELECT T1.Sales, T1.Profit, T2.`Sub-Category` FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Order ID` = 'US-2011-126571' AND T2.Region = 'East'; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: What is the product's name in the highest quantity in a single purchase? [/INST] | SELECT T2.`Product Name` FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Region = 'East' ORDER BY T1.Quantity DESC LIMIT 1; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: List the customer's name from the South region with a standard class ship mode and sales greater than the 88% of the average sales of all orders. [/INST] | SELECT DISTINCT T2.`Customer Name` FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T2.Region = 'South' AND T1.`Ship Mode` = 'Standard Class' AND 100 * T1.Sales / ( SELECT AVG(Sales) FROM south_superstore ) > 88; |
[INST] Here is a database schema:
people :
Customer ID [ TEXT ]
Customer Name [ TEXT ]
Segment [ TEXT ]
Country [ TEXT ]
City [ TEXT ]
State [ TEXT ]
Postal Code [ INTEGER ]
Region [ TEXT ]
product :
Product ID [ TEXT ]
Product Name [ TEXT ]
Category [ TEXT ]
Sub-Category [ TEXT ]
Region [ TEXT ]
central_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] central_superstore.Customer ID = people.Customer ID
Region [ TEXT ] central_superstore.Region = people.Region
Product ID [ TEXT ] central_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
east_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] east_superstore.Customer ID = people.Customer ID
Region [ TEXT ] east_superstore.Region = people.Region
Product ID [ TEXT ] east_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
south_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] south_superstore.Customer ID = people.Customer ID
Region [ TEXT ] south_superstore.Region = people.Region
Product ID [ TEXT ] south_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
west_superstore :
Row ID [ INTEGER ] primary_key
Order ID [ TEXT ]
Order Date [ DATE ]
Ship Date [ DATE ]
Ship Mode [ TEXT ]
Customer ID [ TEXT ] west_superstore.Customer ID = people.Customer ID
Region [ TEXT ] west_superstore.Region = people.Region
Product ID [ TEXT ] west_superstore.Product ID = product.Product ID
Sales [ REAL ]
Quantity [ INTEGER ]
Discount [ REAL ]
Profit [ REAL ]
Please write me a SQL statement that answers the following question: Among the customers from Indiana, what is the percentage of their purchased orders in the Central region with no discount? [/INST] | SELECT CAST(SUM(CASE WHEN T2.Discount = 0 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T2.Region = 'Central' AND T1.State = 'Indiana'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: Among all the male officers, what is the percentage of them are White? [/INST] | SELECT CAST(SUM(IIF(race = 'W', 1, 0)) AS REAL) * 100 / COUNT(case_number) FROM officers WHERE gender = 'M'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: What is the percentage of the cases involved more than 3 officers from year 2010 to 2015? [/INST] | SELECT CAST(SUM(IIF(officer_count > 3, 1, 0)) AS REAL) * 100 / COUNT(case_number) FROM incidents WHERE STRFTIME('%Y', date) BETWEEN '2010' AND '2015'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: In which year has the greatest number of cases where Handgun was used as weapon? [/INST] | SELECT STRFTIME('%Y', date) FROM incidents WHERE subject_weapon = 'Handgun' GROUP BY STRFTIME('%Y', date) ORDER BY COUNT(case_number) DESC LIMIT 1; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: Among the cases dismissed by the grand jury disposition, what percentage of cases is where the subject is injured? [/INST] | SELECT CAST(SUM(subject_statuses = 'Injured') AS REAL) * 100 / COUNT(case_number) FROM incidents WHERE grand_jury_disposition = 'No Bill'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: Did the number of cases with Vehicle as subject weapon increase or decrease from year 2007 to 2008. State the difference. [/INST] | SELECT SUM(IIF(STRFTIME('%Y', date) = '2007', 1, 0)) - SUM(IIF(STRFTIME('%Y', date) = '2008', 1, 0)) FROM incidents WHERE subject_weapon = 'Vehicle'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: Among the 'Handgun' weapon used by subject, how many percent were 'Shoot and Miss'? [/INST] | SELECT CAST(SUM(subject_statuses = 'Shoot and Miss') AS REAL) * 100 / COUNT(case_number) FROM incidents WHERE subject_weapon = 'Handgun'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: Who are the officers involved in cases that are voted as 'No Bill'. List their last name and gender. [/INST] | SELECT T2.last_name, T2.gender FROM incidents AS T1 INNER JOIN officers AS T2 ON T1.case_number = T2.case_number WHERE T1.grand_jury_disposition = 'No Bill'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: Which are the cases where the subject are female. List the case number, subject status and weapon. [/INST] | SELECT T1.case_number, T1.subject_statuses, T1.subject_weapon FROM incidents AS T1 INNER JOIN subjects AS T2 ON T1.case_number = T2.case_number WHERE T2.gender = 'F'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: From the cases where the subject are male, list the case number and the location and subject status. [/INST] | SELECT T1.case_number, T1.location, T1.subject_statuses FROM incidents AS T1 INNER JOIN subjects AS T2 ON T1.case_number = T2.case_number WHERE T2.gender = 'M'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: For case(s) where officer 'Evenden, George' is in charged, state the case number and the grand jury disposition? [/INST] | SELECT T1.case_number, T1.grand_jury_disposition FROM incidents AS T1 INNER JOIN officers AS T2 ON T1.case_number = T2.case_number WHERE T2.first_name = 'George' AND T2.last_name = 'Evenden'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: For case number '134472-2015', list the last name of the officers involved and state the subject statuses. [/INST] | SELECT T2.last_name, T1.subject_statuses FROM incidents AS T1 INNER JOIN officers AS T2 ON T1.case_number = T2.case_number WHERE T1.case_number = '134472-2015'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: From the cases where the subject were deceased, list the subject's last name, gender, race and case number. [/INST] | SELECT T2.last_name, T2.gender, T2.race, T2.case_number FROM incidents AS T1 INNER JOIN subjects AS T2 ON T1.case_number = T2.case_number WHERE T1.subject_statuses = 'Deceased'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: What is the percentage of subject who are female used the Vehicle as weapon? [/INST] | SELECT CAST(SUM(T1.subject_weapon = 'Vehicle') AS REAL) * 100 / COUNT(T1.case_number) FROM incidents T1 INNER JOIN subjects T2 ON T1.case_number = T2.case_number WHERE T2.gender = 'F'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: From the 'Injured' statuses of the subject, what is the ratio of weapons used are knife against handgun? [/INST] | SELECT CAST(SUM(T1.subject_weapon = 'Knife') AS REAL) * 100 / SUM(T1.subject_weapon = 'Handgun') FROM incidents AS T1 INNER JOIN subjects AS T2 ON T1.case_number = T2.case_number WHERE T1.subject_statuses = 'Injured'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: List all cases from the year 2012 in which the subject was deceased [/INST] | SELECT case_number FROM incidents WHERE STRFTIME('%Y', date) > '2011' AND subject_statuses = 'Deceased'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: Of all male officers, what percentage are black officers? [/INST] | SELECT CAST(SUM(race = 'B') AS REAL) * 100 / COUNT(case_number) FROM officers WHERE gender = 'M'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: How many incidents in which the subject's weapon was a vehicle were investigated by a female officer? [/INST] | SELECT COUNT(T1.case_number) FROM incidents AS T1 INNER JOIN officers AS T2 ON T1.case_number = T2.case_number WHERE T1.subject_weapon = 'Vehicle' AND T2.gender = 'F'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: In how many cases where the subject was a female was the subject's status listed as Deceased? [/INST] | SELECT COUNT(T1.case_number) FROM incidents AS T1 INNER JOIN subjects AS T2 ON T1.case_number = T2.case_number WHERE T2.gender = 'F' AND T1.subject_statuses = 'Deceased'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: Of the black officers, how many of them investigated cases between the years 2010 and 2015? [/INST] | SELECT COUNT(T1.case_number) FROM officers AS T1 INNER JOIN incidents AS T2 ON T2.case_number = T1.case_number WHERE T1.race = 'B' AND T2.date BETWEEN '2010-01-01' AND '2015-12-31'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: How many instances were found in June 2015? [/INST] | SELECT COUNT(case_number) FROM incidents WHERE date BETWEEN '2015-06-01' AND '2015-06-30'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: How many people were injured between 2006 and 2014 as a result of a handgun? [/INST] | SELECT COUNT(location) FROM incidents WHERE subject_weapon = 'Handgun' AND subject_statuses = 'Injured' AND date BETWEEN '2006-01-01' AND '2013-12-31'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: What is the most common type of weapon that causes death? [/INST] | SELECT subject_weapon FROM incidents WHERE subject_statuses = 'Deceased' GROUP BY subject_weapon ORDER BY COUNT(case_number) DESC LIMIT 1; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: What is the proportion of white males and females in the police force? [/INST] | SELECT CAST(SUM(gender = 'M') AS REAL) / SUM(gender = 'F') FROM officers WHERE race = 'W'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: How many more black female victims than white female victims were discovered? [/INST] | SELECT SUM(race = 'B') - SUM(race = 'W') FROM subjects WHERE gender = 'F'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: What percentage of deaths were caused by rifles? [/INST] | SELECT CAST(SUM(subject_statuses = 'Deceased') AS REAL) * 100 / COUNT(case_number) FROM incidents WHERE subject_weapon = 'Rifle'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: Which type of weapon was used to attack the victim in the record number 031347-2015? What is the victim's race and gender? [/INST] | SELECT T1.subject_weapon, T2.race, T2.gender FROM incidents AS T1 INNER JOIN subjects AS T2 ON T1.case_number = T2.case_number WHERE T1.case_number = '031347-2015'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: Which near-death incident did a policeman by the name of Ruben Fredirick look into? What is the victim in this incident's race and gender? [/INST] | SELECT T1.case_number, T3.race, T3.gender FROM incidents AS T1 INNER JOIN officers AS T2 ON T1.case_number = T2.case_number INNER JOIN subjects AS T3 ON T1.case_number = T3.case_number WHERE T2.first_name = 'Fredirick' AND T2.last_name = 'Ruben'; |
[INST] Here is a database schema:
incidents :
case_number [ TEXT ] primary_key
date [ DATE ]
location [ TEXT ]
subject_statuses [ TEXT ]
subject_weapon [ TEXT ]
subjects [ TEXT ]
subject_count [ INTEGER ]
officers [ TEXT ]
officers :
case_number [ TEXT ] officers.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
subjects :
case_number [ TEXT ] subjects.case_number = incidents.case_number
race [ TEXT ]
gender [ TEXT ]
last_name [ TEXT ]
first_name [ TEXT ]
full_name [ TEXT ]
Please write me a SQL statement that answers the following question: What proportion of male police officers looked into events where people were injured? [/INST] | SELECT CAST(SUM(T2.gender = 'M') AS REAL) * 100 / COUNT(T1.case_number) FROM incidents T1 INNER JOIN officers T2 ON T1.case_number = T2.case_number WHERE T1.subject_statuses = 'Injured'; |
[INST] Here is a database schema:
Classification :
GeneID [ TEXT ] primary_key
Localization [ TEXT ]
Genes :
GeneID [ TEXT ] Genes.GeneID = Classification.GeneID
Essential [ TEXT ]
Class [ TEXT ]
Complex [ TEXT ]
Phenotype [ TEXT ]
Motif [ TEXT ]
Chromosome [ INTEGER ]
Function [ TEXT ]
Localization [ TEXT ]
Interactions :
GeneID1 [ TEXT ] Interactions.GeneID1 = Classification.GeneID
GeneID2 [ TEXT ] Interactions.GeneID2 = Classification.GeneID
Type [ TEXT ]
Expression_Corr [ REAL ]
Please write me a SQL statement that answers the following question: For the genes that are located in the plasma membrane, please list their number of chromosomes. [/INST] | SELECT T1.Chromosome FROM Genes AS T1 INNER JOIN Classification AS T2 ON T1.GeneID = T2.GeneID WHERE T2.Localization = 'plasma membrane'; |
[INST] Here is a database schema:
Classification :
GeneID [ TEXT ] primary_key
Localization [ TEXT ]
Genes :
GeneID [ TEXT ] Genes.GeneID = Classification.GeneID
Essential [ TEXT ]
Class [ TEXT ]
Complex [ TEXT ]
Phenotype [ TEXT ]
Motif [ TEXT ]
Chromosome [ INTEGER ]
Function [ TEXT ]
Localization [ TEXT ]
Interactions :
GeneID1 [ TEXT ] Interactions.GeneID1 = Classification.GeneID
GeneID2 [ TEXT ] Interactions.GeneID2 = Classification.GeneID
Type [ TEXT ]
Expression_Corr [ REAL ]
Please write me a SQL statement that answers the following question: How many non-essential genes are located in the nucleus? [/INST] | SELECT COUNT(T1.GeneID) FROM Genes AS T1 INNER JOIN Classification AS T2 ON T1.GeneID = T2.GeneID WHERE T2.Localization = 'nucleus' AND T1.Essential = 'Non-Essential'; |
[INST] Here is a database schema:
Classification :
GeneID [ TEXT ] primary_key
Localization [ TEXT ]
Genes :
GeneID [ TEXT ] Genes.GeneID = Classification.GeneID
Essential [ TEXT ]
Class [ TEXT ]
Complex [ TEXT ]
Phenotype [ TEXT ]
Motif [ TEXT ]
Chromosome [ INTEGER ]
Function [ TEXT ]
Localization [ TEXT ]
Interactions :
GeneID1 [ TEXT ] Interactions.GeneID1 = Classification.GeneID
GeneID2 [ TEXT ] Interactions.GeneID2 = Classification.GeneID
Type [ TEXT ]
Expression_Corr [ REAL ]
Please write me a SQL statement that answers the following question: Among the genes with nucleic acid metabolism defects, how many of them can be found in the vacuole? [/INST] | SELECT COUNT(T1.GeneID) FROM Genes AS T1 INNER JOIN Classification AS T2 ON T1.GeneID = T2.GeneID WHERE T2.Localization = 'vacuole' AND T1.Phenotype = 'Nucleic acid metabolism defects'; |
[INST] Here is a database schema:
Classification :
GeneID [ TEXT ] primary_key
Localization [ TEXT ]
Genes :
GeneID [ TEXT ] Genes.GeneID = Classification.GeneID
Essential [ TEXT ]
Class [ TEXT ]
Complex [ TEXT ]
Phenotype [ TEXT ]
Motif [ TEXT ]
Chromosome [ INTEGER ]
Function [ TEXT ]
Localization [ TEXT ]
Interactions :
GeneID1 [ TEXT ] Interactions.GeneID1 = Classification.GeneID
GeneID2 [ TEXT ] Interactions.GeneID2 = Classification.GeneID
Type [ TEXT ]
Expression_Corr [ REAL ]
Please write me a SQL statement that answers the following question: Please list the location of the genes that have the most chromosomes. [/INST] | SELECT T2.Localization FROM Genes AS T1 INNER JOIN Classification AS T2 ON T1.GeneID = T2.GeneID ORDER BY T1.Chromosome DESC LIMIT 1; |
[INST] Here is a database schema:
Classification :
GeneID [ TEXT ] primary_key
Localization [ TEXT ]
Genes :
GeneID [ TEXT ] Genes.GeneID = Classification.GeneID
Essential [ TEXT ]
Class [ TEXT ]
Complex [ TEXT ]
Phenotype [ TEXT ]
Motif [ TEXT ]
Chromosome [ INTEGER ]
Function [ TEXT ]
Localization [ TEXT ]
Interactions :
GeneID1 [ TEXT ] Interactions.GeneID1 = Classification.GeneID
GeneID2 [ TEXT ] Interactions.GeneID2 = Classification.GeneID
Type [ TEXT ]
Expression_Corr [ REAL ]
Please write me a SQL statement that answers the following question: Among the pairs of genes that are both located in the nucleus, what is the highest expression correlation score? [/INST] | SELECT T2.Expression_Corr FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 INNER JOIN Genes AS T3 ON T3.GeneID = T2.GeneID2 WHERE T1.Localization = 'nucleus' AND T3.Localization = 'nucleus' ORDER BY T2.Expression_Corr DESC LIMIT 1; |
[INST] Here is a database schema:
Classification :
GeneID [ TEXT ] primary_key
Localization [ TEXT ]
Genes :
GeneID [ TEXT ] Genes.GeneID = Classification.GeneID
Essential [ TEXT ]
Class [ TEXT ]
Complex [ TEXT ]
Phenotype [ TEXT ]
Motif [ TEXT ]
Chromosome [ INTEGER ]
Function [ TEXT ]
Localization [ TEXT ]
Interactions :
GeneID1 [ TEXT ] Interactions.GeneID1 = Classification.GeneID
GeneID2 [ TEXT ] Interactions.GeneID2 = Classification.GeneID
Type [ TEXT ]
Expression_Corr [ REAL ]
Please write me a SQL statement that answers the following question: What are the functions of the pair of genes that have the lowest expression correlation score?a [/INST] | SELECT T1.Function FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 ORDER BY T2.Expression_Corr ASC LIMIT 1; |
[INST] Here is a database schema:
Classification :
GeneID [ TEXT ] primary_key
Localization [ TEXT ]
Genes :
GeneID [ TEXT ] Genes.GeneID = Classification.GeneID
Essential [ TEXT ]
Class [ TEXT ]
Complex [ TEXT ]
Phenotype [ TEXT ]
Motif [ TEXT ]
Chromosome [ INTEGER ]
Function [ TEXT ]
Localization [ TEXT ]
Interactions :
GeneID1 [ TEXT ] Interactions.GeneID1 = Classification.GeneID
GeneID2 [ TEXT ] Interactions.GeneID2 = Classification.GeneID
Type [ TEXT ]
Expression_Corr [ REAL ]
Please write me a SQL statement that answers the following question: Among the pairs of genes that are not from the class of motorproteins, how many of them are negatively correlated? [/INST] | SELECT COUNT(T1.GeneID) FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 WHERE T2.Expression_Corr < 0 AND T1.Class = 'Motorproteins'; |
[INST] Here is a database schema:
Classification :
GeneID [ TEXT ] primary_key
Localization [ TEXT ]
Genes :
GeneID [ TEXT ] Genes.GeneID = Classification.GeneID
Essential [ TEXT ]
Class [ TEXT ]
Complex [ TEXT ]
Phenotype [ TEXT ]
Motif [ TEXT ]
Chromosome [ INTEGER ]
Function [ TEXT ]
Localization [ TEXT ]
Interactions :
GeneID1 [ TEXT ] Interactions.GeneID1 = Classification.GeneID
GeneID2 [ TEXT ] Interactions.GeneID2 = Classification.GeneID
Type [ TEXT ]
Expression_Corr [ REAL ]
Please write me a SQL statement that answers the following question: For the pairs of genes with one having 8 chromosomes and the other having 6 chromosomes, what is the highest expression correlation score? [/INST] | SELECT T2.Expression_Corr FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 WHERE T1.Chromosome = 6 OR T1.Chromosome = 8 ORDER BY T2.Expression_Corr DESC LIMIT 1; |
[INST] Here is a database schema:
Classification :
GeneID [ TEXT ] primary_key
Localization [ TEXT ]
Genes :
GeneID [ TEXT ] Genes.GeneID = Classification.GeneID
Essential [ TEXT ]
Class [ TEXT ]
Complex [ TEXT ]
Phenotype [ TEXT ]
Motif [ TEXT ]
Chromosome [ INTEGER ]
Function [ TEXT ]
Localization [ TEXT ]
Interactions :
GeneID1 [ TEXT ] Interactions.GeneID1 = Classification.GeneID
GeneID2 [ TEXT ] Interactions.GeneID2 = Classification.GeneID
Type [ TEXT ]
Expression_Corr [ REAL ]
Please write me a SQL statement that answers the following question: Please list the motif of the genes that are located in the cytoplasm and have 7 chromosomes. [/INST] | SELECT T2.GeneID1, T2.GeneID2 FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 WHERE T1.Localization = 'cytoplasm' AND T1.Chromosome = 7; |
[INST] Here is a database schema:
Classification :
GeneID [ TEXT ] primary_key
Localization [ TEXT ]
Genes :
GeneID [ TEXT ] Genes.GeneID = Classification.GeneID
Essential [ TEXT ]
Class [ TEXT ]
Complex [ TEXT ]
Phenotype [ TEXT ]
Motif [ TEXT ]
Chromosome [ INTEGER ]
Function [ TEXT ]
Localization [ TEXT ]
Interactions :
GeneID1 [ TEXT ] Interactions.GeneID1 = Classification.GeneID
GeneID2 [ TEXT ] Interactions.GeneID2 = Classification.GeneID
Type [ TEXT ]
Expression_Corr [ REAL ]
Please write me a SQL statement that answers the following question: For the non-essential genes whose functions are transcription, how many of them are not located in the cytoplasm? [/INST] | SELECT COUNT(T1.GeneID) FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 WHERE T1.Localization != 'cytoplasm' AND T1.Function = 'TRANSCRIPTION' AND T1.Essential = 'NON-Essential'; |
[INST] Here is a database schema:
Classification :
GeneID [ TEXT ] primary_key
Localization [ TEXT ]
Genes :
GeneID [ TEXT ] Genes.GeneID = Classification.GeneID
Essential [ TEXT ]
Class [ TEXT ]
Complex [ TEXT ]
Phenotype [ TEXT ]
Motif [ TEXT ]
Chromosome [ INTEGER ]
Function [ TEXT ]
Localization [ TEXT ]
Interactions :
GeneID1 [ TEXT ] Interactions.GeneID1 = Classification.GeneID
GeneID2 [ TEXT ] Interactions.GeneID2 = Classification.GeneID
Type [ TEXT ]
Expression_Corr [ REAL ]
Please write me a SQL statement that answers the following question: How many pairs of positively correlated genes are both non-essential? [/INST] | SELECT COUNT(T2.GeneID2) FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 WHERE T2.Expression_Corr > 0 AND T1.Essential = 'Non-Essential'; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.