nl stringlengths 22 185 | sql stringlengths 22 608 | db_id stringclasses 40
values | table_schema stringclasses 305
values |
|---|---|---|---|
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; | cre_Doc_and_collections | [{'table_name': 'collection subsets', 'table_schema': [{'col_name': 'collection subset id'}, {'col_name': 'collection subset name'}, {'col_name': 'collecrtion subset details'}], 'foreign_key_columns': [], 'primary_keys': ['collection subset id']}, {'table_name': 'collection subset members', 'table_schema': [{'col_name'... |
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; | cre_Doc_and_collections | [{'table_name': 'document objects', 'table_schema': [{'col_name': 'document object id'}, {'col_name': 'parent document object id'}, {'col_name': 'owner'}, {'col_name': 'description'}, {'col_name': 'other details'}], 'foreign_key_columns': [], 'primary_keys': ['document object id']}] |
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; | cre_Doc_and_collections | [{'table_name': 'document objects', 'table_schema': [{'col_name': 'document object id'}, {'col_name': 'parent document object id'}, {'col_name': 'owner'}, {'col_name': 'description'}, {'col_name': 'other details'}], 'foreign_key_columns': [], 'primary_keys': ['document object id']}] |
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; | cre_Doc_and_collections | [{'table_name': 'document subset members', 'table_schema': [{'col_name': 'document object id'}, {'col_name': 'related document object id'}, {'col_name': 'document subset id'}], 'foreign_key_columns': ['document subset id', 'related document object id', 'document object id'], 'primary_keys': ['document object id']}] |
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; | cre_Doc_and_collections | [{'table_name': 'document subset members', 'table_schema': [{'col_name': 'document object id'}, {'col_name': 'related document object id'}, {'col_name': 'document subset id'}], 'foreign_key_columns': ['document subset id', 'related document object id', 'document object id'], 'primary_keys': ['document object id']}] |
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; | cre_Doc_and_collections | [{'table_name': 'document subset members', 'table_schema': [{'col_name': 'document object id'}, {'col_name': 'related document object id'}, {'col_name': 'document subset id'}], 'foreign_key_columns': ['document subset id', 'related document object id', 'document object id'], 'primary_keys': ['document object id']}] |
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; | cre_Doc_and_collections | [{'table_name': 'document subset members', 'table_schema': [{'col_name': 'document object id'}, {'col_name': 'related document object id'}, {'col_name': 'document subset id'}], 'foreign_key_columns': ['document subset id', 'related document object id', 'document object id'], 'primary_keys': ['document object id']}] |
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'; | cre_Doc_and_collections | [{'table_name': 'document objects', 'table_schema': [{'col_name': 'document object id'}, {'col_name': 'parent document object id'}, {'col_name': 'owner'}, {'col_name': 'description'}, {'col_name': 'other details'}], 'foreign_key_columns': [], 'primary_keys': ['document object id']}, {'table_name': 'document subset memb... |
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'; | cre_Doc_and_collections | [{'table_name': 'document objects', 'table_schema': [{'col_name': 'document object id'}, {'col_name': 'parent document object id'}, {'col_name': 'owner'}, {'col_name': 'description'}, {'col_name': 'other details'}], 'foreign_key_columns': [], 'primary_keys': ['document object id']}, {'table_name': 'document subset memb... |
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' | cre_Doc_and_collections | [{'table_name': 'document subsets', 'table_schema': [{'col_name': 'document subset id'}, {'col_name': 'document subset name'}, {'col_name': 'document subset details'}], 'foreign_key_columns': [], 'primary_keys': ['document subset id']}, {'table_name': 'document objects', 'table_schema': [{'col_name': 'document object i... |
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' | cre_Doc_and_collections | [{'table_name': 'document subsets', 'table_schema': [{'col_name': 'document subset id'}, {'col_name': 'document subset name'}, {'col_name': 'document subset details'}], 'foreign_key_columns': [], 'primary_keys': ['document subset id']}, {'table_name': 'document objects', 'table_schema': [{'col_name': 'document object i... |
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; | cre_Doc_and_collections | [{'table_name': 'document subsets', 'table_schema': [{'col_name': 'document subset id'}, {'col_name': 'document subset name'}, {'col_name': 'document subset details'}], 'foreign_key_columns': [], 'primary_keys': ['document subset id']}, {'table_name': 'document subset members', 'table_schema': [{'col_name': 'document o... |
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; | cre_Doc_and_collections | [{'table_name': 'document subsets', 'table_schema': [{'col_name': 'document subset id'}, {'col_name': 'document subset name'}, {'col_name': 'document subset details'}], 'foreign_key_columns': [], 'primary_keys': ['document subset id']}, {'table_name': 'document subset members', 'table_schema': [{'col_name': 'document o... |
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; | cre_Doc_and_collections | [{'table_name': 'document subsets', 'table_schema': [{'col_name': 'document subset id'}, {'col_name': 'document subset name'}, {'col_name': 'document subset details'}], 'foreign_key_columns': [], 'primary_keys': ['document subset id']}, {'table_name': 'document subset members', 'table_schema': [{'col_name': 'document o... |
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; | cre_Doc_and_collections | [{'table_name': 'document subsets', 'table_schema': [{'col_name': 'document subset id'}, {'col_name': 'document subset name'}, {'col_name': 'document subset details'}], 'foreign_key_columns': [], 'primary_keys': ['document subset id']}, {'table_name': 'document subset members', 'table_schema': [{'col_name': 'document o... |
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"; | cre_Doc_and_collections | [{'table_name': 'document subsets', 'table_schema': [{'col_name': 'document subset id'}, {'col_name': 'document subset name'}, {'col_name': 'document subset details'}], 'foreign_key_columns': [], 'primary_keys': ['document subset id']}, {'table_name': 'document subset members', 'table_schema': [{'col_name': 'document o... |
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"; | cre_Doc_and_collections | [{'table_name': 'document subsets', 'table_schema': [{'col_name': 'document subset id'}, {'col_name': 'document subset name'}, {'col_name': 'document subset details'}], 'foreign_key_columns': [], 'primary_keys': ['document subset id']}, {'table_name': 'document subset members', 'table_schema': [{'col_name': 'document o... |
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 | cre_Doc_and_collections | [{'table_name': 'document subsets', 'table_schema': [{'col_name': 'document subset id'}, {'col_name': 'document subset name'}, {'col_name': 'document subset details'}], 'foreign_key_columns': [], 'primary_keys': ['document subset id']}, {'table_name': 'document subset members', 'table_schema': [{'col_name': 'document o... |
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 | cre_Doc_and_collections | [{'table_name': 'document subsets', 'table_schema': [{'col_name': 'document subset id'}, {'col_name': 'document subset name'}, {'col_name': 'document subset details'}], 'foreign_key_columns': [], 'primary_keys': ['document subset id']}, {'table_name': 'document subset members', 'table_schema': [{'col_name': 'document o... |
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' | cre_Doc_and_collections | [{'table_name': 'document objects', 'table_schema': [{'col_name': 'document object id'}, {'col_name': 'parent document object id'}, {'col_name': 'owner'}, {'col_name': 'description'}, {'col_name': 'other details'}], 'foreign_key_columns': [], 'primary_keys': ['document object id']}, {'table_name': 'collections', 'table... |
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' | cre_Doc_and_collections | [{'table_name': 'document objects', 'table_schema': [{'col_name': 'document object id'}, {'col_name': 'parent document object id'}, {'col_name': 'owner'}, {'col_name': 'description'}, {'col_name': 'other details'}], 'foreign_key_columns': [], 'primary_keys': ['document object id']}, {'table_name': 'collections', 'table... |
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 | cre_Doc_and_collections | [{'table_name': 'collections', 'table_schema': [{'col_name': 'collection id'}, {'col_name': 'parent collection id'}, {'col_name': 'collection name'}, {'col_name': 'collection description'}], 'foreign_key_columns': [], 'primary_keys': ['collection id']}, {'table_name': 'documents in collections', 'table_schema': [{'col_... |
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 | cre_Doc_and_collections | [{'table_name': 'collections', 'table_schema': [{'col_name': 'collection id'}, {'col_name': 'parent collection id'}, {'col_name': 'collection name'}, {'col_name': 'collection description'}], 'foreign_key_columns': [], 'primary_keys': ['collection id']}, {'table_name': 'documents in collections', 'table_schema': [{'col_... |
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"; | cre_Doc_and_collections | [{'table_name': 'collections', 'table_schema': [{'col_name': 'collection id'}, {'col_name': 'parent collection id'}, {'col_name': 'collection name'}, {'col_name': 'collection description'}], 'foreign_key_columns': [], 'primary_keys': ['collection id']}, {'table_name': 'documents in collections', 'table_schema': [{'col_... |
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"; | cre_Doc_and_collections | [{'table_name': 'collections', 'table_schema': [{'col_name': 'collection id'}, {'col_name': 'parent collection id'}, {'col_name': 'collection name'}, {'col_name': 'collection description'}], 'foreign_key_columns': [], 'primary_keys': ['collection id']}, {'table_name': 'documents in collections', 'table_schema': [{'col_... |
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"; | cre_Doc_and_collections | [{'table_name': 'collections', 'table_schema': [{'col_name': 'collection id'}, {'col_name': 'parent collection id'}, {'col_name': 'collection name'}, {'col_name': 'collection description'}], 'foreign_key_columns': [], 'primary_keys': ['collection id']}, {'table_name': 'documents in collections', 'table_schema': [{'col_... |
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"; | cre_Doc_and_collections | [{'table_name': 'collections', 'table_schema': [{'col_name': 'collection id'}, {'col_name': 'parent collection id'}, {'col_name': 'collection name'}, {'col_name': 'collection description'}], 'foreign_key_columns': [], 'primary_keys': ['collection id']}, {'table_name': 'documents in collections', 'table_schema': [{'col_... |
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; | cre_Doc_and_collections | [{'table_name': 'collections', 'table_schema': [{'col_name': 'collection id'}, {'col_name': 'parent collection id'}, {'col_name': 'collection name'}, {'col_name': 'collection description'}], 'foreign_key_columns': [], 'primary_keys': ['collection id']}, {'table_name': 'documents in collections', 'table_schema': [{'col_... |
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; | cre_Doc_and_collections | [{'table_name': 'collections', 'table_schema': [{'col_name': 'collection id'}, {'col_name': 'parent collection id'}, {'col_name': 'collection name'}, {'col_name': 'collection description'}], 'foreign_key_columns': [], 'primary_keys': ['collection id']}, {'table_name': 'documents in collections', 'table_schema': [{'col_... |
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_... | cre_Doc_and_collections | [{'table_name': 'document subsets', 'table_schema': [{'col_name': 'document subset id'}, {'col_name': 'document subset name'}, {'col_name': 'document subset details'}], 'foreign_key_columns': [], 'primary_keys': ['document subset id']}, {'table_name': 'collections', 'table_schema': [{'col_name': 'collection id'}, {'col... |
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_... | cre_Doc_and_collections | [{'table_name': 'document subsets', 'table_schema': [{'col_name': 'document subset id'}, {'col_name': 'document subset name'}, {'col_name': 'document subset details'}], 'foreign_key_columns': [], 'primary_keys': ['document subset id']}, {'table_name': 'collections', 'table_schema': [{'col_name': 'collection id'}, {'col... |
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_Su... | cre_Doc_and_collections | [{'table_name': 'document subsets', 'table_schema': [{'col_name': 'document subset id'}, {'col_name': 'document subset name'}, {'col_name': 'document subset details'}], 'foreign_key_columns': [], 'primary_keys': ['document subset id']}, {'table_name': 'collections', 'table_schema': [{'col_name': 'collection id'}, {'col... |
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_Su... | cre_Doc_and_collections | [{'table_name': 'document subsets', 'table_schema': [{'col_name': 'document subset id'}, {'col_name': 'document subset name'}, {'col_name': 'document subset details'}], 'foreign_key_columns': [], 'primary_keys': ['document subset id']}, {'table_name': 'collections', 'table_schema': [{'col_name': 'collection id'}, {'col... |
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_... | cre_Doc_and_collections | [{'table_name': 'document subsets', 'table_schema': [{'col_name': 'document subset id'}, {'col_name': 'document subset name'}, {'col_name': 'document subset details'}], 'foreign_key_columns': [], 'primary_keys': ['document subset id']}, {'table_name': 'collections', 'table_schema': [{'col_name': 'collection id'}, {'col... |
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_... | cre_Doc_and_collections | [{'table_name': 'document subsets', 'table_schema': [{'col_name': 'document subset id'}, {'col_name': 'document subset name'}, {'col_name': 'document subset details'}], 'foreign_key_columns': [], 'primary_keys': ['document subset id']}, {'table_name': 'collections', 'table_schema': [{'col_name': 'collection id'}, {'col... |
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"; | cre_Doc_and_collections | [{'table_name': 'collections', 'table_schema': [{'col_name': 'collection id'}, {'col_name': 'parent collection id'}, {'col_name': 'collection name'}, {'col_name': 'collection description'}], 'foreign_key_columns': [], 'primary_keys': ['collection id']}, {'table_name': 'collection subset members', 'table_schema': [{'col... |
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"; | cre_Doc_and_collections | [{'table_name': 'collections', 'table_schema': [{'col_name': 'collection id'}, {'col_name': 'parent collection id'}, {'col_name': 'collection name'}, {'col_name': 'collection description'}], 'foreign_key_columns': [], 'primary_keys': ['collection id']}, {'table_name': 'collection subset members', 'table_schema': [{'col... |
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"; | cre_Doc_and_collections | [{'table_name': 'collections', 'table_schema': [{'col_name': 'collection id'}, {'col_name': 'parent collection id'}, {'col_name': 'collection name'}, {'col_name': 'collection description'}], 'foreign_key_columns': [], 'primary_keys': ['collection id']}, {'table_name': 'collection subset members', 'table_schema': [{'col... |
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"; | cre_Doc_and_collections | [{'table_name': 'collections', 'table_schema': [{'col_name': 'collection id'}, {'col_name': 'parent collection id'}, {'col_name': 'collection name'}, {'col_name': 'collection description'}], 'foreign_key_columns': [], 'primary_keys': ['collection id']}, {'table_name': 'collection subset members', 'table_schema': [{'col... |
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"; | cre_Doc_and_collections | [{'table_name': 'collection subsets', 'table_schema': [{'col_name': 'collection subset id'}, {'col_name': 'collection subset name'}, {'col_name': 'collecrtion subset details'}], 'foreign_key_columns': [], 'primary_keys': ['collection subset id']}, {'table_name': 'collections', 'table_schema': [{'col_name': 'collection ... |
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"; | cre_Doc_and_collections | [{'table_name': 'collection subsets', 'table_schema': [{'col_name': 'collection subset id'}, {'col_name': 'collection subset name'}, {'col_name': 'collecrtion subset details'}], 'foreign_key_columns': [], 'primary_keys': ['collection subset id']}, {'table_name': 'collections', 'table_schema': [{'col_name': 'collection ... |
How many songs contain "Love" in their names? | SELECT count(*) FROM songs WHERE name LIKE "%Love%" | sing_contest | [{'table_name': 'songs', 'table_schema': [{'col_name': 'id'}, {'col_name': 'language'}, {'col_name': 'original artist'}, {'col_name': 'name'}, {'col_name': 'english translation'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
List the name of the songs in ascending, lexicographical order. | SELECT name FROM songs ORDER BY name | sing_contest | [{'table_name': 'songs', 'table_schema': [{'col_name': 'id'}, {'col_name': 'language'}, {'col_name': 'original artist'}, {'col_name': 'name'}, {'col_name': 'english translation'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
List the names and languages of the songs . | select name , language from songs | sing_contest | [{'table_name': 'songs', 'table_schema': [{'col_name': 'id'}, {'col_name': 'language'}, {'col_name': 'original artist'}, {'col_name': 'name'}, {'col_name': 'english translation'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
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 | sing_contest | [{'table_name': 'performance score', 'table_schema': [{'col_name': 'participant id'}, {'col_name': 'songs id'}, {'col_name': 'voice sound quality'}, {'col_name': 'rhythm tempo'}, {'col_name': 'stage presence'}], 'foreign_key_columns': ['songs id', 'participant id'], 'primary_keys': ['participant id']}] |
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' | sing_contest | [{'table_name': 'participants', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'popularity'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'performance score', 'table_schema': [{'col_name': 'participant id'}, {'col_name': 'songs id'}, {'col_name': 'voice sound quality'}, ... |
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' | sing_contest | [{'table_name': 'songs', 'table_schema': [{'col_name': 'id'}, {'col_name': 'language'}, {'col_name': 'original artist'}, {'col_name': 'name'}, {'col_name': 'english translation'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
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' | sing_contest | [{'table_name': 'songs', 'table_schema': [{'col_name': 'id'}, {'col_name': 'language'}, {'col_name': 'original artist'}, {'col_name': 'name'}, {'col_name': 'english translation'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
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' | sing_contest | [{'table_name': 'songs', 'table_schema': [{'col_name': 'id'}, {'col_name': 'language'}, {'col_name': 'original artist'}, {'col_name': 'name'}, {'col_name': 'english translation'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'performance score', 'table_schema': [{'col_name': 'participant id'}, {'... |
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 | sing_contest | [{'table_name': 'participants', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'popularity'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'performance score', 'table_schema': [{'col_name': 'participant id'}, {'col_name': 'songs id'}, {'col_name': 'voice sound quality'}, ... |
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(*) | sing_contest | [{'table_name': 'participants', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'popularity'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'performance score', 'table_schema': [{'col_name': 'participant id'}, {'col_name': 'songs id'}, {'col_name': 'voice sound quality'}, ... |
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 | sing_contest | [{'table_name': 'participants', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'popularity'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'performance score', 'table_schema': [{'col_name': 'participant id'}, {'col_name': 'songs id'}, {'col_name': 'voice sound quality'}, ... |
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' | sing_contest | [{'table_name': 'songs', 'table_schema': [{'col_name': 'id'}, {'col_name': 'language'}, {'col_name': 'original artist'}, {'col_name': 'name'}, {'col_name': 'english translation'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'performance score', 'table_schema': [{'col_name': 'participant id'}, {'... |
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 | sing_contest | [{'table_name': 'songs', 'table_schema': [{'col_name': 'id'}, {'col_name': 'language'}, {'col_name': 'original artist'}, {'col_name': 'name'}, {'col_name': 'english translation'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'performance score', 'table_schema': [{'col_name': 'participant id'}, {'... |
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 | sing_contest | [{'table_name': 'performance score', 'table_schema': [{'col_name': 'participant id'}, {'col_name': 'songs id'}, {'col_name': 'voice sound quality'}, {'col_name': 'rhythm tempo'}, {'col_name': 'stage presence'}], 'foreign_key_columns': ['songs id', 'participant id'], 'primary_keys': ['participant id']}] |
How many songs listed are not performed? | SELECT count(*) FROM songs WHERE id NOT IN ( SELECT songs_id FROM performance_score ); | sing_contest | [{'table_name': 'songs', 'table_schema': [{'col_name': 'id'}, {'col_name': 'language'}, {'col_name': 'original artist'}, {'col_name': 'name'}, {'col_name': 'english translation'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'performance score', 'table_schema': [{'col_name': 'participant id'}, {'... |
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 | sing_contest | [{'table_name': 'songs', 'table_schema': [{'col_name': 'id'}, {'col_name': 'language'}, {'col_name': 'original artist'}, {'col_name': 'name'}, {'col_name': 'english translation'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'performance score', 'table_schema': [{'col_name': 'participant id'}, {'... |
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' | sing_contest | [{'table_name': 'participants', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'popularity'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'songs', 'table_schema': [{'col_name': 'id'}, {'col_name': 'language'}, {'col_name': 'original artist'}, {'col_name': 'name'}, {'col_... |
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 JOI... | sing_contest | [{'table_name': 'participants', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'popularity'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'songs', 'table_schema': [{'col_name': 'id'}, {'col_name': 'language'}, {'col_name': 'original artist'}, {'col_name': 'name'}, {'col_... |
Which song names have the substring "Is"? | SELECT name FROM songs WHERE name LIKE "%Is%" | sing_contest | [{'table_name': 'songs', 'table_schema': [{'col_name': 'id'}, {'col_name': 'language'}, {'col_name': 'original artist'}, {'col_name': 'name'}, {'col_name': 'english translation'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
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 | sing_contest | [{'table_name': 'songs', 'table_schema': [{'col_name': 'id'}, {'col_name': 'language'}, {'col_name': 'original artist'}, {'col_name': 'name'}, {'col_name': 'english translation'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'performance score', 'table_schema': [{'col_name': 'participant id'}, {'... |
How many cities do we have? | SELECT count(*) FROM City | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
Count the number of cities. | SELECT count(*) FROM City | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
List all different states . | select distinct state from city | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
What are all the distinct states? | SELECT DISTINCT state FROM City | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
How many countries do we have? | SELECT count(DISTINCT country) FROM City | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
Count the number of coutries. | SELECT count(DISTINCT country) FROM City | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
Show names, codes, states, countries for all cities. | SELECT city_name , city_code , state , country FROM City | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
What are the names, codes, states, and countries for all cities? | SELECT city_name , city_code , state , country FROM City | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
What is the latitude and longitude for Baltimore? | SELECT latitude , longitude FROM City WHERE city_name = "Baltimore" | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
What latitude and longitude correspond to Baltimore? | SELECT latitude , longitude FROM City WHERE city_name = "Baltimore" | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
Show names for all cities in state PA. | SELECT city_name FROM City WHERE state = "PA" | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
What are the names of all cities in PA? | SELECT city_name FROM City WHERE state = "PA" | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
How many cities are in Canada? | SELECT count(*) FROM City WHERE country = "CANADA" | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
Count the number of cities in Canada. | SELECT count(*) FROM City WHERE country = "CANADA" | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
Show names for all USA city ordered by latitude. | SELECT city_name FROM City WHERE country = "USA" ORDER BY latitude | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
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 | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
Show all states and number of cities in each state. | SELECT state , count(*) FROM City GROUP BY state | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
How many cities are in each state? | SELECT state , count(*) FROM City GROUP BY state | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
Show all countries and number of cities in each . | select country , count(*) from city group by country | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
How many cities are there in each country? | SELECT country , count(*) FROM City GROUP BY country | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
List all states with at least two cities. | SELECT state FROM City GROUP BY state HAVING count(*) >= 2 | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
Which states have at least two cities? | SELECT state FROM City GROUP BY state HAVING count(*) >= 2 | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
Which state has most number of cities? | SELECT state FROM City GROUP BY state ORDER BY count(*) DESC LIMIT 1 | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
Give the state that has the most cities. | SELECT state FROM City GROUP BY state ORDER BY count(*) DESC LIMIT 1 | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
Which country has fewest number of cities? | SELECT country FROM City GROUP BY country ORDER BY count(*) ASC LIMIT 1 | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
Give the country with the fewest number of cities. | SELECT country FROM City GROUP BY country ORDER BY count(*) ASC LIMIT 1 | address_1 | [{'table_name': 'city', 'table_schema': [{'col_name': 'city code'}, {'col_name': 'city name'}, {'col_name': 'state'}, {'col_name': 'country'}, {'col_name': 'latitude'}, {'col_name': 'longitude'}], 'foreign_key_columns': [], 'primary_keys': ['city code']}] |
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" | address_1 | [{'table_name': 'student', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'last name'}, {'col_name': 'first name'}, {'col_name': 'age'}, {'col_name': 'sex'}, {'col_name': 'major'}, {'col_name': 'advisor'}, {'col_name': 'city code'}], 'foreign_key_columns': ['city code'], 'primary_keys': ['student id']}, {'ta... |
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" | address_1 | [{'table_name': 'student', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'last name'}, {'col_name': 'first name'}, {'col_name': 'age'}, {'col_name': 'sex'}, {'col_name': 'major'}, {'col_name': 'advisor'}, {'col_name': 'city code'}], 'foreign_key_columns': ['city code'], 'primary_keys': ['student id']}, {'ta... |
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" | address_1 | [{'table_name': 'student', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'last name'}, {'col_name': 'first name'}, {'col_name': 'age'}, {'col_name': 'sex'}, {'col_name': 'major'}, {'col_name': 'advisor'}, {'col_name': 'city code'}], 'foreign_key_columns': ['city code'], 'primary_keys': ['student id']}, {'ta... |
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" | address_1 | [{'table_name': 'student', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'last name'}, {'col_name': 'first name'}, {'col_name': 'age'}, {'col_name': 'sex'}, {'col_name': 'major'}, {'col_name': 'advisor'}, {'col_name': 'city code'}], 'foreign_key_columns': ['city code'], 'primary_keys': ['student id']}, {'ta... |
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" | address_1 | [{'table_name': 'student', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'last name'}, {'col_name': 'first name'}, {'col_name': 'age'}, {'col_name': 'sex'}, {'col_name': 'major'}, {'col_name': 'advisor'}, {'col_name': 'city code'}], 'foreign_key_columns': ['city code'], 'primary_keys': ['student id']}, {'ta... |
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" | address_1 | [{'table_name': 'student', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'last name'}, {'col_name': 'first name'}, {'col_name': 'age'}, {'col_name': 'sex'}, {'col_name': 'major'}, {'col_name': 'advisor'}, {'col_name': 'city code'}], 'foreign_key_columns': ['city code'], 'primary_keys': ['student id']}, {'ta... |
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 | address_1 | [{'table_name': 'student', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'last name'}, {'col_name': 'first name'}, {'col_name': 'age'}, {'col_name': 'sex'}, {'col_name': 'major'}, {'col_name': 'advisor'}, {'col_name': 'city code'}], 'foreign_key_columns': ['city code'], 'primary_keys': ['student id']}, {'ta... |
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 | address_1 | [{'table_name': 'student', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'last name'}, {'col_name': 'first name'}, {'col_name': 'age'}, {'col_name': 'sex'}, {'col_name': 'major'}, {'col_name': 'advisor'}, {'col_name': 'city code'}], 'foreign_key_columns': ['city code'], 'primary_keys': ['student id']}, {'ta... |
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 | address_1 | [{'table_name': 'student', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'last name'}, {'col_name': 'first name'}, {'col_name': 'age'}, {'col_name': 'sex'}, {'col_name': 'major'}, {'col_name': 'advisor'}, {'col_name': 'city code'}], 'foreign_key_columns': ['city code'], 'primary_keys': ['student id']}, {'ta... |
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 | address_1 | [{'table_name': 'student', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'last name'}, {'col_name': 'first name'}, {'col_name': 'age'}, {'col_name': 'sex'}, {'col_name': 'major'}, {'col_name': 'advisor'}, {'col_name': 'city code'}], 'foreign_key_columns': ['city code'], 'primary_keys': ['student id']}, {'ta... |
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 | address_1 | [{'table_name': 'student', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'last name'}, {'col_name': 'first name'}, {'col_name': 'age'}, {'col_name': 'sex'}, {'col_name': 'major'}, {'col_name': 'advisor'}, {'col_name': 'city code'}], 'foreign_key_columns': ['city code'], 'primary_keys': ['student id']}, {'ta... |
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 | address_1 | [{'table_name': 'student', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'last name'}, {'col_name': 'first name'}, {'col_name': 'age'}, {'col_name': 'sex'}, {'col_name': 'major'}, {'col_name': 'advisor'}, {'col_name': 'city code'}], 'foreign_key_columns': ['city code'], 'primary_keys': ['student id']}, {'ta... |
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 | address_1 | [{'table_name': 'student', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'last name'}, {'col_name': 'first name'}, {'col_name': 'age'}, {'col_name': 'sex'}, {'col_name': 'major'}, {'col_name': 'advisor'}, {'col_name': 'city code'}], 'foreign_key_columns': ['city code'], 'primary_keys': ['student id']}, {'ta... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.