text
stringlengths
0
220
JOIN customers c ON s.customer_id = c.customer_id
WHERE c.age BETWEEN 25 AND 35
AND s.company_name = 'Jones, Doyle and Anderson'
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 Dorsey PLC ordered by rating from highest to lowest.
SQL Query: SELECT * FROM products WHERE company_name = 'Dorsey PLC' ORDER BY rating DESC
Natural Query: What is the total rating of all products for Hughes Group?
SQL Query: SELECT TOTAL(rating) as result FROM products WHERE company_name = 'Hughes Group'
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Blake-Wong 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 = 'Blake-Wong'
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 Aguilar, Hughes and Ponce between 2024-07-07 and 2024-08-23?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Aguilar, Hughes and Ponce' AND order_date BETWEEN '2024-07-07' AND '2024-08-23'
Natural Query: List all products of Shields-Anderson ordered by price from highest to lowest.
SQL Query: SELECT * FROM products WHERE company_name = 'Shields-Anderson' ORDER BY price DESC
Natural Query: What are the top 4 products by customers for Rodriguez Inc this month?
SQL Query: SELECT product_name, SUM(customers) as total_customers FROM sales WHERE company_name = 'Rodriguez Inc' AND period = 'this month' GROUP BY product_name ORDER BY total_customers DESC LIMIT 4
Natural Query: List all customers and their total order value for Grant-Miller.
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 = 'Grant-Miller' GROUP BY c.customer_id
Natural Query: How many orders were placed for Williams Ltd between 2024-06-14 and 2024-07-16?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Williams Ltd' AND order_date BETWEEN '2024-06-14' AND '2024-07-16'
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Duncan and Sons 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 = 'Duncan and Sons'
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 Fields Inc 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 = 'Fields 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 quantity for each category in Roach-Holmes?
SQL Query: SELECT category, SUM(quantity) as total_quantity FROM sales WHERE company_name = 'Roach-Holmes' GROUP BY category ORDER BY total_quantity DESC
Natural Query: What is the total rating of all products for Brown-Williams?
SQL Query: SELECT TOTAL(rating) as result FROM products WHERE company_name = 'Brown-Williams'
Natural Query: What are the top 4 products by customers for Ellis-Miller all time?
SQL Query: SELECT product_name, SUM(customers) as total_customers FROM sales WHERE company_name = 'Ellis-Miller' AND period = 'all time' GROUP BY product_name ORDER BY total_customers DESC LIMIT 4
Natural Query: What are the top 5 products by customers for Perkins Group this month?
SQL Query: SELECT product_name, SUM(customers) as total_customers FROM sales WHERE company_name = 'Perkins Group' AND period = 'this month' GROUP BY product_name ORDER BY total_customers DESC LIMIT 5
Natural Query: What is the average rating of all products for Chandler-Gay?
SQL Query: SELECT AVERAGE(rating) as result FROM products WHERE company_name = 'Chandler-Gay'
Natural Query: How many orders were placed for Williams, Cox and Potter between 2023-11-22 and 2024-06-30?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Williams, Cox and Potter' AND order_date BETWEEN '2023-11-22' AND '2024-06-30'
Natural Query: Show me all products in the join category with a price over $378.05.
SQL Query: SELECT * FROM products WHERE category = 'join' AND price > 378.05
Natural Query: List all products of Maynard Ltd ordered by price from highest to lowest.
SQL Query: SELECT * FROM products WHERE company_name = 'Maynard Ltd' ORDER BY price DESC
Natural Query: List all products of Aguilar LLC ordered by rating from highest to lowest.
SQL Query: SELECT * FROM products WHERE company_name = 'Aguilar LLC' ORDER BY rating DESC
Natural Query: How many orders were placed for Oconnell, Cervantes and Reynolds between 2024-08-22 and 2024-09-12?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Oconnell, Cervantes and Reynolds' AND order_date BETWEEN '2024-08-22' AND '2024-09-12'
Natural Query: How many orders were placed for Hall PLC between 2024-01-25 and 2024-03-15?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Hall PLC' AND order_date BETWEEN '2024-01-25' AND '2024-03-15'
Natural Query: What is the total sales for each country in Webb, Stafford and Davis?
SQL Query: SELECT country, SUM(sales) as total_sales FROM sales WHERE company_name = 'Webb, Stafford and Davis' GROUP BY country ORDER BY total_sales DESC