Database: concert_singer
# 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 )
# concert.stadium_id = stadium.stadium_id
# singer_in_concert.singer_id = singer.singer_id
# singer_in_concert.concert_id = concert.concert_id

Question: How many singers do we have?
SQL: select count ( * ) from singer

Question: What is the total number of singers?
SQL: select count ( * ) from singer

Question: Show name, country, age for all singers ordered by age from the oldest to the youngest.
SQL: 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?
SQL: select name , country , age from singer order by age desc

Question: What is the average, minimum, and maximum age of all singers from France?
SQL: 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?
SQL: select avg ( age ) , min ( age ) , max ( age ) from singer where country = 'France'

Question: Show the name and the release year of the song by the youngest singer.
SQL: select song_name , song_release_year from singer order by age asc limit 1

Question: What are the names and release years for all the songs of the youngest singer?
SQL: select song_name , song_release_year from singer order by age asc limit 1

Question: What are all distinct countries where singers above age 20 are from?
SQL: select distinct country from singer where age > 20

Question: What are  the different countries with singers above age 20?
SQL: select distinct country from singer where age > 20

Question: Show all countries and the number of singers in each country.
SQL: select country , count ( * ) from singer group by country

Question: How many singers are from each country?
SQL: select country , count ( * ) from singer group by country

Question: List all song names by singers above the average age.
SQL: 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?
SQL: select song_name from singer where age > ( select avg ( age ) from singer )

Question: Show location and name for all stadiums with a capacity between 5000 and 10000.
SQL: 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?
SQL: select location , name from stadium where capacity between 5000 and 10000

Question: What is the maximum capacity and the average of all stadiums ?
SQL: select max ( capacity ) , average from stadium

Question: What is the average and maximum capacities for all stadiums ?
SQL: select avg ( capacity ) , max ( capacity ) from stadium

Question: What is the name and capacity for the stadium with highest average attendance?
SQL: 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?
SQL: select name , capacity from stadium order by average desc limit 1

Question: How many concerts are there in year 2014 or 2015?
SQL: select count ( * ) from concert where year = 2014 or year = 2015

Question: How many concerts occurred in 2014 or 2015?
SQL: select count ( * ) from concert where year = 2014 or year = 2015

Question: Show the stadium name and the number of concerts in each stadium.
SQL: select stadium.name , count ( * ) from concert join stadium on concert.stadium_id = stadium.stadium_id group by concert.stadium_id

Question: For each stadium, how many concerts play there?
SQL: select stadium.name , count ( * ) from concert join stadium on concert.stadium_id = stadium.stadium_id group by concert.stadium_id

Question: Show the stadium name and capacity with most number of concerts in year 2014 or after.
SQL: select stadium.name , stadium.capacity from concert join stadium on concert.stadium_id = stadium.stadium_id where concert.year >= 2014 group by stadium.stadium_id order by count ( * ) desc limit 1

Question: What is the name and capacity of the stadium with the most concerts after 2013 ?
SQL: select stadium.name , stadium.capacity from concert join stadium on concert.stadium_id = stadium.stadium_id where concert.year > 2013 group by stadium.stadium_id order by count ( * ) desc limit 1

Question: Which year has most number of concerts?
SQL: select year from concert group by year order by count ( * ) desc limit 1

Question: What is the year that had the most concerts?
SQL: select year from concert group by year order by count ( * ) desc limit 1

Question: Show the stadium names without any concert.
SQL: 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?
SQL: select name from stadium where stadium_id not in ( select stadium_id from concert )

Question: Show countries where a singer above age 40 and a singer below 30 are from.
SQL: select country from singer where age > 40 intersect select country from singer where age < 30

Question: Show names for all stadiums except for stadiums having a concert in year 2014.
SQL: select name from stadium except select stadium.name from concert join stadium on concert.stadium_id = stadium.stadium_id where concert.year = 2014

Question: What are the names of all stadiums that did not have a concert in 2014?
SQL: select name from stadium except select stadium.name from concert join stadium on concert.stadium_id = stadium.stadium_id where concert.year = 2014

Question: Show the name and theme for all concerts and the number of singers in each concert.
SQL: select concert.concert_name , concert.theme , count ( * ) from singer_in_concert join concert on singer_in_concert.concert_id = concert.concert_id group by concert.concert_id

Question: What are the names , themes , and number of singers for every concert ?
SQL: select concert.concert_name , concert.theme , count ( * ) from singer_in_concert join concert on singer_in_concert.concert_id = concert.concert_id group by concert.concert_id

Question: List singer names and number of concerts for each singer.
SQL: select singer.name , count ( * ) from singer_in_concert join singer on singer_in_concert.singer_id = singer.singer_id group by singer.singer_id

Question: What are the names of the singers and number of concerts for each person?
SQL: select singer.name , count ( * ) from singer_in_concert join singer on singer_in_concert.singer_id = singer.singer_id group by singer.singer_id

Question: List all singer names in concerts in year 2014.
SQL: select singer.name from singer_in_concert join singer on singer_in_concert.singer_id = singer.singer_id join concert on singer_in_concert.concert_id = concert.concert_id where concert.year = 2014

Question: What are the names of the singers who performed in a concert in 2014?
SQL: select singer.name from singer_in_concert join singer on singer_in_concert.singer_id = singer.singer_id join concert on singer_in_concert.concert_id = concert.concert_id where concert.year = 2014

Question: what is the name and nation of the singer who have a song having 'Hey' in its name?
SQL: 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?
SQL: select name , country from singer where song_name like '%Hey%'

Question: Find the name and location of the stadiums which some concerts happened in the years of both 2014 and 2015.
SQL: select stadium.name , stadium.location from concert join stadium on concert.stadium_id = stadium.stadium_id where concert.year = 2014 intersect select stadium.name , stadium.location from concert join stadium on concert.stadium_id = stadium.stadium_id where concert.year = 2015

Question: What are the names and locations of the stadiums that had concerts that occurred in both 2014 and 2015?
SQL: select stadium.name , stadium.location from concert join stadium on concert.stadium_id = stadium.stadium_id where concert.year = 2014 intersect select stadium.name , stadium.location from concert join stadium on concert.stadium_id = stadium.stadium_id where concert.year = 2015

Question: Find the number of concerts happened in the stadium with the highest capacity .
SQL: 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 ?
SQL: select count ( * ) from concert where stadium_id = ( select stadium_id from stadium order by capacity desc limit 1 )