text
stringlengths
0
220
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Castillo, Ritter and Rhodes 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 = 'Castillo, Ritter and Rhodes'
AND s.sale_date >= DATE_SUB(CURDATE(), INTERVAL 3 MONTH)
GROUP BY p.category
ORDER BY total_sales DESC
LIMIT 5
Natural Query: Show me all products in the know category with a price over $368.04.
SQL Query: SELECT * FROM products WHERE category = 'know' AND price > 368.04
Natural Query: What are the top 5 products by orders for Wilson, Lopez and Woods last quarter?
SQL Query: SELECT product_name, SUM(orders) as total_orders FROM sales WHERE company_name = 'Wilson, Lopez and Woods' AND period = 'last quarter' GROUP BY product_name ORDER BY total_orders DESC LIMIT 5
Natural Query: What is the minimum price of all products for Munoz and Sons?
SQL Query: SELECT MINIMUM(price) as result FROM products WHERE company_name = 'Munoz and Sons'
Natural Query: List all products of Hernandez Ltd ordered by stock_quantity from highest to lowest.
SQL Query: SELECT * FROM products WHERE company_name = 'Hernandez Ltd' ORDER BY stock_quantity DESC
Natural Query: List all customers and their total order value for Patterson-Stevens.
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 = 'Patterson-Stevens' GROUP BY c.customer_id
Natural Query: What are the top 3 products by customers for Torres, Stafford and James all time?
SQL Query: SELECT product_name, SUM(customers) as total_customers FROM sales WHERE company_name = 'Torres, Stafford and James' AND period = 'all time' GROUP BY product_name ORDER BY total_customers DESC LIMIT 3
Natural Query: How many orders were placed for Daniels, Ruiz and Roman between 2024-03-25 and 2024-09-08?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Daniels, Ruiz and Roman' AND order_date BETWEEN '2024-03-25' AND '2024-09-08'
Natural Query: List all customers and their total order value for Cox LLC.
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 = 'Cox LLC' GROUP BY c.customer_id
Natural Query: What is the total sales for each country in Best-Gonzales?
SQL Query: SELECT country, SUM(sales) as total_sales FROM sales WHERE company_name = 'Best-Gonzales' GROUP BY country ORDER BY total_sales DESC
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Bender-Porter 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 = 'Bender-Porter'
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 products of Page-Hart ordered by stock_quantity from lowest to highest.
SQL Query: SELECT * FROM products WHERE company_name = 'Page-Hart' ORDER BY stock_quantity ASC
Natural Query: What are the top 10 products by revenue for Davis Inc this month?
SQL Query: SELECT product_name, SUM(revenue) as total_revenue FROM sales WHERE company_name = 'Davis Inc' AND period = 'this month' GROUP BY product_name ORDER BY total_revenue DESC LIMIT 10
Natural Query: Show me all products in the include category with a price over $651.53.
SQL Query: SELECT * FROM products WHERE category = 'include' AND price > 651.53
Natural Query: List all customers and their total order value for Gilbert-Harris.
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 = 'Gilbert-Harris' GROUP BY c.customer_id
Natural Query: What is the total quantity for each supplier in Valdez LLC?
SQL Query: SELECT supplier, SUM(quantity) as total_quantity FROM sales WHERE company_name = 'Valdez LLC' GROUP BY supplier ORDER BY total_quantity DESC
Natural Query: What is the total profit for each category in Bailey, Porter and Jackson?
SQL Query: SELECT category, SUM(profit) as total_profit FROM sales WHERE company_name = 'Bailey, Porter and Jackson' GROUP BY category ORDER BY total_profit DESC
Natural Query: Show me all products in the star category with a price over $350.18.
SQL Query: SELECT * FROM products WHERE category = 'star' AND price > 350.18
Natural Query: What is the minimum rating of all products for Davis, Hayden and Smith?
SQL Query: SELECT MINIMUM(rating) as result FROM products WHERE company_name = 'Davis, Hayden and Smith'
Natural Query: List all products of Kelly PLC ordered by stock_quantity from highest to lowest.
SQL Query: SELECT * FROM products WHERE company_name = 'Kelly PLC' ORDER BY stock_quantity DESC
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Preston-Johnson 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 = 'Preston-Johnson'
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 7 products by customers for Moore Ltd this year?
SQL Query: SELECT product_name, SUM(customers) as total_customers FROM sales WHERE company_name = 'Moore Ltd' AND period = 'this year' GROUP BY product_name ORDER BY total_customers DESC LIMIT 7
Natural Query: Show me all products in the conference category with a price over $887.36.
SQL Query: SELECT * FROM products WHERE category = 'conference' AND price > 887.36
Natural Query: List all products of Oconnell, Vasquez and Miller ordered by rating from lowest to highest.
SQL Query: SELECT * FROM products WHERE company_name = 'Oconnell, Vasquez and Miller' ORDER BY rating ASC