db_id
stringclasses
20 values
query
stringlengths
20
422
question
stringlengths
18
174
create_w_keys
stringclasses
20 values
create_wo_keys
stringclasses
20 values
difficulty
stringclasses
4 values
zero_shot_request
stringlengths
527
3.32k
concert_singer
SELECT count(*) FROM singer
How many singers do we have?
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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
easy
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: How many singers do we have?
concert_singer
SELECT count(*) FROM singer
What is the total number of singers?
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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
easy
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: What is the total number of singers?
concert_singer
SELECT name , country , age FROM singer ORDER BY age DESC
Show name, country, age for all singers ordered by age from the oldest to the youngest.
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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: Show name, country, age for all singers ordered by age from the oldest to the youngest.
concert_singer
SELECT name , country , age FROM singer ORDER BY age DESC
What are the names, countries, and ages for every singer in descending order of age?
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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: What are the names, countries, and ages for every singer in descending order of age?
concert_singer
SELECT avg(age) , min(age) , max(age) FROM singer WHERE country = 'France'
What is the average, minimum, and maximum age of all singers from 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: What is the average, minimum, and maximum age of all singers from France?
concert_singer
SELECT avg(age) , min(age) , max(age) FROM singer WHERE country = 'France'
What is the average, minimum, and maximum age for all French singers?
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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: What is the average, minimum, and maximum age for all French singers?
concert_singer
SELECT song_name , song_release_year FROM singer ORDER BY age LIMIT 1
Show the name and the release year of the song by the youngest 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: Show the name and the release year of the song by the youngest singer.
concert_singer
SELECT song_name , song_release_year FROM singer ORDER BY age LIMIT 1
What are the names and release years for all the songs of the youngest 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: What are the names and release years for all the songs of the youngest singer?
concert_singer
SELECT DISTINCT country FROM singer WHERE age > 20
What are all distinct countries where singers above age 20 are from?
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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
easy
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: What are all distinct countries where singers above age 20 are from?
concert_singer
SELECT DISTINCT country FROM singer WHERE age > 20
What are the different countries with singers above 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
easy
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: What are the different countries with singers above age 20?
concert_singer
SELECT country , count(*) FROM singer GROUP BY country
Show all countries and the number of singers in each 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: Show all countries and the number of singers in each country.
concert_singer
SELECT country , count(*) FROM singer GROUP BY country
How many singers are from each 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: How many singers are from each country?
concert_singer
SELECT song_name FROM singer WHERE age > (SELECT avg(age) FROM singer)
List all song names by singers above the average age.
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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: List all song names by singers above the average age.
concert_singer
SELECT song_name FROM singer WHERE age > (SELECT avg(age) FROM singer)
What are all the song names by singers who are older than average?
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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: What are all the song names by singers who are older than average?
concert_singer
SELECT LOCATION , name FROM stadium WHERE capacity BETWEEN 5000 AND 10000
Show location and name for all stadiums with a 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: Show location and name for all stadiums with a capacity between 5000 and 10000.
concert_singer
SELECT LOCATION , name FROM stadium WHERE capacity BETWEEN 5000 AND 10000
What are the locations and names of all stations with 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: What are the locations and names of all stations with capacity between 5000 and 10000?
concert_singer
select max(capacity), average from stadium
What is the maximum capacity and the average of all stadiums ?
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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: What is the maximum capacity and the average of all stadiums ?
concert_singer
select avg(capacity) , max(capacity) from stadium
What is the average and maximum capacities for all stadiums ?
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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: What is the average and maximum capacities for all stadiums ?
concert_singer
SELECT name , capacity FROM stadium ORDER BY average DESC LIMIT 1
What is the name and capacity for the stadium with highest average attendance?
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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: What is the name and capacity for the stadium with highest average attendance?
concert_singer
SELECT name , capacity FROM stadium ORDER BY average DESC LIMIT 1
What is the name and capacity for the stadium with the highest average attendance?
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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: What is the name and capacity for the stadium with the highest average attendance?
concert_singer
SELECT count(*) FROM concert WHERE YEAR = 2014 OR YEAR = 2015
How many concerts are there in year 2014 or 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: How many concerts are there in year 2014 or 2015?
concert_singer
SELECT count(*) FROM concert WHERE YEAR = 2014 OR YEAR = 2015
How many concerts occurred in 2014 or 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: How many concerts occurred in 2014 or 2015?
concert_singer
SELECT T2.name , count(*) FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id GROUP BY T1.stadium_id
Show the stadium name and the number of concerts in each 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: Show the stadium name and the number of concerts in each stadium.
concert_singer
SELECT T2.name , count(*) FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id GROUP BY T1.stadium_id
For each stadium, how many concerts play there?
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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: For each stadium, how many concerts play there?
concert_singer
SELECT T2.name , T2.capacity FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.year >= 2014 GROUP BY T2.stadium_id ORDER BY count(*) DESC LIMIT 1
Show the stadium name and capacity with most number of concerts in year 2014 or after.
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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
extra
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: Show the stadium name and capacity with most number of concerts in year 2014 or after.
concert_singer
select t2.name , t2.capacity from concert as t1 join stadium as t2 on t1.stadium_id = t2.stadium_id where t1.year > 2013 group by t2.stadium_id order by count(*) desc limit 1
What is the name and capacity of the stadium with the most concerts after 2013 ?
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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
extra
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: What is the name and capacity of the stadium with the most concerts after 2013 ?
concert_singer
SELECT YEAR FROM concert GROUP BY YEAR ORDER BY count(*) DESC LIMIT 1
Which year has most number of concerts?
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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: Which year has most number of concerts?
concert_singer
SELECT YEAR FROM concert GROUP BY YEAR ORDER BY count(*) DESC LIMIT 1
What is the year that had the most concerts?
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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: What is the year that had the most concerts?
concert_singer
SELECT name FROM stadium WHERE stadium_id NOT IN (SELECT stadium_id FROM concert)
Show the stadium names without any 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: Show the stadium names without any concert.
concert_singer
SELECT name FROM stadium WHERE stadium_id NOT IN (SELECT stadium_id FROM concert)
What are the names of the stadiums without any concerts?
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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: What are the names of the stadiums without any concerts?
concert_singer
SELECT country FROM singer WHERE age > 40 INTERSECT SELECT country FROM singer WHERE age < 30
Show countries where a singer above age 40 and a singer below 30 are from.
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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: Show countries where a singer above age 40 and a singer below 30 are from.
concert_singer
SELECT name FROM stadium EXCEPT SELECT T2.name FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.year = 2014
Show names for all stadiums except for stadiums having a concert in 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: Show names for all stadiums except for stadiums having a concert in year 2014.
concert_singer
SELECT name FROM stadium EXCEPT SELECT T2.name FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.year = 2014
What are the names of all stadiums that did not have a concert in 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: What are the names of all stadiums that did not have a concert in 2014?
concert_singer
SELECT T2.concert_name , T2.theme , count(*) FROM singer_in_concert AS T1 JOIN concert AS T2 ON T1.concert_id = T2.concert_id GROUP BY T2.concert_id
Show the name and theme for all concerts and the number of singers in each 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: Show the name and theme for all concerts and the number of singers in each concert.
concert_singer
select t2.concert_name , t2.theme , count(*) from singer_in_concert as t1 join concert as t2 on t1.concert_id = t2.concert_id group by t2.concert_id
What are the names , themes , and number of singers for every 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: What are the names , themes , and number of singers for every concert ?
concert_singer
SELECT T2.name , count(*) FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id = T2.singer_id GROUP BY T2.singer_id
List singer names and number of concerts for each 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: List singer names and number of concerts for each singer.
concert_singer
SELECT T2.name , count(*) FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id = T2.singer_id GROUP BY T2.singer_id
What are the names of the singers and number of concerts for each person?
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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: What are the names of the singers and number of concerts for each person?
concert_singer
SELECT T2.name FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id = T2.singer_id JOIN concert AS T3 ON T1.concert_id = T3.concert_id WHERE T3.year = 2014
List all singer names in concerts in 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: List all singer names in concerts in year 2014.
concert_singer
SELECT T2.name FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id = T2.singer_id JOIN concert AS T3 ON T1.concert_id = T3.concert_id WHERE T3.year = 2014
What are the names of the singers who performed in a concert in 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: What are the names of the singers who performed in a concert in 2014?
concert_singer
SELECT name , country FROM singer WHERE song_name LIKE '%Hey%'
what is the name and nation of the singer who have a song having 'Hey' in its name?
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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: what is the name and nation of the singer who have a song having 'Hey' in its name?
concert_singer
SELECT name , country FROM singer WHERE song_name LIKE '%Hey%'
What is the name and country of origin of every singer who has a song with the word 'Hey' in its title?
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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: What is the name and country of origin of every singer who has a song with the word 'Hey' in its title?
concert_singer
SELECT T2.name , T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2014 INTERSECT SELECT T2.name , T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2015
Find the name and location of the stadiums which some concerts happened in the years of both 2014 and 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
extra
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: Find the name and location of the stadiums which some concerts happened in the years of both 2014 and 2015.
concert_singer
SELECT T2.name , T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2014 INTERSECT SELECT T2.name , T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2015
What are the names and locations of the stadiums that had concerts that occurred in both 2014 and 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
extra
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: What are the names and locations of the stadiums that had concerts that occurred in both 2014 and 2015?
concert_singer
select count(*) from concert where stadium_id = (select stadium_id from stadium order by capacity desc limit 1)
Find the number of concerts happened in the stadium with the highest capacity .
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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: Find the number of concerts happened in the stadium with the highest capacity .
concert_singer
select count(*) from concert where stadium_id = (select stadium_id from stadium order by capacity desc limit 1)
What are the number of concerts that occurred in the stadium with the largest capacity ?
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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") );
CREATE TABLE stadium (Stadium_ID INT, Location TEXT, Name TEXT, Capacity INT, Highest INT, Lowest INT, Average INT); CREATE TABLE singer (Singer_ID INT, Name TEXT, Country TEXT, Song_Name TEXT, Song_release_year TEXT, Age INT, Is_male bool); CREATE TABLE concert (concert_ID INT, concert_Name TEXT, Theme TEXT, Stadium_ID TEXT, Year TEXT); CREATE TABLE singer_in_concert (concert_ID INT, Singer_ID TEXT);
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: 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","Singer_ID"), FOREIGN KEY ("concert_ID") REFERENCES "concert"("concert_ID"), FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID") ); QUESTION: What are the number of concerts that occurred in the stadium with the largest capacity ?
pets_1
SELECT count(*) FROM pets WHERE weight > 10
Find the number of pets whose weight is heavier than 10.
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
easy
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: Find the number of pets whose weight is heavier than 10.
pets_1
SELECT count(*) FROM pets WHERE weight > 10
How many pets have a greater weight than 10?
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
easy
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: How many pets have a greater weight than 10?
pets_1
SELECT weight FROM pets ORDER BY pet_age LIMIT 1
Find the weight of the youngest dog.
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: Find the weight of the youngest dog.
pets_1
SELECT weight FROM pets ORDER BY pet_age LIMIT 1
How much does the youngest dog weigh?
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: How much does the youngest dog weigh?
pets_1
SELECT max(weight) , petType FROM pets GROUP BY petType
Find the maximum weight for each type of pet. List the maximum weight and pet type.
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: Find the maximum weight for each type of pet. List the maximum weight and pet type.
pets_1
SELECT max(weight) , petType FROM pets GROUP BY petType
List the maximum weight and type for each type of pet.
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: List the maximum weight and type for each type of pet.
pets_1
SELECT count(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid WHERE T1.age > 20
Find number of pets owned by students who are older than 20.
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: Find number of pets owned by students who are older than 20.
pets_1
SELECT count(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid WHERE T1.age > 20
How many pets are owned by students that have an age greater than 20?
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: How many pets are owned by students that have an age greater than 20?
pets_1
SELECT count(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T2.petid = T3.petid WHERE T1.sex = 'F' AND T3.pettype = 'dog'
Find the number of dog pets that are raised by female students (with sex F).
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: Find the number of dog pets that are raised by female students (with sex F).
pets_1
SELECT count(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T2.petid = T3.petid WHERE T1.sex = 'F' AND T3.pettype = 'dog'
How many dog pets are raised by female students?
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: How many dog pets are raised by female students?
pets_1
SELECT count(DISTINCT pettype) FROM pets
Find the number of distinct type of pets.
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
easy
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: Find the number of distinct type of pets.
pets_1
SELECT count(DISTINCT pettype) FROM pets
How many different types of pet are there?
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
easy
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: How many different types of pet are there?
pets_1
SELECT DISTINCT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat' OR T3.pettype = 'dog'
Find the first name of students who have cat or dog pet.
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
extra
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: Find the first name of students who have cat or dog pet.
pets_1
SELECT DISTINCT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat' OR T3.pettype = 'dog'
What are the first names of every student who has a cat or dog as a pet?
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
extra
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: What are the first names of every student who has a cat or dog as a pet?
pets_1
select t1.fname from student as t1 join has_pet as t2 on t1.stuid = t2.stuid join pets as t3 on t3.petid = t2.petid where t3.pettype = 'cat' intersect select t1.fname from student as t1 join has_pet as t2 on t1.stuid = t2.stuid join pets as t3 on t3.petid = t2.petid where t3.pettype = 'dog'
Find the first name of students who have both cat and dog pets .
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
extra
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: Find the first name of students who have both cat and dog pets .
pets_1
SELECT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat' INTERSECT SELECT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'dog'
What are the students' first names who have both cats and dogs as pets?
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
extra
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: What are the students' first names who have both cats and dogs as pets?
pets_1
SELECT major , age FROM student WHERE stuid NOT IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat')
Find the major and age of students who do not have a cat pet.
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
extra
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: Find the major and age of students who do not have a cat pet.
pets_1
SELECT major , age FROM student WHERE stuid NOT IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat')
What major is every student who does not own a cat as a pet, and also how old are they?
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
extra
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: What major is every student who does not own a cat as a pet, and also how old are they?
pets_1
SELECT stuid FROM student EXCEPT SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat'
Find the id of students who do not have a cat pet.
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: Find the id of students who do not have a cat pet.
pets_1
SELECT stuid FROM student EXCEPT SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat'
What are the ids of the students who do not own cats as pets?
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: What are the ids of the students who do not own cats as pets?
pets_1
SELECT T1.fname , T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'dog' AND T1.stuid NOT IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat')
Find the first name and age of students who have a dog but do not have a cat as a pet.
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
extra
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: Find the first name and age of students who have a dog but do not have a cat as a pet.
pets_1
SELECT T1.fname , T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'dog' AND T1.stuid NOT IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat')
What is the first name of every student who has a dog but does not have a cat?
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
extra
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: What is the first name of every student who has a dog but does not have a cat?
pets_1
SELECT pettype , weight FROM pets ORDER BY pet_age LIMIT 1
Find the type and weight of the youngest pet.
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: Find the type and weight of the youngest pet.
pets_1
SELECT pettype , weight FROM pets ORDER BY pet_age LIMIT 1
What type of pet is the youngest animal, and how much does it weigh?
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: What type of pet is the youngest animal, and how much does it weigh?
pets_1
SELECT petid , weight FROM pets WHERE pet_age > 1
Find the id and weight of all pets whose age is older than 1.
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: Find the id and weight of all pets whose age is older than 1.
pets_1
SELECT petid , weight FROM pets WHERE pet_age > 1
What is the id and weight of every pet who is older than 1?
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: What is the id and weight of every pet who is older than 1?
pets_1
SELECT avg(pet_age) , max(pet_age) , pettype FROM pets GROUP BY pettype
Find the average and maximum age for each type of pet.
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: Find the average and maximum age for each type of pet.
pets_1
SELECT avg(pet_age) , max(pet_age) , pettype FROM pets GROUP BY pettype
What is the average and maximum age for each pet type?
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: What is the average and maximum age for each pet type?
pets_1
SELECT avg(weight) , pettype FROM pets GROUP BY pettype
Find the average weight for each pet type.
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: Find the average weight for each pet type.
pets_1
SELECT avg(weight) , pettype FROM pets GROUP BY pettype
What is the average weight for each type of pet?
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: What is the average weight for each type of pet?
pets_1
SELECT DISTINCT T1.fname , T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid
Find the first name and age of students who have a pet.
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: Find the first name and age of students who have a pet.
pets_1
SELECT DISTINCT T1.fname , T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid
What are the different first names and ages of the students who do have pets?
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: What are the different first names and ages of the students who do have pets?
pets_1
SELECT T2.petid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid WHERE T1.Lname = 'Smith'
Find the id of the pet owned by student whose last name is ‘Smith’.
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: Find the id of the pet owned by student whose last name is ‘Smith’.
pets_1
SELECT T2.petid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid WHERE T1.Lname = 'Smith'
What is the id of the pet owned by the student whose last name is 'Smith'?
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: What is the id of the pet owned by the student whose last name is 'Smith'?
pets_1
SELECT count(*) , T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid GROUP BY T1.stuid
Find the number of pets for each student who has any pet and student id.
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: Find the number of pets for each student who has any pet and student id.
pets_1
select count(*) , t1.stuid from student as t1 join has_pet as t2 on t1.stuid = t2.stuid group by t1.stuid
For students who have pets , how many pets does each student have ? list their ids instead of names .
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: For students who have pets , how many pets does each student have ? list their ids instead of names .
pets_1
SELECT T1.fname , T1.sex FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid GROUP BY T1.stuid HAVING count(*) > 1
Find the first name and gender of student who have more than one pet.
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: Find the first name and gender of student who have more than one pet.
pets_1
SELECT T1.fname , T1.sex FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid GROUP BY T1.stuid HAVING count(*) > 1
What is the first name and gender of the all the students who have more than one pet?
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: What is the first name and gender of the all the students who have more than one pet?
pets_1
SELECT T1.lname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pet_age = 3 AND T3.pettype = 'cat'
Find the last name of the student who has a cat that is age 3.
create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
CREATE TABLE Student (StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3)); CREATE TABLE Has_Pet (StuID INTEGER, PetID INTEGER); CREATE TABLE Pets (PetID INTEGER, PetType VARCHAR(20), pet_age INTEGER, weight REAL);
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: create table Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); create table Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY(PetID) REFERENCES Pets(PetID), FOREIGN KEY(StuID) REFERENCES Student(StuID) ); create table Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL ); QUESTION: Find the last name of the student who has a cat that is age 3.
README.md exists but content is empty. Use the Edit dataset card button to edit it.
Downloads last month
33
Edit dataset card