text
stringlengths
0
220
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Perry Ltd 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 = 'Perry Ltd'
AND s.sale_date >= DATE_SUB(CURDATE(), INTERVAL 3 MONTH)
GROUP BY p.category
ORDER BY total_sales DESC
LIMIT 5
Natural Query: How many orders were placed for Vazquez Ltd between 2024-01-27 and 2024-05-27?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Vazquez Ltd' AND order_date BETWEEN '2024-01-27' AND '2024-05-27'
Natural Query: What is the minimum quantity of all products for Goodwin-Decker?
SQL Query: SELECT MINIMUM(quantity) as result FROM products WHERE company_name = 'Goodwin-Decker'
Natural Query: How many orders were placed for Hall Group between 2024-09-10 and 2024-09-10?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Hall Group' AND order_date BETWEEN '2024-09-10' AND '2024-09-10'
Natural Query: How many orders were placed for Miller and Sons between 2023-10-31 and 2024-03-25?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Miller and Sons' AND order_date BETWEEN '2023-10-31' AND '2024-03-25'
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Green, Patterson and 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 = 'Green, Patterson and 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 is the maximum quantity of all products for Perry LLC?
SQL Query: SELECT MAXIMUM(quantity) as result FROM products WHERE company_name = 'Perry LLC'
Natural Query: How many orders were placed for Gonzales-Lewis between 2024-01-03 and 2024-05-13?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Gonzales-Lewis' AND order_date BETWEEN '2024-01-03' AND '2024-05-13'
Natural Query: What is the total profit for each country in Sullivan Group?
SQL Query: SELECT country, SUM(profit) as total_profit FROM sales WHERE company_name = 'Sullivan Group' GROUP BY country ORDER BY total_profit DESC
Natural Query: List all customers and their total order value for Ramsey, Martinez and Hampton.
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 = 'Ramsey, Martinez and Hampton' GROUP BY c.customer_id
Natural Query: List all products of Gibbs PLC ordered by rating from lowest to highest.
SQL Query: SELECT * FROM products WHERE company_name = 'Gibbs PLC' ORDER BY rating ASC
Natural Query: List all products of Johnston Group ordered by price from highest to lowest.
SQL Query: SELECT * FROM products WHERE company_name = 'Johnston Group' ORDER BY price DESC
Natural Query: List all customers and their total order value for Gallagher-Flynn.
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 = 'Gallagher-Flynn' GROUP BY c.customer_id
Natural Query: How many orders were placed for Wright, Erickson and Bass between 2024-06-02 and 2024-07-30?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Wright, Erickson and Bass' AND order_date BETWEEN '2024-06-02' AND '2024-07-30'
Natural Query: List all products of Mcdonald Inc ordered by stock_quantity from lowest to highest.
SQL Query: SELECT * FROM products WHERE company_name = 'Mcdonald Inc' ORDER BY stock_quantity ASC
Natural Query: List all products of Bailey and Sons ordered by stock_quantity from lowest to highest.
SQL Query: SELECT * FROM products WHERE company_name = 'Bailey and Sons' ORDER BY stock_quantity ASC
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Reid-Hahn 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 = 'Reid-Hahn'
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 Kelly LLC?
SQL Query: SELECT category, SUM(sales) as total_sales FROM sales WHERE company_name = 'Kelly LLC' GROUP BY category ORDER BY total_sales DESC
Natural Query: How many orders were placed for Middleton-Harris between 2024-08-24 and 2024-09-11?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Middleton-Harris' AND order_date BETWEEN '2024-08-24' AND '2024-09-11'
Natural Query: Show me all products in the physical category with a price over $645.16.
SQL Query: SELECT * FROM products WHERE category = 'physical' AND price > 645.16
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Hernandez-Franco 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 = 'Hernandez-Franco'
AND s.sale_date >= DATE_SUB(CURDATE(), INTERVAL 3 MONTH)
GROUP BY p.category
ORDER BY total_sales DESC
LIMIT 5