text
stringlengths
0
220
SQL Query: SELECT p.category, SUM(s.sales) as total_sales
FROM sales s
JOIN products p ON s.product_id = p.product_id
JOIN customers c ON s.customer_id = c.customer_id
WHERE c.age BETWEEN 25 AND 35
AND s.company_name = 'Miller Inc'
AND s.sale_date >= DATE_SUB(CURDATE(), INTERVAL 3 MONTH)
GROUP BY p.category
ORDER BY total_sales DESC
LIMIT 5
Natural Query: What is the total sales for each category in Chapman LLC?
SQL Query: SELECT category, SUM(sales) as total_sales FROM sales WHERE company_name = 'Chapman LLC' GROUP BY category ORDER BY total_sales DESC
Natural Query: What is the total quantity for each category in Reyes-Wagner?
SQL Query: SELECT category, SUM(quantity) as total_quantity FROM sales WHERE company_name = 'Reyes-Wagner' GROUP BY category ORDER BY total_quantity DESC
Natural Query: What are the top 7 products by sales for Horn-Meyer this year?
SQL Query: SELECT product_name, SUM(sales) as total_sales FROM sales WHERE company_name = 'Horn-Meyer' AND period = 'this year' GROUP BY product_name ORDER BY total_sales DESC LIMIT 7
Natural Query: List all customers and their total order value for Dawson and Sons.
SQL Query: SELECT c.customer_name, SUM(o.order_total) as total_value FROM customers c JOIN orders o ON c.customer_id = o.customer_id WHERE c.company_name = 'Dawson and Sons' GROUP BY c.customer_id
Natural Query: How many orders were placed for Cooper Ltd between 2024-03-17 and 2024-05-12?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Cooper Ltd' AND order_date BETWEEN '2024-03-17' AND '2024-05-12'
Natural Query: What is the minimum rating of all products for Burns, Griffith and Smith?
SQL Query: SELECT MINIMUM(rating) as result FROM products WHERE company_name = 'Burns, Griffith and Smith'
Natural Query: What is the total quantity of all products for Smith, Allen and Valencia?
SQL Query: SELECT TOTAL(quantity) as result FROM products WHERE company_name = 'Smith, Allen and Valencia'
Natural Query: How many orders were placed for Howell Group between 2024-05-15 and 2024-05-19?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Howell Group' AND order_date BETWEEN '2024-05-15' AND '2024-05-19'
Natural Query: List all products of Oneal and Sons ordered by stock_quantity from highest to lowest.
SQL Query: SELECT * FROM products WHERE company_name = 'Oneal and Sons' ORDER BY stock_quantity DESC
Natural Query: Show me all products in the stop category with a price over $846.85.
SQL Query: SELECT * FROM products WHERE category = 'stop' AND price > 846.85
Natural Query: What is the total sales for each category in Davis Inc?
SQL Query: SELECT category, SUM(sales) as total_sales FROM sales WHERE company_name = 'Davis Inc' GROUP BY category ORDER BY total_sales DESC
Natural Query: List all customers and their total order value for Burke and Sons.
SQL Query: SELECT c.customer_name, SUM(o.order_total) as total_value FROM customers c JOIN orders o ON c.customer_id = o.customer_id WHERE c.company_name = 'Burke and Sons' GROUP BY c.customer_id
Natural Query: List all products of Randall, Rubio and Cole ordered by stock_quantity from lowest to highest.
SQL Query: SELECT * FROM products WHERE company_name = 'Randall, Rubio and Cole' ORDER BY stock_quantity ASC
Natural Query: What are the top 6 products by sales for Gray and Sons this month?
SQL Query: SELECT product_name, SUM(sales) as total_sales FROM sales WHERE company_name = 'Gray and Sons' AND period = 'this month' GROUP BY product_name ORDER BY total_sales DESC LIMIT 6
Natural Query: What are the top 3 products by orders for Jones Group this year?
SQL Query: SELECT product_name, SUM(orders) as total_orders FROM sales WHERE company_name = 'Jones Group' AND period = 'this year' GROUP BY product_name ORDER BY total_orders DESC LIMIT 3
Natural Query: List all products of Byrd, Warren and Matthews ordered by price from lowest to highest.
SQL Query: SELECT * FROM products WHERE company_name = 'Byrd, Warren and Matthews' ORDER BY price ASC
Natural Query: What is the maximum price of all products for White, Fleming and Santos?
SQL Query: SELECT MAXIMUM(price) as result FROM products WHERE company_name = 'White, Fleming and Santos'
Natural Query: What is the total profit for each country in Simmons Ltd?
SQL Query: SELECT country, SUM(profit) as total_profit FROM sales WHERE company_name = 'Simmons Ltd' GROUP BY country ORDER BY total_profit DESC
Natural Query: What is the maximum rating of all products for Brown PLC?
SQL Query: SELECT MAXIMUM(rating) as result FROM products WHERE company_name = 'Brown PLC'
Natural Query: List all products of Sandoval, Schroeder and Clark ordered by stock_quantity from lowest to highest.
SQL Query: SELECT * FROM products WHERE company_name = 'Sandoval, Schroeder and Clark' ORDER BY stock_quantity ASC
Natural Query: List all products of Wood-Pearson ordered by price from highest to lowest.
SQL Query: SELECT * FROM products WHERE company_name = 'Wood-Pearson' ORDER BY price DESC
Natural Query: How many orders were placed for Powell-Olson between 2024-05-11 and 2024-06-02?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Powell-Olson' AND order_date BETWEEN '2024-05-11' AND '2024-06-02'
Natural Query: What are the top 8 products by sales for Parker LLC this month?
SQL Query: SELECT product_name, SUM(sales) as total_sales FROM sales WHERE company_name = 'Parker LLC' AND period = 'this month' GROUP BY product_name ORDER BY total_sales DESC LIMIT 8
Natural Query: What are the top 3 products by sales for Peterson and Sons this month?
SQL Query: SELECT product_name, SUM(sales) as total_sales FROM sales WHERE company_name = 'Peterson and Sons' AND period = 'this month' GROUP BY product_name ORDER BY total_sales DESC LIMIT 3
Natural Query: What is the maximum quantity of all products for Anderson LLC?
SQL Query: SELECT MAXIMUM(quantity) as result FROM products WHERE company_name = 'Anderson LLC'
Natural Query: List all products of Howard, Nguyen and Rangel ordered by stock_quantity from highest to lowest.
SQL Query: SELECT * FROM products WHERE company_name = 'Howard, Nguyen and Rangel' ORDER BY stock_quantity DESC
Natural Query: What is the total sales for each country in Johnson, Myers and Austin?
SQL Query: SELECT country, SUM(sales) as total_sales FROM sales WHERE company_name = 'Johnson, Myers and Austin' GROUP BY country ORDER BY total_sales DESC
Natural Query: How many orders were placed for Murphy-Salazar between 2024-01-29 and 2024-07-19?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Murphy-Salazar' AND order_date BETWEEN '2024-01-29' AND '2024-07-19'
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Adams-Garcia for the last quarter?
SQL Query: SELECT p.category, SUM(s.sales) as total_sales
FROM sales s
JOIN products p ON s.product_id = p.product_id
JOIN customers c ON s.customer_id = c.customer_id