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 = 'Case-Rodriguez' |
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 customers and their total order value for Morales Group. |
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 = 'Morales Group' GROUP BY c.customer_id |
Natural Query: What is the total sales for each supplier in Reilly, Baker and Acosta? |
SQL Query: SELECT supplier, SUM(sales) as total_sales FROM sales WHERE company_name = 'Reilly, Baker and Acosta' GROUP BY supplier ORDER BY total_sales DESC |
Natural Query: List all customers and their total order value for Clark Group. |
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 = 'Clark Group' GROUP BY c.customer_id |
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Graham, Jackson and Pollard 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, Jackson and Pollard' |
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 quantity of all products for Kaiser, Houston and Howard? |
SQL Query: SELECT MINIMUM(quantity) as result FROM products WHERE company_name = 'Kaiser, Houston and Howard' |
Natural Query: List all products of Rodriguez Group ordered by rating from highest to lowest. |
SQL Query: SELECT * FROM products WHERE company_name = 'Rodriguez Group' ORDER BY rating DESC |
Natural Query: What are the top 4 products by sales for Andrade, Thomas and Lynch all time? |
SQL Query: SELECT product_name, SUM(sales) as total_sales FROM sales WHERE company_name = 'Andrade, Thomas and Lynch' AND period = 'all time' GROUP BY product_name ORDER BY total_sales DESC LIMIT 4 |
Natural Query: Show me all products in the seek category with a price over $936.91. |
SQL Query: SELECT * FROM products WHERE category = 'seek' AND price > 936.91 |
Natural Query: Show me all products in the term category with a price over $284.05. |
SQL Query: SELECT * FROM products WHERE category = 'term' AND price > 284.05 |
Natural Query: What is the total quantity for each category in Powell PLC? |
SQL Query: SELECT category, SUM(quantity) as total_quantity FROM sales WHERE company_name = 'Powell PLC' GROUP BY category ORDER BY total_quantity DESC |
Natural Query: How many orders were placed for Smith and Sons between 2024-08-03 and 2024-09-07? |
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Smith and Sons' AND order_date BETWEEN '2024-08-03' AND '2024-09-07' |
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Golden 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 = 'Golden Ltd' |
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 average price of all products for Harrison, Potter and Gonzalez? |
SQL Query: SELECT AVERAGE(price) as result FROM products WHERE company_name = 'Harrison, Potter and Gonzalez' |
Natural Query: Show me all products in the worker category with a price over $776.62. |
SQL Query: SELECT * FROM products WHERE category = 'worker' AND price > 776.62 |
Natural Query: How many orders were placed for Douglas-Rivera between 2023-10-13 and 2023-11-06? |
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Douglas-Rivera' AND order_date BETWEEN '2023-10-13' AND '2023-11-06' |
Natural Query: What is the maximum rating of all products for Perry and Sons? |
SQL Query: SELECT MAXIMUM(rating) as result FROM products WHERE company_name = 'Perry and Sons' |
Natural Query: What is the average price of all products for Drake-Wong? |
SQL Query: SELECT AVERAGE(price) as result FROM products WHERE company_name = 'Drake-Wong' |
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Kennedy, Arias and Collins 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 = 'Kennedy, Arias and Collins' |
AND s.sale_date >= DATE_SUB(CURDATE(), INTERVAL 3 MONTH) |
GROUP BY p.category |
ORDER BY total_sales DESC |
LIMIT 5 |
Natural Query: Show me all products in the too category with a price over $213.42. |
SQL Query: SELECT * FROM products WHERE category = 'too' AND price > 213.42 |
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Patterson-Sullivan 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.