db_id stringclasses 140
values | question stringlengths 16 224 | query stringlengths 18 577 | db_schema stringclasses 140
values | question_toks listlengths 4 44 |
|---|---|---|---|---|
coffee_shop | What are the average score and average staff number of all shops? | SELECT avg(num_of_staff) , avg(score) FROM shop | shop: Shop_ID (number), Address (text), Num_of_staff (text), Score (number), Open_Year (text) | member: Member_ID (number), Name (text), Membership_card (text), Age (number), Time_of_purchase (number), Level_of_membership (number), Address (text) | happy_hour: HH_ID (number), Shop_ID (number), Month (text), Num_of_shaf... | [
"What",
"are",
"the",
"average",
"score",
"and",
"average",
"staff",
"number",
"of",
"all",
"shops",
"?"
] |
coffee_shop | Find the id and address of the shops whose score is below the average score. | SELECT shop_id , address FROM shop WHERE score < (SELECT avg(score) FROM shop) | shop: Shop_ID (number), Address (text), Num_of_staff (text), Score (number), Open_Year (text) | member: Member_ID (number), Name (text), Membership_card (text), Age (number), Time_of_purchase (number), Level_of_membership (number), Address (text) | happy_hour: HH_ID (number), Shop_ID (number), Month (text), Num_of_shaf... | [
"Find",
"the",
"id",
"and",
"address",
"of",
"the",
"shops",
"whose",
"score",
"is",
"below",
"the",
"average",
"score",
"."
] |
coffee_shop | Find the address and staff number of the shops that do not have any happy hour. | SELECT address , num_of_staff FROM shop WHERE shop_id NOT IN (SELECT shop_id FROM happy_hour) | shop: Shop_ID (number), Address (text), Num_of_staff (text), Score (number), Open_Year (text) | member: Member_ID (number), Name (text), Membership_card (text), Age (number), Time_of_purchase (number), Level_of_membership (number), Address (text) | happy_hour: HH_ID (number), Shop_ID (number), Month (text), Num_of_shaf... | [
"Find",
"the",
"address",
"and",
"staff",
"number",
"of",
"the",
"shops",
"that",
"do",
"not",
"have",
"any",
"happy",
"hour",
"."
] |
coffee_shop | What are the id and address of the shops which have a happy hour in May? | SELECT t1.address , t1.shop_id FROM shop AS t1 JOIN happy_hour AS t2 ON t1.shop_id = t2.shop_id WHERE MONTH = 'May' | shop: Shop_ID (number), Address (text), Num_of_staff (text), Score (number), Open_Year (text) | member: Member_ID (number), Name (text), Membership_card (text), Age (number), Time_of_purchase (number), Level_of_membership (number), Address (text) | happy_hour: HH_ID (number), Shop_ID (number), Month (text), Num_of_shaf... | [
"What",
"are",
"the",
"id",
"and",
"address",
"of",
"the",
"shops",
"which",
"have",
"a",
"happy",
"hour",
"in",
"May",
"?"
] |
coffee_shop | which shop has happy hour most frequently? List its id and number of happy hours. | SELECT shop_id , count(*) FROM happy_hour GROUP BY shop_id ORDER BY count(*) DESC LIMIT 1 | shop: Shop_ID (number), Address (text), Num_of_staff (text), Score (number), Open_Year (text) | member: Member_ID (number), Name (text), Membership_card (text), Age (number), Time_of_purchase (number), Level_of_membership (number), Address (text) | happy_hour: HH_ID (number), Shop_ID (number), Month (text), Num_of_shaf... | [
"which",
"shop",
"has",
"happy",
"hour",
"most",
"frequently",
"?",
"List",
"its",
"id",
"and",
"number",
"of",
"happy",
"hours",
"."
] |
coffee_shop | Which month has the most happy hours? | SELECT MONTH FROM happy_hour GROUP BY MONTH ORDER BY count(*) DESC LIMIT 1 | shop: Shop_ID (number), Address (text), Num_of_staff (text), Score (number), Open_Year (text) | member: Member_ID (number), Name (text), Membership_card (text), Age (number), Time_of_purchase (number), Level_of_membership (number), Address (text) | happy_hour: HH_ID (number), Shop_ID (number), Month (text), Num_of_shaf... | [
"Which",
"month",
"has",
"the",
"most",
"happy",
"hours",
"?"
] |
coffee_shop | Which months have more than 2 happy hours? | SELECT MONTH FROM happy_hour GROUP BY MONTH HAVING count(*) > 2 | shop: Shop_ID (number), Address (text), Num_of_staff (text), Score (number), Open_Year (text) | member: Member_ID (number), Name (text), Membership_card (text), Age (number), Time_of_purchase (number), Level_of_membership (number), Address (text) | happy_hour: HH_ID (number), Shop_ID (number), Month (text), Num_of_shaf... | [
"Which",
"months",
"have",
"more",
"than",
"2",
"happy",
"hours",
"?"
] |
chinook_1 | How many albums are there? | SELECT count(*) FROM ALBUM | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"How",
"many",
"albums",
"are",
"there",
"?"
] |
chinook_1 | Find the number of albums. | SELECT count(*) FROM ALBUM | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"the",
"number",
"of",
"albums",
"."
] |
chinook_1 | List the names of all music genres. | SELECT Name FROM GENRE | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"List",
"the",
"names",
"of",
"all",
"music",
"genres",
"."
] |
chinook_1 | What are the names of different music genres? | SELECT Name FROM GENRE | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"are",
"the",
"names",
"of",
"different",
"music",
"genres",
"?"
] |
chinook_1 | Find all the customer information in state NY. | SELECT * FROM CUSTOMER WHERE State = "NY" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"all",
"the",
"customer",
"information",
"in",
"state",
"NY",
"."
] |
chinook_1 | What is all the customer information for customers in NY state? | SELECT * FROM CUSTOMER WHERE State = "NY" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"is",
"all",
"the",
"customer",
"information",
"for",
"customers",
"in",
"NY",
"state",
"?"
] |
chinook_1 | What are the first names and last names of the employees who live in Calgary city. | SELECT FirstName , LastName FROM EMPLOYEE WHERE City = "Calgary" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"are",
"the",
"first",
"names",
"and",
"last",
"names",
"of",
"the",
"employees",
"who",
"live",
"in",
"Calgary",
"city",
"."
] |
chinook_1 | Find the full names of employees living in the city of Calgary. | SELECT FirstName , LastName FROM EMPLOYEE WHERE City = "Calgary" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"the",
"full",
"names",
"of",
"employees",
"living",
"in",
"the",
"city",
"of",
"Calgary",
"."
] |
chinook_1 | What are the distinct billing countries of the invoices? | SELECT distinct(BillingCountry) FROM INVOICE | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"are",
"the",
"distinct",
"billing",
"countries",
"of",
"the",
"invoices",
"?"
] |
chinook_1 | Find the different billing countries for all invoices. | SELECT distinct(BillingCountry) FROM INVOICE | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"the",
"different",
"billing",
"countries",
"for",
"all",
"invoices",
"."
] |
chinook_1 | Find the names of all artists that have "a" in their names. | SELECT Name FROM ARTIST WHERE Name LIKE "%a%" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"the",
"names",
"of",
"all",
"artists",
"that",
"have",
"``",
"a",
"''",
"in",
"their",
"names",
"."
] |
chinook_1 | What are the names of artist who have the letter 'a' in their names? | SELECT Name FROM ARTIST WHERE Name LIKE "%a%" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"are",
"the",
"names",
"of",
"artist",
"who",
"have",
"the",
"letter",
"'a",
"'",
"in",
"their",
"names",
"?"
] |
chinook_1 | Find the title of all the albums of the artist "AC/DC". | SELECT Title FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = "AC/DC" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"the",
"title",
"of",
"all",
"the",
"albums",
"of",
"the",
"artist",
"``",
"AC/DC",
"''",
"."
] |
chinook_1 | What are the titles of albums by the artist "AC/DC"? | SELECT Title FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = "AC/DC" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"are",
"the",
"titles",
"of",
"albums",
"by",
"the",
"artist",
"``",
"AC/DC",
"''",
"?"
] |
chinook_1 | Hom many albums does the artist "Metallica" have? | SELECT COUNT(*) FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = "Metallica" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Hom",
"many",
"albums",
"does",
"the",
"artist",
"``",
"Metallica",
"''",
"have",
"?"
] |
chinook_1 | Find the number of albums by the artist "Metallica". | SELECT COUNT(*) FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = "Metallica" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"the",
"number",
"of",
"albums",
"by",
"the",
"artist",
"``",
"Metallica",
"''",
"."
] |
chinook_1 | Which artist does the album "Balls to the Wall" belong to? | SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T1.Title = "Balls to the Wall" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Which",
"artist",
"does",
"the",
"album",
"``",
"Balls",
"to",
"the",
"Wall",
"''",
"belong",
"to",
"?"
] |
chinook_1 | Find the name of the artist who made the album "Balls to the Wall". | SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T1.Title = "Balls to the Wall" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"the",
"name",
"of",
"the",
"artist",
"who",
"made",
"the",
"album",
"``",
"Balls",
"to",
"the",
"Wall",
"''",
"."
] |
chinook_1 | Which artist has the most albums? | SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId GROUP BY T2.Name ORDER BY COUNT(*) DESC LIMIT 1 | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Which",
"artist",
"has",
"the",
"most",
"albums",
"?"
] |
chinook_1 | What is the name of the artist with the greatest number of albums? | SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId GROUP BY T2.Name ORDER BY COUNT(*) DESC LIMIT 1 | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"is",
"the",
"name",
"of",
"the",
"artist",
"with",
"the",
"greatest",
"number",
"of",
"albums",
"?"
] |
chinook_1 | Find the names of all the tracks that contain the word "you". | SELECT Name FROM TRACK WHERE Name LIKE '%you%' | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"the",
"names",
"of",
"all",
"the",
"tracks",
"that",
"contain",
"the",
"word",
"``",
"you",
"''",
"."
] |
chinook_1 | What are the names of tracks that contain the the word you in them? | SELECT Name FROM TRACK WHERE Name LIKE '%you%' | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"are",
"the",
"names",
"of",
"tracks",
"that",
"contain",
"the",
"the",
"word",
"you",
"in",
"them",
"?"
] |
chinook_1 | What is the average unit price of all the tracks? | SELECT AVG(UnitPrice) FROM TRACK | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"is",
"the",
"average",
"unit",
"price",
"of",
"all",
"the",
"tracks",
"?"
] |
chinook_1 | Find the average unit price for a track. | SELECT AVG(UnitPrice) FROM TRACK | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"the",
"average",
"unit",
"price",
"for",
"a",
"track",
"."
] |
chinook_1 | What are the durations of the longest and the shortest tracks in milliseconds? | SELECT max(Milliseconds) , min(Milliseconds) FROM TRACK | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"are",
"the",
"durations",
"of",
"the",
"longest",
"and",
"the",
"shortest",
"tracks",
"in",
"milliseconds",
"?"
] |
chinook_1 | Find the maximum and minimum durations of tracks in milliseconds. | SELECT max(Milliseconds) , min(Milliseconds) FROM TRACK | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"the",
"maximum",
"and",
"minimum",
"durations",
"of",
"tracks",
"in",
"milliseconds",
"."
] |
chinook_1 | Show the album names, ids and the number of tracks for each album. | SELECT T1.Title , T2.AlbumID , COUNT(*) FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId = T2.AlbumId GROUP BY T2.AlbumID | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Show",
"the",
"album",
"names",
",",
"ids",
"and",
"the",
"number",
"of",
"tracks",
"for",
"each",
"album",
"."
] |
chinook_1 | What are the names and ids of the different albums, and how many tracks are on each? | SELECT T1.Title , T2.AlbumID , COUNT(*) FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId = T2.AlbumId GROUP BY T2.AlbumID | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"are",
"the",
"names",
"and",
"ids",
"of",
"the",
"different",
"albums",
",",
"and",
"how",
"many",
"tracks",
"are",
"on",
"each",
"?"
] |
chinook_1 | What is the name of the most common genre in all tracks? | SELECT T1.Name FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId GROUP BY T2.GenreId ORDER BY COUNT(*) DESC LIMIT 1 | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"is",
"the",
"name",
"of",
"the",
"most",
"common",
"genre",
"in",
"all",
"tracks",
"?"
] |
chinook_1 | Find the name of the genre that is most frequent across all tracks. | SELECT T1.Name FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId GROUP BY T2.GenreId ORDER BY COUNT(*) DESC LIMIT 1 | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"the",
"name",
"of",
"the",
"genre",
"that",
"is",
"most",
"frequent",
"across",
"all",
"tracks",
"."
] |
chinook_1 | What is the least common media type in all tracks? | SELECT T1.Name FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId GROUP BY T2.MediaTypeId ORDER BY COUNT(*) ASC LIMIT 1 | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"is",
"the",
"least",
"common",
"media",
"type",
"in",
"all",
"tracks",
"?"
] |
chinook_1 | What is the name of the media type that is least common across all tracks? | SELECT T1.Name FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId GROUP BY T2.MediaTypeId ORDER BY COUNT(*) ASC LIMIT 1 | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"is",
"the",
"name",
"of",
"the",
"media",
"type",
"that",
"is",
"least",
"common",
"across",
"all",
"tracks",
"?"
] |
chinook_1 | Show the album names and ids for albums that contain tracks with unit price bigger than 1. | SELECT T1.Title , T2.AlbumID FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId = T2.AlbumId WHERE T2.UnitPrice > 1 GROUP BY T2.AlbumID | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Show",
"the",
"album",
"names",
"and",
"ids",
"for",
"albums",
"that",
"contain",
"tracks",
"with",
"unit",
"price",
"bigger",
"than",
"1",
"."
] |
chinook_1 | What are the titles and ids for albums containing tracks with unit price greater than 1? | SELECT T1.Title , T2.AlbumID FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId = T2.AlbumId WHERE T2.UnitPrice > 1 GROUP BY T2.AlbumID | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"are",
"the",
"titles",
"and",
"ids",
"for",
"albums",
"containing",
"tracks",
"with",
"unit",
"price",
"greater",
"than",
"1",
"?"
] |
chinook_1 | How many tracks belong to rock genre? | SELECT COUNT(*) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Rock" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"How",
"many",
"tracks",
"belong",
"to",
"rock",
"genre",
"?"
] |
chinook_1 | Count the number of tracks that are part of the rock genre. | SELECT COUNT(*) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Rock" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Count",
"the",
"number",
"of",
"tracks",
"that",
"are",
"part",
"of",
"the",
"rock",
"genre",
"."
] |
chinook_1 | What is the average unit price of tracks that belong to Jazz genre? | SELECT AVG(UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Jazz" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"is",
"the",
"average",
"unit",
"price",
"of",
"tracks",
"that",
"belong",
"to",
"Jazz",
"genre",
"?"
] |
chinook_1 | Find the average unit price of jazz tracks. | SELECT AVG(UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Jazz" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"the",
"average",
"unit",
"price",
"of",
"jazz",
"tracks",
"."
] |
chinook_1 | What is the first name and last name of the customer that has email "luisg@embraer.com.br"? | SELECT FirstName , LastName FROM CUSTOMER WHERE Email = "luisg@embraer.com.br" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"is",
"the",
"first",
"name",
"and",
"last",
"name",
"of",
"the",
"customer",
"that",
"has",
"email",
"``",
"luisg",
"@",
"embraer.com.br",
"''",
"?"
] |
chinook_1 | Find the full name of the customer with the email "luisg@embraer.com.br". | SELECT FirstName , LastName FROM CUSTOMER WHERE Email = "luisg@embraer.com.br" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"the",
"full",
"name",
"of",
"the",
"customer",
"with",
"the",
"email",
"``",
"luisg",
"@",
"embraer.com.br",
"''",
"."
] |
chinook_1 | How many customers have email that contains "gmail.com"? | SELECT COUNT(*) FROM CUSTOMER WHERE Email LIKE "%gmail.com%" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"How",
"many",
"customers",
"have",
"email",
"that",
"contains",
"``",
"gmail.com",
"''",
"?"
] |
chinook_1 | Count the number of customers that have an email containing "gmail.com". | SELECT COUNT(*) FROM CUSTOMER WHERE Email LIKE "%gmail.com%" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Count",
"the",
"number",
"of",
"customers",
"that",
"have",
"an",
"email",
"containing",
"``",
"gmail.com",
"''",
"."
] |
chinook_1 | What is the first name and last name employee helps the customer with first name Leonie? | SELECT T2.FirstName , T2.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId WHERE T1.FirstName = "Leonie" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"is",
"the",
"first",
"name",
"and",
"last",
"name",
"employee",
"helps",
"the",
"customer",
"with",
"first",
"name",
"Leonie",
"?"
] |
chinook_1 | Find the full names of employees who help customers with the first name Leonie. | SELECT T2.FirstName , T2.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId WHERE T1.FirstName = "Leonie" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"the",
"full",
"names",
"of",
"employees",
"who",
"help",
"customers",
"with",
"the",
"first",
"name",
"Leonie",
"."
] |
chinook_1 | What city does the employee who helps the customer with postal code 70174 live in? | SELECT T2.City FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId WHERE T1.PostalCode = "70174" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"city",
"does",
"the",
"employee",
"who",
"helps",
"the",
"customer",
"with",
"postal",
"code",
"70174",
"live",
"in",
"?"
] |
chinook_1 | Find the cities corresponding to employees who help customers with the postal code 70174. | SELECT T2.City FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId WHERE T1.PostalCode = "70174" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"the",
"cities",
"corresponding",
"to",
"employees",
"who",
"help",
"customers",
"with",
"the",
"postal",
"code",
"70174",
"."
] |
chinook_1 | How many distinct cities does the employees live in? | SELECT COUNT(DISTINCT city) FROM EMPLOYEE | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"How",
"many",
"distinct",
"cities",
"does",
"the",
"employees",
"live",
"in",
"?"
] |
chinook_1 | Find the number of different cities that employees live in. | SELECT COUNT(DISTINCT city) FROM EMPLOYEE | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"the",
"number",
"of",
"different",
"cities",
"that",
"employees",
"live",
"in",
"."
] |
chinook_1 | Find all invoice dates corresponding to customers with first name Astrid and last name Gruber. | SELECT T2.InvoiceDate FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.FirstName = "Astrid" AND LastName = "Gruber" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"all",
"invoice",
"dates",
"corresponding",
"to",
"customers",
"with",
"first",
"name",
"Astrid",
"and",
"last",
"name",
"Gruber",
"."
] |
chinook_1 | What are the invoice dates for customers with the first name Astrid and the last name Gruber? | SELECT T2.InvoiceDate FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.FirstName = "Astrid" AND LastName = "Gruber" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"are",
"the",
"invoice",
"dates",
"for",
"customers",
"with",
"the",
"first",
"name",
"Astrid",
"and",
"the",
"last",
"name",
"Gruber",
"?"
] |
chinook_1 | Find all the customer last names that do not have invoice totals larger than 20. | SELECT LastName FROM CUSTOMER EXCEPT SELECT T1.LastName FROM CUSTOMER AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T2.total > 20 | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"all",
"the",
"customer",
"last",
"names",
"that",
"do",
"not",
"have",
"invoice",
"totals",
"larger",
"than",
"20",
"."
] |
chinook_1 | What are the last names of customers without invoice totals exceeding 20? | SELECT LastName FROM CUSTOMER EXCEPT SELECT T1.LastName FROM CUSTOMER AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T2.total > 20 | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"are",
"the",
"last",
"names",
"of",
"customers",
"without",
"invoice",
"totals",
"exceeding",
"20",
"?"
] |
chinook_1 | Find the first names of all customers that live in Brazil and have an invoice. | SELECT DISTINCT T1.FirstName FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.country = "Brazil" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"the",
"first",
"names",
"of",
"all",
"customers",
"that",
"live",
"in",
"Brazil",
"and",
"have",
"an",
"invoice",
"."
] |
chinook_1 | What are the different first names for customers from Brazil who have also had an invoice? | SELECT DISTINCT T1.FirstName FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.country = "Brazil" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"are",
"the",
"different",
"first",
"names",
"for",
"customers",
"from",
"Brazil",
"who",
"have",
"also",
"had",
"an",
"invoice",
"?"
] |
chinook_1 | Find the address of all customers that live in Germany and have invoice. | SELECT DISTINCT T1.Address FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.country = "Germany" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"the",
"address",
"of",
"all",
"customers",
"that",
"live",
"in",
"Germany",
"and",
"have",
"invoice",
"."
] |
chinook_1 | What are the addresses of customers living in Germany who have had an invoice? | SELECT DISTINCT T1.Address FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.country = "Germany" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"are",
"the",
"addresses",
"of",
"customers",
"living",
"in",
"Germany",
"who",
"have",
"had",
"an",
"invoice",
"?"
] |
chinook_1 | List the phone numbers of all employees. | SELECT Phone FROM EMPLOYEE | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"List",
"the",
"phone",
"numbers",
"of",
"all",
"employees",
"."
] |
chinook_1 | What are the phone numbers for each employee? | SELECT Phone FROM EMPLOYEE | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"are",
"the",
"phone",
"numbers",
"for",
"each",
"employee",
"?"
] |
chinook_1 | How many tracks are in the AAC audio file media type? | SELECT COUNT(*) FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId WHERE T1.Name = "AAC audio file" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"How",
"many",
"tracks",
"are",
"in",
"the",
"AAC",
"audio",
"file",
"media",
"type",
"?"
] |
chinook_1 | Count the number of tracks that are of the media type "AAC audio file". | SELECT COUNT(*) FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId WHERE T1.Name = "AAC audio file" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Count",
"the",
"number",
"of",
"tracks",
"that",
"are",
"of",
"the",
"media",
"type",
"``",
"AAC",
"audio",
"file",
"''",
"."
] |
chinook_1 | What is the average duration in milliseconds of tracks that belong to Latin or Pop genre? | SELECT AVG(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Latin" OR T1.Name = "Pop" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"is",
"the",
"average",
"duration",
"in",
"milliseconds",
"of",
"tracks",
"that",
"belong",
"to",
"Latin",
"or",
"Pop",
"genre",
"?"
] |
chinook_1 | Find the average millisecond length of Latin and Pop tracks. | SELECT AVG(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Latin" OR T1.Name = "Pop" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"the",
"average",
"millisecond",
"length",
"of",
"Latin",
"and",
"Pop",
"tracks",
"."
] |
chinook_1 | Please show the employee first names and ids of employees who serve at least 10 customers. | SELECT T1.FirstName , T1.SupportRepId FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) >= 10 | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Please",
"show",
"the",
"employee",
"first",
"names",
"and",
"ids",
"of",
"employees",
"who",
"serve",
"at",
"least",
"10",
"customers",
"."
] |
chinook_1 | What are the first names and support rep ids for employees serving 10 or more customers? | SELECT T1.FirstName , T1.SupportRepId FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) >= 10 | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"are",
"the",
"first",
"names",
"and",
"support",
"rep",
"ids",
"for",
"employees",
"serving",
"10",
"or",
"more",
"customers",
"?"
] |
chinook_1 | Please show the employee last names that serves no more than 20 customers. | SELECT T1.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) <= 20 | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Please",
"show",
"the",
"employee",
"last",
"names",
"that",
"serves",
"no",
"more",
"than",
"20",
"customers",
"."
] |
chinook_1 | What are the last names of employees who serve at most 20 customers? | SELECT T1.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) <= 20 | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"are",
"the",
"last",
"names",
"of",
"employees",
"who",
"serve",
"at",
"most",
"20",
"customers",
"?"
] |
chinook_1 | Please list all album titles in alphabetical order. | SELECT Title FROM ALBUM ORDER BY Title | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Please",
"list",
"all",
"album",
"titles",
"in",
"alphabetical",
"order",
"."
] |
chinook_1 | What are all the album titles, in alphabetical order? | SELECT Title FROM ALBUM ORDER BY Title | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"are",
"all",
"the",
"album",
"titles",
",",
"in",
"alphabetical",
"order",
"?"
] |
chinook_1 | Please list the name and id of all artists that have at least 3 albums in alphabetical order. | SELECT T2.Name , T1.ArtistId FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistID GROUP BY T1.ArtistId HAVING COUNT(*) >= 3 ORDER BY T2.Name | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Please",
"list",
"the",
"name",
"and",
"id",
"of",
"all",
"artists",
"that",
"have",
"at",
"least",
"3",
"albums",
"in",
"alphabetical",
"order",
"."
] |
chinook_1 | What are the names and ids of artists with 3 or more albums, listed in alphabetical order? | SELECT T2.Name , T1.ArtistId FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistID GROUP BY T1.ArtistId HAVING COUNT(*) >= 3 ORDER BY T2.Name | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"are",
"the",
"names",
"and",
"ids",
"of",
"artists",
"with",
"3",
"or",
"more",
"albums",
",",
"listed",
"in",
"alphabetical",
"order",
"?"
] |
chinook_1 | Find the names of artists that do not have any albums. | SELECT Name FROM ARTIST EXCEPT SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"the",
"names",
"of",
"artists",
"that",
"do",
"not",
"have",
"any",
"albums",
"."
] |
chinook_1 | What are the names of artists who have not released any albums? | SELECT Name FROM ARTIST EXCEPT SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"are",
"the",
"names",
"of",
"artists",
"who",
"have",
"not",
"released",
"any",
"albums",
"?"
] |
chinook_1 | What is the average unit price of rock tracks? | SELECT AVG(T2.UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Rock" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"is",
"the",
"average",
"unit",
"price",
"of",
"rock",
"tracks",
"?"
] |
chinook_1 | Find the average unit price of tracks from the Rock genre. | SELECT AVG(T2.UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Rock" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"the",
"average",
"unit",
"price",
"of",
"tracks",
"from",
"the",
"Rock",
"genre",
"."
] |
chinook_1 | What are the duration of the longest and shortest pop tracks in milliseconds? | SELECT max(Milliseconds) , min(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Pop" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"are",
"the",
"duration",
"of",
"the",
"longest",
"and",
"shortest",
"pop",
"tracks",
"in",
"milliseconds",
"?"
] |
chinook_1 | Find the maximum and minimum millisecond lengths of pop tracks. | SELECT max(Milliseconds) , min(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Pop" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"the",
"maximum",
"and",
"minimum",
"millisecond",
"lengths",
"of",
"pop",
"tracks",
"."
] |
chinook_1 | What are the birth dates of employees living in Edmonton? | SELECT BirthDate FROM EMPLOYEE WHERE City = "Edmonton" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"are",
"the",
"birth",
"dates",
"of",
"employees",
"living",
"in",
"Edmonton",
"?"
] |
chinook_1 | Find the birth dates corresponding to employees who live in the city of Edmonton. | SELECT BirthDate FROM EMPLOYEE WHERE City = "Edmonton" | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"the",
"birth",
"dates",
"corresponding",
"to",
"employees",
"who",
"live",
"in",
"the",
"city",
"of",
"Edmonton",
"."
] |
chinook_1 | What are the distinct unit prices of all tracks? | SELECT distinct(UnitPrice) FROM TRACK | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"are",
"the",
"distinct",
"unit",
"prices",
"of",
"all",
"tracks",
"?"
] |
chinook_1 | Find the distinct unit prices for tracks. | SELECT distinct(UnitPrice) FROM TRACK | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"the",
"distinct",
"unit",
"prices",
"for",
"tracks",
"."
] |
chinook_1 | How many artists do not have any album? | SELECT count(*) FROM ARTIST WHERE artistid NOT IN(SELECT artistid FROM ALBUM) | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"How",
"many",
"artists",
"do",
"not",
"have",
"any",
"album",
"?"
] |
chinook_1 | Cound the number of artists who have not released an album. | SELECT count(*) FROM ARTIST WHERE artistid NOT IN(SELECT artistid FROM ALBUM) | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Cound",
"the",
"number",
"of",
"artists",
"who",
"have",
"not",
"released",
"an",
"album",
"."
] |
chinook_1 | What are the album titles for albums containing both 'Reggae' and 'Rock' genre tracks? | SELECT T1.Title FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId JOIN Genre AS T3 ON T2.GenreID = T3.GenreID WHERE T3.Name = 'Reggae' INTERSECT SELECT T1.Title FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId JOIN Genre AS T3 ON T2.GenreID = T3.GenreID WHERE T3.Name = 'Rock' | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"What",
"are",
"the",
"album",
"titles",
"for",
"albums",
"containing",
"both",
"'Reggae",
"'",
"and",
"'Rock",
"'",
"genre",
"tracks",
"?"
] |
chinook_1 | Find the titles of albums that contain tracks of both the Reggae and Rock genres. | SELECT T1.Title FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId JOIN Genre AS T3 ON T2.GenreID = T3.GenreID WHERE T3.Name = 'Reggae' INTERSECT SELECT T1.Title FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId JOIN Genre AS T3 ON T2.GenreID = T3.GenreID WHERE T3.Name = 'Rock' | Album: AlbumId (number), Title (text), ArtistId (number) | Artist: ArtistId (number), Name (text) | Customer: CustomerId (number), FirstName (text), LastName (text), Company (text), Address (text), City (text), State (text), Country (text), PostalCode (text), Phone (text), Fax (text), Email (text), SupportRepId (number... | [
"Find",
"the",
"titles",
"of",
"albums",
"that",
"contain",
"tracks",
"of",
"both",
"the",
"Reggae",
"and",
"Rock",
"genres",
"."
] |
insurance_fnol | Find all the phone numbers. | SELECT customer_phone FROM available_policies | Customers: Customer_ID (number), Customer_name (text) | Services: Service_ID (number), Service_name (text) | Available_Policies: Policy_ID (number), policy_type_code (text), Customer_Phone (text) | Customers_Policies: Customer_ID (number), Policy_ID (number), Date_Opened (time), Date_Closed (time) | First_Notification_... | [
"Find",
"all",
"the",
"phone",
"numbers",
"."
] |
insurance_fnol | What are all the phone numbers? | SELECT customer_phone FROM available_policies | Customers: Customer_ID (number), Customer_name (text) | Services: Service_ID (number), Service_name (text) | Available_Policies: Policy_ID (number), policy_type_code (text), Customer_Phone (text) | Customers_Policies: Customer_ID (number), Policy_ID (number), Date_Opened (time), Date_Closed (time) | First_Notification_... | [
"What",
"are",
"all",
"the",
"phone",
"numbers",
"?"
] |
insurance_fnol | What are the customer phone numbers under the policy "Life Insurance"? | SELECT customer_phone FROM available_policies WHERE policy_type_code = "Life Insurance" | Customers: Customer_ID (number), Customer_name (text) | Services: Service_ID (number), Service_name (text) | Available_Policies: Policy_ID (number), policy_type_code (text), Customer_Phone (text) | Customers_Policies: Customer_ID (number), Policy_ID (number), Date_Opened (time), Date_Closed (time) | First_Notification_... | [
"What",
"are",
"the",
"customer",
"phone",
"numbers",
"under",
"the",
"policy",
"``",
"Life",
"Insurance",
"''",
"?"
] |
insurance_fnol | What are the phone numbers of customers using the policy with the code "Life Insurance"? | SELECT customer_phone FROM available_policies WHERE policy_type_code = "Life Insurance" | Customers: Customer_ID (number), Customer_name (text) | Services: Service_ID (number), Service_name (text) | Available_Policies: Policy_ID (number), policy_type_code (text), Customer_Phone (text) | Customers_Policies: Customer_ID (number), Policy_ID (number), Date_Opened (time), Date_Closed (time) | First_Notification_... | [
"What",
"are",
"the",
"phone",
"numbers",
"of",
"customers",
"using",
"the",
"policy",
"with",
"the",
"code",
"``",
"Life",
"Insurance",
"''",
"?"
] |
insurance_fnol | Which policy type has the most records in the database? | SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1 | Customers: Customer_ID (number), Customer_name (text) | Services: Service_ID (number), Service_name (text) | Available_Policies: Policy_ID (number), policy_type_code (text), Customer_Phone (text) | Customers_Policies: Customer_ID (number), Policy_ID (number), Date_Opened (time), Date_Closed (time) | First_Notification_... | [
"Which",
"policy",
"type",
"has",
"the",
"most",
"records",
"in",
"the",
"database",
"?"
] |
insurance_fnol | Which policy type appears most frequently in the available policies? | SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1 | Customers: Customer_ID (number), Customer_name (text) | Services: Service_ID (number), Service_name (text) | Available_Policies: Policy_ID (number), policy_type_code (text), Customer_Phone (text) | Customers_Policies: Customer_ID (number), Policy_ID (number), Date_Opened (time), Date_Closed (time) | First_Notification_... | [
"Which",
"policy",
"type",
"appears",
"most",
"frequently",
"in",
"the",
"available",
"policies",
"?"
] |
insurance_fnol | What are all the customer phone numbers under the most popular policy type? | SELECT customer_phone FROM available_policies WHERE policy_type_code = (SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1) | Customers: Customer_ID (number), Customer_name (text) | Services: Service_ID (number), Service_name (text) | Available_Policies: Policy_ID (number), policy_type_code (text), Customer_Phone (text) | Customers_Policies: Customer_ID (number), Policy_ID (number), Date_Opened (time), Date_Closed (time) | First_Notification_... | [
"What",
"are",
"all",
"the",
"customer",
"phone",
"numbers",
"under",
"the",
"most",
"popular",
"policy",
"type",
"?"
] |
insurance_fnol | Find the phone numbers of customers using the most common policy type among the available policies. | SELECT customer_phone FROM available_policies WHERE policy_type_code = (SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1) | Customers: Customer_ID (number), Customer_name (text) | Services: Service_ID (number), Service_name (text) | Available_Policies: Policy_ID (number), policy_type_code (text), Customer_Phone (text) | Customers_Policies: Customer_ID (number), Policy_ID (number), Date_Opened (time), Date_Closed (time) | First_Notification_... | [
"Find",
"the",
"phone",
"numbers",
"of",
"customers",
"using",
"the",
"most",
"common",
"policy",
"type",
"among",
"the",
"available",
"policies",
"."
] |
insurance_fnol | Find the policy type used by more than 4 customers. | SELECT policy_type_code FROM available_policies GROUP BY policy_type_code HAVING count(*) > 4 | Customers: Customer_ID (number), Customer_name (text) | Services: Service_ID (number), Service_name (text) | Available_Policies: Policy_ID (number), policy_type_code (text), Customer_Phone (text) | Customers_Policies: Customer_ID (number), Policy_ID (number), Date_Opened (time), Date_Closed (time) | First_Notification_... | [
"Find",
"the",
"policy",
"type",
"used",
"by",
"more",
"than",
"4",
"customers",
"."
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.