text
stringlengths
0
220
GROUP BY p.category
ORDER BY total_sales DESC
LIMIT 5
Natural Query: List all customers and their total order value for Barry, Nguyen and Fleming.
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 = 'Barry, Nguyen and Fleming' GROUP BY c.customer_id
Natural Query: What is the total profit for each category in Lam Group?
SQL Query: SELECT category, SUM(profit) as total_profit FROM sales WHERE company_name = 'Lam Group' GROUP BY category ORDER BY total_profit DESC
Natural Query: How many orders were placed for Pruitt-Kennedy between 2024-03-24 and 2024-06-13?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Pruitt-Kennedy' AND order_date BETWEEN '2024-03-24' AND '2024-06-13'
Natural Query: What are the top 4 products by orders for Molina, George and Contreras last quarter?
SQL Query: SELECT product_name, SUM(orders) as total_orders FROM sales WHERE company_name = 'Molina, George and Contreras' AND period = 'last quarter' GROUP BY product_name ORDER BY total_orders DESC LIMIT 4
Natural Query: List all customers and their total order value for Harris-Moore.
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 = 'Harris-Moore' GROUP BY c.customer_id
Natural Query: How many orders were placed for Brown Group between 2023-10-23 and 2024-01-16?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Brown Group' AND order_date BETWEEN '2023-10-23' AND '2024-01-16'
Natural Query: Show me all products in the little category with a price over $185.89.
SQL Query: SELECT * FROM products WHERE category = 'little' AND price > 185.89
Natural Query: How many orders were placed for Stewart and Sons between 2024-02-13 and 2024-04-12?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Stewart and Sons' AND order_date BETWEEN '2024-02-13' AND '2024-04-12'
Natural Query: What are the top 3 products by revenue for Daniels-Rush this month?
SQL Query: SELECT product_name, SUM(revenue) as total_revenue FROM sales WHERE company_name = 'Daniels-Rush' AND period = 'this month' GROUP BY product_name ORDER BY total_revenue DESC LIMIT 3
Natural Query: What are the top 7 products by orders for Thomas Group all time?
SQL Query: SELECT product_name, SUM(orders) as total_orders FROM sales WHERE company_name = 'Thomas Group' AND period = 'all time' GROUP BY product_name ORDER BY total_orders DESC LIMIT 7
Natural Query: Show me all products in the rock category with a price over $879.71.
SQL Query: SELECT * FROM products WHERE category = 'rock' AND price > 879.71
Natural Query: How many orders were placed for Davenport-Lara between 2024-04-27 and 2024-08-31?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Davenport-Lara' AND order_date BETWEEN '2024-04-27' AND '2024-08-31'
Natural Query: How many orders were placed for Zimmerman-Murphy between 2024-08-06 and 2024-08-19?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Zimmerman-Murphy' AND order_date BETWEEN '2024-08-06' AND '2024-08-19'
Natural Query: What are the top 5 products by customers for Jones Ltd this month?
SQL Query: SELECT product_name, SUM(customers) as total_customers FROM sales WHERE company_name = 'Jones Ltd' AND period = 'this month' GROUP BY product_name ORDER BY total_customers DESC LIMIT 5
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Pierce-Bowman 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
WHERE c.age BETWEEN 25 AND 35
AND s.company_name = 'Pierce-Bowman'
AND s.sale_date >= DATE_SUB(CURDATE(), INTERVAL 3 MONTH)
GROUP BY p.category
ORDER BY total_sales DESC
LIMIT 5
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Frey-Lang 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
WHERE c.age BETWEEN 25 AND 35
AND s.company_name = 'Frey-Lang'
AND s.sale_date >= DATE_SUB(CURDATE(), INTERVAL 3 MONTH)
GROUP BY p.category
ORDER BY total_sales DESC
LIMIT 5
Natural Query: List all customers and their total order value for Hernandez, Ward and Wiley.
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 = 'Hernandez, Ward and Wiley' GROUP BY c.customer_id
Natural Query: List all customers and their total order value for Cunningham, Klein and Wong.
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 = 'Cunningham, Klein and Wong' GROUP BY c.customer_id
Natural Query: Show me all products in the author category with a price over $677.44.
SQL Query: SELECT * FROM products WHERE category = 'author' AND price > 677.44
Natural Query: List all customers and their total order value for Weeks, Graham and Ayala.
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 = 'Weeks, Graham and Ayala' GROUP BY c.customer_id
Natural Query: Show me all products in the agency category with a price over $276.87.
SQL Query: SELECT * FROM products WHERE category = 'agency' AND price > 276.87
Natural Query: How many orders were placed for Thompson, Anderson and Mueller between 2024-05-29 and 2024-07-29?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Thompson, Anderson and Mueller' AND order_date BETWEEN '2024-05-29' AND '2024-07-29'
Natural Query: List all customers and their total order value for Stephens-Rios.
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 = 'Stephens-Rios' GROUP BY c.customer_id
Natural Query: List all products of Gould PLC ordered by stock_quantity from highest to lowest.
SQL Query: SELECT * FROM products WHERE company_name = 'Gould PLC' ORDER BY stock_quantity DESC
Natural Query: What is the total sales for each country in Harris, Joyce and Vega?
SQL Query: SELECT country, SUM(sales) as total_sales FROM sales WHERE company_name = 'Harris, Joyce and Vega' GROUP BY country ORDER BY total_sales DESC
Natural Query: What is the total sales for each category in Mitchell, Gonzalez and Arnold?
SQL Query: SELECT category, SUM(sales) as total_sales FROM sales WHERE company_name = 'Mitchell, Gonzalez and Arnold' GROUP BY category ORDER BY total_sales DESC