db_id
stringclasses 40
values | query
stringlengths 22
608
| question
stringlengths 22
185
|
|---|---|---|
customers_and_orders
|
SELECT order_status_code FROM Customer_orders GROUP BY order_status_code ORDER BY count(*) DESC LIMIT 1
|
Give the order status code that is most frequent across customer orders.
|
customers_and_orders
|
SELECT count(*) FROM Customers WHERE customer_id NOT IN ( SELECT customer_id FROM Customer_orders)
|
How many customers do not have an order?
|
customers_and_orders
|
SELECT count(*) FROM Customers WHERE customer_id NOT IN ( SELECT customer_id FROM Customer_orders)
|
Count the number of customers who have not made an order.
|
customers_and_orders
|
SELECT product_name FROM Products EXCEPT SELECT T1.product_name FROM Products AS t1 JOIN Order_items AS T2 ON T1.product_id = T2.product_id
|
Show all product names without an order.
|
customers_and_orders
|
SELECT product_name FROM Products EXCEPT SELECT T1.product_name FROM Products AS t1 JOIN Order_items AS T2 ON T1.product_id = T2.product_id
|
What are the names of products that have not been ordered?
|
customers_and_orders
|
SELECT sum(order_quantity) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id WHERE T2.product_name = "Monitor"
|
How many products named Monitor have been ordered?
|
customers_and_orders
|
SELECT sum(order_quantity) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id WHERE T2.product_name = "Monitor"
|
What is the total number of Monitor products that have been ordered?
|
customers_and_orders
|
SELECT count(DISTINCT T3.customer_id) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id JOIN Customer_orders AS T3 ON T3.order_id = T1.order_id WHERE T2.product_name = "Monitor"
|
How many customers have ordered the product named Monitor?
|
customers_and_orders
|
SELECT count(DISTINCT T3.customer_id) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id JOIN Customer_orders AS T3 ON T3.order_id = T1.order_id WHERE T2.product_name = "Monitor"
|
Count the number of different customers who have bought a Monitor Product.
|
customers_and_orders
|
SELECT count(DISTINCT customer_id) FROM Customer_orders
|
How many customers have an order?
|
customers_and_orders
|
SELECT count(DISTINCT customer_id) FROM Customer_orders
|
Count the number of differnt customers who have made an order.
|
customers_and_orders
|
SELECT customer_id FROM Customers EXCEPT SELECT customer_id FROM Customer_orders
|
Show all customer ids without an order.
|
customers_and_orders
|
SELECT customer_id FROM Customers EXCEPT SELECT customer_id FROM Customer_orders
|
What are the ids of customers who have not made an order?
|
customers_and_orders
|
SELECT T1.order_date , T1.order_id FROM Customer_Orders AS T1 JOIN Order_items AS T2 ON T1.order_id = T2.order_id WHERE T2.order_quantity > 6 UNION SELECT T1.order_date , T1.order_id FROM Customer_Orders AS T1 JOIN Order_items AS T2 ON T1.order_id = T2.order_id GROUP BY T1.order_id HAVING count(*) > 3;
|
Show all the order dates and ids of the orders with quantity of any product larger than 6 or with more than 3 products.
|
customers_and_orders
|
SELECT T1.order_date , T1.order_id FROM Customer_Orders AS T1 JOIN Order_items AS T2 ON T1.order_id = T2.order_id WHERE T2.order_quantity > 6 UNION SELECT T1.order_date , T1.order_id FROM Customer_Orders AS T1 JOIN Order_items AS T2 ON T1.order_id = T2.order_id GROUP BY T1.order_id HAVING count(*) > 3;
|
What are the order ids and corresponding order dates for orders with a quantity greater than 6 or consisting of more than 3 products?
|
region_building
|
SELECT count(*) FROM building
|
How many buildings are there?
|
region_building
|
SELECT count(*) FROM building
|
Count the number of buildings.
|
region_building
|
SELECT Name FROM building ORDER BY Number_of_Stories ASC
|
List the names of buildings in ascending order of number of stories.
|
region_building
|
SELECT Name FROM building ORDER BY Number_of_Stories ASC
|
What is the list of building names, sorted by the number of stories of each building in ascending order?
|
region_building
|
SELECT Address FROM building ORDER BY Completed_Year DESC
|
List the addresses of buildings in descending order of building completion year.
|
region_building
|
SELECT Address FROM building ORDER BY Completed_Year DESC
|
Sort the buildings in descending order of building completion year, and return the building addresses.
|
region_building
|
SELECT max(Number_of_Stories) FROM building WHERE Completed_Year != "1980"
|
What is the maximum number of stories of buildings not completed in 1980?
|
region_building
|
SELECT max(Number_of_Stories) FROM building WHERE Completed_Year != "1980"
|
Among the buildings not completed in 1980, what is the maximum number of stories?
|
region_building
|
SELECT avg(Population) FROM region
|
What is the average population for all regions?
|
region_building
|
SELECT avg(Population) FROM region
|
Compute the average population of a region.
|
region_building
|
SELECT Name FROM region ORDER BY Name ASC
|
What are the names of regions in ascending alphabetical order?
|
region_building
|
SELECT Name FROM region ORDER BY Name ASC
|
List the names of regions in alphabetical order.
|
region_building
|
SELECT Capital FROM region WHERE Area > 10000
|
What are the capitals of the regions with area bigger than 10000?
|
region_building
|
SELECT Capital FROM region WHERE Area > 10000
|
Give me the capitals of the regions whose area is larger than 10000.
|
region_building
|
SELECT Capital FROM region ORDER BY Population DESC LIMIT 1
|
List the capital of the region with the largest population.
|
region_building
|
SELECT Capital FROM region ORDER BY Population DESC LIMIT 1
|
Which region has the largest population? Give me the capital of the region.
|
region_building
|
SELECT Name FROM region ORDER BY Area DESC LIMIT 5
|
List the names of the regions with the top 5 largest areas.
|
region_building
|
SELECT Name FROM region ORDER BY Area DESC LIMIT 5
|
What are the names of the 5 largest regions in terms of area?
|
region_building
|
SELECT T1.Name , T2.Name FROM building AS T1 JOIN region AS T2 ON T1.Region_ID = T2.Region_ID
|
Show the names of buildings and the names of regions they are in.
|
region_building
|
SELECT T1.Name , T2.Name FROM building AS T1 JOIN region AS T2 ON T1.Region_ID = T2.Region_ID
|
For each building, return the name of the building and the name of the region it belongs to.
|
region_building
|
SELECT T2.Name FROM building AS T1 JOIN region AS T2 ON T1.Region_ID = T2.Region_ID GROUP BY T1.Region_ID HAVING COUNT(*) > 1
|
Show the names of regions that have more than one building.
|
region_building
|
SELECT T2.Name FROM building AS T1 JOIN region AS T2 ON T1.Region_ID = T2.Region_ID GROUP BY T1.Region_ID HAVING COUNT(*) > 1
|
Which regions have more than one building? Give me the names of the regions.
|
region_building
|
SELECT T2.capital FROM building AS T1 JOIN region AS T2 ON T1.Region_ID = T2.Region_ID GROUP BY T1.Region_ID ORDER BY COUNT(*) DESC LIMIT 1
|
Show the capital of the region that has the most buildings.
|
region_building
|
SELECT T2.capital FROM building AS T1 JOIN region AS T2 ON T1.Region_ID = T2.Region_ID GROUP BY T1.Region_ID ORDER BY COUNT(*) DESC LIMIT 1
|
Which region has the largest number of buildings? Show me the capital of the region.
|
region_building
|
SELECT T1.Address , T2.Capital FROM building AS T1 JOIN region AS T2 ON T1.Region_ID = T2.Region_ID
|
Show addresses of buildings and the capitals of regions they are in.
|
region_building
|
SELECT T1.Address , T2.Capital FROM building AS T1 JOIN region AS T2 ON T1.Region_ID = T2.Region_ID
|
For each building, return the address of the building and the name of the region it belongs to.
|
region_building
|
SELECT T1.Number_of_Stories FROM building AS T1 JOIN region AS T2 ON T1.Region_ID = T2.Region_ID WHERE T2.Name = "Abruzzo"
|
Show the number of stories of buildings in the region with name "Abruzzo".
|
region_building
|
SELECT T1.Number_of_Stories FROM building AS T1 JOIN region AS T2 ON T1.Region_ID = T2.Region_ID WHERE T2.Name = "Abruzzo"
|
Return the number of stories for each building in the region named "Abruzzo".
|
region_building
|
SELECT Completed_Year , COUNT(*) FROM building GROUP BY Completed_Year
|
Please show each completion year and the number of buildings completed in that year.
|
region_building
|
SELECT Completed_Year , COUNT(*) FROM building GROUP BY Completed_Year
|
For completion year, return the year and the number of buildings completed.
|
region_building
|
SELECT Completed_Year FROM building GROUP BY Completed_Year ORDER BY COUNT(*) DESC LIMIT 1
|
List the year in which the most buildings are completed.
|
region_building
|
SELECT Completed_Year FROM building GROUP BY Completed_Year ORDER BY COUNT(*) DESC LIMIT 1
|
In which year did the most building constructions complete?
|
region_building
|
SELECT Name FROM region WHERE Region_ID NOT IN (SELECT Region_ID FROM building)
|
List the names of regions that do not have any buildings.
|
region_building
|
SELECT Name FROM region WHERE Region_ID NOT IN (SELECT Region_ID FROM building)
|
What are the names of regions in which there are no buildings?
|
region_building
|
SELECT Completed_Year FROM building WHERE Number_of_Stories > 20 INTERSECT SELECT Completed_Year FROM building WHERE Number_of_Stories < 15
|
Show the completed years shared by buildings with more than 20 stories and buildings with less than 15 stories.
|
region_building
|
SELECT Completed_Year FROM building WHERE Number_of_Stories > 20 INTERSECT SELECT Completed_Year FROM building WHERE Number_of_Stories < 15
|
In which years did both buildings with more than 20 stories and buildings with less than 15 stories were completed?
|
region_building
|
SELECT DISTINCT Address FROM building
|
Show the distinct addresses of buildings.
|
region_building
|
SELECT DISTINCT Address FROM building
|
Give me a list of distinct building addresses.
|
region_building
|
SELECT Completed_Year FROM building ORDER BY Number_of_Stories DESC
|
Show the completed years of buildings in descending order of the number of stories.
|
region_building
|
SELECT Completed_Year FROM building ORDER BY Number_of_Stories DESC
|
Sort buildings in descending order of the number of stories, and return their completion years.
|
government_shift
|
select channel_details from channels order by channel_details
|
List details of all the channel in alphabetical order .
|
government_shift
|
select channel_details from channels order by channel_details
|
What is the list of channel details ordered alphabetically ?
|
government_shift
|
SELECT count(*) FROM services
|
How many services are there?
|
government_shift
|
SELECT count(*) FROM services
|
Count the number of services.
|
government_shift
|
SELECT analytical_layer_type_code FROM analytical_layer GROUP BY analytical_layer_type_code ORDER BY count(*) DESC LIMIT 1
|
What is the most common analytical layer type code?
|
government_shift
|
SELECT analytical_layer_type_code FROM analytical_layer GROUP BY analytical_layer_type_code ORDER BY count(*) DESC LIMIT 1
|
Find the analytical layer type code that appears most often.
|
government_shift
|
SELECT t3.service_details FROM customers AS t1 JOIN customers_and_services AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t1.customer_details = "Hardy Kutch"
|
Find all the services that has been used by the customer with details "Hardy Kutch".
|
government_shift
|
SELECT t3.service_details FROM customers AS t1 JOIN customers_and_services AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t1.customer_details = "Hardy Kutch"
|
Which services were used by the customer with details "Hardy Kutch"? Give me the service details.
|
government_shift
|
select t1.service_details from services as t1 join customers_and_services as t2 on t1.service_id = t2.service_id group by t1.service_details having count(*) > 3
|
Find the details of the services that have been used by more than 3 times .
|
government_shift
|
SELECT t1.service_details FROM services AS t1 JOIN customers_and_services AS t2 ON t1.service_id = t2.service_id GROUP BY t1.service_details HAVING count(*) > 3
|
Which services were used by customers by more than 3 times? Give me the service details.
|
government_shift
|
SELECT t1.customer_details FROM customers AS t1 JOIN customers_and_services AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_details ORDER BY count(*) DESC LIMIT 1
|
Find the details of the customer who has used services the most times.
|
government_shift
|
select t1.customer_details from customers as t1 join customers_and_services as t2 on t1.customer_id = t2.customer_id group by t1.customer_details order by count(*) desc limit 1
|
return the details of the customer with largest count of used services.
|
government_shift
|
select t1.customer_details from customers as t1 join customers_and_services as t2 on t1.customer_id = t2.customer_id group by t1.customer_details order by count(*) desc limit 1
|
Find the name of the customer who has used the most types of services .
|
government_shift
|
select t1.customer_details from customers as t1 join customers_and_services as t2 on t1.customer_id = t2.customer_id group by t1.customer_details order by count(*) desc limit 1
|
Which customer has used the most types of services ? Give me the customer details .
|
government_shift
|
select customer_details from customers where customer_id not in (select customer_id from customers_and_services)
|
Find the details of the customer who has never used any services .
|
government_shift
|
select customer_details from customers where customer_id not in (select customer_id from customers_and_services)
|
Which customers never used any services ? Give me the customer details .
|
government_shift
|
select distinct t1.customer_details from customers as t1 join customers_and_services as t2 on t1.customer_id = t2.customer_id where t2.service_id = (select service_id from services group by service_id order by count(*) asc limit 1)
|
Find the details of the customers who have used the least-used service .
|
government_shift
|
select distinct t1.customer_details from customers as t1 join customers_and_services as t2 on t1.customer_id = t2.customer_id where t2.service_id = (select service_id from services group by service_id order by count(*) asc limit 1)
|
Which customers used the least commonly-used service ? Give me the distinct customer details .
|
government_shift
|
SELECT count(DISTINCT customers_and_services_details) FROM customers_and_services
|
How many distinct customer and services details are there?
|
government_shift
|
SELECT count(DISTINCT customers_and_services_details) FROM customers_and_services
|
Count the total number of available customers and services details.
|
government_shift
|
SELECT customer_details FROM customers WHERE customer_details LIKE "%Kutch%"
|
Find all the customers whose name contains "Kutch".
|
government_shift
|
SELECT customer_details FROM customers WHERE customer_details LIKE "%Kutch%"
|
What are the details of the customers who have "Kutch" in part of their details?
|
government_shift
|
SELECT DISTINCT t3.service_details FROM customers AS t1 JOIN customers_and_services AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id JOIN customer_interactions AS t4 ON t3.service_id = t4.service_id WHERE t1.customer_details = "Hardy Kutch" OR t4.services_and_channels_details = "good"
|
Find the name of all the services which either have been used by customer "Hardy Kutch" or have been rated as "good" in one of the customer interactions.
|
government_shift
|
SELECT DISTINCT t3.service_details FROM customers AS t1 JOIN customers_and_services AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id JOIN customer_interactions AS t4 ON t3.service_id = t4.service_id WHERE t1.customer_details = "Hardy Kutch" OR t4.services_and_channels_details = "good"
|
Which services are used by the customer "Hardy Kutch" or are rated as "good" in a customer interaction? Give me the service details.
|
government_shift
|
SELECT DISTINCT t3.service_details FROM customers AS t1 JOIN customers_and_services AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id JOIN customer_interactions AS t4 ON t3.service_id = t4.service_id WHERE t1.customer_details = "Hardy Kutch" AND t4.services_and_channels_details = "bad"
|
Find the names of all the services which both have been used by customer "Hardy Kutch" and have been rated "bad" in one of the customer interactions.
|
government_shift
|
SELECT DISTINCT t3.service_details FROM customers AS t1 JOIN customers_and_services AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id JOIN customer_interactions AS t4 ON t3.service_id = t4.service_id WHERE t1.customer_details = "Hardy Kutch" AND t4.services_and_channels_details = "bad"
|
Which services are both used by the customer "Hardy Kutch" and are rated as "bad" in a customer interaction? Give me the service details.
|
government_shift
|
select distinct t1.service_details from services as t1 join customer_interactions as t2 on t1.service_id = t2.service_id join channels as t3 on t2.channel_id = t3.channel_id where t3.channel_details = "15 ij"
|
Find details of all the services that have interacted with `` 15 ij '' for the the channel details.
|
government_shift
|
SELECT DISTINCT t1.service_details FROM services AS t1 JOIN customer_interactions AS t2 ON t1.service_id = t2.service_id JOIN channels AS t3 ON t2.channel_id = t3.channel_id WHERE t3.channel_details = "15 ij"
|
Give me the details of all the services that have interacted with the channel with detail "15 ij".
|
government_shift
|
select t1.customer_details from customers as t1 join customer_interactions as t2 on t1.customer_id = t2.customer_id where t2.status_code = "stuck" and services_and_channels_details = "bad"
|
Find all the details of the customers who have been involved in an interaction with status `` Stuck '' and service and channel detail `` bad '' .
|
government_shift
|
SELECT t1.customer_details FROM customers AS t1 JOIN customer_interactions AS t2 ON t1.customer_id = t2.customer_id WHERE t2.status_code = "Stuck" AND services_and_channels_details = "bad"
|
Which customers have experienced status "Stuck" and service and channel detail "bad" in an interaction? Give me the customer details.
|
government_shift
|
SELECT count(*) FROM integration_platform WHERE integration_platform_details = "Success"
|
How many integration platforms are successful?
|
government_shift
|
SELECT count(*) FROM integration_platform WHERE integration_platform_details = "Success"
|
Count the number of integration platforms that have "Success" in the details.
|
government_shift
|
select distinct t1.customer_details from customers as t1 join customer_interactions as t2 on t1.customer_id = t2.customer_id join integration_platform as t3 where t3.integration_platform_details = "fail"
|
List the details of all the customers who are associated with a failed integration platform .
|
government_shift
|
SELECT DISTINCT t1.customer_details FROM customers AS t1 JOIN customer_interactions AS t2 ON t1.customer_id = t2.customer_id JOIN integration_platform AS t3 WHERE t3.integration_platform_details = "Fail"
|
Which customers have integration platform details "Fail" in interactions? Give me the customer details.
|
government_shift
|
select service_details from services except select t2.service_details from customers_and_services as t1 join services as t2 on t1.service_id = t2.service_id
|
Which service ( s ) has never been used by any customer ? List their details .
|
government_shift
|
select service_details from services except select t2.service_details from customers_and_services as t1 join services as t2 on t1.service_id = t2.service_id
|
Find details of the services that no customer has ever used . Return the service details .
|
government_shift
|
SELECT analytical_layer_type_code , count(*) FROM analytical_layer GROUP BY analytical_layer_type_code
|
Find all the layer type codes with their corresponding usage count.
|
government_shift
|
SELECT analytical_layer_type_code , count(*) FROM analytical_layer GROUP BY analytical_layer_type_code
|
For each analytical layer, return the analytical layer type code and the number of times it was used.
|
government_shift
|
select distinct t1.service_details from services as t1 join customers_and_services as t2 on t1.service_id = t2.service_id where t2.customers_and_services_details = "unsatisfied"
|
Find details of all the services that have been marked as `` unsatisfied '' in customers and services details .
|
government_shift
|
SELECT DISTINCT t1.service_details FROM services AS t1 JOIN customers_and_services AS t2 ON t1.service_id = t2.service_id WHERE t2.customers_and_services_details = "Unsatisfied"
|
Which services have been rated as "unsatisfied" in customers and services details? Give me the service_details.
|
vehicle_rent
|
SELECT count(*) FROM vehicles
|
How many vehicles do we have?
|
vehicle_rent
|
SELECT count(*) FROM vehicles
|
Count the number of vehicles.
|
vehicle_rent
|
SELECT name FROM vehicles ORDER BY model_year DESC
|
Show names for all vehicles in descending order of model year.
|
vehicle_rent
|
SELECT name FROM vehicles ORDER BY model_year DESC
|
What are the names of all vehicles, ordered by model year descending?
|
vehicle_rent
|
SELECT DISTINCT type_of_powertrain FROM vehicles
|
List all distinct types of powertrain of vehicles.
|
Subsets and Splits
World Countries Non-English Languages
The query filters specific database entries based on a particular query pattern, providing limited insight as it simply retrieves rows that match a specific condition.