text
stringlengths
0
220
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 = 'Bennett, Nelson and Clark' GROUP BY c.customer_id
Natural Query: Show me all products in the identify category with a price over $812.54.
SQL Query: SELECT * FROM products WHERE category = 'identify' AND price > 812.54
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Sanchez, Boyd and Freeman 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 = 'Sanchez, Boyd and Freeman'
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 quantity for each country in Salinas and Sons?
SQL Query: SELECT country, SUM(quantity) as total_quantity FROM sales WHERE company_name = 'Salinas and Sons' GROUP BY country ORDER BY total_quantity DESC
Natural Query: What is the total sales for each supplier in Harris-Costa?
SQL Query: SELECT supplier, SUM(sales) as total_sales FROM sales WHERE company_name = 'Harris-Costa' GROUP BY supplier ORDER BY total_sales DESC
Natural Query: List all customers and their total order value for Davis, Le and Hammond.
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 = 'Davis, Le and Hammond' GROUP BY c.customer_id
Natural Query: List all products of Hull-Waters ordered by rating from lowest to highest.
SQL Query: SELECT * FROM products WHERE company_name = 'Hull-Waters' ORDER BY rating ASC
Natural Query: What is the minimum rating of all products for Hunt PLC?
SQL Query: SELECT MINIMUM(rating) as result FROM products WHERE company_name = 'Hunt PLC'
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Smith-Anderson 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 = 'Smith-Anderson'
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 8 products by customers for James and Sons all time?
SQL Query: SELECT product_name, SUM(customers) as total_customers FROM sales WHERE company_name = 'James and Sons' AND period = 'all time' GROUP BY product_name ORDER BY total_customers DESC LIMIT 8
Natural Query: What are the top 4 products by revenue for Murphy Inc all time?
SQL Query: SELECT product_name, SUM(revenue) as total_revenue FROM sales WHERE company_name = 'Murphy Inc' AND period = 'all time' GROUP BY product_name ORDER BY total_revenue DESC LIMIT 4
Natural Query: List all customers and their total order value for Murray-Davidson.
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 = 'Murray-Davidson' GROUP BY c.customer_id
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Lewis-Taylor 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 = 'Lewis-Taylor'
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 Rhodes-Turner 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 = 'Rhodes-Turner'
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 Smith-Larsen ordered by rating from highest to lowest.
SQL Query: SELECT * FROM products WHERE company_name = 'Smith-Larsen' ORDER BY rating DESC
Natural Query: Show me all products in the vote category with a price over $398.07.
SQL Query: SELECT * FROM products WHERE category = 'vote' AND price > 398.07
Natural Query: How many orders were placed for Garcia and Sons between 2024-07-09 and 2024-07-29?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Garcia and Sons' AND order_date BETWEEN '2024-07-09' AND '2024-07-29'
Natural Query: What are the top 8 products by revenue for Marsh, White and Rhodes all time?
SQL Query: SELECT product_name, SUM(revenue) as total_revenue FROM sales WHERE company_name = 'Marsh, White and Rhodes' AND period = 'all time' GROUP BY product_name ORDER BY total_revenue DESC LIMIT 8
Natural Query: List all customers and their total order value for Oconnor-Torres.
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 = 'Oconnor-Torres' GROUP BY c.customer_id
Natural Query: Show me all products in the reason category with a price over $710.08.
SQL Query: SELECT * FROM products WHERE category = 'reason' AND price > 710.08
Natural Query: What is the average price of all products for Rodriguez LLC?
SQL Query: SELECT AVERAGE(price) as result FROM products WHERE company_name = 'Rodriguez LLC'
Natural Query: List all products of Beck-Fleming ordered by stock_quantity from lowest to highest.
SQL Query: SELECT * FROM products WHERE company_name = 'Beck-Fleming' ORDER BY stock_quantity ASC