query_id
int64
0
2.15k
database_id
stringclasses
40 values
table_id
listlengths
1
4
query
stringlengths
22
185
answer
stringlengths
22
608
difficulty
stringclasses
4 values
700
cre_Doc_and_collections
[ "collection_subsets", "collection_subset_members" ]
What are the collection subset ids, names, and number of collections for each subset?
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;
medium
701
cre_Doc_and_collections
[ "document_objects" ]
Which document has most of child? List the document id and the number of child.
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;
extra
702
cre_Doc_and_collections
[ "document_objects" ]
For each document object id, how many children do they have?
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;
extra
703
cre_Doc_and_collections
[ "document_subset_members" ]
Which document has least number of related documents? List the document id and the number of related documents.
SELECT Document_Object_ID , count(*) FROM Document_Subset_Members GROUP BY Document_Object_ID ORDER BY count(*) ASC LIMIT 1;
hard
704
cre_Doc_and_collections
[ "document_subset_members" ]
What is the document object id with the least number of documents ?
select document_object_id , count(*) from document_subset_members group by document_object_id order by count(*) asc limit 1;
hard
705
cre_Doc_and_collections
[ "document_subset_members" ]
Which document has between 2 and 4 number of documents ? List the document id and the number of related documents .
select document_object_id , count(*) from document_subset_members group by document_object_id having count(*) between 2 and 4;
medium
706
cre_Doc_and_collections
[ "document_subset_members" ]
What are the ids of the dcouments that have between 2 and 4 related documents and how many related items are there?
SELECT Document_Object_ID , count(*) FROM Document_Subset_Members GROUP BY Document_Object_ID HAVING count(*) BETWEEN 2 AND 4;
medium
707
cre_Doc_and_collections
[ "document_objects", "document_subset_members" ]
List all owner of documents that is related to documents owned by Braeden.
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';
medium
708
cre_Doc_and_collections
[ "document_objects", "document_subset_members" ]
What are the different owners of documents that are related to ones owned by Braeden?
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';
medium
709
cre_Doc_and_collections
[ "document_subsets", "document_objects", "document_subset_members" ]
Which unique subset does document owned by Braeden belong to? List the subset name.
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'
hard
710
cre_Doc_and_collections
[ "document_subsets", "document_objects", "document_subset_members" ]
What are the different subset names of all documents owned by Braeden?
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'
hard
711
cre_Doc_and_collections
[ "document_subsets", "document_subset_members" ]
List subset id, name and number of different documents in each subset.
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;
medium
712
cre_Doc_and_collections
[ "document_subsets", "document_subset_members" ]
What is the subset id, name, and number of different documents for each subset?
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;
medium
713
cre_Doc_and_collections
[ "document_subset_members", "document_subsets" ]
Which document subset has most of number of distinct documents ? List subset id , name and number of documents .
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;
extra
714
cre_Doc_and_collections
[ "document_subset_members", "document_subsets" ]
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 ?
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;
extra
715
cre_Doc_and_collections
[ "document_subsets", "document_subset_members" ]
For document subset named 'Best for 2000', List all document id that in this subset.
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";
medium
716
cre_Doc_and_collections
[ "document_subsets", "document_subset_members" ]
For the document subset named 'Best for 2000', what are the document ids in that subset?
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";
medium
717
cre_Doc_and_collections
[ "document_subsets", "document_subset_members" ]
List all document subsets of documents that related to each document id. List the name of document subset and the document id.
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
medium
718
cre_Doc_and_collections
[ "document_subset_members", "document_subsets" ]
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 ?
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
medium
719
cre_Doc_and_collections
[ "collections", "document_objects", "documents_in_collections" ]
List the Collection Name that document owned by 'Ransom ' belong to .
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'
hard
720
cre_Doc_and_collections
[ "collections", "document_objects", "documents_in_collections" ]
What is the collection name of a document owned by 'Ransom'?
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'
hard
721
cre_Doc_and_collections
[ "collections", "documents_in_collections" ]
How many collections does each document belong to? List the count and the document id.
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
medium
722
cre_Doc_and_collections
[ "collections", "documents_in_collections" ]
For each document object id, how many collections does it belong to?
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
medium
723
cre_Doc_and_collections
[ "collections", "documents_in_collections" ]
How many documents does collection named 'Best' has?
SELECT count(*) FROM Collections AS T1 JOIN Documents_in_Collections AS T2 ON T1.Collection_ID = T2.Collection_ID WHERE T1.Collection_Name = "Best";
medium
724
cre_Doc_and_collections
[ "collections", "documents_in_collections" ]
What is the number of documents in the collection named 'Best'?
SELECT count(*) FROM Collections AS T1 JOIN Documents_in_Collections AS T2 ON T1.Collection_ID = T2.Collection_ID WHERE T1.Collection_Name = "Best";
medium
725
cre_Doc_and_collections
[ "collections", "documents_in_collections" ]
List the document id of all documents in collection named Best.
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";
medium
726
cre_Doc_and_collections
[ "collections", "documents_in_collections" ]
What is the number of document object ids in the collection named Best?
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";
medium
727
cre_Doc_and_collections
[ "collections", "documents_in_collections" ]
Which collection have most number of documents? List collection name, id and number of documents.
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;
extra
728
cre_Doc_and_collections
[ "collections", "documents_in_collections" ]
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?
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;
extra
729
cre_Doc_and_collections
[ "document_subsets", "collections", "document_subset_members", "documents_in_collections" ]
List id of documents that in document subset Best for 2000 and collection named Best.
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";
extra
730
cre_Doc_and_collections
[ "document_subsets", "collections", "document_subset_members", "documents_in_collections" ]
What are the different document object ids in the subset named 'Best for 2000' and in the collection named 'Best'?
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";
extra
731
cre_Doc_and_collections
[ "document_subsets", "collections", "document_subset_members", "documents_in_collections" ]
List id of documents that in collection named Best but not in document subset Best for 2000.
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"
extra
732
cre_Doc_and_collections
[ "document_subsets", "collections", "document_subset_members", "documents_in_collections" ]
What are the different document object ids that are in the collection named Best but not in the subset named 'Best for 2000'?
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"
extra
733
cre_Doc_and_collections
[ "document_subsets", "collections", "document_subset_members", "documents_in_collections" ]
List id of documents that in document subset Best for 2000 or in collection named Best.
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";
extra
734
cre_Doc_and_collections
[ "document_subsets", "collections", "document_subset_members", "documents_in_collections" ]
What are the different document ids that are in the subset named 'Best for 2000' or in the collection named 'Best'?
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";
extra
735
cre_Doc_and_collections
[ "collections", "collection_subset_members" ]
List all name of collections that are related to collection named Best.
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";
extra
736
cre_Doc_and_collections
[ "collections", "collection_subset_members" ]
What are the names of the collections that are related to the collection named Best?
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";
extra
737
cre_Doc_and_collections
[ "collections", "collection_subset_members" ]
How many collections that are related to collection named Best?
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";
medium
738
cre_Doc_and_collections
[ "collections", "collection_subset_members" ]
How many different collections are related to the one named 'Best'?
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";
medium
739
cre_Doc_and_collections
[ "collection_subsets", "collections", "collection_subset_members" ]
Which collection subset does collection name Best in? List collection subset name.
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";
hard
740
cre_Doc_and_collections
[ "collection_subsets", "collections", "collection_subset_members" ]
What are the collection subsets that the collection named 'Best' in?
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";
hard
741
sing_contest
[ "songs" ]
How many songs contain "Love" in their names?
SELECT count(*) FROM songs WHERE name LIKE "%Love%"
medium
742
sing_contest
[ "songs" ]
List the name of the songs in ascending, lexicographical order.
SELECT name FROM songs ORDER BY name
easy
743
sing_contest
[ "songs" ]
List the names and languages of the songs .
select name , language from songs
medium
744
sing_contest
[ "performance_score" ]
What are the maximum and minimum voice sound quality score of the performances?
SELECT max(voice_sound_quality) , min(voice_sound_quality) FROM performance_score
medium
745
sing_contest
[ "participants", "performance_score" ]
What are the voice sound quality score, rhythm tempo score and stage presence score performed by the participant named 'Freeway'?
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'
medium
746
sing_contest
[ "songs" ]
What are the id, language and original artist of the songs whose name is not 'Love'?
SELECT id , LANGUAGE , original_artist FROM songs WHERE name != 'Love'
medium
747
sing_contest
[ "songs" ]
What are the names and original artists of the song whose English translation is 'All the streets of love'?
SELECT name , original_artist FROM songs WHERE english_translation = 'All the streets of love'
medium
748
sing_contest
[ "songs", "performance_score" ]
What are the distinct stage presence scores for all the songs that are in language 'English' ?
SELECT DISTINCT T2.stage_presence FROM songs AS T1 JOIN performance_score AS T2 ON T1.id = T2.songs_id WHERE T1.language = 'English'
medium
749
sing_contest
[ "participants", "performance_score" ]
What are the ids and names of the participants who have performed at least two songs?
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
medium
750
sing_contest
[ "participants", "performance_score" ]
What are the ids, names and popularity of the participants, order by the number of songs they perform?
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(*)
hard
751
sing_contest
[ "participants", "performance_score" ]
What are the id and name of the participants who received score 5 for their sound quality or rhythm tempo?
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
hard
752
sing_contest
[ "songs", "performance_score" ]
What are the voice sound quality scores received for the song named ' The Balkan Girls ' in English language ?
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'
medium
753
sing_contest
[ "songs", "performance_score" ]
What are the id and name of the song sung by the most participants?
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
extra
754
sing_contest
[ "performance_score" ]
How many performances have a stage presence score less than 7 or higher than 9?
SELECT count(*) FROM performance_score WHERE stage_presence < 7 OR stage_presence > 9
medium
755
sing_contest
[ "songs", "performance_score" ]
How many songs listed are not performed?
SELECT count(*) FROM songs WHERE id NOT IN ( SELECT songs_id FROM performance_score );
extra
756
sing_contest
[ "songs", "performance_score" ]
What are the average rhythm scores for the songs in each different language?
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
medium
757
sing_contest
[ "participants", "songs", "performance_score" ]
What are the distinct names of the participants who have sung a song in 'English'?
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'
hard
758
sing_contest
[ "participants", "songs", "performance_score" ]
What are the name and popularity of participants who have sung a song both in 'Croatian' language and in 'English' language?
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'
extra
759
sing_contest
[ "songs" ]
Which song names have the substring "Is"?
SELECT name FROM songs WHERE name LIKE "%Is%"
medium
760
sing_contest
[ "songs", "performance_score" ]
Find the original artists who sing songs with rhythm tempo above 5 , and list results in descending order of voice sound quality .
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
hard
761
address_1
[ "city" ]
How many cities do we have?
SELECT count(*) FROM City
easy
762
address_1
[ "city" ]
Count the number of cities.
SELECT count(*) FROM City
easy
763
address_1
[ "city" ]
List all different states .
select distinct state from city
easy
764
address_1
[ "city" ]
What are all the distinct states?
SELECT DISTINCT state FROM City
easy
765
address_1
[ "city" ]
How many countries do we have?
SELECT count(DISTINCT country) FROM City
easy
766
address_1
[ "city" ]
Count the number of coutries.
SELECT count(DISTINCT country) FROM City
easy
767
address_1
[ "city" ]
Show names, codes, states, countries for all cities.
SELECT city_name , city_code , state , country FROM City
medium
768
address_1
[ "city" ]
What are the names, codes, states, and countries for all cities?
SELECT city_name , city_code , state , country FROM City
medium
769
address_1
[ "city" ]
What is the latitude and longitude for Baltimore?
SELECT latitude , longitude FROM City WHERE city_name = "Baltimore"
medium
770
address_1
[ "city" ]
What latitude and longitude correspond to Baltimore?
SELECT latitude , longitude FROM City WHERE city_name = "Baltimore"
medium
771
address_1
[ "city" ]
Show names for all cities in state PA.
SELECT city_name FROM City WHERE state = "PA"
easy
772
address_1
[ "city" ]
What are the names of all cities in PA?
SELECT city_name FROM City WHERE state = "PA"
easy
773
address_1
[ "city" ]
How many cities are in Canada?
SELECT count(*) FROM City WHERE country = "CANADA"
easy
774
address_1
[ "city" ]
Count the number of cities in Canada.
SELECT count(*) FROM City WHERE country = "CANADA"
easy
775
address_1
[ "city" ]
Show names for all USA city ordered by latitude.
SELECT city_name FROM City WHERE country = "USA" ORDER BY latitude
medium
776
address_1
[ "city" ]
What are all the city names for cities in the USA, ordered by latitude?
SELECT city_name FROM City WHERE country = "USA" ORDER BY latitude
medium
777
address_1
[ "city" ]
Show all states and number of cities in each state.
SELECT state , count(*) FROM City GROUP BY state
medium
778
address_1
[ "city" ]
How many cities are in each state?
SELECT state , count(*) FROM City GROUP BY state
medium
779
address_1
[ "city" ]
Show all countries and number of cities in each .
select country , count(*) from city group by country
medium
780
address_1
[ "city" ]
How many cities are there in each country?
SELECT country , count(*) FROM City GROUP BY country
medium
781
address_1
[ "city" ]
List all states with at least two cities.
SELECT state FROM City GROUP BY state HAVING count(*) >= 2
easy
782
address_1
[ "city" ]
Which states have at least two cities?
SELECT state FROM City GROUP BY state HAVING count(*) >= 2
easy
783
address_1
[ "city" ]
Which state has most number of cities?
SELECT state FROM City GROUP BY state ORDER BY count(*) DESC LIMIT 1
hard
784
address_1
[ "city" ]
Give the state that has the most cities.
SELECT state FROM City GROUP BY state ORDER BY count(*) DESC LIMIT 1
hard
785
address_1
[ "city" ]
Which country has fewest number of cities?
SELECT country FROM City GROUP BY country ORDER BY count(*) ASC LIMIT 1
hard
786
address_1
[ "city" ]
Give the country with the fewest number of cities.
SELECT country FROM City GROUP BY country ORDER BY count(*) ASC LIMIT 1
hard
787
address_1
[ "city", "student" ]
Show the first name and the last name for students living in state MD.
SELECT T2.Fname , T2.Lname FROM City AS T1 JOIN Student AS T2 ON T1.city_code = T2.city_code WHERE T1.state = "MD"
medium
788
address_1
[ "city", "student" ]
What are the full names of students living in MD?
SELECT T2.Fname , T2.Lname FROM City AS T1 JOIN Student AS T2 ON T1.city_code = T2.city_code WHERE T1.state = "MD"
medium
789
address_1
[ "city", "student" ]
How many students live in China?
SELECT count(*) FROM City AS T1 JOIN Student AS T2 ON T1.city_code = T2.city_code WHERE T1.country = "CHINA"
medium
790
address_1
[ "city", "student" ]
Count the number of students living in China.
SELECT count(*) FROM City AS T1 JOIN Student AS T2 ON T1.city_code = T2.city_code WHERE T1.country = "CHINA"
medium
791
address_1
[ "city", "student" ]
Return the first name and major of students are living in Baltimore?
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"
medium
792
address_1
[ "city", "student" ]
What are the first names and majors of students living in Baltimore?
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"
medium
793
address_1
[ "city", "student" ]
Show the number of students living in each country.
SELECT T1.country , count(*) FROM City AS T1 JOIN Student AS T2 ON T1.city_code = T2.city_code GROUP BY T1.country
medium
794
address_1
[ "city", "student" ]
How many students live in each country?
SELECT T1.country , count(*) FROM City AS T1 JOIN Student AS T2 ON T1.city_code = T2.city_code GROUP BY T1.country
medium
795
address_1
[ "city", "student" ]
Find the number of students living in each city.
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
medium
796
address_1
[ "city", "student" ]
How many students live in each city?
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
medium
797
address_1
[ "city", "student" ]
Which state has most number of students?
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
extra
798
address_1
[ "city", "student" ]
Give the state that has the most students.
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
extra
799
address_1
[ "city", "student" ]
Which country has least number of students?
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
extra