db_id
stringlengths
4
31
SQL
stringlengths
18
1.45k
input_sequence
stringlengths
148
11k
question
stringlengths
16
325
bike_1
select date from weather where mean_sea_level_pressure_inches between 30.3 and 31
Question: what are the dates that have an average sea level pressure between 30.3 and 31? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_sta...
what are the dates that have an average sea level pressure between 30.3 and 31?
bike_1
select date , max_temperature_f - min_temperature_f from weather order by max_temperature_f - min_temperature_f limit 1
Question: find the day in which the difference between the max temperature and min temperature was the smallest. also report the difference. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, star...
find the day in which the difference between the max temperature and min temperature was the smallest. also report the difference.
bike_1
select date , max_temperature_f - min_temperature_f from weather order by max_temperature_f - min_temperature_f limit 1
Question: what are the days that had the smallest temperature range, and what was that range? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end...
what are the days that had the smallest temperature range, and what was that range?
bike_1
select distinct t1.id , t1.name from station as t1 join status as t2 on t1.id = t2.station_id where t2.bikes_available > 12
Question: what are the id and name of the stations that have ever had more than 12 bikes available? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_dat...
what are the id and name of the stations that have ever had more than 12 bikes available?
bike_1
select distinct t1.id , t1.name from station as t1 join status as t2 on t1.id = t2.station_id where t2.bikes_available > 12
Question: what are the different ids and names of the stations that have had more than 12 bikes available? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, ...
what are the different ids and names of the stations that have had more than 12 bikes available?
bike_1
select zip_code from weather group by zip_code having avg(mean_humidity) < 70 intersect select zip_code from trip group by zip_code having count(*) >= 100
Question: give me the zip code where the average mean humidity is below 70 and at least 100 trips took place. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_i...
give me the zip code where the average mean humidity is below 70 and at least 100 trips took place.
bike_1
select zip_code from weather group by zip_code having avg(mean_humidity) < 70 intersect select zip_code from trip group by zip_code having count(*) >= 100
Question: what are the zip codes that have an average mean humidity below 70 and had at least 100 trips come through there? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, s...
what are the zip codes that have an average mean humidity below 70 and had at least 100 trips come through there?
bike_1
select name from station where city = 'palo alto' except select end_station_name from trip group by end_station_name having count(*) > 100
Question: what are the names of stations that are located in palo alto city but have never been the ending point of trips more than 100 times? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, st...
what are the names of stations that are located in palo alto city but have never been the ending point of trips more than 100 times?
bike_1
select name from station where city = 'palo alto' except select end_station_name from trip group by end_station_name having count(*) > 100
Question: what are the names of the stations that are located in palo alto but have never been the ending point of the trips | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, ...
what are the names of the stations that are located in palo alto but have never been the ending point of the trips
bike_1
select count(*) from station as t1 join trip as t2 join station as t3 join trip as t4 on t1.id = t2.start_station_id and t2.id = t4.id and t3.id = t4.end_station_id where t1.city = 'mountain view' and t3.city = 'palo alto'
Question: how many trips started from mountain view city and ended at palo alto city? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station...
how many trips started from mountain view city and ended at palo alto city?
bike_1
select count(*) from station as t1 join trip as t2 join station as t3 join trip as t4 on t1.id = t2.start_station_id and t2.id = t4.id and t3.id = t4.end_station_id where t1.city = 'mountain view' and t3.city = 'palo alto'
Question: how many trips stated from a station in mountain view and ended at one in palo alto? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, e...
how many trips stated from a station in mountain view and ended at one in palo alto?
bike_1
select avg(t1.lat) , avg(t1.long) from station as t1 join trip as t2 on t1.id = t2.start_station_id
Question: what is the average latitude and longitude of the starting points of all trips? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_sta...
what is the average latitude and longitude of the starting points of all trips?
bike_1
select avg(t1.lat) , avg(t1.long) from station as t1 join trip as t2 on t1.id = t2.start_station_id
Question: what is the average latitude and longitude of all starting stations for the trips? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_...
what is the average latitude and longitude of all starting stations for the trips?
book_2
select count(*) from book
Question: how many books are there? | Tables: publication -> Publication_ID, Book_ID, Publisher, Publication_Date, Price. book -> Book_ID, Title, Issues, Writer. | Joins: publication.Book_ID = book.Book_ID,
how many books are there?
book_2
select writer from book order by writer asc
Question: list the writers of the books in ascending alphabetical order. | Tables: publication -> Publication_ID, Book_ID, Publisher, Publication_Date, Price. book -> Book_ID, Title, Issues, Writer. | Joins: publication.Book_ID = book.Book_ID,
list the writers of the books in ascending alphabetical order.
book_2
select title from book order by issues asc
Question: list the titles of the books in ascending order of issues. | Tables: publication -> Publication_ID, Book_ID, Publisher, Publication_Date, Price. book -> Book_ID, Title, Issues, Writer. | Joins: publication.Book_ID = book.Book_ID,
list the titles of the books in ascending order of issues.
book_2
select title from book where writer != 'elaine lee'
Question: what are the titles of the books whose writer is not 'elaine lee'? | Tables: publication -> Publication_ID, Book_ID, Publisher, Publication_Date, Price. book -> Book_ID, Title, Issues, Writer. | Joins: publication.Book_ID = book.Book_ID,
what are the titles of the books whose writer is not 'elaine lee'?
book_2
select title , issues from book
Question: what are the title and issues of the books? | Tables: publication -> Publication_ID, Book_ID, Publisher, Publication_Date, Price. book -> Book_ID, Title, Issues, Writer. | Joins: publication.Book_ID = book.Book_ID,
what are the title and issues of the books?
book_2
select publication_date from publication order by price desc
Question: what are the dates of publications in descending order of price? | Tables: publication -> Publication_ID, Book_ID, Publisher, Publication_Date, Price. book -> Book_ID, Title, Issues, Writer. | Joins: publication.Book_ID = book.Book_ID,
what are the dates of publications in descending order of price?
book_2
select distinct publisher from publication where price > 5000000
Question: what are the distinct publishers of publications with price higher than 5000000? | Tables: publication -> Publication_ID, Book_ID, Publisher, Publication_Date, Price. book -> Book_ID, Title, Issues, Writer. | Joins: publication.Book_ID = book.Book_ID,
what are the distinct publishers of publications with price higher than 5000000?
book_2
select publisher from publication order by price desc limit 1
Question: list the publisher of the publication with the highest price. | Tables: publication -> Publication_ID, Book_ID, Publisher, Publication_Date, Price. book -> Book_ID, Title, Issues, Writer. | Joins: publication.Book_ID = book.Book_ID,
list the publisher of the publication with the highest price.
book_2
select publication_date from publication order by price asc limit 3
Question: list the publication dates of publications with 3 lowest prices. | Tables: publication -> Publication_ID, Book_ID, Publisher, Publication_Date, Price. book -> Book_ID, Title, Issues, Writer. | Joins: publication.Book_ID = book.Book_ID,
list the publication dates of publications with 3 lowest prices.
book_2
select t1.title , t2.publication_date from book as t1 join publication as t2 on t1.book_id = t2.book_id
Question: show the title and publication dates of books. | Tables: publication -> Publication_ID, Book_ID, Publisher, Publication_Date, Price. book -> Book_ID, Title, Issues, Writer. | Joins: publication.Book_ID = book.Book_ID,
show the title and publication dates of books.
book_2
select t1.writer from book as t1 join publication as t2 on t1.book_id = t2.book_id where t2.price > 4000000
Question: show writers who have published a book with price more than 4000000. | Tables: publication -> Publication_ID, Book_ID, Publisher, Publication_Date, Price. book -> Book_ID, Title, Issues, Writer. | Joins: publication.Book_ID = book.Book_ID,
show writers who have published a book with price more than 4000000.
book_2
select t1.title from book as t1 join publication as t2 on t1.book_id = t2.book_id order by t2.price desc
Question: show the titles of books in descending order of publication price. | Tables: publication -> Publication_ID, Book_ID, Publisher, Publication_Date, Price. book -> Book_ID, Title, Issues, Writer. | Joins: publication.Book_ID = book.Book_ID,
show the titles of books in descending order of publication price.
book_2
select publisher from publication group by publisher having count(*) > 1
Question: show publishers that have more than one publication. | Tables: publication -> Publication_ID, Book_ID, Publisher, Publication_Date, Price. book -> Book_ID, Title, Issues, Writer. | Joins: publication.Book_ID = book.Book_ID,
show publishers that have more than one publication.
book_2
select publisher , count(*) from publication group by publisher
Question: show different publishers together with the number of publications they have. | Tables: publication -> Publication_ID, Book_ID, Publisher, Publication_Date, Price. book -> Book_ID, Title, Issues, Writer. | Joins: publication.Book_ID = book.Book_ID,
show different publishers together with the number of publications they have.
book_2
select publication_date from publication group by publication_date order by count(*) desc limit 1
Question: please show the most common publication date. | Tables: publication -> Publication_ID, Book_ID, Publisher, Publication_Date, Price. book -> Book_ID, Title, Issues, Writer. | Joins: publication.Book_ID = book.Book_ID,
please show the most common publication date.
book_2
select writer from book group by writer having count(*) > 1
Question: list the writers who have written more than one book. | Tables: publication -> Publication_ID, Book_ID, Publisher, Publication_Date, Price. book -> Book_ID, Title, Issues, Writer. | Joins: publication.Book_ID = book.Book_ID,
list the writers who have written more than one book.
book_2
select title from book where book_id not in (select book_id from publication)
Question: list the titles of books that are not published. | Tables: publication -> Publication_ID, Book_ID, Publisher, Publication_Date, Price. book -> Book_ID, Title, Issues, Writer. | Joins: publication.Book_ID = book.Book_ID,
list the titles of books that are not published.
book_2
select publisher from publication where price > 10000000 intersect select publisher from publication where price < 5000000
Question: show the publishers that have publications with price higher than 10000000 and publications with price lower than 5000000. | Tables: publication -> Publication_ID, Book_ID, Publisher, Publication_Date, Price. book -> Book_ID, Title, Issues, Writer. | Joins: publication.Book_ID = book.Book_ID,
show the publishers that have publications with price higher than 10000000 and publications with price lower than 5000000.
book_2
select count (distinct publication_date) from publication
Question: what is the number of distinct publication dates? | Tables: publication -> Publication_ID, Book_ID, Publisher, Publication_Date, Price. book -> Book_ID, Title, Issues, Writer. | Joins: publication.Book_ID = book.Book_ID,
what is the number of distinct publication dates?
book_2
select count (distinct publication_date) from publication
Question: how many distinct publication dates are there in our record? | Tables: publication -> Publication_ID, Book_ID, Publisher, Publication_Date, Price. book -> Book_ID, Title, Issues, Writer. | Joins: publication.Book_ID = book.Book_ID,
how many distinct publication dates are there in our record?
book_2
select price from publication where publisher = 'person' or publisher = 'wiley'
Question: show the prices of publications whose publisher is either 'person' or 'wiley' | Tables: publication -> Publication_ID, Book_ID, Publisher, Publication_Date, Price. book -> Book_ID, Title, Issues, Writer. | Joins: publication.Book_ID = book.Book_ID,
show the prices of publications whose publisher is either 'person' or 'wiley'
musical
select count(*) from actor
Question: how many actors are there? | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
how many actors are there?
musical
select count(*) from actor
Question: count the number of actors. | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
count the number of actors.
musical
select name from actor order by name asc
Question: list the name of actors in ascending alphabetical order. | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
list the name of actors in ascending alphabetical order.
musical
select name from actor order by name asc
Question: what are the names of actors, ordered alphabetically? | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
what are the names of actors, ordered alphabetically?
musical
select character , duration from actor
Question: what are the characters and duration of actors? | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
what are the characters and duration of actors?
musical
select character , duration from actor
Question: return the characters and durations for each actor. | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
return the characters and durations for each actor.
musical
select name from actor where age != 20
Question: list the name of actors whose age is not 20. | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
list the name of actors whose age is not 20.
musical
select name from actor where age != 20
Question: what are the names of actors who are not 20 years old? | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
what are the names of actors who are not 20 years old?
musical
select character from actor order by age desc
Question: what are the characters of actors in descending order of age? | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
what are the characters of actors in descending order of age?
musical
select character from actor order by age desc
Question: return the characters for actors, ordered by age descending. | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
return the characters for actors, ordered by age descending.
musical
select duration from actor order by age desc limit 1
Question: what is the duration of the oldest actor? | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
what is the duration of the oldest actor?
musical
select duration from actor order by age desc limit 1
Question: return the duration of the actor with the greatest age. | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
return the duration of the actor with the greatest age.
musical
select name from musical where nominee = 'bob fosse'
Question: what are the names of musicals with nominee 'bob fosse'? | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
what are the names of musicals with nominee 'bob fosse'?
musical
select name from musical where nominee = 'bob fosse'
Question: return the names of musicals who have the nominee bob fosse. | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
return the names of musicals who have the nominee bob fosse.
musical
select distinct nominee from musical where award != 'tony award'
Question: what are the distinct nominees of the musicals with the award that is not 'tony award'? | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
what are the distinct nominees of the musicals with the award that is not 'tony award'?
musical
select distinct nominee from musical where award != 'tony award'
Question: return the different nominees of musicals that have an award that is not the tony award. | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
return the different nominees of musicals that have an award that is not the tony award.
musical
select t1.name , t2.name from actor as t1 join musical as t2 on t1.musical_id = t2.musical_id
Question: show names of actors and names of musicals they are in. | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
show names of actors and names of musicals they are in.
musical
select t1.name , t2.name from actor as t1 join musical as t2 on t1.musical_id = t2.musical_id
Question: what are the names of actors and the musicals that they are in? | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
what are the names of actors and the musicals that they are in?
musical
select t1.name from actor as t1 join musical as t2 on t1.musical_id = t2.musical_id where t2.name = 'the phantom of the opera'
Question: show names of actors that have appeared in musical with name 'the phantom of the opera'. | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
show names of actors that have appeared in musical with name 'the phantom of the opera'.
musical
select t1.name from actor as t1 join musical as t2 on t1.musical_id = t2.musical_id where t2.name = 'the phantom of the opera'
Question: what are the names of actors who have been in the musical titled the phantom of the opera? | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
what are the names of actors who have been in the musical titled the phantom of the opera?
musical
select t1.name from actor as t1 join musical as t2 on t1.musical_id = t2.musical_id order by t2.year desc
Question: show names of actors in descending order of the year their musical is awarded. | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
show names of actors in descending order of the year their musical is awarded.
musical
select t1.name from actor as t1 join musical as t2 on t1.musical_id = t2.musical_id order by t2.year desc
Question: what are the names of actors ordered descending by the year in which their musical was awarded? | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
what are the names of actors ordered descending by the year in which their musical was awarded?
musical
select t2.name , count(*) from actor as t1 join musical as t2 on t1.musical_id = t2.musical_id group by t1.musical_id
Question: show names of musicals and the number of actors who have appeared in the musicals. | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
show names of musicals and the number of actors who have appeared in the musicals.
musical
select t2.name , count(*) from actor as t1 join musical as t2 on t1.musical_id = t2.musical_id group by t1.musical_id
Question: how many actors have appeared in each musical? | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
how many actors have appeared in each musical?
musical
select t2.name from actor as t1 join musical as t2 on t1.musical_id = t2.musical_id group by t1.musical_id having count(*) >= 3
Question: show names of musicals which have at least three actors. | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
show names of musicals which have at least three actors.
musical
select t2.name from actor as t1 join musical as t2 on t1.musical_id = t2.musical_id group by t1.musical_id having count(*) >= 3
Question: what are the names of musicals who have at 3 or more actors? | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
what are the names of musicals who have at 3 or more actors?
musical
select nominee , count(*) from musical group by nominee
Question: show different nominees and the number of musicals they have been nominated. | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
show different nominees and the number of musicals they have been nominated.
musical
select nominee , count(*) from musical group by nominee
Question: how many musicals has each nominee been nominated for? | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
how many musicals has each nominee been nominated for?
musical
select nominee from musical group by nominee order by count(*) desc limit 1
Question: please show the nominee who has been nominated the greatest number of times. | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
please show the nominee who has been nominated the greatest number of times.
musical
select nominee from musical group by nominee order by count(*) desc limit 1
Question: who is the nominee who has been nominated for the most musicals? | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
who is the nominee who has been nominated for the most musicals?
musical
select result from musical group by result order by count(*) desc limit 1
Question: list the most common result of the musicals. | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
list the most common result of the musicals.
musical
select result from musical group by result order by count(*) desc limit 1
Question: return the most frequent result across all musicals. | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
return the most frequent result across all musicals.
musical
select nominee from musical group by nominee having count(*) > 2
Question: list the nominees that have been nominated more than two musicals. | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
list the nominees that have been nominated more than two musicals.
musical
select nominee from musical group by nominee having count(*) > 2
Question: who are the nominees who have been nominated more than two times? | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
who are the nominees who have been nominated more than two times?
musical
select name from musical where musical_id not in (select musical_id from actor)
Question: list the name of musicals that do not have actors. | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
list the name of musicals that do not have actors.
musical
select name from musical where musical_id not in (select musical_id from actor)
Question: what are the names of musicals who have no actors? | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
what are the names of musicals who have no actors?
musical
select nominee from musical where award = 'tony award' intersect select nominee from musical where award = 'drama desk award'
Question: show the nominees that have nominated musicals for both 'tony award' and 'drama desk award'. | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
show the nominees that have nominated musicals for both 'tony award' and 'drama desk award'.
musical
select nominee from musical where award = 'tony award' intersect select nominee from musical where award = 'drama desk award'
Question: who are the nominees who have been nominated for both a tony award and a drama desk award? | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
who are the nominees who have been nominated for both a tony award and a drama desk award?
musical
select nominee from musical where award = 'tony award' or award = 'cleavant derricks'
Question: show the musical nominee with award 'bob fosse' or 'cleavant derricks'. | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
show the musical nominee with award 'bob fosse' or 'cleavant derricks'.
musical
select nominee from musical where award = 'tony award' or award = 'cleavant derricks'
Question: who are the nominees who were nominated for either of the bob fosse or cleavant derricks awards? | Tables: musical -> Musical_ID, Name, Year, Award, Category, Nominee, Result. actor -> Actor_ID, Name, Musical_ID, Character, Duration, age. | Joins: actor.Musical_ID = actor.Actor_ID,
who are the nominees who were nominated for either of the bob fosse or cleavant derricks awards?
twitter_1
select email from user_profiles where name = 'mary'
Question: find the emails of the user named 'mary'. | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_profiles.uid, tweets.uid = user_profiles.uid,
find the emails of the user named 'mary'.
twitter_1
select partitionid from user_profiles where name = 'iron man'
Question: what is the partition id of the user named 'iron man'. | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_profiles.uid, tweets.uid = user_profiles.uid,
what is the partition id of the user named 'iron man'.
twitter_1
select count(*) from user_profiles
Question: how many users are there? | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_profiles.uid, tweets.uid = user_profiles.uid,
how many users are there?
twitter_1
select count(*) from follows
Question: how many followers does each user have? | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_profiles.uid, tweets.uid = user_profiles.uid,
how many followers does each user have?
twitter_1
select count(*) from follows group by f1
Question: find the number of followers for each user. | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_profiles.uid, tweets.uid = user_profiles.uid,
find the number of followers for each user.
twitter_1
select count(*) from tweets
Question: find the number of tweets in record. | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_profiles.uid, tweets.uid = user_profiles.uid,
find the number of tweets in record.
twitter_1
select count(distinct uid) from tweets
Question: find the number of users who posted some tweets. | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_profiles.uid, tweets.uid = user_profiles.uid,
find the number of users who posted some tweets.
twitter_1
select name , email from user_profiles where name like '%swift%'
Question: find the name and email of the user whose name contains the word swift. | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_profiles.uid, tweets.uid = user_profiles.uid,
find the name and email of the user whose name contains the word swift.
twitter_1
select name from user_profiles where email like '%superstar%' or email like '%edu%'
Question: find the names of users whose emails contain superstar or edu. | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_profiles.uid, tweets.uid = user_profiles.uid,
find the names of users whose emails contain superstar or edu.
twitter_1
select text from tweets where text like '%intern%'
Question: return the text of tweets about the topic 'intern'. | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_profiles.uid, tweets.uid = user_profiles.uid,
return the text of tweets about the topic 'intern'.
twitter_1
select name , email from user_profiles where followers > 1000
Question: find the name and email of the users who have more than 1000 followers. | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_profiles.uid, tweets.uid = user_profiles.uid,
find the name and email of the users who have more than 1000 followers.
twitter_1
select t1.name from user_profiles as t1 join follows as t2 on t1.uid = t2.f1 group by t2.f1 having count(*) > (select count(*) from user_profiles as t1 join follows as t2 on t1.uid = t2.f1 where t1.name = 'tyler swift')
Question: find the names of the users whose number of followers is greater than that of the user named 'tyler swift'. | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_profiles.uid, twee...
find the names of the users whose number of followers is greater than that of the user named 'tyler swift'.
twitter_1
select t1.name , t1.email from user_profiles as t1 join follows as t2 on t1.uid = t2.f1 group by t2.f1 having count(*) > 1
Question: find the name and email for the users who have more than one follower. | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_profiles.uid, tweets.uid = user_profiles.uid,
find the name and email for the users who have more than one follower.
twitter_1
select t1.name from user_profiles as t1 join tweets as t2 on t1.uid = t2.uid group by t2.uid having count(*) > 1
Question: find the names of users who have more than one tweet. | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_profiles.uid, tweets.uid = user_profiles.uid,
find the names of users who have more than one tweet.
twitter_1
select t2.f1 from user_profiles as t1 join follows as t2 on t1.uid = t2.f2 where t1.name = 'mary' intersect select t2.f1 from user_profiles as t1 join follows as t2 on t1.uid = t2.f2 where t1.name = 'susan'
Question: find the id of users who are followed by mary and susan. | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_profiles.uid, tweets.uid = user_profiles.uid,
find the id of users who are followed by mary and susan.
twitter_1
select t2.f1 from user_profiles as t1 join follows as t2 on t1.uid = t2.f2 where t1.name = 'mary' or t1.name = 'susan'
Question: find the id of users who are followed by mary or susan. | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_profiles.uid, tweets.uid = user_profiles.uid,
find the id of users who are followed by mary or susan.
twitter_1
select name from user_profiles order by followers desc limit 1
Question: find the name of the user who has the largest number of followers. | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_profiles.uid, tweets.uid = user_profiles.uid,
find the name of the user who has the largest number of followers.
twitter_1
select name , email from user_profiles order by followers limit 1
Question: find the name and email of the user followed by the least number of people. | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_profiles.uid, tweets.uid = user_profiles.uid,
find the name and email of the user followed by the least number of people.
twitter_1
select name , followers from user_profiles order by followers desc
Question: list the name and number of followers for each user, and sort the results by the number of followers in descending order. | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_prof...
list the name and number of followers for each user, and sort the results by the number of followers in descending order.
twitter_1
select name from user_profiles order by followers desc limit 5
Question: list the names of 5 users followed by the largest number of other users. | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_profiles.uid, tweets.uid = user_profiles.uid,
list the names of 5 users followed by the largest number of other users.
twitter_1
select text from tweets order by createdate
Question: list the text of all tweets in the order of date. | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_profiles.uid, tweets.uid = user_profiles.uid,
list the text of all tweets in the order of date.
twitter_1
select t1.name , count(*) from user_profiles as t1 join tweets as t2 on t1.uid = t2.uid group by t2.uid
Question: find the name of each user and number of tweets tweeted by each of them. | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_profiles.uid, tweets.uid = user_profiles.uid,
find the name of each user and number of tweets tweeted by each of them.
twitter_1
select t1.name , t1.partitionid from user_profiles as t1 join tweets as t2 on t1.uid = t2.uid group by t2.uid having count(*) < 2
Question: find the name and partition id for users who tweeted less than twice. | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_profiles.uid, tweets.uid = user_profiles.uid,
find the name and partition id for users who tweeted less than twice.
twitter_1
select t1.name , count(*) from user_profiles as t1 join tweets as t2 on t1.uid = t2.uid group by t2.uid having count(*) > 1
Question: find the name of the user who tweeted more than once, and number of tweets tweeted by them. | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_profiles.uid, tweets.uid = user_pr...
find the name of the user who tweeted more than once, and number of tweets tweeted by them.
twitter_1
select avg(followers) from user_profiles where uid not in (select uid from tweets)
Question: find the average number of followers for the users who do not have any tweet. | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_profiles.uid, tweets.uid = user_profiles.uid,
find the average number of followers for the users who do not have any tweet.
twitter_1
select avg(followers) from user_profiles where uid in (select uid from tweets)
Question: find the average number of followers for the users who had some tweets. | Tables: follows -> f1, f2. tweets -> id, uid, text, createdate. user_profiles -> uid, name, email, partitionid, followers. | Joins: follows.f2 = user_profiles.uid, follows.f1 = user_profiles.uid, tweets.uid = user_profiles.uid,
find the average number of followers for the users who had some tweets.