minktn/spider-data huggingface dataset:
Database: online_exams
Question: Which students have 2 or more answer records? Give me their first names.
SQL: SELECT T2.First_Name FROM Student_Answers AS T1 JOIN Students AS T2 ON T1.Student_ID  =  T2.Student_ID GROUP BY T1.Student_ID HAVING COUNT(*)  >=  2
Database: online_exams
Question: What is the most common valid answer text?
SQL: SELECT Valid_Answer_Text FROM Valid_Answers GROUP BY Valid_Answer_Text ORDER BY COUNT(*) DESC LIMIT 1
Database: online_exams
Question: Find the valid answer text that appeared most frequently.
SQL: SELECT Valid_Answer_Text FROM Valid_Answers GROUP BY Valid_Answer_Text ORDER BY COUNT(*) DESC LIMIT 1
Database: online_exams
Question: List the last names of the students whose gender is not "M".
SQL: SELECT Last_Name FROM Students WHERE Gender_MFU != "M"
Database: online_exams
Question: What are the last names of the students with gender other than "M"?
SQL: SELECT Last_Name FROM Students WHERE Gender_MFU != "M"
Database: online_exams
Question: List each gender and the corresponding number of students.
SQL: SELECT Gender_MFU ,  COUNT(*) FROM Students GROUP BY Gender_MFU
Database: online_exams
Question: For each gender, return the gender code and the number of students who identify as that gender.
SQL: SELECT Gender_MFU ,  COUNT(*) FROM Students GROUP BY Gender_MFU
Database: online_exams
Question: List the last names of the students whose gender is "F" or "M".
SQL: SELECT Last_Name FROM Students WHERE Gender_MFU  =  "F" OR Gender_MFU  =  "M"
Database: online_exams
Question: Which students identify their gender as "F" or "M"? Give me their last names.
SQL: SELECT Last_Name FROM Students WHERE Gender_MFU  =  "F" OR Gender_MFU  =  "M"
Database: online_exams
Question: List the first names of the students who do not have any answers.
SQL: SELECT First_Name FROM Students WHERE Student_ID NOT IN (SELECT Student_ID FROM Student_Answers)
Database: online_exams
Question: Which students do not have any answers? Find their first names.
SQL: SELECT First_Name FROM Students WHERE Student_ID NOT IN (SELECT Student_ID FROM Student_Answers)
Database: online_exams
Question: Show the student answer texts that received both "Normal" and "Absent" as comments.
SQL: SELECT Student_Answer_Text FROM Student_Answers WHERE Comments  =  "Normal" INTERSECT SELECT Student_Answer_Text FROM Student_Answers WHERE Comments  =  "Absent"
Database: online_exams
Question: Which student answer texts were given both "Normal" and "Absent" as comments?
SQL: SELECT Student_Answer_Text FROM Student_Answers WHERE Comments  =  "Normal" INTERSECT SELECT Student_Answer_Text FROM Student_Answers WHERE Comments  =  "Absent"
Database: online_exams
Question: Show the types of questions that have at least three questions.
SQL: SELECT Type_of_Question_Code FROM Questions GROUP BY Type_of_Question_Code HAVING count(*)  >=  3
Database: online_exams
Question: Which types of questions have 3 or more questions? Return the questions type code.
SQL: SELECT Type_of_Question_Code FROM Questions GROUP BY Type_of_Question_Code HAVING count(*)  >=  3
Database: online_exams
Question: Show all information on students.
SQL: SELECT * FROM Students
Database: online_exams
Question: What is al the available information of each student?
SQL: SELECT * FROM Students
Database: customers_and_orders
Question: How many addresses do we have?
SQL: SELECT count(*) FROM Addresses
Database: customers_and_orders
Question: Count the number of addresses.
SQL: SELECT count(*) FROM Addresses
Database: customers_and_orders
Question: List all address ids and address details.
SQL: SELECT address_id ,  address_details FROM Addresses
Database: customers_and_orders
Question: What are all the address ids and address details?
SQL: SELECT address_id ,  address_details FROM Addresses
Database: customers_and_orders
Question: How many products do we have?
SQL: SELECT count(*) FROM Products
Database: customers_and_orders
Question: Count the number of products.
SQL: SELECT count(*) FROM Products
Database: customers_and_orders
Question: Show all product ids, product type codes, and product name.
SQL: SELECT product_id ,  product_type_code ,  product_name FROM Products
Database: customers_and_orders
Question: What are the ids, type codes, and names for all products?
SQL: SELECT product_id ,  product_type_code ,  product_name FROM Products
Database: customers_and_orders
Question: What is the price for the product with name Monitor?
SQL: SELECT product_price FROM Products WHERE product_name  =  "Monitor"
Database: customers_and_orders
Question: Give the price of the Monitor product.
SQL: SELECT product_price FROM Products WHERE product_name  =  "Monitor"
Database: customers_and_orders
Question: Show the minimum, average, maximum price for all products.
SQL: SELECT min(product_price) ,  avg(product_price) ,  max(product_price) FROM Products
Database: customers_and_orders
Question: What are the minimum, average, and maximum prices across all products?
SQL: SELECT min(product_price) ,  avg(product_price) ,  max(product_price) FROM Products
Database: customers_and_orders
Question: What is the average price for products with type Clothes?
SQL: SELECT avg(product_price) FROM Products WHERE product_type_code  =  "Clothes"
Database: customers_and_orders
Question: Return the average price of Clothes.
SQL: SELECT avg(product_price) FROM Products WHERE product_type_code  =  "Clothes"
Database: customers_and_orders
Question: How many hardware type products do we have?
SQL: SELECT count(*) FROM Products WHERE product_type_code  =  "Hardware"
Database: customers_and_orders
Question: Count the number of products of the type Hardware.
SQL: SELECT count(*) FROM Products WHERE product_type_code  =  "Hardware"
Database: customers_and_orders
Question: Show all product names with price higher than the average.
SQL: SELECT product_name FROM Products WHERE product_price  >  (SELECT avg(product_price) FROM Products)
Database: customers_and_orders
Question: What are the names of products that have a price above the average for all products.
SQL: SELECT product_name FROM Products WHERE product_price  >  (SELECT avg(product_price) FROM Products)
Database: customers_and_orders
Question: Show all hardware product names with price higher than the average price of hardware type products.
SQL: SELECT product_name FROM Products WHERE product_type_code  =  "Hardware" AND product_price  >  (SELECT avg(product_price) FROM Products WHERE product_type_code  =  "Hardware")
Database: customers_and_orders
Question: What are the names of Hardware product with prices above the average price of Hardware products.
SQL: SELECT product_name FROM Products WHERE product_type_code  =  "Hardware" AND product_price  >  (SELECT avg(product_price) FROM Products WHERE product_type_code  =  "Hardware")
Database: customers_and_orders
Question: What is the name of the most expensive product with type Clothes?
SQL: SELECT product_name FROM Products WHERE product_type_code  =  "Clothes" ORDER BY product_price DESC LIMIT 1
Database: customers_and_orders
Question: Give the name of the most expensive Clothes product.
SQL: SELECT product_name FROM Products WHERE product_type_code  =  "Clothes" ORDER BY product_price DESC LIMIT 1
Database: customers_and_orders
Question: What is the product id and product name for the cheapest Hardware type product?
SQL: SELECT product_id ,  product_name FROM Products WHERE product_type_code  =  "Hardware" ORDER BY product_price ASC LIMIT 1
Database: customers_and_orders
Question: Give the id and name of the cheapest Hardware product.
SQL: SELECT product_id ,  product_name FROM Products WHERE product_type_code  =  "Hardware" ORDER BY product_price ASC LIMIT 1
Database: customers_and_orders
Question: List all product names in descending order of price.
SQL: SELECT product_name FROM Products ORDER BY product_price DESC
Database: customers_and_orders
Question: What are the names of the products, sorted by descending price?
SQL: SELECT product_name FROM Products ORDER BY product_price DESC
Database: customers_and_orders
Question: Show all hardware type products in ascending order of price.
SQL: SELECT product_name FROM Products WHERE product_type_code  =  "Hardware" ORDER BY product_price ASC
Database: customers_and_orders
Question: What are the names of all Hardware products, sorted by price ascending?
SQL: SELECT product_name FROM Products WHERE product_type_code  =  "Hardware" ORDER BY product_price ASC
Database: customers_and_orders
Question: List all product type codes and the number of products in each type.
SQL: SELECT product_type_code ,  count(*) FROM Products GROUP BY product_type_code
Database: customers_and_orders
Question: How many products are there for each product type?
SQL: SELECT product_type_code ,  count(*) FROM Products GROUP BY product_type_code
Database: customers_and_orders
Question: Show all product type codes and the average price for each type.
SQL: SELECT product_type_code ,  avg(product_price) FROM Products GROUP BY product_type_code
Database: customers_and_orders
Question: What is the average price of products for each product type?
SQL: SELECT product_type_code ,  avg(product_price) FROM Products GROUP BY product_type_code
Database: customers_and_orders
Question: What are the product type code with at least two products?
SQL: SELECT product_type_code FROM Products GROUP BY product_type_code HAVING count(*)  >=  2
Database: customers_and_orders
Question: Give the product type codes of product types that have two or more products.
SQL: SELECT product_type_code FROM Products GROUP BY product_type_code HAVING count(*)  >=  2
Database: customers_and_orders
Question: What is the product type code with most number of products?
SQL: SELECT product_type_code FROM Products GROUP BY product_type_code ORDER BY count(*) DESC LIMIT 1
Database: customers_and_orders
Question: What is the most frequent product type code?
SQL: SELECT product_type_code FROM Products GROUP BY product_type_code ORDER BY count(*) DESC LIMIT 1
Database: customers_and_orders
Question: How many customers do we have?
SQL: SELECT count(*) FROM Customers
Database: customers_and_orders
Question: Count the number of customers.
SQL: SELECT count(*) FROM Customers
Database: customers_and_orders
Question: Show all customer ids and customer names.
SQL: SELECT customer_id ,  customer_name FROM Customers
Database: customers_and_orders
Question: What are the ids and names of all customers?
SQL: SELECT customer_id ,  customer_name FROM Customers
Database: customers_and_orders
Question: What is the customer address, customer phone, and customer email for Jeromy?
SQL: SELECT customer_address ,  customer_phone ,  customer_email FROM Customers WHERE customer_name  =  "Jeromy"
Database: customers_and_orders
Question: Give the address, phone, and email for customers with the name Jeromy.
SQL: SELECT customer_address ,  customer_phone ,  customer_email FROM Customers WHERE customer_name  =  "Jeromy"
Database: customers_and_orders
Question: Show all payment method codes and the number of customers in each code.
SQL: SELECT payment_method_code ,  count(*) FROM Customers GROUP BY payment_method_code
Database: customers_and_orders
Question: How many customers use each payment method?
SQL: SELECT payment_method_code ,  count(*) FROM Customers GROUP BY payment_method_code
Database: customers_and_orders
Question: What is the payment method code used by most number of customers?
SQL: SELECT payment_method_code FROM Customers GROUP BY payment_method_code ORDER BY count(*) DESC LIMIT 1
Database: customers_and_orders
Question: Give the code of the payment method that is most commonly used.
SQL: SELECT payment_method_code FROM Customers GROUP BY payment_method_code ORDER BY count(*) DESC LIMIT 1
Database: customers_and_orders
Question: Show all customer names with the  payment method code used by least number of customers.
SQL: SELECT customer_name FROM Customers WHERE payment_method_code  =  ( SELECT payment_method_code FROM Customers GROUP BY payment_method_code ORDER BY count(*) ASC LIMIT 1)
Database: customers_and_orders
Question: What are the names of customers who use the least common payment method?
SQL: SELECT customer_name FROM Customers WHERE payment_method_code  =  ( SELECT payment_method_code FROM Customers GROUP BY payment_method_code ORDER BY count(*) ASC LIMIT 1)
Database: customers_and_orders
Question: What is the payment method and customer number for customer named Jeromy?
SQL: SELECT payment_method_code ,  customer_number FROM Customers WHERE customer_name  =  "Jeromy"
Database: customers_and_orders
Question: Give the payment method code and customer number corresponding to the customer named Jeromy.
SQL: SELECT payment_method_code ,  customer_number FROM Customers WHERE customer_name  =  "Jeromy"
Database: customers_and_orders
Question: What are the distinct payment methods used by customers?
SQL: SELECT DISTINCT payment_method_code FROM Customers
Database: customers_and_orders
Question: Give the different payment method codes that customers use.
SQL: SELECT DISTINCT payment_method_code FROM Customers
Database: customers_and_orders
Question: Show the id and the product type for all products, order by product name.
SQL: SELECT product_id ,  product_type_code FROM Products ORDER BY product_name
Database: customers_and_orders
Question: What are the ids and product types for all products, sorted alphabetically by product name?
SQL: SELECT product_id ,  product_type_code FROM Products ORDER BY product_name
Database: customers_and_orders
Question: What is the product type with least number of products?
SQL: SELECT product_type_code FROM Products GROUP BY product_type_code ORDER BY count(*) ASC LIMIT 1
Database: customers_and_orders
Question: What is the code of the product type that is least common?
SQL: SELECT product_type_code FROM Products GROUP BY product_type_code ORDER BY count(*) ASC LIMIT 1
Database: customers_and_orders
Question: How many customer orders do we have?
SQL: SELECT count(*) FROM Customer_orders
Database: customers_and_orders
Question: Count the number of customer orders.
SQL: SELECT count(*) FROM Customer_orders
Database: customers_and_orders
Question: Show the order ids, order dates, and order status codes for all orders by customer Jeromy.
SQL: SELECT order_id ,  order_date ,  order_status_code FROM Customer_orders AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.customer_name  =  "Jeromy"
Database: customers_and_orders
Question: What were the ids, dates, and status codes for orders made by Jeromy?
SQL: SELECT order_id ,  order_date ,  order_status_code FROM Customer_orders AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.customer_name  =  "Jeromy"
Database: customers_and_orders
Question: Show all customer names, ids and the number of orders by each customer.
SQL: SELECT T2.customer_name ,  T1.customer_id ,  count(*) FROM Customer_orders AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id
Database: customers_and_orders
Question: What are the names, ids, and number of orders made for each customer?
SQL: SELECT T2.customer_name ,  T1.customer_id ,  count(*) FROM Customer_orders AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id
Database: customers_and_orders
Question: What is the customer id, name, phone, and email for the customer with most orders?
SQL: SELECT T1.customer_id ,  T2.customer_name ,  T2.customer_phone ,  T2.customer_email FROM Customer_orders AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1
Database: customers_and_orders
Question: Give the id, name, phone, and email corresponding to the customer who made the most orders.
SQL: SELECT T1.customer_id ,  T2.customer_name ,  T2.customer_phone ,  T2.customer_email FROM Customer_orders AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1
Database: customers_and_orders
Question: Show all order status and the number of orders in each status.
SQL: SELECT order_status_code ,  count(*) FROM Customer_orders GROUP BY order_status_code
Database: customers_and_orders
Question: How many orders have each order status code?
SQL: SELECT order_status_code ,  count(*) FROM Customer_orders GROUP BY order_status_code
Database: customers_and_orders
Question: What is the order status code that is most common?
SQL: SELECT order_status_code FROM Customer_orders GROUP BY order_status_code ORDER BY count(*) DESC LIMIT 1
Database: customers_and_orders
Question: Give the order status code that is most frequent across customer orders.
SQL: SELECT order_status_code FROM Customer_orders GROUP BY order_status_code ORDER BY count(*) DESC LIMIT 1
Database: customers_and_orders
Question: How many customers do not have an order?
SQL: SELECT count(*) FROM Customers WHERE customer_id NOT IN  ( SELECT customer_id FROM Customer_orders)
Database: customers_and_orders
Question: Count the number of customers who have not made an order.
SQL: SELECT count(*) FROM Customers WHERE customer_id NOT IN  ( SELECT customer_id FROM Customer_orders)
Database: customers_and_orders
Question: Show all product names without an order.
SQL: 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
Database: customers_and_orders
Question: What are the names of products that have not been ordered?
SQL: 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
Database: customers_and_orders
Question: How many products named Monitor have been ordered?
SQL: 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"
Database: customers_and_orders
Question: What is the total number of Monitor products that have been ordered?
SQL: 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"
Database: customers_and_orders
Question: How many customers have ordered the product named Monitor?
SQL: 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"
Database: customers_and_orders
Question: Count the number of different customers who have bought a Monitor Product.
SQL: 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"
Database: customers_and_orders
Question: How many customers have an order?
SQL: SELECT count(DISTINCT customer_id) FROM Customer_orders
Database: customers_and_orders
Question: Count the number of differnt customers who have made an order.
SQL: SELECT count(DISTINCT customer_id) FROM Customer_orders
Database: customers_and_orders
Question: Show all customer ids without an order.
SQL: SELECT customer_id FROM Customers EXCEPT SELECT customer_id FROM Customer_orders
Database: customers_and_orders
Question: What are the ids of customers who have not made an order?
SQL: SELECT customer_id FROM Customers EXCEPT SELECT customer_id FROM Customer_orders
Database: customers_and_orders
Question: Show all the order dates and ids of the orders with quantity of any product larger than 6 or with more than 3 products.
SQL: 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;
Database: customers_and_orders
Question: What are the order ids and corresponding order dates for orders with a quantity greater than 6 or consisting of more than 3 products?
SQL: 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;
Database: region_building
Question: How many buildings are there?
SQL: SELECT count(*) FROM building
Database: region_building
Question: Count the number of buildings.
SQL: SELECT count(*) FROM building
Database: region_building
Question: List the names of buildings in ascending order of number of stories.
SQL: SELECT Name FROM building ORDER BY Number_of_Stories ASC
Database: region_building
Question: What is the list of building names, sorted by the number of stories of each building in ascending order?
SQL: SELECT Name FROM building ORDER BY Number_of_Stories ASC
Database: region_building
Question: List the addresses of buildings in descending order of building completion year.
SQL: SELECT Address FROM building ORDER BY Completed_Year DESC
Database: region_building
Question: Sort the buildings in descending order of building completion year, and return the building addresses.
SQL: SELECT Address FROM building ORDER BY Completed_Year DESC
Database: region_building
Question: What is the maximum number of stories of buildings not completed in 1980?
SQL: SELECT max(Number_of_Stories) FROM building WHERE Completed_Year != "1980"
Database: region_building
Question: Among the buildings not completed in 1980, what is the maximum number of stories?
SQL: SELECT max(Number_of_Stories) FROM building WHERE Completed_Year != "1980"
Database: region_building
Question: What is the average population for all regions?
SQL: SELECT avg(Population) FROM region
Database: region_building
Question: Compute the average population of a region.
SQL: SELECT avg(Population) FROM region
Database: region_building
Question: What are the names of regions in ascending alphabetical order?
SQL: SELECT Name FROM region ORDER BY Name ASC
Database: region_building
Question: List the names of regions in alphabetical order.
SQL: SELECT Name FROM region ORDER BY Name ASC
Database: region_building
Question: What are the capitals of the regions with area bigger than 10000?
SQL: SELECT Capital FROM region WHERE Area  >  10000
Database: region_building
Question: Give me the capitals of the regions whose area is larger than 10000.
SQL: SELECT Capital FROM region WHERE Area  >  10000
Database: region_building
Question: List the capital of the region with the largest population.
SQL: SELECT Capital FROM region ORDER BY Population DESC LIMIT 1
Database: region_building
Question: Which region has the largest population? Give me the capital of the region.
SQL: SELECT Capital FROM region ORDER BY Population DESC LIMIT 1
Database: region_building
Question: List the names of the regions with the top 5 largest areas.
SQL: SELECT Name FROM region ORDER BY Area DESC LIMIT 5
Database: region_building
Question: What are the names of the 5 largest regions in terms of area?
SQL: SELECT Name FROM region ORDER BY Area DESC LIMIT 5
Database: region_building
Question: Show the names of buildings and the names of regions they are in.
SQL: SELECT T1.Name ,  T2.Name FROM building AS T1 JOIN region AS T2 ON T1.Region_ID  =  T2.Region_ID
Database: region_building
Question: For each building, return the name of the building and the name of the region it belongs to.
SQL: SELECT T1.Name ,  T2.Name FROM building AS T1 JOIN region AS T2 ON T1.Region_ID  =  T2.Region_ID
Database: region_building
Question: Show the names of regions that have more than one building.
SQL: 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
Database: region_building
Question: Which regions have more than one building? Give me the names of the regions.
SQL: 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
Database: region_building
Question: Show the capital of the region that has the most buildings.
SQL: 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
Database: region_building
Question: Which region has the largest number of buildings? Show me the capital of the region.
SQL: 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
Database: region_building
Question: Show addresses of buildings and the capitals of regions they are in.
SQL: SELECT T1.Address ,  T2.Capital FROM building AS T1 JOIN region AS T2 ON T1.Region_ID  =  T2.Region_ID
Database: region_building
Question: For each building, return the address of the building and the name of the region it belongs to.
SQL: SELECT T1.Address ,  T2.Capital FROM building AS T1 JOIN region AS T2 ON T1.Region_ID  =  T2.Region_ID
Database: region_building
Question: Show the number of stories of buildings in the region with name "Abruzzo".
SQL: SELECT T1.Number_of_Stories FROM building AS T1 JOIN region AS T2 ON T1.Region_ID  =  T2.Region_ID WHERE T2.Name  =  "Abruzzo"
Database: region_building
Question: Return the number of stories for each building in the region named "Abruzzo".
SQL: SELECT T1.Number_of_Stories FROM building AS T1 JOIN region AS T2 ON T1.Region_ID  =  T2.Region_ID WHERE T2.Name  =  "Abruzzo"
Database: region_building
Question: Please show each completion year and the number of buildings completed in that year.
SQL: SELECT Completed_Year ,  COUNT(*) FROM building GROUP BY Completed_Year
Database: region_building
Question: For completion year, return the year and the number of buildings completed.
SQL: SELECT Completed_Year ,  COUNT(*) FROM building GROUP BY Completed_Year
Database: region_building
Question: List the year in which the most buildings are completed.
SQL: SELECT Completed_Year FROM building GROUP BY Completed_Year ORDER BY COUNT(*) DESC LIMIT 1
Database: region_building
Question: In which year did the most building constructions complete?
SQL: SELECT Completed_Year FROM building GROUP BY Completed_Year ORDER BY COUNT(*) DESC LIMIT 1
Database: region_building
Question: List the names of regions that do not have any buildings.
SQL: SELECT Name FROM region WHERE Region_ID NOT IN (SELECT Region_ID FROM building)
Database: region_building
Question: What are the names of regions in which there are no buildings?
SQL: SELECT Name FROM region WHERE Region_ID NOT IN (SELECT Region_ID FROM building)
Database: region_building
Question: Show the completed years shared by buildings with more than 20 stories and buildings with less than 15 stories.
SQL: SELECT Completed_Year FROM building WHERE Number_of_Stories  >  20 INTERSECT SELECT Completed_Year FROM building WHERE Number_of_Stories  <  15
Database: region_building
Question: In which years did both buildings with more than 20 stories and buildings with less than 15 stories were completed?
SQL: SELECT Completed_Year FROM building WHERE Number_of_Stories  >  20 INTERSECT SELECT Completed_Year FROM building WHERE Number_of_Stories  <  15
Database: region_building
Question: Show the distinct addresses of buildings.
SQL: SELECT DISTINCT Address FROM building
Database: region_building
Question: Give me a list of distinct building addresses.
SQL: SELECT DISTINCT Address FROM building
Database: region_building
Question: Show the completed years of buildings in descending order of the number of stories.
SQL: SELECT Completed_Year FROM building ORDER BY Number_of_Stories DESC
Database: region_building
Question: Sort buildings in descending order of the number of stories, and return their completion years.
SQL: SELECT Completed_Year FROM building ORDER BY Number_of_Stories DESC
Database: government_shift
Question: List details of all the channel in alphabetical order .
SQL: select channel_details from channels order by channel_details
Database: government_shift
Question: What is the list of channel details ordered alphabetically ?
SQL: select channel_details from channels order by channel_details
Database: government_shift
Question: How many services are there?
SQL: SELECT count(*) FROM services
Database: government_shift
Question: Count the number of services.
SQL: SELECT count(*) FROM services
Database: government_shift
Question: What is the most common analytical layer type code?
SQL: SELECT analytical_layer_type_code FROM analytical_layer GROUP BY analytical_layer_type_code ORDER BY count(*) DESC LIMIT 1
Database: government_shift
Question: Find the analytical layer type code that appears most often.
SQL: SELECT analytical_layer_type_code FROM analytical_layer GROUP BY analytical_layer_type_code ORDER BY count(*) DESC LIMIT 1
Database: government_shift
Question: Find all the services that has been used by the customer with details "Hardy Kutch".
SQL: 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"
Database: government_shift
Question: Which services were used by the customer with details "Hardy Kutch"? Give me the service details.
SQL: 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"
Database: government_shift
Question: Find the details of the services that have been used by more than 3 times .
SQL: 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
Database: government_shift
Question: Which services were used by customers by more than 3 times? Give me the service details.
SQL: 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
Database: government_shift
Question: Find the details of the customer who has used services the most times.
SQL: 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
Database: government_shift
Question: return the details of the customer with largest count of used services.
SQL: 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
Database: government_shift
Question: Find the name of the customer who has used the most types of services .
SQL: 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
Database: government_shift
Question: Which customer has used the most types of services ? Give me the customer details .
SQL: 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
Database: government_shift
Question: Find the details of the customer who has never used any services .
SQL: select customer_details from customers where customer_id not in (select customer_id from customers_and_services)
Database: government_shift
Question: Which customers never used any services ? Give me the customer details .
SQL: select customer_details from customers where customer_id not in (select customer_id from customers_and_services)
Database: government_shift
Question: Find the details of the customers who have used the least-used service .
SQL: 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)
Database: government_shift
Question: Which customers used the least commonly-used service ? Give me the distinct customer details .
SQL: 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)
Database: government_shift
Question: How many distinct customer and services details are there?
SQL: SELECT count(DISTINCT customers_and_services_details) FROM customers_and_services
Database: government_shift
Question: Count the total number of available customers and services details.
SQL: SELECT count(DISTINCT customers_and_services_details) FROM customers_and_services
Database: government_shift
Question: Find all the customers whose name contains "Kutch".
SQL: SELECT customer_details FROM customers WHERE customer_details LIKE "%Kutch%"
Database: government_shift
Question: What are the details of the customers who have "Kutch" in part of their details?
SQL: SELECT customer_details FROM customers WHERE customer_details LIKE "%Kutch%"
Database: government_shift
Question: 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.
SQL: 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"
Database: government_shift
Question: Which services are used by the customer "Hardy Kutch" or are rated as "good" in a customer interaction? Give me the service details.
SQL: 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"
Database: government_shift
Question: 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.
SQL: 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"
Database: government_shift
Question: Which services are both used by the customer "Hardy Kutch" and are rated as "bad" in a customer interaction? Give me the service details.
SQL: 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"
Database: government_shift
Question: Find details of all the services that have interacted with `` 15 ij '' for the the channel details.
SQL: 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"
Database: government_shift
Question: Give me the details of all the services that have interacted with the channel with detail "15 ij".
SQL: 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"
Database: government_shift
Question: Find all the details of the customers who have been involved in an interaction with status `` Stuck '' and service and channel detail `` bad '' .
SQL: 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"
Database: government_shift
Question: Which customers have experienced status "Stuck" and service and channel detail "bad" in  an interaction? Give me the customer details.
SQL: 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"
Database: government_shift
Question: How many integration platforms are successful?
SQL: SELECT count(*) FROM integration_platform WHERE integration_platform_details  =  "Success"
Database: government_shift
Question: Count the number of integration platforms that have "Success" in the details.
SQL: SELECT count(*) FROM integration_platform WHERE integration_platform_details  =  "Success"
Database: government_shift
Question: List the details of all the customers who are associated with a failed integration platform .
SQL: 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"
Database: government_shift
Question: Which customers have integration platform details "Fail" in interactions? Give me the customer details.
SQL: 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"
Database: government_shift
Question: Which service ( s ) has never been used by any customer ? List their details .
SQL: 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
Database: government_shift
Question: Find details of the services that no customer has ever used . Return the service details .
SQL: 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
Database: government_shift
Question: Find all the layer type codes with their corresponding usage count.
SQL: SELECT analytical_layer_type_code ,  count(*) FROM analytical_layer GROUP BY analytical_layer_type_code
Database: government_shift
Question: For each analytical layer, return the analytical layer type code and the number of times it was used.
SQL: SELECT analytical_layer_type_code ,  count(*) FROM analytical_layer GROUP BY analytical_layer_type_code
Database: government_shift
Question: Find details of all the services that have been marked as `` unsatisfied '' in customers and services details .
SQL: 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"
Database: government_shift
Question: Which services have been rated as "unsatisfied" in customers and services details? Give me the service_details.
SQL: 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"
Database: vehicle_rent
Question: How many vehicles do we have?
SQL: SELECT count(*) FROM vehicles
Database: vehicle_rent
Question: Count the number of vehicles.
SQL: SELECT count(*) FROM vehicles
Database: vehicle_rent
Question: Show names for all vehicles in descending order of model year.
SQL: SELECT name FROM vehicles ORDER BY model_year DESC
Database: vehicle_rent
Question: What are the names of all vehicles, ordered by model year descending?
SQL: SELECT name FROM vehicles ORDER BY model_year DESC
Database: vehicle_rent
Question: List all distinct types of powertrain of vehicles.
SQL: SELECT DISTINCT type_of_powertrain FROM vehicles
Database: vehicle_rent
Question: What are the different types of powertrains?
SQL: SELECT DISTINCT type_of_powertrain FROM vehicles
Database: vehicle_rent
Question: Show name, type of powertrain, and annual fuel cost for all vehicles with model year 2013 or 2014.
SQL: SELECT name ,  type_of_powertrain ,  annual_fuel_cost FROM vehicles WHERE model_year  =  2013 OR model_year  =  2014
Database: vehicle_rent
Question: What are the names, types of powertrains, and yearly fuel costs for vehicles with model years in either 2013 2014?
SQL: SELECT name ,  type_of_powertrain ,  annual_fuel_cost FROM vehicles WHERE model_year  =  2013 OR model_year  =  2014
Database: vehicle_rent
Question: Show types of powertrain with vehicles both from 2014 and 2013.
SQL: SELECT type_of_powertrain FROM vehicles WHERE model_year  =  2014 INTERSECT SELECT type_of_powertrain FROM vehicles WHERE model_year  =  2013
Database: vehicle_rent
Question: What are the types of powertrains that have vehicles that were made in both 2013 and 2014?
SQL: SELECT type_of_powertrain FROM vehicles WHERE model_year  =  2014 INTERSECT SELECT type_of_powertrain FROM vehicles WHERE model_year  =  2013
Database: vehicle_rent
Question: Show all types of powertrain and the number of vehicles in each type.
SQL: SELECT type_of_powertrain ,  count(*) FROM vehicles GROUP BY type_of_powertrain
Database: vehicle_rent
Question: How many vehicles have each type of powertrain?
SQL: SELECT type_of_powertrain ,  count(*) FROM vehicles GROUP BY type_of_powertrain
Database: vehicle_rent
Question: What is the type of powertrain with most number of vehicles.
SQL: SELECT type_of_powertrain FROM vehicles GROUP BY type_of_powertrain ORDER BY count(*) DESC LIMIT 1
Database: vehicle_rent
Question: Which type of powertrain is most common?
SQL: SELECT type_of_powertrain FROM vehicles GROUP BY type_of_powertrain ORDER BY count(*) DESC LIMIT 1
Database: vehicle_rent
Question: Show minimum, maximum, and average annual fuel cost for all vehicles.
SQL: SELECT min(annual_fuel_cost) ,  max(annual_fuel_cost) ,  avg(annual_fuel_cost) FROM vehicles
Database: vehicle_rent
Question: What are the minimum, maximum, and average annual fuel costs across all vehicles?
SQL: SELECT min(annual_fuel_cost) ,  max(annual_fuel_cost) ,  avg(annual_fuel_cost) FROM vehicles
Database: vehicle_rent
Question: Show name and model year for vehicles with city fuel economy rate less than or equal to highway fuel economy rate.
SQL: SELECT name ,  model_year FROM vehicles WHERE city_fuel_economy_rate  <=  highway_fuel_economy_rate
Database: vehicle_rent
Question: What are the names and model years for vehicles that have a city fuel economy rate less than or equal to its highway fuel economy rate?
SQL: SELECT name ,  model_year FROM vehicles WHERE city_fuel_economy_rate  <=  highway_fuel_economy_rate
Database: vehicle_rent
Question: Show the type of powertrain with at least two vehicles, and the average annual fuel cost for vehicles in each such type.
SQL: SELECT type_of_powertrain ,  avg(annual_fuel_cost) FROM vehicles GROUP BY type_of_powertrain HAVING count(*)  >=  2
Database: vehicle_rent
Question: What are the types of powertrains for which there are two or more vehicles, and what are their average annual fuel costs?
SQL: SELECT type_of_powertrain ,  avg(annual_fuel_cost) FROM vehicles GROUP BY type_of_powertrain HAVING count(*)  >=  2
Database: vehicle_rent
Question: Show the name, age, membership credit for all customers?
SQL: SELECT name ,  age ,  membership_credit FROM customers
Database: vehicle_rent
Question: What are the names, ages, and membership credits for all customers?
SQL: SELECT name ,  age ,  membership_credit FROM customers
Database: vehicle_rent
Question: Show the name and age of the customer with maximum membership credit.
SQL: SELECT name ,  age FROM customers ORDER BY membership_credit DESC LIMIT 1
Database: vehicle_rent
Question: What is the name and age of the customer with the most membership credit?
SQL: SELECT name ,  age FROM customers ORDER BY membership_credit DESC LIMIT 1
Database: vehicle_rent
Question: What is the average age for customers with a membership credit above the average?
SQL: SELECT avg(age) FROM customers WHERE membership_credit  >  (SELECT avg(membership_credit) FROM customers)
Database: vehicle_rent
Question: Return the average age for customers who have membership above the average across all customers.
SQL: SELECT avg(age) FROM customers WHERE membership_credit  >  (SELECT avg(membership_credit) FROM customers)
Database: vehicle_rent
Question: Show all information for all discounts.
SQL: SELECT * FROM discount
Database: vehicle_rent
Question: Return all information about discounts.
SQL: SELECT * FROM discount
Database: vehicle_rent
Question: Show the name and total hours of renting for each vehicle.
SQL: SELECT T2.name ,  sum(T1.total_hours) FROM renting_history AS T1 JOIN vehicles AS T2 ON T1.vehicles_id  =  T2.id GROUP BY T2.id
Database: vehicle_rent
Question: What are the names and total rental hours for each vehicle?
SQL: SELECT T2.name ,  sum(T1.total_hours) FROM renting_history AS T1 JOIN vehicles AS T2 ON T1.vehicles_id  =  T2.id GROUP BY T2.id
Database: vehicle_rent
Question: Show the name of vehicles with no renting history.
SQL: SELECT name FROM vehicles WHERE id NOT IN (SELECT vehicles_id FROM renting_history)
Database: vehicle_rent
Question: What are the names of vehicles that have never been rented?
SQL: SELECT name FROM vehicles WHERE id NOT IN (SELECT vehicles_id FROM renting_history)
Database: vehicle_rent
Question: Show the name of customer with at least two renting history records.
SQL: SELECT T2.name FROM renting_history AS T1 JOIN customers AS T2 ON T1.customer_id  =  T2.id GROUP BY T2.id HAVING count(*)  >=  2
Database: vehicle_rent
Question: What are the names of customers who have two or more records of rental history?
SQL: SELECT T2.name FROM renting_history AS T1 JOIN customers AS T2 ON T1.customer_id  =  T2.id GROUP BY T2.id HAVING count(*)  >=  2
Database: vehicle_rent
Question: Show the name and model year of the vehicle with most number of renting history records.
SQL: SELECT T2.name ,  T2.model_year FROM renting_history AS T1 JOIN vehicles AS T2 ON T1.vehicles_id  =  T2.id GROUP BY T2.id ORDER BY count(*) DESC LIMIT 1
Database: vehicle_rent
Question: What is the name and model year of the vehicle which has been rented the most times?
SQL: SELECT T2.name ,  T2.model_year FROM renting_history AS T1 JOIN vehicles AS T2 ON T1.vehicles_id  =  T2.id GROUP BY T2.id ORDER BY count(*) DESC LIMIT 1
Database: vehicle_rent
Question: Show the vehicle name with a descending order of total hours of renting.
SQL: SELECT T2.name FROM renting_history AS T1 JOIN vehicles AS T2 ON T1.vehicles_id  =  T2.id GROUP BY T2.id ORDER BY sum(T1.total_hours) DESC
Database: vehicle_rent
Question: What are the names of vehicles, sorted descending by total hours of renting?
SQL: SELECT T2.name FROM renting_history AS T1 JOIN vehicles AS T2 ON T1.vehicles_id  =  T2.id GROUP BY T2.id ORDER BY sum(T1.total_hours) DESC
Database: vehicle_rent
Question: What is the discount name with most number of renting history records?
SQL: SELECT T2.name FROM renting_history AS T1 JOIN discount AS T2 ON T1.discount_id  =  T2.id GROUP BY T2.id ORDER BY count(*) DESC LIMIT 1
Database: vehicle_rent
Question: Return the name of the discount that corresponds to the most rental history records.
SQL: SELECT T2.name FROM renting_history AS T1 JOIN discount AS T2 ON T1.discount_id  =  T2.id GROUP BY T2.id ORDER BY count(*) DESC LIMIT 1
Database: vehicle_rent
Question: Find the name and powertrain type of the cars that rented for more than 30 total hours.
SQL: SELECT T2.name ,  T2.Type_of_powertrain FROM renting_history AS T1 JOIN vehicles AS T2 ON T1.vehicles_id  =  T2.id GROUP BY T1.vehicles_id HAVING sum(T1.total_hours)  >  30
Database: vehicle_rent
Question: What are the names and powertrain types of cars that have more than 30 total rental hours?
SQL: SELECT T2.name ,  T2.Type_of_powertrain FROM renting_history AS T1 JOIN vehicles AS T2 ON T1.vehicles_id  =  T2.id GROUP BY T1.vehicles_id HAVING sum(T1.total_hours)  >  30
Database: vehicle_rent
Question: Find the average city and highway fuel rates for cars with different powertrain types.
SQL: SELECT avg(City_fuel_economy_rate) ,  avg(Highway_fuel_economy_rate) , Type_of_powertrain FROM vehicles GROUP BY Type_of_powertrain