minktn/spider-data huggingface dataset:
Database: restaurant_bills
Question: Which nations have both customers with card credit above 50 and customers with card credit below 75.
SQL: SELECT Nationality FROM customer WHERE Card_Credit  <  50 INTERSECT SELECT Nationality FROM customer WHERE Card_Credit  >  75
Database: restaurant_bills
Question: Show the names of customers and names of dishes they order.
SQL: SELECT T1.Name ,  T2.Dish_Name FROM customer AS T1 JOIN customer_order AS T2 ON T1.Customer_ID  =  T2.Customer_ID
Database: restaurant_bills
Question: For each order, return the customer name and the dish name.
SQL: SELECT T1.Name ,  T2.Dish_Name FROM customer AS T1 JOIN customer_order AS T2 ON T1.Customer_ID  =  T2.Customer_ID
Database: restaurant_bills
Question: Show the names of customers and names of dishes they order, in descending order of the quantity of dish.
SQL: SELECT T1.Name ,  T2.Dish_Name FROM customer AS T1 JOIN customer_order AS T2 ON T1.Customer_ID  =  T2.Customer_ID ORDER BY T2.Quantity DESC
Database: restaurant_bills
Question: For each order, find the customer name and the dish name. Sort the result in descending order of the quantity of dish.
SQL: SELECT T1.Name ,  T2.Dish_Name FROM customer AS T1 JOIN customer_order AS T2 ON T1.Customer_ID  =  T2.Customer_ID ORDER BY T2.Quantity DESC
Database: restaurant_bills
Question: Show each customer name and the total quantities of dishes ordered by that customer.
SQL: SELECT T1.Name ,  sum(T2.Quantity) FROM customer AS T1 JOIN customer_order AS T2 ON T1.Customer_ID  =  T2.Customer_ID GROUP BY T1.Name
Database: restaurant_bills
Question: What is the total quantities of dishes ordered by each customer ? List the customer name and the total quantity .
SQL: select t1.name ,  sum(t2.quantity) from customer as t1 join customer_order as t2 on t1.customer_id  =  t2.customer_id group by t1.name
Database: restaurant_bills
Question: Show the customers with total quantity of order bigger than 1.
SQL: SELECT T1.Name FROM customer AS T1 JOIN customer_order AS T2 ON T1.Customer_ID  =  T2.Customer_ID GROUP BY T1.Name HAVING sum(T2.Quantity)  >  1
Database: restaurant_bills
Question: Which customers have total order quantity greater than 1? Give me the customer names.
SQL: SELECT T1.Name FROM customer AS T1 JOIN customer_order AS T2 ON T1.Customer_ID  =  T2.Customer_ID GROUP BY T1.Name HAVING sum(T2.Quantity)  >  1
Database: restaurant_bills
Question: Show distinct managers of branches.
SQL: SELECT DISTINCT Manager FROM branch
Database: restaurant_bills
Question: Who are the distinct managers of branches?
SQL: SELECT DISTINCT Manager FROM branch
Database: restaurant_bills
Question: List the names of customers that do not have any order.
SQL: SELECT name FROM customer WHERE Customer_ID NOT IN (SELECT Customer_ID FROM customer_order)
Database: restaurant_bills
Question: Which customers do not have any order? Give me the customer names.
SQL: SELECT name FROM customer WHERE Customer_ID NOT IN (SELECT Customer_ID FROM customer_order)
Database: club_leader
Question: How many members are there?
SQL: SELECT count(*) FROM member
Database: club_leader
Question: List the names of members in ascending order of age.
SQL: SELECT Name FROM member ORDER BY Age ASC
Database: club_leader
Question: What are the names and nationalities of the members?
SQL: SELECT Name ,  Nationality FROM member
Database: club_leader
Question: List the names of members whose nationality is not `` England '' .
SQL: select name from member where nationality != "england"
Database: club_leader
Question: Show the names of members whose age is either 19 or 20.
SQL: SELECT Name FROM member WHERE Age  =  19 OR Age  =  20
Database: club_leader
Question: What is the name of the oldest member?
SQL: SELECT Name FROM member ORDER BY Age DESC LIMIT 1
Database: club_leader
Question: Show different nationalities along with the number of members of each nationality.
SQL: SELECT Nationality ,  COUNT(*) FROM member GROUP BY Nationality
Database: club_leader
Question: Please show the most common nationality of members.
SQL: SELECT Nationality ,  COUNT(*) FROM member GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1
Database: club_leader
Question: Show the nations that have at least two members.
SQL: SELECT Nationality FROM member GROUP BY Nationality HAVING COUNT(*)  >=  2
Database: club_leader
Question: Show the names of club leaders and the names of clubs they joined.
SQL: SELECT T3.Name ,  T2.Club_Name FROM club_leader AS T1 JOIN club AS T2 ON T1.Club_ID  =  T2.Club_ID JOIN member AS T3 ON T1.Member_ID  =  T3.Member_ID
Database: club_leader
Question: Show the names of club leaders of clubs with overall ranking higher than 100.
SQL: SELECT T3.Name ,  T2.Club_Name FROM club_leader AS T1 JOIN club AS T2 ON T1.Club_ID  =  T2.Club_ID JOIN member AS T3 ON T1.Member_ID  =  T3.Member_ID WHERE T2.Overall_Ranking  <  100
Database: club_leader
Question: Show the names of club leaders that joined their club before 2018.
SQL: SELECT T3.Name ,  T2.Club_Name FROM club_leader AS T1 JOIN club AS T2 ON T1.Club_ID  =  T2.Club_ID JOIN member AS T3 ON T1.Member_ID  =  T3.Member_ID WHERE T1.Year_Join  <  2018
Database: club_leader
Question: Show the name of the leader of the club named "Houston".
SQL: SELECT T3.Name FROM club_leader AS T1 JOIN club AS T2 ON T1.Club_ID  =  T2.Club_ID JOIN member AS T3 ON T1.Member_ID  =  T3.Member_ID WHERE T2.Club_Name  =  "Houston"
Database: club_leader
Question: List the names of members that are not club leaders.
SQL: SELECT Name FROM member WHERE Member_ID NOT IN (SELECT Member_ID FROM club_leader)
Database: club_leader
Question: Show the nations that have both members older than 22 and members younger than 19.
SQL: SELECT Nationality FROM member WHERE Age  >  22 INTERSECT SELECT Nationality FROM member WHERE Age  <  19
Database: club_leader
Question: What is the average age of all the club leaders?
SQL: SELECT avg(T2.age) FROM club_leader AS T1 JOIN member AS T2 ON T1.member_id  =  T2.member_id
Database: club_leader
Question: Which club name contains the string 'state'?
SQL: SELECT club_name FROM club WHERE club_name LIKE '%state%'
Database: cre_Doc_and_collections
Question: List all collections' subset. List the subsets' names.
SQL: SELECT Collection_Subset_Name FROM Collection_Subsets;
Database: cre_Doc_and_collections
Question: What are the collection susbset names?
SQL: SELECT Collection_Subset_Name FROM Collection_Subsets;
Database: cre_Doc_and_collections
Question: What is detail of collection subset with name 'Top collection'?
SQL: SELECT Collecrtion_Subset_Details FROM Collection_Subsets WHERE Collection_Subset_Name = "Top collection";
Database: cre_Doc_and_collections
Question: What collection details are there on the subset named 'Top collection'?
SQL: SELECT Collecrtion_Subset_Details FROM Collection_Subsets WHERE Collection_Subset_Name = "Top collection";
Database: cre_Doc_and_collections
Question: List all documents's subset. List the subset's name.
SQL: SELECT Document_Subset_Name FROM Document_Subsets;
Database: cre_Doc_and_collections
Question: What are the document subset names?
SQL: SELECT Document_Subset_Name FROM Document_Subsets;
Database: cre_Doc_and_collections
Question: What is the detail of document subset with name 'Best for 2000'?
SQL: SELECT Document_Subset_Details FROM Document_Subsets WHERE Document_Subset_Name = "Best for 2000";
Database: cre_Doc_and_collections
Question: What are the details on the document subsets that are named 'Best for 2000'?
SQL: SELECT Document_Subset_Details FROM Document_Subsets WHERE Document_Subset_Name = "Best for 2000";
Database: cre_Doc_and_collections
Question: List document id of all documents.
SQL: SELECT Document_Object_ID FROM Document_Objects;
Database: cre_Doc_and_collections
Question: What is the object id of the document objects?
SQL: SELECT Document_Object_ID FROM Document_Objects;
Database: cre_Doc_and_collections
Question: What is the parent document of document owned by Marlin? List the document id.
SQL: SELECT Parent_Document_Object_ID FROM Document_Objects WHERE OWNER  =  'Marlin'
Database: cre_Doc_and_collections
Question: What are the document object ids of the objects owned by Marlin?
SQL: SELECT Parent_Document_Object_ID FROM Document_Objects WHERE OWNER  =  'Marlin'
Database: cre_Doc_and_collections
Question: What is the owner of document with the Description 'Braeden Collection'?
SQL: SELECT OWNER FROM Document_Objects WHERE Description  =  'Braeden Collection'
Database: cre_Doc_and_collections
Question: What are the owners of the document objects described as the 'Braeden Collection'?
SQL: SELECT OWNER FROM Document_Objects WHERE Description  =  'Braeden Collection'
Database: cre_Doc_and_collections
Question: What is the owner of the parent document of document owned by 'Marlin'?
SQL: SELECT T2.Owner FROM Document_Objects AS T1 JOIN Document_Objects AS T2 ON T1.Parent_Document_Object_ID = T2.Document_Object_ID WHERE T1.Owner  =  'Marlin'
Database: cre_Doc_and_collections
Question: Who is the owner of the parent document of every documents where 'Marlin' is the owner?
SQL: SELECT T2.Owner FROM Document_Objects AS T1 JOIN Document_Objects AS T2 ON T1.Parent_Document_Object_ID = T2.Document_Object_ID WHERE T1.Owner  =  'Marlin'
Database: cre_Doc_and_collections
Question: What are the different descriptions of all the parent documents?
SQL: SELECT DISTINCT T2.Description FROM Document_Objects AS T1 JOIN Document_Objects AS T2 ON T1.Parent_Document_Object_ID = T2.Document_Object_ID
Database: cre_Doc_and_collections
Question: What is the unique description of every parent document?
SQL: SELECT DISTINCT T2.Description FROM Document_Objects AS T1 JOIN Document_Objects AS T2 ON T1.Parent_Document_Object_ID = T2.Document_Object_ID
Database: cre_Doc_and_collections
Question: How many documents owned by Marlin?
SQL: SELECT count(*) FROM Document_Objects WHERE OWNER = "Marlin";
Database: cre_Doc_and_collections
Question: What is the count of documents owned by Marlin?
SQL: SELECT count(*) FROM Document_Objects WHERE OWNER = "Marlin";
Database: cre_Doc_and_collections
Question: List all documents ids that are not the parent of other documents.
SQL: SELECT Document_Object_ID FROM Document_Objects EXCEPT SELECT Parent_Document_Object_ID FROM Document_Objects
Database: cre_Doc_and_collections
Question: What are the ids of the documents that are not parent documents?
SQL: SELECT Document_Object_ID FROM Document_Objects EXCEPT SELECT Parent_Document_Object_ID FROM Document_Objects
Database: cre_Doc_and_collections
Question: How many child documents does each parent document has? List the document id and the number.
SQL: SELECT T2.Document_Object_ID ,  count(*) FROM Document_Objects AS T1 JOIN Document_Objects AS T2 ON T1.Parent_Document_Object_ID = T2.Document_Object_ID GROUP BY T2.Document_Object_ID;
Database: cre_Doc_and_collections
Question: What is the number of child documents for each parent document, and what are the ids of the parent documents?
SQL: SELECT T2.Document_Object_ID ,  count(*) FROM Document_Objects AS T1 JOIN Document_Objects AS T2 ON T1.Parent_Document_Object_ID = T2.Document_Object_ID GROUP BY T2.Document_Object_ID;
Database: cre_Doc_and_collections
Question: List the name of all collections.
SQL: SELECT Collection_Name FROM Collections;
Database: cre_Doc_and_collections
Question: what are the collection names?
SQL: SELECT Collection_Name FROM Collections;
Database: cre_Doc_and_collections
Question: What is the description of collection named Best?
SQL: SELECT Collection_Description FROM Collections WHERE Collection_Name = "Best";
Database: cre_Doc_and_collections
Question: What are the collection descriptions that are named as 'Best'?
SQL: SELECT Collection_Description FROM Collections WHERE Collection_Name = "Best";
Database: cre_Doc_and_collections
Question: What is the name of the parent collection of the collection named Nice?
SQL: SELECT T2.Collection_Name FROM Collections AS T1 JOIN Collections AS T2 ON T1.Parent_Collection_ID = T2.Collection_ID WHERE T1.Collection_Name = "Nice";
Database: cre_Doc_and_collections
Question: What are the names of all parent collections of the collection named Nice?
SQL: SELECT T2.Collection_Name FROM Collections AS T1 JOIN Collections AS T2 ON T1.Parent_Collection_ID = T2.Collection_ID WHERE T1.Collection_Name = "Nice";
Database: cre_Doc_and_collections
Question: Which collection is not the parent of other collection? List the collection's name.
SQL: SELECT Collection_Name FROM Collections EXCEPT SELECT T2.Collection_Name FROM Collections AS T1 JOIN Collections AS T2 ON T1.Parent_Collection_ID = T2.Collection_ID;
Database: cre_Doc_and_collections
Question: What are the names of the collections that are not the parent of the other collections?
SQL: SELECT Collection_Name FROM Collections EXCEPT SELECT T2.Collection_Name FROM Collections AS T1 JOIN Collections AS T2 ON T1.Parent_Collection_ID = T2.Collection_ID;
Database: cre_Doc_and_collections
Question: List document that have more than one child. List the document id.
SQL: SELECT T2.Document_Object_ID FROM Document_Objects AS T1 JOIN Document_Objects AS T2 ON T1.Parent_Document_Object_ID = T2.Document_Object_ID GROUP BY T2.Document_Object_ID HAVING count(*)  >  1;
Database: cre_Doc_and_collections
Question: What are the ids of the documents that have more than one child?
SQL: SELECT T2.Document_Object_ID FROM Document_Objects AS T1 JOIN Document_Objects AS T2 ON T1.Parent_Document_Object_ID = T2.Document_Object_ID GROUP BY T2.Document_Object_ID HAVING count(*)  >  1;
Database: cre_Doc_and_collections
Question: How many child collection does the collection named Best has?
SQL: SELECT count(*) FROM Collections AS T1 JOIN Collections AS T2 ON T1.Parent_Collection_ID = T2.Collection_ID WHERE T2.Collection_Name = "Best";
Database: cre_Doc_and_collections
Question: What is the number of child collections belonging to the collection named Best?
SQL: SELECT count(*) FROM Collections AS T1 JOIN Collections AS T2 ON T1.Parent_Collection_ID = T2.Collection_ID WHERE T2.Collection_Name = "Best";
Database: cre_Doc_and_collections
Question: List all document which is related to document owned by Ransom . List the document id .
SQL: select t1.document_object_id from document_subset_members as t1 join document_objects as t2 on t1.document_object_id  =  t2.document_object_id where t2.owner  =  'ransom'
Database: cre_Doc_and_collections
Question: What are the document object ids of the related to the document owned by Ransom ?
SQL: select t1.document_object_id from document_subset_members as t1 join document_objects as t2 on t1.document_object_id  =  t2.document_object_id where t2.owner  =  'ransom'
Database: cre_Doc_and_collections
Question: List collection subset id, name and number of collections in each subset.
SQL: SELECT T2.Collection_Subset_ID ,  T1.Collection_Subset_Name ,  count(*) FROM Collection_Subsets AS T1 JOIN Collection_Subset_Members AS T2 ON T1.Collection_Subset_ID =  T2.Collection_Subset_ID GROUP BY T2.Collection_Subset_ID;
Database: cre_Doc_and_collections
Question: What are the collection subset ids, names, and number of collections for each subset?
SQL: SELECT T2.Collection_Subset_ID ,  T1.Collection_Subset_Name ,  count(*) FROM Collection_Subsets AS T1 JOIN Collection_Subset_Members AS T2 ON T1.Collection_Subset_ID =  T2.Collection_Subset_ID GROUP BY T2.Collection_Subset_ID;
Database: cre_Doc_and_collections
Question: Which document has most of child? List the document id and the number of child.
SQL: SELECT T2.Document_Object_ID ,  count(*) FROM Document_Objects AS T1 JOIN Document_Objects AS T2 ON T1.Parent_Document_Object_ID = T2.Document_Object_ID GROUP BY T2.Document_Object_ID ORDER BY count(*) DESC LIMIT 1;
Database: cre_Doc_and_collections
Question: For each document object id, how many children do they have?
SQL: SELECT T2.Document_Object_ID ,  count(*) FROM Document_Objects AS T1 JOIN Document_Objects AS T2 ON T1.Parent_Document_Object_ID = T2.Document_Object_ID GROUP BY T2.Document_Object_ID ORDER BY count(*) DESC LIMIT 1;
Database: cre_Doc_and_collections
Question: Which document has least number of related documents? List the document id and the number of related documents.
SQL: SELECT Document_Object_ID , count(*) FROM Document_Subset_Members GROUP BY Document_Object_ID ORDER BY count(*) ASC LIMIT 1;
Database: cre_Doc_and_collections
Question: What is the document object id with the least number of documents ?
SQL: select document_object_id , count(*) from document_subset_members group by document_object_id order by count(*) asc limit 1;
Database: cre_Doc_and_collections
Question: Which document has between 2 and 4 number of documents ? List the document id and the number of related documents .
SQL: select document_object_id , count(*) from document_subset_members group by document_object_id having count(*) between 2 and 4;
Database: cre_Doc_and_collections
Question: What are the ids of the dcouments that have between 2 and 4 related documents and how many related items are there?
SQL: SELECT Document_Object_ID , count(*) FROM Document_Subset_Members GROUP BY Document_Object_ID HAVING count(*) BETWEEN 2 AND 4;
Database: cre_Doc_and_collections
Question: List all owner of documents that is related to documents owned by Braeden.
SQL: SELECT DISTINCT OWNER FROM Document_Subset_Members AS T1 JOIN Document_Objects AS T2 ON T1.Related_Document_Object_ID  =  T2.Document_Object_ID WHERE T2.Owner  =  'Braeden';
Database: cre_Doc_and_collections
Question: What are the different owners of documents that are related to ones owned by Braeden?
SQL: SELECT DISTINCT OWNER FROM Document_Subset_Members AS T1 JOIN Document_Objects AS T2 ON T1.Related_Document_Object_ID  =  T2.Document_Object_ID WHERE T2.Owner  =  'Braeden';
Database: cre_Doc_and_collections
Question: Which unique subset does document owned by Braeden belong to? List the subset name.
SQL: SELECT DISTINCT T1.Document_Subset_Name FROM Document_Subsets AS T1 JOIN Document_Subset_Members AS T2 ON T1.Document_Subset_ID =  T2.Document_Subset_ID JOIN Document_Objects AS T3 ON T2.Document_Object_ID  =  T3.Document_Object_ID WHERE T3.owner  =  'Braeden'
Database: cre_Doc_and_collections
Question: What are the different subset names of all documents owned by Braeden?
SQL: SELECT DISTINCT T1.Document_Subset_Name FROM Document_Subsets AS T1 JOIN Document_Subset_Members AS T2 ON T1.Document_Subset_ID =  T2.Document_Subset_ID JOIN Document_Objects AS T3 ON T2.Document_Object_ID  =  T3.Document_Object_ID WHERE T3.owner  =  'Braeden'
Database: cre_Doc_and_collections
Question: List subset id, name and number of different documents in each subset.
SQL: SELECT T1.Document_Subset_ID ,  T2.Document_Subset_Name , count(DISTINCT T1.Document_Object_ID) FROM Document_Subset_Members AS T1 JOIN Document_Subsets AS T2 ON T1.Document_Subset_ID =  T2.Document_Subset_ID GROUP BY T1.Document_Subset_ID;
Database: cre_Doc_and_collections
Question: What is the subset id, name, and number of different documents for each subset?
SQL: SELECT T1.Document_Subset_ID ,  T2.Document_Subset_Name , count(DISTINCT T1.Document_Object_ID) FROM Document_Subset_Members AS T1 JOIN Document_Subsets AS T2 ON T1.Document_Subset_ID =  T2.Document_Subset_ID GROUP BY T1.Document_Subset_ID;
Database: cre_Doc_and_collections
Question: Which document subset has most of number of distinct documents ? List subset id , name and number of documents .
SQL: select t1.document_subset_id ,  t2.document_subset_name , count(distinct t1.document_object_id) from document_subset_members as t1 join document_subsets as t2 on t1.document_subset_id =  t2.document_subset_id group by t1.document_subset_id order by count(*) desc limit 1;
Database: cre_Doc_and_collections
Question: For the document subset with the most number of different documents , what are the ids and names of the subset , as well as the number of documents ?
SQL: select t1.document_subset_id ,  t2.document_subset_name , count(distinct t1.document_object_id) from document_subset_members as t1 join document_subsets as t2 on t1.document_subset_id =  t2.document_subset_id group by t1.document_subset_id order by count(*) desc limit 1;
Database: cre_Doc_and_collections
Question: For document subset named 'Best for 2000', List all document id that in this subset.
SQL: SELECT DISTINCT T1.Document_Object_ID FROM Document_Subset_Members AS T1 JOIN Document_Subsets AS T2 ON T1.Document_Subset_ID =  T2.Document_Subset_ID WHERE T2.Document_Subset_Name = "Best for 2000";
Database: cre_Doc_and_collections
Question: For the document subset named 'Best for 2000', what are the document ids in that subset?
SQL: SELECT DISTINCT T1.Document_Object_ID FROM Document_Subset_Members AS T1 JOIN Document_Subsets AS T2 ON T1.Document_Subset_ID =  T2.Document_Subset_ID WHERE T2.Document_Subset_Name = "Best for 2000";
Database: cre_Doc_and_collections
Question: List all document subsets of documents that related to each document id. List the name of document subset and the document id.
SQL: SELECT DISTINCT T3.Document_Subset_Name ,  T1.Document_Object_ID FROM Document_Subset_Members AS T1 JOIN Document_Subset_Members  AS T2 ON T1.Related_Document_Object_ID = T2.Document_Object_ID JOIN Document_Subsets AS T3 ON T2.Document_Subset_ID =  T3.Document_Subset_ID
Database: cre_Doc_and_collections
Question: What are the different subsets of documents related to each document id , list the name of the document subset and id of the actual document ?
SQL: select distinct t3.document_subset_name ,  t1.document_object_id from document_subset_members as t1 join document_subset_members  as t2 on t1.related_document_object_id = t2.document_object_id join document_subsets as t3 on t2.document_subset_id =  t3.document_subset_id
Database: cre_Doc_and_collections
Question: List the Collection Name that document owned by 'Ransom ' belong to .
SQL: select t1.collection_name from collections as t1 join documents_in_collections as t2 on t1.collection_id = t2.collection_id join document_objects as t3 on t2.document_object_id  =  t3.document_object_id where t3.owner  =  'ransom'
Database: cre_Doc_and_collections
Question: What is the collection name of a document owned by 'Ransom'?
SQL: SELECT T1.Collection_Name FROM Collections AS T1 JOIN Documents_in_Collections AS T2 ON T1.Collection_ID = T2.Collection_ID JOIN Document_Objects AS T3 ON T2.Document_object_id  =  T3.Document_object_id WHERE T3.owner  =  'Ransom'
Database: cre_Doc_and_collections
Question: How many collections does each document belong to? List the count and the document id.
SQL: SELECT count(*) ,  T2.Document_Object_ID FROM Collections AS T1 JOIN Documents_in_Collections AS T2 ON T1.Collection_ID = T2.Collection_ID GROUP BY T2.Document_Object_ID
Database: cre_Doc_and_collections
Question: For each document object id, how many collections does it belong to?
SQL: SELECT count(*) ,  T2.Document_Object_ID FROM Collections AS T1 JOIN Documents_in_Collections AS T2 ON T1.Collection_ID = T2.Collection_ID GROUP BY T2.Document_Object_ID
Database: cre_Doc_and_collections
Question: How many documents does collection named 'Best' has?
SQL: SELECT count(*) FROM Collections AS T1 JOIN Documents_in_Collections AS T2 ON T1.Collection_ID = T2.Collection_ID WHERE T1.Collection_Name = "Best";
Database: cre_Doc_and_collections
Question: What is the number of documents in the collection named 'Best'?
SQL: SELECT count(*) FROM Collections AS T1 JOIN Documents_in_Collections AS T2 ON T1.Collection_ID = T2.Collection_ID WHERE T1.Collection_Name = "Best";
Database: cre_Doc_and_collections
Question: List the document id of all documents in collection named Best.
SQL: SELECT T2.Document_Object_ID FROM Collections AS T1 JOIN Documents_in_Collections AS T2 ON T1.Collection_ID = T2.Collection_ID WHERE T1.Collection_Name = "Best";
Database: cre_Doc_and_collections
Question: What is the number of document object ids in the collection named Best?
SQL: SELECT T2.Document_Object_ID FROM Collections AS T1 JOIN Documents_in_Collections AS T2 ON T1.Collection_ID = T2.Collection_ID WHERE T1.Collection_Name = "Best";
Database: cre_Doc_and_collections
Question: Which collection have most number of documents? List collection name, id and number of documents.
SQL: SELECT T1.Collection_Name ,  T1.Collection_ID ,  count(*) FROM Collections AS T1 JOIN Documents_in_Collections AS T2 ON T1.Collection_ID = T2.Collection_ID WHERE T1.Collection_Name = "Best" GROUP BY T1.Collection_ID ORDER BY count(*) DESC LIMIT 1;
Database: cre_Doc_and_collections
Question: For ever collection named 'Best', what is the name and id of the one with the most documents, and how many documents does it have?
SQL: SELECT T1.Collection_Name ,  T1.Collection_ID ,  count(*) FROM Collections AS T1 JOIN Documents_in_Collections AS T2 ON T1.Collection_ID = T2.Collection_ID WHERE T1.Collection_Name = "Best" GROUP BY T1.Collection_ID ORDER BY count(*) DESC LIMIT 1;
Database: cre_Doc_and_collections
Question: List id of documents that in document subset Best for 2000 and collection named Best.
SQL: SELECT DISTINCT T1.Document_Object_ID FROM Document_Subset_Members AS T1 JOIN Document_Subsets AS T2 ON T1.Document_Subset_ID =  T2.Document_Subset_ID JOIN Documents_in_Collections AS T3 ON T1.Document_Object_ID  =  T3.Document_Object_ID JOIN Collections AS T4 ON T3.Collection_ID  =  T4.Collection_ID WHERE T2.Document_Subset_Name = "Best for 2000" AND T4.Collection_Name = "Best";
Database: cre_Doc_and_collections
Question: What are the different document object ids in the subset named 'Best for 2000' and in the collection named 'Best'?
SQL: SELECT DISTINCT T1.Document_Object_ID FROM Document_Subset_Members AS T1 JOIN Document_Subsets AS T2 ON T1.Document_Subset_ID =  T2.Document_Subset_ID JOIN Documents_in_Collections AS T3 ON T1.Document_Object_ID  =  T3.Document_Object_ID JOIN Collections AS T4 ON T3.Collection_ID  =  T4.Collection_ID WHERE T2.Document_Subset_Name = "Best for 2000" AND T4.Collection_Name = "Best";
Database: cre_Doc_and_collections
Question: List id of documents that in collection named Best but not in document subset Best for 2000.
SQL: SELECT DISTINCT T2.Document_Object_ID FROM Collections AS T1 JOIN Documents_in_Collections AS T2 ON T1.Collection_ID = T2.Collection_ID WHERE T1.Collection_Name = "Best" EXCEPT SELECT DISTINCT T3.Document_Object_ID FROM Document_Subset_Members AS T3 JOIN Document_Subsets AS T4 ON T3.Document_Subset_ID =  T4.Document_Subset_ID WHERE T4.Document_Subset_Name = "Best for 2000"
Database: cre_Doc_and_collections
Question: What are the different document object ids that are in the collection named Best but not in the subset named 'Best for 2000'?
SQL: SELECT DISTINCT T2.Document_Object_ID FROM Collections AS T1 JOIN Documents_in_Collections AS T2 ON T1.Collection_ID = T2.Collection_ID WHERE T1.Collection_Name = "Best" EXCEPT SELECT DISTINCT T3.Document_Object_ID FROM Document_Subset_Members AS T3 JOIN Document_Subsets AS T4 ON T3.Document_Subset_ID =  T4.Document_Subset_ID WHERE T4.Document_Subset_Name = "Best for 2000"
Database: cre_Doc_and_collections
Question: List id of documents that in document subset Best for 2000 or in collection named Best.
SQL: SELECT DISTINCT T1.Document_Object_ID FROM Document_Subset_Members AS T1 JOIN Document_Subsets AS T2 ON T1.Document_Subset_ID =  T2.Document_Subset_ID JOIN Documents_in_Collections AS T3 ON T1.Document_Object_ID  =  T3.Document_Object_ID JOIN Collections AS T4 ON T3.Collection_ID  =  T4.Collection_ID WHERE T2.Document_Subset_Name = "Best for 2000" OR T4.Collection_Name = "Best";
Database: cre_Doc_and_collections
Question: What are the different document ids that are in the subset named 'Best for 2000' or in the collection named 'Best'?
SQL: SELECT DISTINCT T1.Document_Object_ID FROM Document_Subset_Members AS T1 JOIN Document_Subsets AS T2 ON T1.Document_Subset_ID =  T2.Document_Subset_ID JOIN Documents_in_Collections AS T3 ON T1.Document_Object_ID  =  T3.Document_Object_ID JOIN Collections AS T4 ON T3.Collection_ID  =  T4.Collection_ID WHERE T2.Document_Subset_Name = "Best for 2000" OR T4.Collection_Name = "Best";
Database: cre_Doc_and_collections
Question: List all name of collections that are related to collection named Best.
SQL: SELECT DISTINCT T4.Collection_Name FROM Collection_Subset_Members AS T1 JOIN Collection_Subset_Members AS T2 ON T1.Related_Collection_ID = T2.Collection_ID JOIN Collections AS T3 ON T1.Collection_ID = T3.Collection_ID JOIN Collections AS T4 ON T2.Collection_ID = T4.Collection_ID WHERE T3.Collection_Name = "Best";
Database: cre_Doc_and_collections
Question: What are the names of the collections that are related to the collection named Best?
SQL: SELECT DISTINCT T4.Collection_Name FROM Collection_Subset_Members AS T1 JOIN Collection_Subset_Members AS T2 ON T1.Related_Collection_ID = T2.Collection_ID JOIN Collections AS T3 ON T1.Collection_ID = T3.Collection_ID JOIN Collections AS T4 ON T2.Collection_ID = T4.Collection_ID WHERE T3.Collection_Name = "Best";
Database: cre_Doc_and_collections
Question: How many collections that are related to collection named Best?
SQL: SELECT count(DISTINCT T1.Related_Collection_ID) FROM Collection_Subset_Members AS T1 JOIN Collections AS T2 ON T1.Collection_ID  =  T2.Collection_ID WHERE T2.Collection_Name = "Best";
Database: cre_Doc_and_collections
Question: How many different collections are related to the one named 'Best'?
SQL: SELECT count(DISTINCT T1.Related_Collection_ID) FROM Collection_Subset_Members AS T1 JOIN Collections AS T2 ON T1.Collection_ID  =  T2.Collection_ID WHERE T2.Collection_Name = "Best";
Database: cre_Doc_and_collections
Question: Which collection subset does collection name Best in? List collection subset name.
SQL: SELECT DISTINCT T1.Collection_Subset_Name FROM Collection_Subsets AS T1 JOIN Collection_Subset_Members AS T2 ON T1.Collection_Subset_ID =  T2.Collection_Subset_ID JOIN Collections AS T3 ON T2.Collection_ID =  T3.Collection_ID WHERE T3.Collection_Name = "Best";
Database: cre_Doc_and_collections
Question: What are the collection subsets that the collection named 'Best' in?
SQL: SELECT DISTINCT T1.Collection_Subset_Name FROM Collection_Subsets AS T1 JOIN Collection_Subset_Members AS T2 ON T1.Collection_Subset_ID =  T2.Collection_Subset_ID JOIN Collections AS T3 ON T2.Collection_ID =  T3.Collection_ID WHERE T3.Collection_Name = "Best";
Database: sing_contest
Question: How many songs contain "Love" in their names?
SQL: SELECT count(*) FROM songs WHERE name LIKE "%Love%"
Database: sing_contest
Question: List the name of the songs in ascending, lexicographical order.
SQL: SELECT name FROM songs ORDER BY name
Database: sing_contest
Question: List the names and languages of the songs .
SQL: select name , language from songs
Database: sing_contest
Question: What are the maximum and minimum voice sound quality score of the performances?
SQL: SELECT max(voice_sound_quality) ,  min(voice_sound_quality) FROM performance_score
Database: sing_contest
Question: What are the voice sound quality score, rhythm tempo score and stage presence score performed by the participant named 'Freeway'?
SQL: SELECT T1.voice_sound_quality ,  T1.rhythm_tempo ,  T1.stage_presence FROM performance_score AS T1 JOIN participants AS T2 ON T1.participant_id  =  T2.id WHERE T2.name  =  'Freeway'
Database: sing_contest
Question: What are the id, language and original artist of the songs whose name is not 'Love'?
SQL: SELECT id ,  LANGUAGE ,  original_artist FROM songs WHERE name != 'Love'
Database: sing_contest
Question: What are the names and original artists of the song whose English translation is 'All the streets of love'?
SQL: SELECT name ,  original_artist FROM songs WHERE english_translation  =  'All the streets of love'
Database: sing_contest
Question: What are the distinct stage presence scores for all the songs that are in language 'English' ?
SQL: SELECT DISTINCT T2.stage_presence FROM songs AS T1 JOIN performance_score AS T2 ON T1.id  =  T2.songs_id WHERE T1.language  =  'English'
Database: sing_contest
Question: What are the ids and names of the participants who have performed at least two songs?
SQL: SELECT T1.id ,  T1.Name FROM participants AS T1 JOIN performance_score AS T2 ON T2.participant_id  =  T1.id GROUP BY T1.id HAVING count(*)  >=  2
Database: sing_contest
Question: What are the ids, names and popularity of the participants, order by the number of songs they perform?
SQL: SELECT T1.id ,  T1.Name ,  T1.popularity FROM participants AS T1 JOIN performance_score AS T2 ON T2.participant_id  =  T1.id GROUP BY T1.id ORDER BY count(*)
Database: sing_contest
Question: What are the id and name of the participants who received score 5 for their sound quality or rhythm tempo?
SQL: SELECT T1.id ,  T1.name FROM participants AS T1 JOIN performance_score AS T2 ON T2.participant_id  =  T1.id WHERE T2.voice_sound_quality  =  5 OR T2.rhythm_tempo  =  5
Database: sing_contest
Question: What are the voice sound quality scores received for the song named ' The Balkan Girls ' in English language ?
SQL: SELECT T1.voice_sound_quality FROM performance_score AS T1 JOIN songs AS T2 ON T1.songs_id  =  T2.id WHERE T2.name  =  ' The Balkan Girls ' AND T2.language  =  'English'
Database: sing_contest
Question: What are the id and name of the song sung by the most participants?
SQL: SELECT T1.id ,  T1.name FROM songs AS T1 JOIN performance_score AS T2 ON T1.id  =  T2.songs_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1
Database: sing_contest
Question: How many performances have a stage presence score less than 7 or higher than 9?
SQL: SELECT count(*) FROM performance_score WHERE stage_presence  <  7 OR stage_presence  >  9
Database: sing_contest
Question: How many songs listed are not performed?
SQL: SELECT count(*) FROM songs WHERE id NOT IN ( SELECT songs_id FROM performance_score );
Database: sing_contest
Question: What are the average rhythm scores for the songs in each different language?
SQL: SELECT avg(T2.rhythm_tempo) ,  T1.language FROM songs AS T1 JOIN performance_score AS T2 ON T2.songs_id  =  T1.id GROUP BY T1.language
Database: sing_contest
Question: What are the distinct names of the participants who have sung a song in 'English'?
SQL: SELECT DISTINCT T1.name FROM participants AS T1 JOIN performance_score AS T2 ON T2.participant_id  =  T1.id JOIN songs AS T3 ON T3.id  =  T2.songs_id WHERE T3.language  =  'English'
Database: sing_contest
Question: What are the name and popularity of participants who have sung a song both in 'Croatian' language and in 'English' language?
SQL: SELECT T1.name ,  T1.popularity FROM participants AS T1 JOIN performance_score AS T2 ON T2.participant_id  =  T1.id JOIN songs AS T3 ON T3.id  =  T2.songs_id WHERE T3.language  =  'Croatian' INTERSECT SELECT T1.name ,  T1.popularity FROM participants AS T1 JOIN performance_score AS T2 ON T2.participant_id  =  T1.id JOIN songs AS T3 ON T3.id  =  T2.songs_id WHERE T3.language  =  'English'
Database: sing_contest
Question: Which song names have the substring "Is"?
SQL: SELECT name FROM songs WHERE name LIKE "%Is%"
Database: sing_contest
Question: Find the original artists who sing songs with rhythm tempo above 5 , and list results in descending order of voice sound quality .
SQL: select t2.original_artist from performance_score as t1 join songs as t2 on t2.id  =  t1.songs_id where t1.rhythm_tempo  >  5 order by t1.voice_sound_quality desc
Database: address_1
Question: How many cities do we have?
SQL: SELECT count(*) FROM City
Database: address_1
Question: Count the number of cities.
SQL: SELECT count(*) FROM City
Database: address_1
Question: List all different states .
SQL: select distinct state from city
Database: address_1
Question: What are all the distinct states?
SQL: SELECT DISTINCT state FROM City
Database: address_1
Question: How many countries do we have?
SQL: SELECT count(DISTINCT country) FROM City
Database: address_1
Question: Count the number of coutries.
SQL: SELECT count(DISTINCT country) FROM City
Database: address_1
Question: Show names, codes, states, countries for all cities.
SQL: SELECT city_name ,  city_code ,  state ,  country FROM City
Database: address_1
Question: What are the names, codes, states, and countries for all cities?
SQL: SELECT city_name ,  city_code ,  state ,  country FROM City
Database: address_1
Question: What is the latitude and longitude for Baltimore?
SQL: SELECT latitude ,  longitude FROM City WHERE city_name  =  "Baltimore"
Database: address_1
Question: What latitude and longitude correspond to Baltimore?
SQL: SELECT latitude ,  longitude FROM City WHERE city_name  =  "Baltimore"
Database: address_1
Question: Show names for all cities in state PA.
SQL: SELECT city_name FROM City WHERE state  =  "PA"
Database: address_1
Question: What are the names of all cities in PA?
SQL: SELECT city_name FROM City WHERE state  =  "PA"
Database: address_1
Question: How many cities are in Canada?
SQL: SELECT count(*) FROM City WHERE country  =  "CANADA"
Database: address_1
Question: Count the number of cities in Canada.
SQL: SELECT count(*) FROM City WHERE country  =  "CANADA"
Database: address_1
Question: Show names for all USA city ordered by latitude.
SQL: SELECT city_name FROM City WHERE country  =  "USA" ORDER BY latitude
Database: address_1
Question: What are all the city names for cities in the USA, ordered by latitude?
SQL: SELECT city_name FROM City WHERE country  =  "USA" ORDER BY latitude
Database: address_1
Question: Show all states and number of cities in each state.
SQL: SELECT state ,  count(*) FROM City GROUP BY state
Database: address_1
Question: How many cities are in each state?
SQL: SELECT state ,  count(*) FROM City GROUP BY state
Database: address_1
Question: Show all countries and number of cities in each .
SQL: select country ,  count(*) from city group by country
Database: address_1
Question: How many cities are there in each country?
SQL: SELECT country ,  count(*) FROM City GROUP BY country
Database: address_1
Question: List all states with at least two cities.
SQL: SELECT state FROM City GROUP BY state HAVING count(*)  >=  2
Database: address_1
Question: Which states have at least two cities?
SQL: SELECT state FROM City GROUP BY state HAVING count(*)  >=  2
Database: address_1
Question: Which state has most number of cities?
SQL: SELECT state FROM City GROUP BY state ORDER BY count(*) DESC LIMIT 1
Database: address_1
Question: Give the state that has the most cities.
SQL: SELECT state FROM City GROUP BY state ORDER BY count(*) DESC LIMIT 1
Database: address_1
Question: Which country has fewest number of cities?
SQL: SELECT country FROM City GROUP BY country ORDER BY count(*) ASC LIMIT 1
Database: address_1
Question: Give the country with the fewest number of cities.
SQL: SELECT country FROM City GROUP BY country ORDER BY count(*) ASC LIMIT 1
Database: address_1
Question: Show the first name and the last name for students living in state MD.
SQL: SELECT T2.Fname ,  T2.Lname FROM City AS T1 JOIN Student AS T2 ON T1.city_code  =  T2.city_code WHERE T1.state  =  "MD"
Database: address_1
Question: What are the full names of students living in MD?
SQL: SELECT T2.Fname ,  T2.Lname FROM City AS T1 JOIN Student AS T2 ON T1.city_code  =  T2.city_code WHERE T1.state  =  "MD"
Database: address_1
Question: How many students live in China?
SQL: SELECT count(*) FROM City AS T1 JOIN Student AS T2 ON T1.city_code  =  T2.city_code WHERE T1.country  =  "CHINA"
Database: address_1
Question: Count the number of students living in China.
SQL: SELECT count(*) FROM City AS T1 JOIN Student AS T2 ON T1.city_code  =  T2.city_code WHERE T1.country  =  "CHINA"
Database: address_1
Question: Return the first name and major of students are living in Baltimore?
SQL: SELECT T2.Fname ,  T2.Major FROM City AS T1 JOIN Student AS T2 ON T1.city_code  =  T2.city_code WHERE T1.city_name  =  "Baltimore"
Database: address_1
Question: What are the first names and majors of students living in Baltimore?
SQL: SELECT T2.Fname ,  T2.Major FROM City AS T1 JOIN Student AS T2 ON T1.city_code  =  T2.city_code WHERE T1.city_name  =  "Baltimore"
Database: address_1
Question: Show the number of students living in each country.
SQL: SELECT T1.country ,  count(*) FROM City AS T1 JOIN Student AS T2 ON T1.city_code  =  T2.city_code GROUP BY T1.country
Database: address_1
Question: How many students live in each country?
SQL: SELECT T1.country ,  count(*) FROM City AS T1 JOIN Student AS T2 ON T1.city_code  =  T2.city_code GROUP BY T1.country
Database: address_1
Question: Find the number of students living in each city.
SQL: SELECT T1.city_name ,  count(*) FROM City AS T1 JOIN Student AS T2 ON T1.city_code  =  T2.city_code GROUP BY T1.city_code
Database: address_1
Question: How many students live in each city?
SQL: SELECT T1.city_name ,  count(*) FROM City AS T1 JOIN Student AS T2 ON T1.city_code  =  T2.city_code GROUP BY T1.city_code
Database: address_1
Question: Which state has most number of students?
SQL: SELECT T1.state FROM City AS T1 JOIN Student AS T2 ON T1.city_code  =  T2.city_code GROUP BY T1.state ORDER BY count(*) DESC LIMIT 1
Database: address_1
Question: Give the state that has the most students.
SQL: SELECT T1.state FROM City AS T1 JOIN Student AS T2 ON T1.city_code  =  T2.city_code GROUP BY T1.state ORDER BY count(*) DESC LIMIT 1
Database: address_1
Question: Which country has least number of students?
SQL: SELECT T1.country FROM City AS T1 JOIN Student AS T2 ON T1.city_code  =  T2.city_code GROUP BY T1.country ORDER BY count(*) LIMIT 1
Database: address_1
Question: Give the country with the fewest students.
SQL: SELECT T1.country FROM City AS T1 JOIN Student AS T2 ON T1.city_code  =  T2.city_code GROUP BY T1.country ORDER BY count(*) LIMIT 1
Database: address_1
Question: Show names for all cities where at least three students live.
SQL: SELECT T1.city_name FROM City AS T1 JOIN Student AS T2 ON T1.city_code  =  T2.city_code GROUP BY T1.city_code HAVING count(*)  >=  3
Database: address_1
Question: What are the names of cities with at least three students?
SQL: SELECT T1.city_name FROM City AS T1 JOIN Student AS T2 ON T1.city_code  =  T2.city_code GROUP BY T1.city_code HAVING count(*)  >=  3
Database: address_1
Question: Show all states where more than 5 students live.
SQL: SELECT T1.state FROM City AS T1 JOIN Student AS T2 ON T1.city_code  =  T2.city_code GROUP BY T1.state HAVING count(*)  >  5
Database: address_1
Question: What are the states with more than 5 students?
SQL: SELECT T1.state FROM City AS T1 JOIN Student AS T2 ON T1.city_code  =  T2.city_code GROUP BY T1.state HAVING count(*)  >  5
Database: address_1
Question: Show ids for all students who don't live in USA.
SQL: SELECT StuID FROM Student EXCEPT SELECT StuID FROM City AS T1 JOIN Student AS T2 ON T1.city_code  =  T2.city_code WHERE country  =  "USA"
Database: address_1
Question: What the the student ids for students not living in the USA?
SQL: SELECT StuID FROM Student EXCEPT SELECT StuID FROM City AS T1 JOIN Student AS T2 ON T1.city_code  =  T2.city_code WHERE country  =  "USA"
Database: address_1
Question: Show ids for all female (sex is F) students living in state PA.
SQL: SELECT StuID FROM City AS T1 JOIN Student AS T2 ON T1.city_code  =  T2.city_code WHERE T1.state  =  "PA"  AND T2.sex  =  'F'
Database: address_1
Question: What are the student ids for female students in the state of PA?
SQL: SELECT StuID FROM City AS T1 JOIN Student AS T2 ON T1.city_code  =  T2.city_code WHERE T1.state  =  "PA"  AND T2.sex  =  'F'
Database: address_1
Question: Show ids for all male students living outside of USA.
SQL: SELECT StuID FROM City AS T1 JOIN Student AS T2 ON T1.city_code  =  T2.city_code WHERE T2.sex  =  'M' AND T1.country != "USA"
Database: address_1
Question: What are the ids for male students not in the USA?
SQL: SELECT StuID FROM City AS T1 JOIN Student AS T2 ON T1.city_code  =  T2.city_code WHERE T2.sex  =  'M' AND T1.country != "USA"
Database: address_1
Question: What is the distance between BAL and CHI?
SQL: SELECT distance FROM Direct_distance WHERE city1_code  =  "BAL" AND city2_code  =  "CHI"
Database: address_1
Question: Give the distance between BAL and CHI?
SQL: SELECT distance FROM Direct_distance WHERE city1_code  =  "BAL" AND city2_code  =  "CHI"
Database: address_1
Question: Show me the distance between Boston and Newark.
SQL: SELECT distance FROM Direct_distance AS T1 JOIN City AS T2 ON T1.city1_code  =  T2.city_code JOIN City AS T3 ON T1.city2_code  =  T3.city_code WHERE T2.city_name  =  "Boston" AND T3.city_name  =  "Newark"
Database: address_1
Question: What is the distance between Boston and Newark?
SQL: SELECT distance FROM Direct_distance AS T1 JOIN City AS T2 ON T1.city1_code  =  T2.city_code JOIN City AS T3 ON T1.city2_code  =  T3.city_code WHERE T2.city_name  =  "Boston" AND T3.city_name  =  "Newark"
Database: address_1
Question: What is the average, minimum, maximum distance between two cities?
SQL: SELECT avg(distance) ,  min(distance) ,  max(distance) FROM Direct_distance
Database: address_1
Question: Give the average, minimum, and maximum distances between two cities.
SQL: SELECT avg(distance) ,  min(distance) ,  max(distance) FROM Direct_distance
Database: address_1
Question: Show me the city code of two cities with maximum distance.
SQL: SELECT city1_code ,  city2_code FROM Direct_distance ORDER BY distance DESC LIMIT 1
Database: address_1
Question: What are the city codes of the cities with the maximum distance?
SQL: SELECT city1_code ,  city2_code FROM Direct_distance ORDER BY distance DESC LIMIT 1
Database: address_1
Question: Show me the city code of two cities with a distance greater than the average.
SQL: SELECT city1_code ,  city2_code FROM Direct_distance WHERE distance  >  (SELECT avg(distance) FROM Direct_distance)
Database: address_1
Question: What are the city codes of cities with distance greater than average?
SQL: SELECT city1_code ,  city2_code FROM Direct_distance WHERE distance  >  (SELECT avg(distance) FROM Direct_distance)
Database: address_1
Question: Show me the city code of two cities with a distance less than 1000.
SQL: SELECT city1_code ,  city2_code FROM Direct_distance WHERE distance  <  1000
Database: address_1
Question: What are the city codes corresponding to cities with distances less than 1000?
SQL: SELECT city1_code ,  city2_code FROM Direct_distance WHERE distance  <  1000
Database: address_1
Question: What is the total distance between city BAL and all other cities.
SQL: SELECT sum(distance) FROM Direct_distance WHERE city1_code  =  "BAL"
Database: address_1
Question: What is the sum of distances between BAL and other cities?
SQL: SELECT sum(distance) FROM Direct_distance WHERE city1_code  =  "BAL"
Database: address_1
Question: What is the average distance between Boston and all other cities.
SQL: SELECT avg(distance) FROM Direct_distance AS T1 JOIN City AS T2 ON T1.city1_code  =  T2.city_code WHERE T2.city_name  =  "Boston"
Database: address_1
Question: Give the average distance between Boston and other cities.
SQL: SELECT avg(distance) FROM Direct_distance AS T1 JOIN City AS T2 ON T1.city1_code  =  T2.city_code WHERE T2.city_name  =  "Boston"
Database: address_1
Question: What is the name of the city closest to Chicago?
SQL: SELECT T3.city_name FROM Direct_distance AS T1 JOIN City AS T2 ON T1.city1_code  =  T2.city_code JOIN City AS T3 ON T1.city2_code  =  T3.city_code WHERE T2.city_name  =  "Chicago" ORDER BY distance LIMIT 1
Database: address_1
Question: Give the name of the nearest city to Chicago.
SQL: SELECT T3.city_name FROM Direct_distance AS T1 JOIN City AS T2 ON T1.city1_code  =  T2.city_code JOIN City AS T3 ON T1.city2_code  =  T3.city_code WHERE T2.city_name  =  "Chicago" ORDER BY distance LIMIT 1
Database: address_1
Question: What is the name of the city furthest to Boston?
SQL: SELECT T3.city_name FROM Direct_distance AS T1 JOIN City AS T2 ON T1.city1_code  =  T2.city_code JOIN City AS T3 ON T1.city2_code  =  T3.city_code WHERE T2.city_name  =  "Boston" ORDER BY distance DESC LIMIT 1
Database: address_1
Question: Give the city name of the city with greatest distance from Boston.
SQL: SELECT T3.city_name FROM Direct_distance AS T1 JOIN City AS T2 ON T1.city1_code  =  T2.city_code JOIN City AS T3 ON T1.city2_code  =  T3.city_code WHERE T2.city_name  =  "Boston" ORDER BY distance DESC LIMIT 1
Database: address_1
Question: Show all city codes and the total distance to all other cities.
SQL: SELECT city1_code ,  sum(distance) FROM Direct_distance GROUP BY city1_code
Database: address_1
Question: For each city, what is the the city code and sum of distances from each?
SQL: SELECT city1_code ,  sum(distance) FROM Direct_distance GROUP BY city1_code
Database: address_1
Question: Show all city names and the average distance to all other cities.
SQL: SELECT T2.city_name ,  avg(distance) FROM Direct_distance AS T1 JOIN City AS T2 ON T1.city1_code  =  T2.city_code GROUP BY T1.city1_code