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 = 'Gaines, Klein and Hunter' |
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 Hudson-Hall? |
SQL Query: SELECT category, SUM(sales) as total_sales FROM sales WHERE company_name = 'Hudson-Hall' GROUP BY category ORDER BY total_sales DESC |
Natural Query: List all products of King, Jackson and Griffin ordered by rating from lowest to highest. |
SQL Query: SELECT * FROM products WHERE company_name = 'King, Jackson and Griffin' ORDER BY rating ASC |
Natural Query: What is the minimum quantity of all products for Chapman PLC? |
SQL Query: SELECT MINIMUM(quantity) as result FROM products WHERE company_name = 'Chapman PLC' |
Natural Query: What is the average rating of all products for Lawrence, Miller and Williams? |
SQL Query: SELECT AVERAGE(rating) as result FROM products WHERE company_name = 'Lawrence, Miller and Williams' |
Natural Query: List all products of Anderson-Day ordered by stock_quantity from highest to lowest. |
SQL Query: SELECT * FROM products WHERE company_name = 'Anderson-Day' ORDER BY stock_quantity DESC |
Natural Query: What is the total sales for each country in White Ltd? |
SQL Query: SELECT country, SUM(sales) as total_sales FROM sales WHERE company_name = 'White Ltd' GROUP BY country ORDER BY total_sales DESC |
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Moore, Nunez and Washington 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 = 'Moore, Nunez and Washington' |
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 profit for each supplier in Hendricks-Lee? |
SQL Query: SELECT supplier, SUM(profit) as total_profit FROM sales WHERE company_name = 'Hendricks-Lee' GROUP BY supplier ORDER BY total_profit DESC |
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Chang, Brooks and Hamilton 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 = 'Chang, Brooks and Hamilton' |
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 profit for each category in Mann, Hunt and Lewis? |
SQL Query: SELECT category, SUM(profit) as total_profit FROM sales WHERE company_name = 'Mann, Hunt and Lewis' GROUP BY category ORDER BY total_profit DESC |
Natural Query: What is the maximum price of all products for Murray-Hall? |
SQL Query: SELECT MAXIMUM(price) as result FROM products WHERE company_name = 'Murray-Hall' |
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Graham, Savage and Williams 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 = 'Graham, Savage and Williams' |
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 King-Winters ordered by rating from lowest to highest. |
SQL Query: SELECT * FROM products WHERE company_name = 'King-Winters' ORDER BY rating ASC |
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Moore-Barnett 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 = 'Moore-Barnett' |
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 minimum price of all products for Lee, Ramos and Spencer? |
SQL Query: SELECT MINIMUM(price) as result FROM products WHERE company_name = 'Lee, Ramos and Spencer' |
Natural Query: What are the top 9 products by orders for Parker and Sons last quarter? |
SQL Query: SELECT product_name, SUM(orders) as total_orders FROM sales WHERE company_name = 'Parker and Sons' AND period = 'last quarter' GROUP BY product_name ORDER BY total_orders DESC LIMIT 9 |
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Johnson, Martinez and Kirk 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 = 'Johnson, Martinez and Kirk' |
AND s.sale_date >= DATE_SUB(CURDATE(), INTERVAL 3 MONTH) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.