db_id
stringclasses
20 values
question_en
stringlengths
18
174
query
stringlengths
20
422
answer
stringlengths
14
111k
hardness
stringclasses
4 values
query_llm
stringlengths
20
486
schema_SQLDatabase
stringclasses
20 values
schema_our
stringclasses
20 values
schema_dict
stringclasses
20 values
selector
stringlengths
21
225
selector_correct
stringlengths
25
225
schema_SQLDatabase_reduzido
stringlengths
42
669
schema_SQLDatabase_reduzido_tabelas
stringclasses
157 values
concert_singer
How many singers do we have?
SELECT count(*) FROM singer
[{'count(*)': 6}]
easy
SELECT count(*) FROM singer
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'singer': ['singer_id'] }
{ 'singer': ['Singer_ID'] }
CREATE TABLE singer ( Singer_ID INT, PRIMARY KEY (Singer_ID) );
CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) );
concert_singer
What is the total number of singers?
SELECT count(*) FROM singer
[{'count(*)': 6}]
easy
SELECT count(*) FROM singer
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'singer': ['singer_id'] }
{ 'singer': ['Singer_ID'] }
CREATE TABLE singer ( Singer_ID INT, PRIMARY KEY (Singer_ID) );
CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) );
concert_singer
Show name, country, age for all singers ordered by age from the oldest to the youngest.
SELECT name , country , age FROM singer ORDER BY age DESC
[{'Name': 'Joe Sharp', 'Country': 'Netherlands', 'Age': 52}, {'Name': 'John Nizinik', 'Country': 'France', 'Age': 43}, {'Name': 'Rose White', 'Country': 'France', 'Age': 41}, {'Name': 'Timbaland', 'Country': 'United States', 'Age': 32}, {'Name': 'Justin Brown', 'Country': 'France', 'Age': 29}, {'Name': 'Tribal King', 'Country': 'France', 'Age': 25}]
medium
SELECT name , country , age FROM singer ORDER BY age DESC
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'singer': ['singer_id', 'name', 'country', 'age'] }
{ 'singer': ['Singer_ID', 'Name', 'Country', 'Age'] }
CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Age INT, PRIMARY KEY (Singer_ID) );
CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) );
concert_singer
What are the names, countries, and ages for every singer in descending order of age?
SELECT name , country , age FROM singer ORDER BY age DESC
[{'Name': 'Joe Sharp', 'Country': 'Netherlands', 'Age': 52}, {'Name': 'John Nizinik', 'Country': 'France', 'Age': 43}, {'Name': 'Rose White', 'Country': 'France', 'Age': 41}, {'Name': 'Timbaland', 'Country': 'United States', 'Age': 32}, {'Name': 'Justin Brown', 'Country': 'France', 'Age': 29}, {'Name': 'Tribal King', 'Country': 'France', 'Age': 25}]
medium
SELECT name , country , age FROM singer ORDER BY age DESC
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'singer': ['singer_id', 'name', 'country', 'age'] }
{ 'singer': ['Singer_ID', 'Name', 'Country', 'Age'] }
CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Age INT, PRIMARY KEY (Singer_ID) );
CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) );
concert_singer
What is the average, minimum, and maximum age of all singers from France?
SELECT avg(age) , min(age) , max(age) FROM singer WHERE country = 'France'
[{'avg(age)': 34.5, 'min(age)': 25, 'max(age)': 43}]
medium
SELECT avg(age) , min(age) , max(age) FROM singer WHERE country = 'France'
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'singer': ['singer_id', 'country', 'age'] }
{ 'singer': ['Singer_ID', 'Country', 'Age'] }
CREATE TABLE singer ( Singer_ID INT, Country TEXT, Age INT, PRIMARY KEY (Singer_ID) );
CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) );
concert_singer
What is the average, minimum, and maximum age for all French singers?
SELECT avg(age) , min(age) , max(age) FROM singer WHERE country = 'France'
[{'avg(age)': 34.5, 'min(age)': 25, 'max(age)': 43}]
medium
SELECT avg(age) , min(age) , max(age) FROM singer WHERE country = 'France'
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'singer': ['singer_id', 'country', 'age'] }
{ 'singer': ['Singer_ID', 'Country', 'Age'] }
CREATE TABLE singer ( Singer_ID INT, Country TEXT, Age INT, PRIMARY KEY (Singer_ID) );
CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) );
concert_singer
Show the name and the release year of the song by the youngest singer.
SELECT song_name , song_release_year FROM singer ORDER BY age LIMIT 1
[{'Song_Name': 'Love', 'Song_release_year': '2016'}]
medium
SELECT song_name , song_release_year FROM singer ORDER BY age LIMIT 1
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'singer': ['singer_id', 'song_name', 'song_release_year', 'age'] }
{ 'singer': ['Singer_ID', 'Song_Name', 'Song_release_year', 'Age'] }
CREATE TABLE singer ( Singer_ID INT, Song_Name TEXT, Song_release_year TEXT, Age INT, PRIMARY KEY (Singer_ID) );
CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) );
concert_singer
What are the names and release years for all the songs of the youngest singer?
SELECT song_name , song_release_year FROM singer ORDER BY age LIMIT 1
[{'Song_Name': 'Love', 'Song_release_year': '2016'}]
medium
SELECT song_name , song_release_year FROM singer ORDER BY age LIMIT 1
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'singer': ['singer_id', 'song_name', 'song_release_year', 'age'] }
{ 'singer': ['Singer_ID', 'Song_Name', 'Song_release_year', 'Age'] }
CREATE TABLE singer ( Singer_ID INT, Song_Name TEXT, Song_release_year TEXT, Age INT, PRIMARY KEY (Singer_ID) );
CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) );
concert_singer
What are all distinct countries where singers above age 20 are from?
SELECT DISTINCT country FROM singer WHERE age > 20
[{'Country': 'Netherlands'}, {'Country': 'United States'}, {'Country': 'France'}]
easy
SELECT DISTINCT country FROM singer WHERE age > 20
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'singer': ['singer_id', 'country', 'age'] }
{ 'singer': ['Singer_ID', 'Country', 'Age'] }
CREATE TABLE singer ( Singer_ID INT, Country TEXT, Age INT, PRIMARY KEY (Singer_ID) );
CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) );
concert_singer
What are the different countries with singers above age 20?
SELECT DISTINCT country FROM singer WHERE age > 20
[{'Country': 'Netherlands'}, {'Country': 'United States'}, {'Country': 'France'}]
easy
SELECT DISTINCT country FROM singer WHERE age > 20
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'singer': ['singer_id', 'country', 'age'] }
{ 'singer': ['Singer_ID', 'Country', 'Age'] }
CREATE TABLE singer ( Singer_ID INT, Country TEXT, Age INT, PRIMARY KEY (Singer_ID) );
CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) );
concert_singer
Show all countries and the number of singers in each country.
SELECT country , count(*) FROM singer GROUP BY country
[{'Country': 'France', 'count(*)': 4}, {'Country': 'Netherlands', 'count(*)': 1}, {'Country': 'United States', 'count(*)': 1}]
medium
SELECT country , count(*) FROM singer GROUP BY country
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'singer': ['singer_id', 'country'] }
{ 'singer': ['Singer_ID', 'Country'] }
CREATE TABLE singer ( Singer_ID INT, Country TEXT, PRIMARY KEY (Singer_ID) );
CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) );
concert_singer
How many singers are from each country?
SELECT country , count(*) FROM singer GROUP BY country
[{'Country': 'France', 'count(*)': 4}, {'Country': 'Netherlands', 'count(*)': 1}, {'Country': 'United States', 'count(*)': 1}]
medium
SELECT country , count(*) FROM singer GROUP BY country
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'singer': ['singer_id', 'country'] }
{ 'singer': ['Singer_ID', 'Country'] }
CREATE TABLE singer ( Singer_ID INT, Country TEXT, PRIMARY KEY (Singer_ID) );
CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) );
concert_singer
List all song names by singers above the average age.
SELECT song_name FROM singer WHERE age > (SELECT avg(age) FROM singer)
[{'Song_Name': 'You'}, {'Song_Name': 'Sun'}, {'Song_Name': 'Gentleman'}]
hard
SELECT song_name FROM singer WHERE age > (SELECT avg(age) FROM singer)
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'singer': ['singer_id', 'song_name', 'age'] }
{ 'singer': ['Singer_ID', 'Song_Name', 'Age'] }
CREATE TABLE singer ( Singer_ID INT, Song_Name TEXT, Age INT, PRIMARY KEY (Singer_ID) );
CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) );
concert_singer
What are all the song names by singers who are older than average?
SELECT song_name FROM singer WHERE age > (SELECT avg(age) FROM singer)
[{'Song_Name': 'You'}, {'Song_Name': 'Sun'}, {'Song_Name': 'Gentleman'}]
hard
SELECT song_name FROM singer WHERE age > (SELECT avg(age) FROM singer)
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'singer': ['singer_id', 'song_name', 'age'] }
{ 'singer': ['Singer_ID', 'Song_Name', 'Age'] }
CREATE TABLE singer ( Singer_ID INT, Song_Name TEXT, Age INT, PRIMARY KEY (Singer_ID) );
CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) );
concert_singer
Show location and name for all stadiums with a capacity between 5000 and 10000.
SELECT LOCATION , name FROM stadium WHERE capacity BETWEEN 5000 AND 10000
[{'Nenhum': 'Nenhum resultado encontrado'}]
medium
SELECT LOCATION , name FROM stadium WHERE capacity BETWEEN 5000 AND 10000
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'stadium': ['stadium_id', 'location', 'name', 'capacity'] }
{ 'stadium': ['Stadium_ID', 'Location', 'Name', 'Capacity'] }
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, PRIMARY KEY (Stadium_ID) );
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) );
concert_singer
What are the locations and names of all stations with capacity between 5000 and 10000?
SELECT LOCATION , name FROM stadium WHERE capacity BETWEEN 5000 AND 10000
[{'Nenhum': 'Nenhum resultado encontrado'}]
medium
SELECT LOCATION , name FROM stadium WHERE capacity BETWEEN 5000 AND 10000
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'stadium': ['stadium_id', 'location', 'name', 'capacity'] }
{ 'stadium': ['Stadium_ID', 'Location', 'Name', 'Capacity'] }
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, PRIMARY KEY (Stadium_ID) );
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) );
concert_singer
What is the maximum capacity and the average of all stadiums ?
SELECT max(capacity), average FROM stadium
[{'max(capacity)': 52500, 'Average': 730}]
medium
SELECT max(capacity), average FROM stadium
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'stadium': ['stadium_id', 'capacity', 'average'] }
{ 'stadium': ['Stadium_ID', 'Capacity', 'Average'] }
CREATE TABLE stadium ( Stadium_ID INT, Capacity INT, Average INT, PRIMARY KEY (Stadium_ID) );
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) );
concert_singer
What is the average and maximum capacities for all stadiums ?
SELECT avg(capacity) , max(capacity) FROM stadium
[{'avg(capacity)': 10621.666666666666, 'max(capacity)': 52500}]
medium
SELECT avg(capacity) , max(capacity) FROM stadium
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'stadium': ['stadium_id', 'capacity'] }
{ 'stadium': ['Stadium_ID', 'Capacity'] }
CREATE TABLE stadium ( Stadium_ID INT, Capacity INT, PRIMARY KEY (Stadium_ID) );
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) );
concert_singer
What is the name and capacity for the stadium with highest average attendance?
SELECT name , capacity FROM stadium ORDER BY average DESC LIMIT 1
[{'Name': "Stark's Park", 'Capacity': 10104}]
medium
SELECT name , capacity FROM stadium ORDER BY average DESC LIMIT 1
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'stadium': ['stadium_id', 'name', 'capacity', 'average'] }
{ 'stadium': ['Stadium_ID', 'Name', 'Capacity', 'Average'] }
CREATE TABLE stadium ( Stadium_ID INT, Name TEXT, Capacity INT, Average INT, PRIMARY KEY (Stadium_ID) );
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) );
concert_singer
What is the name and capacity for the stadium with the highest average attendance?
SELECT name , capacity FROM stadium ORDER BY average DESC LIMIT 1
[{'Name': "Stark's Park", 'Capacity': 10104}]
medium
SELECT name , capacity FROM stadium ORDER BY average DESC LIMIT 1
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'stadium': ['stadium_id', 'name', 'capacity', 'average'] }
{ 'stadium': ['Stadium_ID', 'Name', 'Capacity', 'Average'] }
CREATE TABLE stadium ( Stadium_ID INT, Name TEXT, Capacity INT, Average INT, PRIMARY KEY (Stadium_ID) );
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) );
concert_singer
How many concerts are there in year 2014 or 2015?
SELECT count(*) FROM concert WHERE YEAR = 2014 OR YEAR = 2015
[{'count(*)': 6}]
medium
SELECT count(*) FROM concert WHERE YEAR = 2014 OR YEAR = 2015
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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': ['concert_id', 'year'] }
{ 'concert': ['concert_ID', 'Year'] }
CREATE TABLE concert ( concert_ID INT, Year TEXT, PRIMARY KEY (concert_ID) );
CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID) );
concert_singer
How many concerts occurred in 2014 or 2015?
SELECT count(*) FROM concert WHERE YEAR = 2014 OR YEAR = 2015
[{'count(*)': 6}]
medium
SELECT count(*) FROM concert WHERE YEAR = 2014 OR YEAR = 2015
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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': ['concert_id', 'year'] }
{ 'concert': ['concert_ID', 'Year'] }
CREATE TABLE concert ( concert_ID INT, Year TEXT, PRIMARY KEY (concert_ID) );
CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID) );
concert_singer
Show the stadium name and the number of concerts in each stadium.
SELECT T2.name , count(*) FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id GROUP BY T1.stadium_id
[{'Name': "Stark's Park", 'count(*)': 1}, {'Name': 'Glebe Park', 'count(*)': 1}, {'Name': 'Somerset Park', 'count(*)': 2}, {'Name': 'Recreation Park', 'count(*)': 1}, {'Name': 'Balmoor', 'count(*)': 1}]
medium
SELECT stadium.name , count(*) FROM concert JOIN stadium ON concert.stadium_id = stadium.stadium_id GROUP BY concert.stadium_id
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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': ['concert_id', 'stadium_id'], 'stadium': ['stadium_id', 'name'] }
{ 'concert': ['concert_ID', 'Stadium_ID'], 'stadium': ['Stadium_ID', 'Name'] }
CREATE TABLE concert ( concert_ID INT, Stadium_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE stadium ( Stadium_ID INT, Name TEXT, PRIMARY KEY (Stadium_ID) );
CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) );
concert_singer
For each stadium, how many concerts play there?
SELECT T2.name , count(*) FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id GROUP BY T1.stadium_id
[{'Name': "Stark's Park", 'count(*)': 1}, {'Name': 'Glebe Park', 'count(*)': 1}, {'Name': 'Somerset Park', 'count(*)': 2}, {'Name': 'Recreation Park', 'count(*)': 1}, {'Name': 'Balmoor', 'count(*)': 1}]
medium
SELECT stadium.name , count(*) FROM concert JOIN stadium ON concert.stadium_id = stadium.stadium_id GROUP BY concert.stadium_id
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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': ['concert_id', 'stadium_id'], 'stadium': ['stadium_id', 'name'] }
{ 'concert': ['concert_ID', 'Stadium_ID'], 'stadium': ['Stadium_ID', 'Name'] }
CREATE TABLE concert ( concert_ID INT, Stadium_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE stadium ( Stadium_ID INT, Name TEXT, PRIMARY KEY (Stadium_ID) );
CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) );
concert_singer
Show the stadium name and capacity with most number of concerts in year 2014 or after.
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
[{'Name': 'Somerset Park', 'Capacity': 11998}]
extra
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
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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': ['concert_id', 'stadium_id', 'year'], 'stadium': ['stadium_id', 'name', 'capacity'] }
{ 'concert': ['concert_ID', 'Stadium_ID', 'Year'], 'stadium': ['Stadium_ID', 'Name', 'Capacity'] }
CREATE TABLE concert ( concert_ID INT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE stadium ( Stadium_ID INT, Name TEXT, Capacity INT, PRIMARY KEY (Stadium_ID) );
CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) );
concert_singer
What is the name and capacity of the stadium with the most concerts after 2013 ?
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
[{'Name': 'Somerset Park', 'Capacity': 11998}]
extra
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
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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': ['concert_id', 'stadium_id', 'year'], 'stadium': ['stadium_id', 'name', 'capacity'] }
{ 'concert': ['concert_ID', 'Stadium_ID', 'Year'], 'stadium': ['Stadium_ID', 'Name', 'Capacity'] }
CREATE TABLE concert ( concert_ID INT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE stadium ( Stadium_ID INT, Name TEXT, Capacity INT, PRIMARY KEY (Stadium_ID) );
CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) );
concert_singer
Which year has most number of concerts?
SELECT YEAR FROM concert GROUP BY YEAR ORDER BY count(*) DESC LIMIT 1
[{'Year': '2015'}]
hard
SELECT YEAR FROM concert GROUP BY YEAR ORDER BY count(*) DESC LIMIT 1
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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': ['concert_id', 'year'] }
{ 'concert': ['concert_ID', 'Year'] }
CREATE TABLE concert ( concert_ID INT, Year TEXT, PRIMARY KEY (concert_ID) );
CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID) );
concert_singer
What is the year that had the most concerts?
SELECT YEAR FROM concert GROUP BY YEAR ORDER BY count(*) DESC LIMIT 1
[{'Year': '2015'}]
hard
SELECT YEAR FROM concert GROUP BY YEAR ORDER BY count(*) DESC LIMIT 1
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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': ['concert_id', 'year'] }
{ 'concert': ['concert_ID', 'Year'] }
CREATE TABLE concert ( concert_ID INT, Year TEXT, PRIMARY KEY (concert_ID) );
CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID) );
concert_singer
Show the stadium names without any concert.
SELECT name FROM stadium WHERE stadium_id NOT IN (SELECT stadium_id FROM concert)
[{'Name': 'Bayview Stadium'}, {'Name': 'Hampden Park'}, {'Name': 'Forthbank Stadium'}, {'Name': 'Gayfield Park'}]
hard
SELECT name FROM stadium WHERE stadium_id NOT IN (SELECT stadium_id FROM concert)
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'stadium': ['stadium_id', 'name'], 'concert': ['concert_id', 'stadium_id'] }
{ 'stadium': ['Stadium_ID', 'Name'], 'concert': ['concert_ID', 'Stadium_ID'] }
CREATE TABLE stadium ( Stadium_ID INT, Name TEXT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE concert ( concert_ID INT, Stadium_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) );
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) );
concert_singer
What are the names of the stadiums without any concerts?
SELECT name FROM stadium WHERE stadium_id NOT IN (SELECT stadium_id FROM concert)
[{'Name': 'Bayview Stadium'}, {'Name': 'Hampden Park'}, {'Name': 'Forthbank Stadium'}, {'Name': 'Gayfield Park'}]
hard
SELECT name FROM stadium WHERE stadium_id NOT IN (SELECT stadium_id FROM concert)
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'stadium': ['stadium_id', 'name'], 'concert': ['concert_id', 'stadium_id'] }
{ 'stadium': ['Stadium_ID', 'Name'], 'concert': ['concert_ID', 'Stadium_ID'] }
CREATE TABLE stadium ( Stadium_ID INT, Name TEXT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE concert ( concert_ID INT, Stadium_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) );
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) );
concert_singer
Show countries where a singer above age 40 and a singer below 30 are from.
SELECT country FROM singer WHERE age > 40 INTERSECT SELECT country FROM singer WHERE age < 30
[{'Country': 'France'}]
hard
SELECT country FROM singer WHERE age > 40 INTERSECT SELECT country FROM singer WHERE age < 30
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'singer': ['singer_id', 'country', 'age'] }
{ 'singer': ['Singer_ID', 'Country', 'Age'] }
CREATE TABLE singer ( Singer_ID INT, Country TEXT, Age INT, PRIMARY KEY (Singer_ID) );
CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) );
concert_singer
Show names for all stadiums except for stadiums having a concert in year 2014.
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
[{'Name': 'Balmoor'}, {'Name': 'Bayview Stadium'}, {'Name': 'Forthbank Stadium'}, {'Name': 'Gayfield Park'}, {'Name': 'Hampden Park'}, {'Name': 'Recreation Park'}]
hard
SELECT name FROM stadium EXCEPT SELECT stadium.name FROM concert JOIN stadium ON concert.stadium_id = stadium.stadium_id WHERE concert.year = 2014
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'stadium': ['stadium_id', 'name'], 'concert': ['concert_id', 'stadium_id', 'year'] }
{ 'stadium': ['Stadium_ID', 'Name'], 'concert': ['concert_ID', 'Stadium_ID', 'Year'] }
CREATE TABLE stadium ( Stadium_ID INT, Name TEXT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE concert ( concert_ID INT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) );
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) );
concert_singer
What are the names of all stadiums that did not have a concert in 2014?
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
[{'Name': 'Balmoor'}, {'Name': 'Bayview Stadium'}, {'Name': 'Forthbank Stadium'}, {'Name': 'Gayfield Park'}, {'Name': 'Hampden Park'}, {'Name': 'Recreation Park'}]
hard
SELECT name FROM stadium EXCEPT SELECT stadium.name FROM concert JOIN stadium ON concert.stadium_id = stadium.stadium_id WHERE concert.year = 2014
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'stadium': ['stadium_id', 'name'], 'concert': ['concert_id', 'stadium_id', 'year'] }
{ 'stadium': ['Stadium_ID', 'Name'], 'concert': ['concert_ID', 'Stadium_ID', 'Year'] }
CREATE TABLE stadium ( Stadium_ID INT, Name TEXT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE concert ( concert_ID INT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) );
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) );
concert_singer
Show the name and theme for all concerts and the number of singers in each concert.
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
[{'concert_Name': 'Auditions', 'Theme': 'Free choice', 'count(*)': 3}, {'concert_Name': 'Super bootcamp', 'Theme': 'Free choice 2', 'count(*)': 2}, {'concert_Name': 'Home Visits', 'Theme': 'Bleeding Love', 'count(*)': 1}, {'concert_Name': 'Week 1', 'Theme': 'Wide Awake', 'count(*)': 1}, {'concert_Name': 'Week 1', 'Theme': 'Happy Tonight', 'count(*)': 2}, {'concert_Name': 'Week 2', 'Theme': 'Party All Night', 'count(*)': 1}]
medium
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
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'singer_in_concert': ['concert_id'], 'concert': ['concert_id', 'concert_name', 'theme'] }
{ 'singer_in_concert': ['concert_ID'], 'concert': ['concert_ID', 'concert_Name', 'Theme'] }
CREATE TABLE singer_in_concert ( concert_ID INT, PRIMARY KEY (concert_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, PRIMARY KEY (concert_ID) );
CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID) );
concert_singer
What are the names , themes , and number of singers for every concert ?
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
[{'concert_Name': 'Auditions', 'Theme': 'Free choice', 'count(*)': 3}, {'concert_Name': 'Super bootcamp', 'Theme': 'Free choice 2', 'count(*)': 2}, {'concert_Name': 'Home Visits', 'Theme': 'Bleeding Love', 'count(*)': 1}, {'concert_Name': 'Week 1', 'Theme': 'Wide Awake', 'count(*)': 1}, {'concert_Name': 'Week 1', 'Theme': 'Happy Tonight', 'count(*)': 2}, {'concert_Name': 'Week 2', 'Theme': 'Party All Night', 'count(*)': 1}]
medium
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
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'singer_in_concert': ['concert_id'], 'concert': ['concert_id', 'concert_name', 'theme'] }
{ 'singer_in_concert': ['concert_ID'], 'concert': ['concert_ID', 'concert_Name', 'Theme'] }
CREATE TABLE singer_in_concert ( concert_ID INT, PRIMARY KEY (concert_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, PRIMARY KEY (concert_ID) );
CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID) );
concert_singer
List singer names and number of concerts for each 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
[{'Name': 'Timbaland', 'count(*)': 2}, {'Name': 'Justin Brown', 'count(*)': 3}, {'Name': 'Rose White', 'count(*)': 1}, {'Name': 'John Nizinik', 'count(*)': 2}, {'Name': 'Tribal King', 'count(*)': 2}]
medium
SELECT singer.name , count(*) FROM singer_in_concert JOIN singer ON singer_in_concert.singer_id = singer.singer_id GROUP BY singer.singer_id
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'singer_in_concert': ['concert_id', 'singer_id'], 'singer': ['singer_id', 'name'] }
{ 'singer_in_concert': ['concert_ID', 'Singer_ID'], 'singer': ['Singer_ID', 'Name'] }
CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, PRIMARY KEY (Singer_ID) );
CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) );
concert_singer
What are the names of the singers and number of concerts for each person?
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
[{'Name': 'Timbaland', 'count(*)': 2}, {'Name': 'Justin Brown', 'count(*)': 3}, {'Name': 'Rose White', 'count(*)': 1}, {'Name': 'John Nizinik', 'count(*)': 2}, {'Name': 'Tribal King', 'count(*)': 2}]
medium
SELECT singer.name , count(*) FROM singer_in_concert JOIN singer ON singer_in_concert.singer_id = singer.singer_id GROUP BY singer.singer_id
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'singer_in_concert': ['concert_id', 'singer_id'], 'singer': ['singer_id', 'name'] }
{ 'singer_in_concert': ['concert_ID', 'Singer_ID'], 'singer': ['Singer_ID', 'Name'] }
CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, PRIMARY KEY (Singer_ID) );
CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) );
concert_singer
List all singer names in concerts in year 2014.
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
[{'Name': 'Timbaland'}, {'Name': 'Justin Brown'}, {'Name': 'John Nizinik'}, {'Name': 'Justin Brown'}, {'Name': 'Tribal King'}, {'Name': 'Rose White'}]
hard
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
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'singer_in_concert': ['concert_id', 'singer_id'], 'singer': ['singer_id', 'name'], 'concert': ['concert_id', 'year'] }
{ 'singer_in_concert': ['concert_ID', 'Singer_ID'], 'singer': ['Singer_ID', 'Name'], 'concert': ['concert_ID', 'Year'] }
CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, Year TEXT, PRIMARY KEY (concert_ID) );
CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID) );
concert_singer
What are the names of the singers who performed in a concert in 2014?
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
[{'Name': 'Timbaland'}, {'Name': 'Justin Brown'}, {'Name': 'John Nizinik'}, {'Name': 'Justin Brown'}, {'Name': 'Tribal King'}, {'Name': 'Rose White'}]
hard
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
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'singer_in_concert': ['concert_id', 'singer_id'], 'singer': ['singer_id', 'name'], 'concert': ['concert_id', 'year'] }
{ 'singer_in_concert': ['concert_ID', 'Singer_ID'], 'singer': ['Singer_ID', 'Name'], 'concert': ['concert_ID', 'Year'] }
CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, Year TEXT, PRIMARY KEY (concert_ID) );
CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID) );
concert_singer
what is the name and nation of the singer who have a song having 'Hey' in its name?
SELECT name , country FROM singer WHERE song_name LIKE '%Hey%'
[{'Name': 'Justin Brown', 'Country': 'France'}]
medium
SELECT name , country FROM singer WHERE song_name LIKE '%Hey%'
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'singer': ['singer_id', 'name', 'country', 'song_name'] }
{ 'singer': ['Singer_ID', 'Name', 'Country', 'Song_Name'] }
CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, PRIMARY KEY (Singer_ID) );
CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) );
concert_singer
What is the name and country of origin of every singer who has a song with the word 'Hey' in its title?
SELECT name , country FROM singer WHERE song_name LIKE '%Hey%'
[{'Name': 'Justin Brown', 'Country': 'France'}]
medium
SELECT name , country FROM singer WHERE song_name LIKE '%Hey%'
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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'] }
{ 'singer': ['singer_id', 'name', 'country', 'song_name'] }
{ 'singer': ['Singer_ID', 'Name', 'Country', 'Song_Name'] }
CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, PRIMARY KEY (Singer_ID) );
CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) );
concert_singer
Find the name and location of the stadiums which some concerts happened in the years of both 2014 and 2015.
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
[{'Name': 'Somerset Park', 'Location': 'Ayr United'}]
extra
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
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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': ['concert_id', 'stadium_id', 'year'], 'stadium': ['stadium_id', 'location', 'name'] }
{ 'concert': ['concert_ID', 'Stadium_ID', 'Year'], 'stadium': ['Stadium_ID', 'Location', 'Name'] }
CREATE TABLE concert ( concert_ID INT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, PRIMARY KEY (Stadium_ID) );
CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) );
concert_singer
What are the names and locations of the stadiums that had concerts that occurred in both 2014 and 2015?
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
[{'Name': 'Somerset Park', 'Location': 'Ayr United'}]
extra
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
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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': ['concert_id', 'stadium_id', 'year'], 'stadium': ['stadium_id', 'location', 'name'] }
{ 'concert': ['concert_ID', 'Stadium_ID', 'Year'], 'stadium': ['Stadium_ID', 'Location', 'Name'] }
CREATE TABLE concert ( concert_ID INT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, PRIMARY KEY (Stadium_ID) );
CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) );
concert_singer
Find the number of concerts happened in the stadium with the highest capacity .
SELECT count(*) FROM concert WHERE stadium_id = (SELECT stadium_id FROM stadium ORDER BY capacity DESC LIMIT 1)
[{'count(*)': 0}]
hard
SELECT count(*) FROM concert WHERE stadium_id = (SELECT stadium_id FROM stadium ORDER BY capacity DESC LIMIT 1)
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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': ['concert_id', 'stadium_id'], 'stadium': ['stadium_id', 'capacity'] }
{ 'concert': ['concert_ID', 'Stadium_ID'], 'stadium': ['Stadium_ID', 'Capacity'] }
CREATE TABLE concert ( concert_ID INT, Stadium_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE stadium ( Stadium_ID INT, Capacity INT, PRIMARY KEY (Stadium_ID) );
CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) );
concert_singer
What are the number of concerts that occurred in the stadium with the largest capacity ?
SELECT count(*) FROM concert WHERE stadium_id = (SELECT stadium_id FROM stadium ORDER BY capacity DESC LIMIT 1)
[{'count(*)': 0}]
hard
SELECT count(*) FROM concert WHERE stadium_id = (SELECT stadium_id FROM stadium ORDER BY capacity DESC LIMIT 1)
CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) ); CREATE TABLE singer ( Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male BOOL, PRIMARY KEY (Singer_ID) ); CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE singer_in_concert ( concert_ID INT, Singer_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID), FOREIGN KEY (concert_ID) REFERENCES concert(concert_ID) );
CREATE TABLE stadium ( stadium.Stadium_ID INT, stadium.Location TEXT, stadium.Name TEXT, stadium.Capacity INT, stadium.Highest INT, stadium.Lowest INT, stadium.Average INT, PRIMARY KEY (stadium.stadium_id) ); CREATE TABLE singer ( singer.Singer_ID INT, singer.Name TEXT, singer.Country TEXT, singer.Song_Name TEXT, singer.Song_release_year TEXT, singer.Age INT, singer.Is_male BOOL, PRIMARY KEY (singer.singer_id) ); CREATE TABLE concert ( concert.concert_ID INT, concert.concert_Name TEXT, concert.Theme TEXT, concert.Stadium_ID TEXT, concert.Year TEXT, PRIMARY KEY (concert.concert_id), FOREIGN KEY (concert.Stadium_ID) REFERENCES stadium.Stadium_ID ); CREATE TABLE singer_in_concert ( singer_in_concert.concert_ID INT, singer_in_concert.Singer_ID TEXT, PRIMARY KEY (singer_in_concert.concert_id), FOREIGN KEY (singer_in_concert.Singer_ID) REFERENCES singer.Singer_ID, FOREIGN KEY (singer_in_concert.concert_ID) REFERENCES concert.concert_ID );
{ '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': ['concert_id', 'stadium_id'], 'stadium': ['stadium_id', 'capacity'] }
{ 'concert': ['concert_ID', 'Stadium_ID'], 'stadium': ['Stadium_ID', 'Capacity'] }
CREATE TABLE concert ( concert_ID INT, Stadium_ID TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE stadium ( Stadium_ID INT, Capacity INT, PRIMARY KEY (Stadium_ID) );
CREATE TABLE concert ( concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT, PRIMARY KEY (concert_ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(Stadium_ID) ); CREATE TABLE stadium ( Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT, PRIMARY KEY (Stadium_ID) );
pets_1
Find the number of pets whose weight is heavier than 10.
SELECT count(*) FROM pets WHERE weight > 10
[{'count(*)': 2}]
easy
SELECT count(*) FROM pets WHERE weight > 10
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3), PRIMARY KEY (StuID) ); CREATE TABLE Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY (StuID) REFERENCES Student(StuID), FOREIGN KEY (PetID) REFERENCES Pets(PetID) ); CREATE TABLE Pets ( PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL, PRIMARY KEY (PetID) );
CREATE TABLE Student ( Student.StuID INTEGER, Student.LName VARCHAR(12), Student.Fname VARCHAR(12), Student.Age INTEGER, Student.Sex VARCHAR(1), Student.Major INTEGER, Student.Advisor INTEGER, Student.city_code VARCHAR(3), PRIMARY KEY (student.stuid) ); CREATE TABLE Has_Pet ( Has_Pet.StuID INTEGER, Has_Pet.PetID INTEGER, FOREIGN KEY (Has_Pet.StuID) REFERENCES Student.StuID, FOREIGN KEY (Has_Pet.PetID) REFERENCES Pets.PetID ); CREATE TABLE Pets ( Pets.PetID INTEGER, Pets.PetType VARCHAR(20), Pets.pet_age INTEGER, Pets.weight REAL, PRIMARY KEY (pets.petid) );
{ 'Student': ['StuID', 'LName', 'Fname', 'Age', 'Sex', 'Major', 'Advisor', 'city_code'], 'Has_Pet': ['StuID', 'PetID'], 'Pets': ['PetID', 'PetType', 'pet_age', 'weight'] }
{ 'pets': ['petid', 'weight'] }
{ 'Pets': ['PetID', 'weight'] }
CREATE TABLE Pets ( PetID INTEGER, weight REAL, PRIMARY KEY (PetID) );
CREATE TABLE Pets ( PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL, PRIMARY KEY (PetID) );
pets_1
How many pets have a greater weight than 10?
SELECT count(*) FROM pets WHERE weight > 10
[{'count(*)': 2}]
easy
SELECT count(*) FROM pets WHERE weight > 10
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3), PRIMARY KEY (StuID) ); CREATE TABLE Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY (StuID) REFERENCES Student(StuID), FOREIGN KEY (PetID) REFERENCES Pets(PetID) ); CREATE TABLE Pets ( PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL, PRIMARY KEY (PetID) );
CREATE TABLE Student ( Student.StuID INTEGER, Student.LName VARCHAR(12), Student.Fname VARCHAR(12), Student.Age INTEGER, Student.Sex VARCHAR(1), Student.Major INTEGER, Student.Advisor INTEGER, Student.city_code VARCHAR(3), PRIMARY KEY (student.stuid) ); CREATE TABLE Has_Pet ( Has_Pet.StuID INTEGER, Has_Pet.PetID INTEGER, FOREIGN KEY (Has_Pet.StuID) REFERENCES Student.StuID, FOREIGN KEY (Has_Pet.PetID) REFERENCES Pets.PetID ); CREATE TABLE Pets ( Pets.PetID INTEGER, Pets.PetType VARCHAR(20), Pets.pet_age INTEGER, Pets.weight REAL, PRIMARY KEY (pets.petid) );
{ 'Student': ['StuID', 'LName', 'Fname', 'Age', 'Sex', 'Major', 'Advisor', 'city_code'], 'Has_Pet': ['StuID', 'PetID'], 'Pets': ['PetID', 'PetType', 'pet_age', 'weight'] }
{ 'pets': ['petid', 'weight'] }
{ 'Pets': ['PetID', 'weight'] }
CREATE TABLE Pets ( PetID INTEGER, weight REAL, PRIMARY KEY (PetID) );
CREATE TABLE Pets ( PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL, PRIMARY KEY (PetID) );
pets_1
Find the weight of the youngest dog.
SELECT weight FROM pets ORDER BY pet_age LIMIT 1
[{'weight': 9.3}]
medium
SELECT weight FROM pets ORDER BY pet_age LIMIT 1
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3), PRIMARY KEY (StuID) ); CREATE TABLE Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY (StuID) REFERENCES Student(StuID), FOREIGN KEY (PetID) REFERENCES Pets(PetID) ); CREATE TABLE Pets ( PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL, PRIMARY KEY (PetID) );
CREATE TABLE Student ( Student.StuID INTEGER, Student.LName VARCHAR(12), Student.Fname VARCHAR(12), Student.Age INTEGER, Student.Sex VARCHAR(1), Student.Major INTEGER, Student.Advisor INTEGER, Student.city_code VARCHAR(3), PRIMARY KEY (student.stuid) ); CREATE TABLE Has_Pet ( Has_Pet.StuID INTEGER, Has_Pet.PetID INTEGER, FOREIGN KEY (Has_Pet.StuID) REFERENCES Student.StuID, FOREIGN KEY (Has_Pet.PetID) REFERENCES Pets.PetID ); CREATE TABLE Pets ( Pets.PetID INTEGER, Pets.PetType VARCHAR(20), Pets.pet_age INTEGER, Pets.weight REAL, PRIMARY KEY (pets.petid) );
{ 'Student': ['StuID', 'LName', 'Fname', 'Age', 'Sex', 'Major', 'Advisor', 'city_code'], 'Has_Pet': ['StuID', 'PetID'], 'Pets': ['PetID', 'PetType', 'pet_age', 'weight'] }
{ 'pets': ['petid', 'pet_age', 'weight'] }
{ 'Pets': ['PetID', 'pet_age', 'weight'] }
CREATE TABLE Pets ( PetID INTEGER, pet_age INTEGER, weight REAL, PRIMARY KEY (PetID) );
CREATE TABLE Pets ( PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL, PRIMARY KEY (PetID) );
pets_1
How much does the youngest dog weigh?
SELECT weight FROM pets ORDER BY pet_age LIMIT 1
[{'weight': 9.3}]
medium
SELECT weight FROM pets ORDER BY pet_age LIMIT 1
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3), PRIMARY KEY (StuID) ); CREATE TABLE Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY (StuID) REFERENCES Student(StuID), FOREIGN KEY (PetID) REFERENCES Pets(PetID) ); CREATE TABLE Pets ( PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL, PRIMARY KEY (PetID) );
CREATE TABLE Student ( Student.StuID INTEGER, Student.LName VARCHAR(12), Student.Fname VARCHAR(12), Student.Age INTEGER, Student.Sex VARCHAR(1), Student.Major INTEGER, Student.Advisor INTEGER, Student.city_code VARCHAR(3), PRIMARY KEY (student.stuid) ); CREATE TABLE Has_Pet ( Has_Pet.StuID INTEGER, Has_Pet.PetID INTEGER, FOREIGN KEY (Has_Pet.StuID) REFERENCES Student.StuID, FOREIGN KEY (Has_Pet.PetID) REFERENCES Pets.PetID ); CREATE TABLE Pets ( Pets.PetID INTEGER, Pets.PetType VARCHAR(20), Pets.pet_age INTEGER, Pets.weight REAL, PRIMARY KEY (pets.petid) );
{ 'Student': ['StuID', 'LName', 'Fname', 'Age', 'Sex', 'Major', 'Advisor', 'city_code'], 'Has_Pet': ['StuID', 'PetID'], 'Pets': ['PetID', 'PetType', 'pet_age', 'weight'] }
{ 'pets': ['petid', 'pet_age', 'weight'] }
{ 'Pets': ['PetID', 'pet_age', 'weight'] }
CREATE TABLE Pets ( PetID INTEGER, pet_age INTEGER, weight REAL, PRIMARY KEY (PetID) );
CREATE TABLE Pets ( PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL, PRIMARY KEY (PetID) );
pets_1
Find the maximum weight for each type of pet. List the maximum weight and pet type.
SELECT max(weight) , petType FROM pets GROUP BY petType
[{'max(weight)': 12.0, 'PetType': 'cat'}, {'max(weight)': 13.4, 'PetType': 'dog'}]
medium
SELECT max(weight) , petType FROM pets GROUP BY petType
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3), PRIMARY KEY (StuID) ); CREATE TABLE Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY (StuID) REFERENCES Student(StuID), FOREIGN KEY (PetID) REFERENCES Pets(PetID) ); CREATE TABLE Pets ( PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL, PRIMARY KEY (PetID) );
CREATE TABLE Student ( Student.StuID INTEGER, Student.LName VARCHAR(12), Student.Fname VARCHAR(12), Student.Age INTEGER, Student.Sex VARCHAR(1), Student.Major INTEGER, Student.Advisor INTEGER, Student.city_code VARCHAR(3), PRIMARY KEY (student.stuid) ); CREATE TABLE Has_Pet ( Has_Pet.StuID INTEGER, Has_Pet.PetID INTEGER, FOREIGN KEY (Has_Pet.StuID) REFERENCES Student.StuID, FOREIGN KEY (Has_Pet.PetID) REFERENCES Pets.PetID ); CREATE TABLE Pets ( Pets.PetID INTEGER, Pets.PetType VARCHAR(20), Pets.pet_age INTEGER, Pets.weight REAL, PRIMARY KEY (pets.petid) );
{ 'Student': ['StuID', 'LName', 'Fname', 'Age', 'Sex', 'Major', 'Advisor', 'city_code'], 'Has_Pet': ['StuID', 'PetID'], 'Pets': ['PetID', 'PetType', 'pet_age', 'weight'] }
{ 'pets': ['petid', 'pettype', 'weight'] }
{ 'Pets': ['PetID', 'PetType', 'weight'] }
CREATE TABLE Pets ( PetID INTEGER, PetType VARCHAR(20), weight REAL, PRIMARY KEY (PetID) );
CREATE TABLE Pets ( PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL, PRIMARY KEY (PetID) );
pets_1
List the maximum weight and type for each type of pet.
SELECT max(weight) , petType FROM pets GROUP BY petType
[{'max(weight)': 12.0, 'PetType': 'cat'}, {'max(weight)': 13.4, 'PetType': 'dog'}]
medium
SELECT max(weight) , petType FROM pets GROUP BY petType
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3), PRIMARY KEY (StuID) ); CREATE TABLE Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY (StuID) REFERENCES Student(StuID), FOREIGN KEY (PetID) REFERENCES Pets(PetID) ); CREATE TABLE Pets ( PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL, PRIMARY KEY (PetID) );
CREATE TABLE Student ( Student.StuID INTEGER, Student.LName VARCHAR(12), Student.Fname VARCHAR(12), Student.Age INTEGER, Student.Sex VARCHAR(1), Student.Major INTEGER, Student.Advisor INTEGER, Student.city_code VARCHAR(3), PRIMARY KEY (student.stuid) ); CREATE TABLE Has_Pet ( Has_Pet.StuID INTEGER, Has_Pet.PetID INTEGER, FOREIGN KEY (Has_Pet.StuID) REFERENCES Student.StuID, FOREIGN KEY (Has_Pet.PetID) REFERENCES Pets.PetID ); CREATE TABLE Pets ( Pets.PetID INTEGER, Pets.PetType VARCHAR(20), Pets.pet_age INTEGER, Pets.weight REAL, PRIMARY KEY (pets.petid) );
{ 'Student': ['StuID', 'LName', 'Fname', 'Age', 'Sex', 'Major', 'Advisor', 'city_code'], 'Has_Pet': ['StuID', 'PetID'], 'Pets': ['PetID', 'PetType', 'pet_age', 'weight'] }
{ 'pets': ['petid', 'pettype', 'weight'] }
{ 'Pets': ['PetID', 'PetType', 'weight'] }
CREATE TABLE Pets ( PetID INTEGER, PetType VARCHAR(20), weight REAL, PRIMARY KEY (PetID) );
CREATE TABLE Pets ( PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL, PRIMARY KEY (PetID) );
pets_1
Find number of pets owned by students who are older than 20.
SELECT count(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid WHERE T1.age > 20
[{'count(*)': 0}]
medium
SELECT count(*) FROM student JOIN has_pet ON student.stuid = has_pet.stuid WHERE student.age > 20
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3), PRIMARY KEY (StuID) ); CREATE TABLE Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY (StuID) REFERENCES Student(StuID), FOREIGN KEY (PetID) REFERENCES Pets(PetID) ); CREATE TABLE Pets ( PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL, PRIMARY KEY (PetID) );
CREATE TABLE Student ( Student.StuID INTEGER, Student.LName VARCHAR(12), Student.Fname VARCHAR(12), Student.Age INTEGER, Student.Sex VARCHAR(1), Student.Major INTEGER, Student.Advisor INTEGER, Student.city_code VARCHAR(3), PRIMARY KEY (student.stuid) ); CREATE TABLE Has_Pet ( Has_Pet.StuID INTEGER, Has_Pet.PetID INTEGER, FOREIGN KEY (Has_Pet.StuID) REFERENCES Student.StuID, FOREIGN KEY (Has_Pet.PetID) REFERENCES Pets.PetID ); CREATE TABLE Pets ( Pets.PetID INTEGER, Pets.PetType VARCHAR(20), Pets.pet_age INTEGER, Pets.weight REAL, PRIMARY KEY (pets.petid) );
{ 'Student': ['StuID', 'LName', 'Fname', 'Age', 'Sex', 'Major', 'Advisor', 'city_code'], 'Has_Pet': ['StuID', 'PetID'], 'Pets': ['PetID', 'PetType', 'pet_age', 'weight'] }
{ 'student': ['stuid', 'age'], 'has_pet': ['stuid'] }
{ 'Student': ['StuID', 'Age'], 'Has_Pet': ['StuID'] }
CREATE TABLE Student ( StuID INTEGER, Age INTEGER, PRIMARY KEY (StuID) ); CREATE TABLE Has_Pet ( StuID INTEGER, FOREIGN KEY (StuID) REFERENCES Student(StuID) );
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3), PRIMARY KEY (StuID) ); CREATE TABLE Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY (StuID) REFERENCES Student(StuID) );
pets_1
How many pets are owned by students that have an age greater than 20?
SELECT count(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid WHERE T1.age > 20
[{'count(*)': 0}]
medium
SELECT count(*) FROM student JOIN has_pet ON student.stuid = has_pet.stuid WHERE student.age > 20
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3), PRIMARY KEY (StuID) ); CREATE TABLE Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY (StuID) REFERENCES Student(StuID), FOREIGN KEY (PetID) REFERENCES Pets(PetID) ); CREATE TABLE Pets ( PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL, PRIMARY KEY (PetID) );
CREATE TABLE Student ( Student.StuID INTEGER, Student.LName VARCHAR(12), Student.Fname VARCHAR(12), Student.Age INTEGER, Student.Sex VARCHAR(1), Student.Major INTEGER, Student.Advisor INTEGER, Student.city_code VARCHAR(3), PRIMARY KEY (student.stuid) ); CREATE TABLE Has_Pet ( Has_Pet.StuID INTEGER, Has_Pet.PetID INTEGER, FOREIGN KEY (Has_Pet.StuID) REFERENCES Student.StuID, FOREIGN KEY (Has_Pet.PetID) REFERENCES Pets.PetID ); CREATE TABLE Pets ( Pets.PetID INTEGER, Pets.PetType VARCHAR(20), Pets.pet_age INTEGER, Pets.weight REAL, PRIMARY KEY (pets.petid) );
{ 'Student': ['StuID', 'LName', 'Fname', 'Age', 'Sex', 'Major', 'Advisor', 'city_code'], 'Has_Pet': ['StuID', 'PetID'], 'Pets': ['PetID', 'PetType', 'pet_age', 'weight'] }
{ 'student': ['stuid', 'age'], 'has_pet': ['stuid'] }
{ 'Student': ['StuID', 'Age'], 'Has_Pet': ['StuID'] }
CREATE TABLE Student ( StuID INTEGER, Age INTEGER, PRIMARY KEY (StuID) ); CREATE TABLE Has_Pet ( StuID INTEGER, FOREIGN KEY (StuID) REFERENCES Student(StuID) );
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3), PRIMARY KEY (StuID) ); CREATE TABLE Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY (StuID) REFERENCES Student(StuID) );
pets_1
Find the number of dog pets that are raised by female students (with sex F).
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'
[{'count(*)': 2}]
hard
SELECT count(*) FROM student JOIN has_pet ON student.stuid = has_pet.stuid JOIN pets ON has_pet.petid = pets.petid WHERE student.sex = 'F' AND pets.pettype = 'dog'
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3), PRIMARY KEY (StuID) ); CREATE TABLE Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY (StuID) REFERENCES Student(StuID), FOREIGN KEY (PetID) REFERENCES Pets(PetID) ); CREATE TABLE Pets ( PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL, PRIMARY KEY (PetID) );
CREATE TABLE Student ( Student.StuID INTEGER, Student.LName VARCHAR(12), Student.Fname VARCHAR(12), Student.Age INTEGER, Student.Sex VARCHAR(1), Student.Major INTEGER, Student.Advisor INTEGER, Student.city_code VARCHAR(3), PRIMARY KEY (student.stuid) ); CREATE TABLE Has_Pet ( Has_Pet.StuID INTEGER, Has_Pet.PetID INTEGER, FOREIGN KEY (Has_Pet.StuID) REFERENCES Student.StuID, FOREIGN KEY (Has_Pet.PetID) REFERENCES Pets.PetID ); CREATE TABLE Pets ( Pets.PetID INTEGER, Pets.PetType VARCHAR(20), Pets.pet_age INTEGER, Pets.weight REAL, PRIMARY KEY (pets.petid) );
{ 'Student': ['StuID', 'LName', 'Fname', 'Age', 'Sex', 'Major', 'Advisor', 'city_code'], 'Has_Pet': ['StuID', 'PetID'], 'Pets': ['PetID', 'PetType', 'pet_age', 'weight'] }
{ 'student': ['stuid', 'sex'], 'has_pet': ['stuid', 'petid'], 'pets': ['petid', 'pettype'] }
{ 'Student': ['StuID', 'Sex'], 'Has_Pet': ['StuID', 'PetID'], 'Pets': ['PetID', 'PetType'] }
CREATE TABLE Student ( StuID INTEGER, Sex VARCHAR(1), PRIMARY KEY (StuID) ); CREATE TABLE Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY (StuID) REFERENCES Student(StuID), FOREIGN KEY (PetID) REFERENCES Pets(PetID) ); CREATE TABLE Pets ( PetID INTEGER, PetType VARCHAR(20), PRIMARY KEY (PetID) );
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3), PRIMARY KEY (StuID) ); CREATE TABLE Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY (StuID) REFERENCES Student(StuID), FOREIGN KEY (PetID) REFERENCES Pets(PetID) ); CREATE TABLE Pets ( PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL, PRIMARY KEY (PetID) );
README.md exists but content is empty. Use the Edit dataset card button to edit it.
Downloads last month
36
Edit dataset card