db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
movie_3 | select t1.title from film as t1 inner join film_category as t2 on t1.film_id = t2.film_id inner join category as t3 on t2.category_id = t3.category_id where t3.name = 'horror' | Question: list at least 10 films that falls into the horror category. | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city ... | list at least 10 films that falls into the horror category. |
movie_3 | select t1.last_name from actor as t1 inner join film_actor as t2 on t1.actor_id = t2.actor_id inner join film as t3 on t2.film_id = t3.film_id where t3.rating = 'nc-17' | Question: who among the actors starred in a nc-17 rated film? provide only the last name of the actors. | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> cat... | who among the actors starred in a nc-17 rated film? provide only the last name of the actors. |
movie_3 | select avg(t3.rental_rate) from actor as t1 inner join film_actor as t2 on t1.actor_id = t2.actor_id inner join film as t3 on t2.film_id = t3.film_id where t1.first_name = 'lucille' and t1.last_name = 'tracy' | Question: calculate the average rate of renting the film that lucille tracy got starred. | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name,... | calculate the average rate of renting the film that lucille tracy got starred. |
movie_3 | select count(film_id) from film where length between 100 and 110 | Question: how many films have a duration between 100 to 110 minutes? | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -... | how many films have a duration between 100 to 110 minutes? |
movie_3 | select actor_id from actor where last_name = 'dee' | Question: list down the actor id of actors with dee as their last name. | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. cit... | list down the actor id of actors with dee as their last name. |
movie_3 | select count(customer_id) from customer where first_name = 'nina' and active = 1 | Question: among the active customers, how many of them have nina as their first name? | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, la... | among the active customers, how many of them have nina as their first name? |
movie_3 | select count(t1.film_id) from film as t1 inner join inventory as t2 on t1.film_id = t2.film_id where t2.store_id = 2 and t1.rating = 'r' | Question: in store id 2, how many of the films are r rating? | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_i... | in store id 2, how many of the films are r rating? |
movie_3 | select t4.store_id from actor as t1 inner join film_actor as t2 on t1.actor_id = t2.actor_id inner join film as t3 on t2.film_id = t3.film_id inner join inventory as t4 on t3.film_id = t4.film_id where t3.length < 100 and t1.first_name = 'reese' and t1.last_name = 'west' | Question: list the store id of the films starred by reese west with a duration of 100 minutes and below? | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> ca... | list the store id of the films starred by reese west with a duration of 100 minutes and below? |
movie_3 | select t3.title from actor as t1 inner join film_actor as t2 on t1.actor_id = t2.actor_id inner join film as t3 on t2.film_id = t3.film_id where t1.first_name = 'nick' and t1.last_name = 'wahlberg' order by t3.rental_rate desc limit 1 | Question: give the duration of the film starred by nick wahlberg with the highest rental rate. | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id,... | give the duration of the film starred by nick wahlberg with the highest rental rate. |
movie_3 | select t3.title from film_actor as t1 inner join actor as t2 on t1.actor_id = t2.actor_id inner join film as t3 on t1.film_id = t3.film_id where t2.first_name = 'russell' and t2.last_name = 'close' | Question: what are the titles of the films starred by russell close? | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -... | what are the titles of the films starred by russell close? |
movie_3 | select t2.store_id from film as t1 inner join inventory as t2 on t1.film_id = t2.film_id where t1.title = 'amadeus holy' | Question: list the store id of the film titled 'amadeus holy'. | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city... | list the store id of the film titled 'amadeus holy'. |
movie_3 | select count(t1.film_id) from film_actor as t1 inner join actor as t2 on t1.actor_id = t2.actor_id inner join film as t3 on t1.film_id = t3.film_id where t3.rental_rate = 2.99 and t2.first_name = 'nina' and t2.last_name = 'soto' | Question: in films with a rental rate of 2.99, how many of the films are starred by nina soto? | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id,... | in films with a rental rate of 2.99, how many of the films are starred by nina soto? |
movie_3 | select sum(iif(t4.film_id = 1, 1, 0)) - sum(iif(t4.film_id = 2, 1, 0)) as diff from film_actor as t1 inner join actor as t2 on t1.actor_id = t2.actor_id inner join film as t3 on t1.film_id = t3.film_id inner join inventory as t4 on t3.film_id = t4.film_id where t2.first_name = 'reese' and t2.last_name = 'west' | Question: among the films starred by reese west, what is the difference between the films that have store id of 1 and store id of 2? | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone,... | among the films starred by reese west, what is the difference between the films that have store id of 1 and store id of 2? |
movie_3 | select postal_code from address where address = '692 joliet street' | Question: what is the postal code of the address 692 joliet street? | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city ->... | what is the postal code of the address 692 joliet street? |
movie_3 | select count(customer_id) from customer where active = 1 | Question: how many customers are active? | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id,... | how many customers are active? |
movie_3 | select count(customer_id) from customer where active = 1 and store_id = 1 | Question: among all the customers of store no.1, how many of them are active? | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_updat... | among all the customers of store no.1, how many of them are active? |
movie_3 | select t1.address from address as t1 inner join customer as t2 on t1.address_id = t2.address_id where t2.first_name = 'mary' and t2.last_name = 'smith' | Question: what is the address of mary smith? | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country... | what is the address of mary smith? |
movie_3 | select count(t2.customer_id) from address as t1 inner join customer as t2 on t1.address_id = t2.address_id inner join city as t3 on t1.city_id = t3.city_id where t2.active = 1 and t3.city = 'arlington' | Question: among all the active customers, how many of them live in arlington? | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_updat... | among all the active customers, how many of them live in arlington? |
movie_3 | select t4.first_name, t4.last_name from address as t1 inner join city as t2 on t1.city_id = t2.city_id inner join country as t3 on t2.country_id = t3.country_id inner join customer as t4 on t1.address_id = t4.address_id where t3.country = 'italy' | Question: please list the full names of all the customers who live in italy. | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update... | please list the full names of all the customers who live in italy. |
movie_3 | select t3.country from address as t1 inner join city as t2 on t1.city_id = t2.city_id inner join country as t3 on t2.country_id = t3.country_id inner join customer as t4 on t1.address_id = t4.address_id where t4.first_name = 'mary' and t4.last_name = 'smith' | Question: which country does mary smith live in? | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, cou... | which country does mary smith live in? |
movie_3 | select t1.amount from payment as t1 inner join customer as t2 on t1.customer_id = t2.customer_id where t2.first_name = 'mary' and t2.last_name = 'smith' order by t1.amount desc limit 1 | Question: what is the biggest amount of payment for a rental made by mary smith? | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_up... | what is the biggest amount of payment for a rental made by mary smith? |
movie_3 | select count(t1.customer_id) from payment as t1 inner join customer as t2 on t1.customer_id = t2.customer_id where t2.first_name = 'mary' and t2.last_name = 'smith' | Question: how many times has mary smith rented a film? | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, cit... | how many times has mary smith rented a film? |
movie_3 | select sum(t1.amount) from payment as t1 inner join customer as t2 on t1.customer_id = t2.customer_id where t2.first_name = 'mary' and t2.last_name = 'smith' | Question: what is the total amount of money mary smith has spent on film rentals? | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_u... | what is the total amount of money mary smith has spent on film rentals? |
movie_3 | select count(t1.customer_id) from payment as t1 inner join customer as t2 on t1.customer_id = t2.customer_id where t2.first_name = 'mary' and t2.last_name = 'smith' and strftime('%y',t1.payment_date) = '2005' and strftime('%y', t1.payment_date) = '6' | Question: among the times mary smith had rented a movie, how many of them happened in june, 2005? | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_... | among the times mary smith had rented a movie, how many of them happened in june, 2005? |
movie_3 | select t2.first_name, t2.last_name from payment as t1 inner join customer as t2 on t1.customer_id = t2.customer_id order by t1.amount desc limit 1 | Question: please give the full name of the customer who had made the biggest amount of payment in one single film rental. | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_updat... | please give the full name of the customer who had made the biggest amount of payment in one single film rental. |
movie_3 | select sum(t5.amount) from address as t1 inner join city as t2 on t1.city_id = t2.city_id inner join country as t3 on t2.country_id = t3.country_id inner join customer as t4 on t1.address_id = t4.address_id inner join payment as t5 on t4.customer_id = t5.customer_id where t3.country = 'italy' | Question: how much in total had the customers in italy spent on film rentals? | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_updat... | how much in total had the customers in italy spent on film rentals? |
movie_3 | select count(t1.amount) from payment as t1 inner join customer as t2 on t1.customer_id = t2.customer_id where t2.first_name = 'mary' and t2.last_name = 'smith' and t1.amount > 4.99 | Question: among the payments made by mary smith, how many of them are over 4.99? | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_up... | among the payments made by mary smith, how many of them are over 4.99? |
movie_3 | select avg(t5.amount) from address as t1 inner join city as t2 on t1.city_id = t2.city_id inner join country as t3 on t2.country_id = t3.country_id inner join customer as t4 on t1.address_id = t4.address_id inner join payment as t5 on t4.customer_id = t5.customer_id where t3.country = 'italy' | Question: what is the average amount of money spent by a customer in italy on a single film rental? | Tables: film_text -> film_id, title, description. actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> categor... | what is the average amount of money spent by a customer in italy on a single film rental? |
concert_singer | select count(*) from singer | Question: how many singers do we have? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in_concert -> concert_ID, Singer_ID. | Joins: c... | how many singers do we have? |
concert_singer | select count(*) from singer | Question: what is the total number of singers? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in_concert -> concert_ID, Singer_ID. | ... | what is the total number of singers? |
concert_singer | select name , country , age from singer order by age desc | Question: show name, country, age for all singers ordered by age from the oldest to the youngest. | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Y... | show name, country, age for all singers ordered by age from the oldest to the youngest. |
concert_singer | select name , country , age from singer order by age desc | Question: what are the names, countries, and ages for every singer in descending order of age? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year... | what are the names, countries, and ages for every singer in descending order of age? |
concert_singer | select avg(age) , min(age) , max(age) from singer where country = 'france' | Question: what is the average, minimum, and maximum age of all singers from france? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in... | what is the average, minimum, and maximum age of all singers from france? |
concert_singer | select avg(age) , min(age) , max(age) from singer where country = 'france' | Question: what is the average, minimum, and maximum age for all french singers? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in_con... | what is the average, minimum, and maximum age for all french singers? |
concert_singer | select song_name , song_release_year from singer order by age limit 1 | Question: show the name and the release year of the song by the youngest singer. | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in_co... | show the name and the release year of the song by the youngest singer. |
concert_singer | select song_name , song_release_year from singer order by age limit 1 | Question: what are the names and release years for all the songs of the youngest singer? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. sing... | what are the names and release years for all the songs of the youngest singer? |
concert_singer | select distinct country from singer where age > 20 | Question: what are all distinct countries where singers above age 20 are from? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in_conc... | what are all distinct countries where singers above age 20 are from? |
concert_singer | select distinct country from singer where age > 20 | Question: what are the different countries with singers above age 20? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in_concert -> c... | what are the different countries with singers above age 20? |
concert_singer | select country , count(*) from singer group by country | Question: show all countries and the number of singers in each country. | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in_concert -> ... | show all countries and the number of singers in each country. |
concert_singer | select country , count(*) from singer group by country | Question: how many singers are from each country? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in_concert -> concert_ID, Singer_ID.... | how many singers are from each country? |
concert_singer | select song_name from singer where age > (select avg(age) from singer) | Question: list all song names by singers above the average age. | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in_concert -> concert_... | list all song names by singers above the average age. |
concert_singer | select song_name from singer where age > (select avg(age) from singer) | Question: what are all the song names by singers who are older than average? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in_concer... | what are all the song names by singers who are older than average? |
concert_singer | select location , name from stadium where capacity between 5000 and 10000 | Question: show location and name for all stadiums with a capacity between 5000 and 10000. | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. sin... | show location and name for all stadiums with a capacity between 5000 and 10000. |
concert_singer | select location , name from stadium where capacity between 5000 and 10000 | Question: what are the locations and names of all stations with capacity between 5000 and 10000? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Ye... | what are the locations and names of all stations with capacity between 5000 and 10000? |
concert_singer | select max(capacity), average from stadium | Question: what is the maximum capacity and the average of all stadiums ? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in_concert ->... | what is the maximum capacity and the average of all stadiums ? |
concert_singer | select avg(capacity) , max(capacity) from stadium | Question: what is the average and maximum capacities for all stadiums ? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in_concert -> ... | what is the average and maximum capacities for all stadiums ? |
concert_singer | select name , capacity from stadium order by average desc limit 1 | Question: what is the name and capacity for the stadium with highest average attendance? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. sing... | what is the name and capacity for the stadium with highest average attendance? |
concert_singer | select name , capacity from stadium order by average desc limit 1 | Question: what is the name and capacity for the stadium with the highest average attendance? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. ... | what is the name and capacity for the stadium with the highest average attendance? |
concert_singer | select count(*) from concert where year = 2014 or year = 2015 | Question: how many concerts are there in year 2014 or 2015? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in_concert -> concert_ID, ... | how many concerts are there in year 2014 or 2015? |
concert_singer | select count(*) from concert where year = 2014 or year = 2015 | Question: how many concerts occurred in 2014 or 2015? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in_concert -> concert_ID, Singer... | how many concerts occurred in 2014 or 2015? |
concert_singer | select t2.name , count(*) from concert as t1 join stadium as t2 on t1.stadium_id = t2.stadium_id group by t1.stadium_id | Question: show the stadium name and the number of concerts in each stadium. | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in_concert... | show the stadium name and the number of concerts in each stadium. |
concert_singer | select t2.name , count(*) from concert as t1 join stadium as t2 on t1.stadium_id = t2.stadium_id group by t1.stadium_id | Question: for each stadium, how many concerts play there? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in_concert -> concert_ID, Si... | for each stadium, how many concerts play there? |
concert_singer | select t2.name , t2.capacity from concert as t1 join stadium as t2 on t1.stadium_id = t2.stadium_id where t1.year >= 2014 group by t2.stadium_id order by count(*) desc limit 1 | Question: show the stadium name and capacity with most number of concerts in year 2014 or after. | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Ye... | show the stadium name and capacity with most number of concerts in year 2014 or after. |
concert_singer | select t2.name , t2.capacity from concert as t1 join stadium as t2 on t1.stadium_id = t2.stadium_id where t1.year > 2013 group by t2.stadium_id order by count(*) desc limit 1 | Question: what is the name and capacity of the stadium with the most concerts after 2013 ? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. si... | what is the name and capacity of the stadium with the most concerts after 2013 ? |
concert_singer | select year from concert group by year order by count(*) desc limit 1 | Question: which year has most number of concerts? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in_concert -> concert_ID, Singer_ID.... | which year has most number of concerts? |
concert_singer | select year from concert group by year order by count(*) desc limit 1 | Question: what is the year that had the most concerts? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in_concert -> concert_ID, Singe... | what is the year that had the most concerts? |
concert_singer | select name from stadium where stadium_id not in (select stadium_id from concert) | Question: show the stadium names without any concert. | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in_concert -> concert_ID, Singer... | show the stadium names without any concert. |
concert_singer | select name from stadium where stadium_id not in (select stadium_id from concert) | Question: what are the names of the stadiums without any concerts? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in_concert -> conce... | what are the names of the stadiums without any concerts? |
concert_singer | select country from singer where age > 40 intersect select country from singer where age < 30 | Question: show countries where a singer above age 40 and a singer below 30 are from. | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_i... | show countries where a singer above age 40 and a singer below 30 are from. |
concert_singer | select name from stadium except select t2.name from concert as t1 join stadium as t2 on t1.stadium_id = t2.stadium_id where t1.year = 2014 | Question: show names for all stadiums except for stadiums having a concert in year 2014. | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. sing... | show names for all stadiums except for stadiums having a concert in year 2014. |
concert_singer | select name from stadium except select t2.name from concert as t1 join stadium as t2 on t1.stadium_id = t2.stadium_id where t1.year = 2014 | Question: what are the names of all stadiums that did not have a concert in 2014? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in_c... | what are the names of all stadiums that did not have a concert in 2014? |
concert_singer | select t2.concert_name , t2.theme , count(*) from singer_in_concert as t1 join concert as t2 on t1.concert_id = t2.concert_id group by t2.concert_id | Question: show the name and theme for all concerts and the number of singers in each concert. | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year.... | show the name and theme for all concerts and the number of singers in each concert. |
concert_singer | select t2.concert_name , t2.theme , count(*) from singer_in_concert as t1 join concert as t2 on t1.concert_id = t2.concert_id group by t2.concert_id | Question: what are the names , themes , and number of singers for every concert ? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in_c... | what are the names , themes , and number of singers for every concert ? |
concert_singer | select t2.name , count(*) from singer_in_concert as t1 join singer as t2 on t1.singer_id = t2.singer_id group by t2.singer_id | Question: list singer names and number of concerts for each singer. | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in_concert -> conc... | list singer names and number of concerts for each singer. |
concert_singer | select t2.name , count(*) from singer_in_concert as t1 join singer as t2 on t1.singer_id = t2.singer_id group by t2.singer_id | Question: what are the names of the singers and number of concerts for each person? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in... | what are the names of the singers and number of concerts for each person? |
concert_singer | select t2.name from singer_in_concert as t1 join singer as t2 on t1.singer_id = t2.singer_id join concert as t3 on t1.concert_id = t3.concert_id where t3.year = 2014 | Question: list all singer names in concerts in year 2014. | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in_concert -> concert_ID, Si... | list all singer names in concerts in year 2014. |
concert_singer | select t2.name from singer_in_concert as t1 join singer as t2 on t1.singer_id = t2.singer_id join concert as t3 on t1.concert_id = t3.concert_id where t3.year = 2014 | Question: what are the names of the singers who performed in a concert in 2014? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. singer_in_con... | what are the names of the singers who performed in a concert in 2014? |
concert_singer | select name , country from singer where song_name like '%hey%' | Question: what is the name and nation of the singer who have a song having 'hey' in its name? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year.... | what is the name and nation of the singer who have a song having 'hey' in its name? |
concert_singer | select name , country from singer where song_name like '%hey%' | Question: what is the name and country of origin of every singer who has a song with the word 'hey' in its title? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Them... | what is the name and country of origin of every singer who has a song with the word 'hey' in its title? |
concert_singer | select t2.name , t2.location from concert as t1 join stadium as t2 on t1.stadium_id = t2.stadium_id where t1.year = 2014 intersect select t2.name , t2.location from concert as t1 join stadium as t2 on t1.stadium_id = t2.stadium_id where t1.year = 2015 | Question: find the name and location of the stadiums which some concerts happened in the years of both 2014 and 2015. | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, ... | find the name and location of the stadiums which some concerts happened in the years of both 2014 and 2015. |
concert_singer | select t2.name , t2.location from concert as t1 join stadium as t2 on t1.stadium_id = t2.stadium_id where t1.year = 2014 intersect select t2.name , t2.location from concert as t1 join stadium as t2 on t1.stadium_id = t2.stadium_id where t1.year = 2015 | Question: what are the names and locations of the stadiums that had concerts that occurred in both 2014 and 2015? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Them... | what are the names and locations of the stadiums that had concerts that occurred in both 2014 and 2015? |
concert_singer | select count(*) from concert where stadium_id = (select stadium_id from stadium order by capacity desc limit 1) | Question: find the number of concerts happened in the stadium with the highest capacity . | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, Year. sin... | find the number of concerts happened in the stadium with the highest capacity . |
concert_singer | select count(*) from concert where stadium_id = (select stadium_id from stadium order by capacity desc limit 1) | Question: what are the number of concerts that occurred in the stadium with the largest capacity ? | Tables: stadium -> Stadium_ID, Location, Name, Capacity, Highest, Lowest, Average. singer -> Singer_ID, Name, Country, Song_Name, Song_release_year, Age, Is_male. concert -> concert_ID, concert_Name, Theme, Stadium_ID, ... | what are the number of concerts that occurred in the stadium with the largest capacity ? |
pets_1 | select count(*) from pets where weight > 10 | Question: find the number of pets whose weight is heavier than 10. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | find the number of pets whose weight is heavier than 10. |
pets_1 | select count(*) from pets where weight > 10 | Question: how many pets have a greater weight than 10? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | how many pets have a greater weight than 10? |
pets_1 | select weight from pets order by pet_age limit 1 | Question: find the weight of the youngest dog. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | find the weight of the youngest dog. |
pets_1 | select weight from pets order by pet_age limit 1 | Question: how much does the youngest dog weigh? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | how much does the youngest dog weigh? |
pets_1 | select max(weight) , pettype from pets group by pettype | Question: find the maximum weight for each type of pet. list the maximum weight and pet type. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | find the maximum weight for each type of pet. list the maximum weight and pet type. |
pets_1 | select max(weight) , pettype from pets group by pettype | Question: list the maximum weight and type for each type of pet. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | list the maximum weight and type for each type of pet. |
pets_1 | select count(*) from student as t1 join has_pet as t2 on t1.stuid = t2.stuid where t1.age > 20 | Question: find number of pets owned by students who are older than 20. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | find number of pets owned by students who are older than 20. |
pets_1 | select count(*) from student as t1 join has_pet as t2 on t1.stuid = t2.stuid where t1.age > 20 | Question: how many pets are owned by students that have an age greater than 20? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | how many pets are owned by students that have an age greater than 20? |
pets_1 | select count(*) from student as t1 join has_pet as t2 on t1.stuid = t2.stuid join pets as t3 on t2.petid = t3.petid where t1.sex = 'f' and t3.pettype = 'dog' | Question: find the number of dog pets that are raised by female students (with sex f). | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | find the number of dog pets that are raised by female students (with sex f). |
pets_1 | select count(*) from student as t1 join has_pet as t2 on t1.stuid = t2.stuid join pets as t3 on t2.petid = t3.petid where t1.sex = 'f' and t3.pettype = 'dog' | Question: how many dog pets are raised by female students? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | how many dog pets are raised by female students? |
pets_1 | select count(distinct pettype) from pets | Question: find the number of distinct type of pets. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | find the number of distinct type of pets. |
pets_1 | select count(distinct pettype) from pets | Question: how many different types of pet are there? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | how many different types of pet are there? |
pets_1 | select distinct t1.fname from student as t1 join has_pet as t2 on t1.stuid = t2.stuid join pets as t3 on t3.petid = t2.petid where t3.pettype = 'cat' or t3.pettype = 'dog' | Question: find the first name of students who have cat or dog pet. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | find the first name of students who have cat or dog pet. |
pets_1 | select distinct t1.fname from student as t1 join has_pet as t2 on t1.stuid = t2.stuid join pets as t3 on t3.petid = t2.petid where t3.pettype = 'cat' or t3.pettype = 'dog' | Question: what are the first names of every student who has a cat or dog as a pet? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | what are the first names of every student who has a cat or dog as a pet? |
pets_1 | select t1.fname from student as t1 join has_pet as t2 on t1.stuid = t2.stuid join pets as t3 on t3.petid = t2.petid where t3.pettype = 'cat' intersect select t1.fname from student as t1 join has_pet as t2 on t1.stuid = t2.stuid join pets as t3 on t3.petid = t2.petid where t3.pettype = 'dog' | Question: find the first name of students who have both cat and dog pets . | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | find the first name of students who have both cat and dog pets . |
pets_1 | select t1.fname from student as t1 join has_pet as t2 on t1.stuid = t2.stuid join pets as t3 on t3.petid = t2.petid where t3.pettype = 'cat' intersect select t1.fname from student as t1 join has_pet as t2 on t1.stuid = t2.stuid join pets as t3 on t3.petid = t2.petid where t3.pettype = 'dog' | Question: what are the students' first names who have both cats and dogs as pets? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | what are the students' first names who have both cats and dogs as pets? |
pets_1 | select major , age from student where stuid not in (select t1.stuid from student as t1 join has_pet as t2 on t1.stuid = t2.stuid join pets as t3 on t3.petid = t2.petid where t3.pettype = 'cat') | Question: find the major and age of students who do not have a cat pet. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | find the major and age of students who do not have a cat pet. |
pets_1 | select major , age from student where stuid not in (select t1.stuid from student as t1 join has_pet as t2 on t1.stuid = t2.stuid join pets as t3 on t3.petid = t2.petid where t3.pettype = 'cat') | Question: what major is every student who does not own a cat as a pet, and also how old are they? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | what major is every student who does not own a cat as a pet, and also how old are they? |
pets_1 | select stuid from student except select t1.stuid from student as t1 join has_pet as t2 on t1.stuid = t2.stuid join pets as t3 on t3.petid = t2.petid where t3.pettype = 'cat' | Question: find the id of students who do not have a cat pet. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | find the id of students who do not have a cat pet. |
pets_1 | select stuid from student except select t1.stuid from student as t1 join has_pet as t2 on t1.stuid = t2.stuid join pets as t3 on t3.petid = t2.petid where t3.pettype = 'cat' | Question: what are the ids of the students who do not own cats as pets? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | what are the ids of the students who do not own cats as pets? |
pets_1 | select t1.fname , t1.age from student as t1 join has_pet as t2 on t1.stuid = t2.stuid join pets as t3 on t3.petid = t2.petid where t3.pettype = 'dog' and t1.stuid not in (select t1.stuid from student as t1 join has_pet as t2 on t1.stuid = t2.stuid join pets as t3 on t3.petid = t2.petid where t3.pettype = '... | Question: find the first name and age of students who have a dog but do not have a cat as a pet. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | find the first name and age of students who have a dog but do not have a cat as a pet. |
pets_1 | select t1.fname , t1.age from student as t1 join has_pet as t2 on t1.stuid = t2.stuid join pets as t3 on t3.petid = t2.petid where t3.pettype = 'dog' and t1.stuid not in (select t1.stuid from student as t1 join has_pet as t2 on t1.stuid = t2.stuid join pets as t3 on t3.petid = t2.petid where t3.pettype = '... | Question: what is the first name of every student who has a dog but does not have a cat? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | what is the first name of every student who has a dog but does not have a cat? |
pets_1 | select pettype , weight from pets order by pet_age limit 1 | Question: find the type and weight of the youngest pet. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | find the type and weight of the youngest pet. |
pets_1 | select pettype , weight from pets order by pet_age limit 1 | Question: what type of pet is the youngest animal, and how much does it weigh? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | what type of pet is the youngest animal, and how much does it weigh? |
pets_1 | select petid , weight from pets where pet_age > 1 | Question: find the id and weight of all pets whose age is older than 1. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | find the id and weight of all pets whose age is older than 1. |
pets_1 | select petid , weight from pets where pet_age > 1 | Question: what is the id and weight of every pet who is older than 1? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | what is the id and weight of every pet who is older than 1? |
pets_1 | select avg(pet_age) , max(pet_age) , pettype from pets group by pettype | Question: find the average and maximum age for each type of pet. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Has_Pet -> StuID, PetID. Pets -> PetID, PetType, pet_age, weight. | Joins: Has_Pet.StuID = Student.StuID, Has_Pet.PetID = Pets.PetID, | find the average and maximum age for each type of pet. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.