text
stringlengths
0
220
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 = 'Parker, Rodriguez and Lane'
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 Woods-Morgan ordered by price from highest to lowest.
SQL Query: SELECT * FROM products WHERE company_name = 'Woods-Morgan' ORDER BY price DESC
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Peters-Nelson 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 = 'Peters-Nelson'
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 Jones-Larsen this year?
SQL Query: SELECT product_name, SUM(customers) as total_customers FROM sales WHERE company_name = 'Jones-Larsen' AND period = 'this year' GROUP BY product_name ORDER BY total_customers DESC LIMIT 8
Natural Query: List all customers and their total order value for Wilson, Kent and Wright.
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 = 'Wilson, Kent and Wright' GROUP BY c.customer_id
Natural Query: List all customers and their total order value for Cooper-Lewis.
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 = 'Cooper-Lewis' GROUP BY c.customer_id
Natural Query: List all customers and their total order value for Kramer-Robinson.
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 = 'Kramer-Robinson' GROUP BY c.customer_id
Natural Query: What are the top 3 products by customers for Williamson, Mason and Fernandez last quarter?
SQL Query: SELECT product_name, SUM(customers) as total_customers FROM sales WHERE company_name = 'Williamson, Mason and Fernandez' AND period = 'last quarter' GROUP BY product_name ORDER BY total_customers DESC LIMIT 3
Natural Query: List all products of Shepherd PLC ordered by price from highest to lowest.
SQL Query: SELECT * FROM products WHERE company_name = 'Shepherd PLC' ORDER BY price DESC
Natural Query: List all products of Campbell, Edwards and Dunn ordered by price from highest to lowest.
SQL Query: SELECT * FROM products WHERE company_name = 'Campbell, Edwards and Dunn' ORDER BY price DESC
Natural Query: List all products of Martin-Morgan ordered by stock_quantity from highest to lowest.
SQL Query: SELECT * FROM products WHERE company_name = 'Martin-Morgan' ORDER BY stock_quantity DESC
Natural Query: What is the average rating of all products for Ortega and Sons?
SQL Query: SELECT AVERAGE(rating) as result FROM products WHERE company_name = 'Ortega and Sons'
Natural Query: List all products of Henderson-Owen ordered by rating from lowest to highest.
SQL Query: SELECT * FROM products WHERE company_name = 'Henderson-Owen' ORDER BY rating ASC
Natural Query: What is the total sales for each supplier in Vasquez PLC?
SQL Query: SELECT supplier, SUM(sales) as total_sales FROM sales WHERE company_name = 'Vasquez PLC' GROUP BY supplier ORDER BY total_sales DESC
Natural Query: What are the top 3 products by customers for Howard, Smith and Vega this month?
SQL Query: SELECT product_name, SUM(customers) as total_customers FROM sales WHERE company_name = 'Howard, Smith and Vega' AND period = 'this month' GROUP BY product_name ORDER BY total_customers DESC LIMIT 3
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Frazier-Castillo 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 = 'Frazier-Castillo'
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 10 products by customers for Meyer, Henry and Smith this year?
SQL Query: SELECT product_name, SUM(customers) as total_customers FROM sales WHERE company_name = 'Meyer, Henry and Smith' AND period = 'this year' GROUP BY product_name ORDER BY total_customers DESC LIMIT 10
Natural Query: What is the total profit for each supplier in Reyes-Kaufman?
SQL Query: SELECT supplier, SUM(profit) as total_profit FROM sales WHERE company_name = 'Reyes-Kaufman' GROUP BY supplier ORDER BY total_profit DESC
Natural Query: List all products of Fletcher and Sons ordered by rating from highest to lowest.
SQL Query: SELECT * FROM products WHERE company_name = 'Fletcher and Sons' ORDER BY rating DESC
Natural Query: What is the maximum quantity of all products for Wilson Inc?
SQL Query: SELECT MAXIMUM(quantity) as result FROM products WHERE company_name = 'Wilson Inc'
Natural Query: What is the total quantity for each supplier in Fox, Case and Nichols?
SQL Query: SELECT supplier, SUM(quantity) as total_quantity FROM sales WHERE company_name = 'Fox, Case and Nichols' GROUP BY supplier ORDER BY total_quantity DESC
Natural Query: How many orders were placed for Kline-Scott between 2023-10-31 and 2024-01-12?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Kline-Scott' AND order_date BETWEEN '2023-10-31' AND '2024-01-12'
Natural Query: List all customers and their total order value for Anthony-Shields.
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 = 'Anthony-Shields' GROUP BY c.customer_id
Natural Query: List all customers and their total order value for Braun Ltd.
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 = 'Braun Ltd' GROUP BY c.customer_id
Natural Query: List all products of Frederick, Brown and Ward ordered by price from highest to lowest.
SQL Query: SELECT * FROM products WHERE company_name = 'Frederick, Brown and Ward' ORDER BY price DESC