target-benchmark/spider-queries huggingface dataset:
Database: cre_Doc_and_collections (tables: document_subsets, collections, document_subset_members, documents_in_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 (tables: document_subsets, collections, document_subset_members, documents_in_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 (tables: collections, collection_subset_members)
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 (tables: collections, collection_subset_members)
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 (tables: collections, collection_subset_members)
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 (tables: collections, collection_subset_members)
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 (tables: collection_subsets, collections, collection_subset_members)
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 (tables: collection_subsets, collections, collection_subset_members)
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 (tables: songs)
Question: How many songs contain "Love" in their names?
SQL: SELECT count(*) FROM songs WHERE name LIKE "%Love%"
Database: sing_contest (tables: songs)
Question: List the name of the songs in ascending, lexicographical order.
SQL: SELECT name FROM songs ORDER BY name
Database: sing_contest (tables: songs)
Question: List the names and languages of the songs .
SQL: select name , language from songs
Database: sing_contest (tables: performance_score)
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 (tables: participants, performance_score)
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 (tables: songs)
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 (tables: songs)
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 (tables: songs, performance_score)
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 (tables: participants, performance_score)
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 (tables: participants, performance_score)
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 (tables: participants, performance_score)
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 (tables: songs, performance_score)
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 (tables: songs, performance_score)
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 (tables: performance_score)
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 (tables: songs, performance_score)
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 (tables: songs, performance_score)
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 (tables: participants, songs, performance_score)
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 (tables: participants, songs, performance_score)
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 (tables: songs)
Question: Which song names have the substring "Is"?
SQL: SELECT name FROM songs WHERE name LIKE "%Is%"
Database: sing_contest (tables: songs, performance_score)
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 (tables: city)
Question: How many cities do we have?
SQL: SELECT count(*) FROM City
Database: address_1 (tables: city)
Question: Count the number of cities.
SQL: SELECT count(*) FROM City
Database: address_1 (tables: city)
Question: List all different states .
SQL: select distinct state from city
Database: address_1 (tables: city)
Question: What are all the distinct states?
SQL: SELECT DISTINCT state FROM City
Database: address_1 (tables: city)
Question: How many countries do we have?
SQL: SELECT count(DISTINCT country) FROM City
Database: address_1 (tables: city)
Question: Count the number of coutries.
SQL: SELECT count(DISTINCT country) FROM City
Database: address_1 (tables: city)
Question: Show names, codes, states, countries for all cities.
SQL: SELECT city_name ,  city_code ,  state ,  country FROM City
Database: address_1 (tables: city)
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 (tables: city)
Question: What is the latitude and longitude for Baltimore?
SQL: SELECT latitude ,  longitude FROM City WHERE city_name  =  "Baltimore"
Database: address_1 (tables: city)
Question: What latitude and longitude correspond to Baltimore?
SQL: SELECT latitude ,  longitude FROM City WHERE city_name  =  "Baltimore"
Database: address_1 (tables: city)
Question: Show names for all cities in state PA.
SQL: SELECT city_name FROM City WHERE state  =  "PA"
Database: address_1 (tables: city)
Question: What are the names of all cities in PA?
SQL: SELECT city_name FROM City WHERE state  =  "PA"
Database: address_1 (tables: city)
Question: How many cities are in Canada?
SQL: SELECT count(*) FROM City WHERE country  =  "CANADA"
Database: address_1 (tables: city)
Question: Count the number of cities in Canada.
SQL: SELECT count(*) FROM City WHERE country  =  "CANADA"
Database: address_1 (tables: city)
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 (tables: city)
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 (tables: city)
Question: Show all states and number of cities in each state.
SQL: SELECT state ,  count(*) FROM City GROUP BY state
Database: address_1 (tables: city)
Question: How many cities are in each state?
SQL: SELECT state ,  count(*) FROM City GROUP BY state
Database: address_1 (tables: city)
Question: Show all countries and number of cities in each .
SQL: select country ,  count(*) from city group by country
Database: address_1 (tables: city)
Question: How many cities are there in each country?
SQL: SELECT country ,  count(*) FROM City GROUP BY country
Database: address_1 (tables: city)
Question: List all states with at least two cities.
SQL: SELECT state FROM City GROUP BY state HAVING count(*)  >=  2
Database: address_1 (tables: city)
Question: Which states have at least two cities?
SQL: SELECT state FROM City GROUP BY state HAVING count(*)  >=  2
Database: address_1 (tables: city)
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 (tables: city)
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 (tables: city)
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 (tables: city)
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 (tables: city, student)
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 (tables: city, student)
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 (tables: city, student)
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 (tables: city, student)
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 (tables: city, student)
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 (tables: city, student)
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 (tables: city, student)
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 (tables: city, student)
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 (tables: city, student)
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 (tables: city, student)
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 (tables: city, student)
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 (tables: city, student)
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 (tables: city, student)
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 (tables: city, student)
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 (tables: city, student)
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 (tables: city, student)
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 (tables: city, student)
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 (tables: city, student)
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 (tables: city, student)
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 (tables: city, student)
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 (tables: city, student)
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 (tables: city, student)
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 (tables: city, student)
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 (tables: city, student)
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 (tables: direct_distance)
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 (tables: direct_distance)
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 (tables: city, direct_distance)
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 (tables: city, direct_distance)
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 (tables: direct_distance)
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 (tables: direct_distance)
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 (tables: direct_distance)
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 (tables: direct_distance)
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 (tables: direct_distance)
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 (tables: direct_distance)
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 (tables: direct_distance)
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 (tables: direct_distance)
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 (tables: direct_distance)
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 (tables: direct_distance)
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 (tables: city, direct_distance)
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 (tables: city, direct_distance)
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 (tables: city, direct_distance)
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 (tables: city, direct_distance)
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 (tables: city, direct_distance)
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 (tables: city, direct_distance)
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 (tables: direct_distance)
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 (tables: direct_distance)
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