text stringlengths 0 220 |
|---|
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 = 'Jones Group' |
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 Craig Ltd between 2024-02-12 and 2024-06-16? |
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Craig Ltd' AND order_date BETWEEN '2024-02-12' AND '2024-06-16' |
Natural Query: How many orders were placed for Ortega, Martinez and Mcbride between 2024-07-20 and 2024-08-01? |
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Ortega, Martinez and Mcbride' AND order_date BETWEEN '2024-07-20' AND '2024-08-01' |
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Ramsey 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 = 'Ramsey 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 is the total price of all products for Lin-Wilkerson? |
SQL Query: SELECT TOTAL(price) as result FROM products WHERE company_name = 'Lin-Wilkerson' |
Natural Query: List all products of Wilson LLC ordered by rating from lowest to highest. |
SQL Query: SELECT * FROM products WHERE company_name = 'Wilson LLC' ORDER BY rating ASC |
Natural Query: What are the top 3 products by orders for Evans, Phillips and Davis this year? |
SQL Query: SELECT product_name, SUM(orders) as total_orders FROM sales WHERE company_name = 'Evans, Phillips and Davis' AND period = 'this year' GROUP BY product_name ORDER BY total_orders DESC LIMIT 3 |
Natural Query: What is the maximum rating of all products for Foster, Ray and Gibson? |
SQL Query: SELECT MAXIMUM(rating) as result FROM products WHERE company_name = 'Foster, Ray and Gibson' |
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Gregory, Watts and Kelley 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 = 'Gregory, Watts and Kelley' |
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 rating of all products for Cain Group? |
SQL Query: SELECT TOTAL(rating) as result FROM products WHERE company_name = 'Cain Group' |
Natural Query: What is the total quantity for each category in Lewis, Williams and Bowen? |
SQL Query: SELECT category, SUM(quantity) as total_quantity FROM sales WHERE company_name = 'Lewis, Williams and Bowen' GROUP BY category ORDER BY total_quantity DESC |
Natural Query: List all products of Kennedy Ltd ordered by price from highest to lowest. |
SQL Query: SELECT * FROM products WHERE company_name = 'Kennedy Ltd' ORDER BY price DESC |
Natural Query: What is the total profit for each country in Reed-Brandt? |
SQL Query: SELECT country, SUM(profit) as total_profit FROM sales WHERE company_name = 'Reed-Brandt' GROUP BY country ORDER BY total_profit DESC |
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Roberson, Humphrey and Lambert 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 = 'Roberson, Humphrey and Lambert' |
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 Williams, Burns and York. |
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 = 'Williams, Burns and York' GROUP BY c.customer_id |
Natural Query: What are the top 8 products by revenue for Roberts-Charles this year? |
SQL Query: SELECT product_name, SUM(revenue) as total_revenue FROM sales WHERE company_name = 'Roberts-Charles' AND period = 'this year' GROUP BY product_name ORDER BY total_revenue DESC LIMIT 8 |
Natural Query: What are the top 6 products by revenue for Miller, Johnson and Ferrell all time? |
SQL Query: SELECT product_name, SUM(revenue) as total_revenue FROM sales WHERE company_name = 'Miller, Johnson and Ferrell' AND period = 'all time' GROUP BY product_name ORDER BY total_revenue DESC LIMIT 6 |
Natural Query: List all customers and their total order value for Gibson-Braun. |
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 = 'Gibson-Braun' GROUP BY c.customer_id |
Natural Query: How many orders were placed for Holloway Ltd between 2024-06-18 and 2024-07-03? |
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Holloway Ltd' AND order_date BETWEEN '2024-06-18' AND '2024-07-03' |
Natural Query: List all customers and their total order value for Franklin 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 = 'Franklin Group' GROUP BY c.customer_id |
Natural Query: List all customers and their total order value for Carter, Wilson and Bishop. |
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 = 'Carter, Wilson and Bishop' GROUP BY c.customer_id |
Natural Query: List all customers and their total order value for King, Fritz and Baker. |
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 = 'King, Fritz and Baker' GROUP BY c.customer_id |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.