Dataset Viewer
Auto-converted to Parquet Duplicate
db_id
stringclasses
20 values
query
stringlengths
25
323
question
stringlengths
22
144
create_w_keys
stringclasses
20 values
create_wo_keys
stringclasses
20 values
difficulty
stringclasses
4 values
zero_shot_request
stringlengths
527
3.29k
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 ("Si...
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_I...
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...
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 ("Si...
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_I...
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...
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 ("Si...
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_I...
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...
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 ("Si...
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_I...
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...
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 ("Si...
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_I...
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...
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 ("Si...
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_I...
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...
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 ("Si...
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_I...
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...
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 ("Si...
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_I...
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...
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 ("Si...
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_I...
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...
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 ("Si...
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_I...
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...
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 ("Si...
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_I...
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...
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, FOREI...
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 I...
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, FOREI...
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 I...
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, FOREI...
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 I...
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, FOREI...
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 I...
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, FOREI...
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 I...
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, FOREI...
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 I...
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, FOREI...
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 I...
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, FOREI...
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 I...
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, FOREI...
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 I...
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, FOREI...
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 I...
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, FOREI...
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 I...
car_1
SELECT count(*) FROM CONTINENTS;
How many continents are there?
CREATE TABLE "continents" ( "ContId" INTEGER PRIMARY KEY, "Continent" TEXT ); CREATE TABLE "countries" ( "CountryId" INTEGER PRIMARY KEY, "CountryName" TEXT, "Continent" INTEGER, FOREIGN KEY (Continent) REFERENCES continents(ContId) ); CREATE TABLE "car_makers" ( "Id" INTEGER PRIMARY KEY, "Maker" TEXT, ...
CREATE TABLE continents (ContId INTEGER, Continent TEXT); CREATE TABLE countries (CountryId INTEGER, CountryName TEXT, Continent INTEGER); CREATE TABLE car_makers (Id INTEGER, Maker TEXT, FullName TEXT, Country TEXT); CREATE TABLE model_list (ModelId INTEGER, Maker INTEGER, Model TEXT); CREATE TABLE car_names (MakeId I...
easy
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "continents" ( "ContId" INTEGER PRIMARY KEY, "Continent" TEXT ); CREATE TABLE "countries" ( "CountryId" INTEGER PRIMARY KEY, "CountryName" TEXT, "Contin...
car_1
SELECT T1.ContId , T1.Continent , count(*) FROM CONTINENTS AS T1 JOIN COUNTRIES AS T2 ON T1.ContId = T2.Continent GROUP BY T1.ContId;
How many countries does each continent have? List the continent id, continent name and the number of countries.
CREATE TABLE "continents" ( "ContId" INTEGER PRIMARY KEY, "Continent" TEXT ); CREATE TABLE "countries" ( "CountryId" INTEGER PRIMARY KEY, "CountryName" TEXT, "Continent" INTEGER, FOREIGN KEY (Continent) REFERENCES continents(ContId) ); CREATE TABLE "car_makers" ( "Id" INTEGER PRIMARY KEY, "Maker" TEXT, ...
CREATE TABLE continents (ContId INTEGER, Continent TEXT); CREATE TABLE countries (CountryId INTEGER, CountryName TEXT, Continent INTEGER); CREATE TABLE car_makers (Id INTEGER, Maker TEXT, FullName TEXT, Country TEXT); CREATE TABLE model_list (ModelId INTEGER, Maker INTEGER, Model TEXT); CREATE TABLE car_names (MakeId I...
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "continents" ( "ContId" INTEGER PRIMARY KEY, "Continent" TEXT ); CREATE TABLE "countries" ( "CountryId" INTEGER PRIMARY KEY, "CountryName" TEXT, "Contin...
car_1
SELECT count(*) FROM COUNTRIES;
How many countries are listed?
CREATE TABLE "continents" ( "ContId" INTEGER PRIMARY KEY, "Continent" TEXT ); CREATE TABLE "countries" ( "CountryId" INTEGER PRIMARY KEY, "CountryName" TEXT, "Continent" INTEGER, FOREIGN KEY (Continent) REFERENCES continents(ContId) ); CREATE TABLE "car_makers" ( "Id" INTEGER PRIMARY KEY, "Maker" TEXT, ...
CREATE TABLE continents (ContId INTEGER, Continent TEXT); CREATE TABLE countries (CountryId INTEGER, CountryName TEXT, Continent INTEGER); CREATE TABLE car_makers (Id INTEGER, Maker TEXT, FullName TEXT, Country TEXT); CREATE TABLE model_list (ModelId INTEGER, Maker INTEGER, Model TEXT); CREATE TABLE car_names (MakeId I...
easy
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "continents" ( "ContId" INTEGER PRIMARY KEY, "Continent" TEXT ); CREATE TABLE "countries" ( "CountryId" INTEGER PRIMARY KEY, "CountryName" TEXT, "Contin...
car_1
SELECT T1.FullName , T1.Id , count(*) FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker GROUP BY T1.Id;
How many models does each car maker produce? List maker full name, id and the number.
CREATE TABLE "continents" ( "ContId" INTEGER PRIMARY KEY, "Continent" TEXT ); CREATE TABLE "countries" ( "CountryId" INTEGER PRIMARY KEY, "CountryName" TEXT, "Continent" INTEGER, FOREIGN KEY (Continent) REFERENCES continents(ContId) ); CREATE TABLE "car_makers" ( "Id" INTEGER PRIMARY KEY, "Maker" TEXT, ...
CREATE TABLE continents (ContId INTEGER, Continent TEXT); CREATE TABLE countries (CountryId INTEGER, CountryName TEXT, Continent INTEGER); CREATE TABLE car_makers (Id INTEGER, Maker TEXT, FullName TEXT, Country TEXT); CREATE TABLE model_list (ModelId INTEGER, Maker INTEGER, Model TEXT); CREATE TABLE car_names (MakeId I...
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "continents" ( "ContId" INTEGER PRIMARY KEY, "Continent" TEXT ); CREATE TABLE "countries" ( "CountryId" INTEGER PRIMARY KEY, "CountryName" TEXT, "Contin...
car_1
SELECT T1.Model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id ORDER BY T2.horsepower ASC LIMIT 1;
Which model of the car has the minimum horsepower?
CREATE TABLE "continents" ( "ContId" INTEGER PRIMARY KEY, "Continent" TEXT ); CREATE TABLE "countries" ( "CountryId" INTEGER PRIMARY KEY, "CountryName" TEXT, "Continent" INTEGER, FOREIGN KEY (Continent) REFERENCES continents(ContId) ); CREATE TABLE "car_makers" ( "Id" INTEGER PRIMARY KEY, "Maker" TEXT, ...
CREATE TABLE continents (ContId INTEGER, Continent TEXT); CREATE TABLE countries (CountryId INTEGER, CountryName TEXT, Continent INTEGER); CREATE TABLE car_makers (Id INTEGER, Maker TEXT, FullName TEXT, Country TEXT); CREATE TABLE model_list (ModelId INTEGER, Maker INTEGER, Model TEXT); CREATE TABLE car_names (MakeId I...
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "continents" ( "ContId" INTEGER PRIMARY KEY, "Continent" TEXT ); CREATE TABLE "countries" ( "CountryId" INTEGER PRIMARY KEY, "CountryName" TEXT, "Contin...
car_1
SELECT T1.model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id WHERE T2.Weight < (SELECT avg(Weight) FROM CARS_DATA)
Find the model of the car whose weight is below the average weight.
CREATE TABLE "continents" ( "ContId" INTEGER PRIMARY KEY, "Continent" TEXT ); CREATE TABLE "countries" ( "CountryId" INTEGER PRIMARY KEY, "CountryName" TEXT, "Continent" INTEGER, FOREIGN KEY (Continent) REFERENCES continents(ContId) ); CREATE TABLE "car_makers" ( "Id" INTEGER PRIMARY KEY, "Maker" TEXT, ...
CREATE TABLE continents (ContId INTEGER, Continent TEXT); CREATE TABLE countries (CountryId INTEGER, CountryName TEXT, Continent INTEGER); CREATE TABLE car_makers (Id INTEGER, Maker TEXT, FullName TEXT, Country TEXT); CREATE TABLE model_list (ModelId INTEGER, Maker INTEGER, Model TEXT); CREATE TABLE car_names (MakeId I...
extra
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "continents" ( "ContId" INTEGER PRIMARY KEY, "Continent" TEXT ); CREATE TABLE "countries" ( "CountryId" INTEGER PRIMARY KEY, "CountryName" TEXT, "Contin...
car_1
SELECT DISTINCT T1.Maker FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker JOIN CAR_NAMES AS T3 ON T2.model = T3.model JOIN CARS_DATA AS T4 ON T3.MakeId = T4.id WHERE T4.year = '1970';
Find the name of the makers that produced some cars in the year of 1970?
CREATE TABLE "continents" ( "ContId" INTEGER PRIMARY KEY, "Continent" TEXT ); CREATE TABLE "countries" ( "CountryId" INTEGER PRIMARY KEY, "CountryName" TEXT, "Continent" INTEGER, FOREIGN KEY (Continent) REFERENCES continents(ContId) ); CREATE TABLE "car_makers" ( "Id" INTEGER PRIMARY KEY, "Maker" TEXT, ...
CREATE TABLE continents (ContId INTEGER, Continent TEXT); CREATE TABLE countries (CountryId INTEGER, CountryName TEXT, Continent INTEGER); CREATE TABLE car_makers (Id INTEGER, Maker TEXT, FullName TEXT, Country TEXT); CREATE TABLE model_list (ModelId INTEGER, Maker INTEGER, Model TEXT); CREATE TABLE car_names (MakeId I...
extra
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "continents" ( "ContId" INTEGER PRIMARY KEY, "Continent" TEXT ); CREATE TABLE "countries" ( "CountryId" INTEGER PRIMARY KEY, "CountryName" TEXT, "Contin...
car_1
SELECT T2.Make , T1.Year FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id = T2.MakeId WHERE T1.Year = (SELECT min(YEAR) FROM CARS_DATA);
Find the make and production time of the cars that were produced in the earliest year?
CREATE TABLE "continents" ( "ContId" INTEGER PRIMARY KEY, "Continent" TEXT ); CREATE TABLE "countries" ( "CountryId" INTEGER PRIMARY KEY, "CountryName" TEXT, "Continent" INTEGER, FOREIGN KEY (Continent) REFERENCES continents(ContId) ); CREATE TABLE "car_makers" ( "Id" INTEGER PRIMARY KEY, "Maker" TEXT, ...
CREATE TABLE continents (ContId INTEGER, Continent TEXT); CREATE TABLE countries (CountryId INTEGER, CountryName TEXT, Continent INTEGER); CREATE TABLE car_makers (Id INTEGER, Maker TEXT, FullName TEXT, Country TEXT); CREATE TABLE model_list (ModelId INTEGER, Maker INTEGER, Model TEXT); CREATE TABLE car_names (MakeId I...
extra
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "continents" ( "ContId" INTEGER PRIMARY KEY, "Continent" TEXT ); CREATE TABLE "countries" ( "CountryId" INTEGER PRIMARY KEY, "CountryName" TEXT, "Contin...
car_1
SELECT DISTINCT T1.model FROM MODEL_LIST AS T1 JOIN CAR_NAMES AS T2 ON T1.model = T2.model JOIN CARS_DATA AS T3 ON T2.MakeId = T3.id WHERE T3.year > 1980;
Which distinct car models are the produced after 1980?
CREATE TABLE "continents" ( "ContId" INTEGER PRIMARY KEY, "Continent" TEXT ); CREATE TABLE "countries" ( "CountryId" INTEGER PRIMARY KEY, "CountryName" TEXT, "Continent" INTEGER, FOREIGN KEY (Continent) REFERENCES continents(ContId) ); CREATE TABLE "car_makers" ( "Id" INTEGER PRIMARY KEY, "Maker" TEXT, ...
CREATE TABLE continents (ContId INTEGER, Continent TEXT); CREATE TABLE countries (CountryId INTEGER, CountryName TEXT, Continent INTEGER); CREATE TABLE car_makers (Id INTEGER, Maker TEXT, FullName TEXT, Country TEXT); CREATE TABLE model_list (ModelId INTEGER, Maker INTEGER, Model TEXT); CREATE TABLE car_names (MakeId I...
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "continents" ( "ContId" INTEGER PRIMARY KEY, "Continent" TEXT ); CREATE TABLE "countries" ( "CountryId" INTEGER PRIMARY KEY, "CountryName" TEXT, "Contin...
car_1
SELECT T1.Continent , count(*) FROM CONTINENTS AS T1 JOIN COUNTRIES AS T2 ON T1.ContId = T2.continent JOIN car_makers AS T3 ON T2.CountryId = T3.Country GROUP BY T1.Continent;
How many car makers are there in each continents? List the continent name and the count.
CREATE TABLE "continents" ( "ContId" INTEGER PRIMARY KEY, "Continent" TEXT ); CREATE TABLE "countries" ( "CountryId" INTEGER PRIMARY KEY, "CountryName" TEXT, "Continent" INTEGER, FOREIGN KEY (Continent) REFERENCES continents(ContId) ); CREATE TABLE "car_makers" ( "Id" INTEGER PRIMARY KEY, "Maker" TEXT, ...
CREATE TABLE continents (ContId INTEGER, Continent TEXT); CREATE TABLE countries (CountryId INTEGER, CountryName TEXT, Continent INTEGER); CREATE TABLE car_makers (Id INTEGER, Maker TEXT, FullName TEXT, Country TEXT); CREATE TABLE model_list (ModelId INTEGER, Maker INTEGER, Model TEXT); CREATE TABLE car_names (MakeId I...
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "continents" ( "ContId" INTEGER PRIMARY KEY, "Continent" TEXT ); CREATE TABLE "countries" ( "CountryId" INTEGER PRIMARY KEY, "CountryName" TEXT, "Contin...
car_1
select count(*) , t2.fullname from model_list as t1 join car_makers as t2 on t1.maker = t2.id group by t2.id;
How many car models are produced by each maker ? Only list the count and the maker full name .
CREATE TABLE "continents" ( "ContId" INTEGER PRIMARY KEY, "Continent" TEXT ); CREATE TABLE "countries" ( "CountryId" INTEGER PRIMARY KEY, "CountryName" TEXT, "Continent" INTEGER, FOREIGN KEY (Continent) REFERENCES continents(ContId) ); CREATE TABLE "car_makers" ( "Id" INTEGER PRIMARY KEY, "Maker" TEXT, ...
CREATE TABLE continents (ContId INTEGER, Continent TEXT); CREATE TABLE countries (CountryId INTEGER, CountryName TEXT, Continent INTEGER); CREATE TABLE car_makers (Id INTEGER, Maker TEXT, FullName TEXT, Country TEXT); CREATE TABLE model_list (ModelId INTEGER, Maker INTEGER, Model TEXT); CREATE TABLE car_names (MakeId I...
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "continents" ( "ContId" INTEGER PRIMARY KEY, "Continent" TEXT ); CREATE TABLE "countries" ( "CountryId" INTEGER PRIMARY KEY, "CountryName" TEXT, "Contin...
car_1
SELECT avg(mpg) FROM CARS_DATA WHERE Cylinders = 4;
What is the average miles per gallon(mpg) of the cars with 4 cylinders?
CREATE TABLE "continents" ( "ContId" INTEGER PRIMARY KEY, "Continent" TEXT ); CREATE TABLE "countries" ( "CountryId" INTEGER PRIMARY KEY, "CountryName" TEXT, "Continent" INTEGER, FOREIGN KEY (Continent) REFERENCES continents(ContId) ); CREATE TABLE "car_makers" ( "Id" INTEGER PRIMARY KEY, "Maker" TEXT, ...
CREATE TABLE continents (ContId INTEGER, Continent TEXT); CREATE TABLE countries (CountryId INTEGER, CountryName TEXT, Continent INTEGER); CREATE TABLE car_makers (Id INTEGER, Maker TEXT, FullName TEXT, Country TEXT); CREATE TABLE model_list (ModelId INTEGER, Maker INTEGER, Model TEXT); CREATE TABLE car_names (MakeId I...
easy
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "continents" ( "ContId" INTEGER PRIMARY KEY, "Continent" TEXT ); CREATE TABLE "countries" ( "CountryId" INTEGER PRIMARY KEY, "CountryName" TEXT, "Contin...
flight_2
SELECT Country FROM AIRLINES WHERE Airline = "JetBlue Airways"
Which country does Airline "JetBlue Airways" belong to?
CREATE TABLE 'airlines' ( uid INTEGER PRIMARY KEY, Airline TEXT, Abbreviation TEXT, Country TEXT ); CREATE TABLE 'airports' ( City TEXT, AirportCode TEXT PRIMARY KEY, AirportName TEXT, Country TEXT, CountryAbbrev TEXT ); CREATE TABLE 'flights' ( Airline INTEGER, FlightNo INTEGER, SourceAirport TEXT...
CREATE TABLE airlines (uid INTEGER, Airline TEXT, Abbreviation TEXT, Country TEXT); CREATE TABLE airports (City TEXT, AirportCode TEXT, AirportName TEXT, Country TEXT, CountryAbbrev TEXT); CREATE TABLE flights (Airline INTEGER, FlightNo INTEGER, SourceAirport TEXT, DestAirport 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 'airlines' ( uid INTEGER PRIMARY KEY, Airline TEXT, Abbreviation TEXT, Country TEXT ); CREATE TABLE 'airports' ( City TEXT, AirportCode TEXT PRIMARY KEY...
flight_2
SELECT Abbreviation FROM AIRLINES WHERE Airline = "JetBlue Airways"
What is the abbreviation of Airline "JetBlue Airways"?
CREATE TABLE 'airlines' ( uid INTEGER PRIMARY KEY, Airline TEXT, Abbreviation TEXT, Country TEXT ); CREATE TABLE 'airports' ( City TEXT, AirportCode TEXT PRIMARY KEY, AirportName TEXT, Country TEXT, CountryAbbrev TEXT ); CREATE TABLE 'flights' ( Airline INTEGER, FlightNo INTEGER, SourceAirport TEXT...
CREATE TABLE airlines (uid INTEGER, Airline TEXT, Abbreviation TEXT, Country TEXT); CREATE TABLE airports (City TEXT, AirportCode TEXT, AirportName TEXT, Country TEXT, CountryAbbrev TEXT); CREATE TABLE flights (Airline INTEGER, FlightNo INTEGER, SourceAirport TEXT, DestAirport 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 'airlines' ( uid INTEGER PRIMARY KEY, Airline TEXT, Abbreviation TEXT, Country TEXT ); CREATE TABLE 'airports' ( City TEXT, AirportCode TEXT PRIMARY KEY...
flight_2
SELECT Airline , Abbreviation FROM AIRLINES WHERE Country = "USA"
List all airline names and their abbreviations in "USA".
CREATE TABLE 'airlines' ( uid INTEGER PRIMARY KEY, Airline TEXT, Abbreviation TEXT, Country TEXT ); CREATE TABLE 'airports' ( City TEXT, AirportCode TEXT PRIMARY KEY, AirportName TEXT, Country TEXT, CountryAbbrev TEXT ); CREATE TABLE 'flights' ( Airline INTEGER, FlightNo INTEGER, SourceAirport TEXT...
CREATE TABLE airlines (uid INTEGER, Airline TEXT, Abbreviation TEXT, Country TEXT); CREATE TABLE airports (City TEXT, AirportCode TEXT, AirportName TEXT, Country TEXT, CountryAbbrev TEXT); CREATE TABLE flights (Airline INTEGER, FlightNo INTEGER, SourceAirport TEXT, DestAirport 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 'airlines' ( uid INTEGER PRIMARY KEY, Airline TEXT, Abbreviation TEXT, Country TEXT ); CREATE TABLE 'airports' ( City TEXT, AirportCode TEXT PRIMARY KEY...
flight_2
SELECT AirportCode , AirportName FROM AIRPORTS WHERE city = "Anthony"
List the airport code and name in the city of Anthony.
CREATE TABLE 'airlines' ( uid INTEGER PRIMARY KEY, Airline TEXT, Abbreviation TEXT, Country TEXT ); CREATE TABLE 'airports' ( City TEXT, AirportCode TEXT PRIMARY KEY, AirportName TEXT, Country TEXT, CountryAbbrev TEXT ); CREATE TABLE 'flights' ( Airline INTEGER, FlightNo INTEGER, SourceAirport TEXT...
CREATE TABLE airlines (uid INTEGER, Airline TEXT, Abbreviation TEXT, Country TEXT); CREATE TABLE airports (City TEXT, AirportCode TEXT, AirportName TEXT, Country TEXT, CountryAbbrev TEXT); CREATE TABLE flights (Airline INTEGER, FlightNo INTEGER, SourceAirport TEXT, DestAirport 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 'airlines' ( uid INTEGER PRIMARY KEY, Airline TEXT, Abbreviation TEXT, Country TEXT ); CREATE TABLE 'airports' ( City TEXT, AirportCode TEXT PRIMARY KEY...
flight_2
SELECT count(*) FROM AIRLINES
How many airlines do we have?
CREATE TABLE 'airlines' ( uid INTEGER PRIMARY KEY, Airline TEXT, Abbreviation TEXT, Country TEXT ); CREATE TABLE 'airports' ( City TEXT, AirportCode TEXT PRIMARY KEY, AirportName TEXT, Country TEXT, CountryAbbrev TEXT ); CREATE TABLE 'flights' ( Airline INTEGER, FlightNo INTEGER, SourceAirport TEXT...
CREATE TABLE airlines (uid INTEGER, Airline TEXT, Abbreviation TEXT, Country TEXT); CREATE TABLE airports (City TEXT, AirportCode TEXT, AirportName TEXT, Country TEXT, CountryAbbrev TEXT); CREATE TABLE flights (Airline INTEGER, FlightNo INTEGER, SourceAirport TEXT, DestAirport 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 'airlines' ( uid INTEGER PRIMARY KEY, Airline TEXT, Abbreviation TEXT, Country TEXT ); CREATE TABLE 'airports' ( City TEXT, AirportCode TEXT PRIMARY KEY...
flight_2
SELECT City , Country FROM AIRPORTS WHERE AirportName = "Alton"
Which city and country is the Alton airport at?
CREATE TABLE 'airlines' ( uid INTEGER PRIMARY KEY, Airline TEXT, Abbreviation TEXT, Country TEXT ); CREATE TABLE 'airports' ( City TEXT, AirportCode TEXT PRIMARY KEY, AirportName TEXT, Country TEXT, CountryAbbrev TEXT ); CREATE TABLE 'flights' ( Airline INTEGER, FlightNo INTEGER, SourceAirport TEXT...
CREATE TABLE airlines (uid INTEGER, Airline TEXT, Abbreviation TEXT, Country TEXT); CREATE TABLE airports (City TEXT, AirportCode TEXT, AirportName TEXT, Country TEXT, CountryAbbrev TEXT); CREATE TABLE flights (Airline INTEGER, FlightNo INTEGER, SourceAirport TEXT, DestAirport 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 'airlines' ( uid INTEGER PRIMARY KEY, Airline TEXT, Abbreviation TEXT, Country TEXT ); CREATE TABLE 'airports' ( City TEXT, AirportCode TEXT PRIMARY KEY...
flight_2
SELECT count(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode JOIN AIRPORTS AS T3 ON T1.SourceAirport = T3.AirportCode WHERE T2.City = "Ashley" AND T3.City = "Aberdeen"
How many flights depart from City 'Aberdeen' and have destination City 'Ashley'?
CREATE TABLE 'airlines' ( uid INTEGER PRIMARY KEY, Airline TEXT, Abbreviation TEXT, Country TEXT ); CREATE TABLE 'airports' ( City TEXT, AirportCode TEXT PRIMARY KEY, AirportName TEXT, Country TEXT, CountryAbbrev TEXT ); CREATE TABLE 'flights' ( Airline INTEGER, FlightNo INTEGER, SourceAirport TEXT...
CREATE TABLE airlines (uid INTEGER, Airline TEXT, Abbreviation TEXT, Country TEXT); CREATE TABLE airports (City TEXT, AirportCode TEXT, AirportName TEXT, Country TEXT, CountryAbbrev TEXT); CREATE TABLE flights (Airline INTEGER, FlightNo INTEGER, SourceAirport TEXT, DestAirport 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 'airlines' ( uid INTEGER PRIMARY KEY, Airline TEXT, Abbreviation TEXT, Country TEXT ); CREATE TABLE 'airports' ( City TEXT, AirportCode TEXT PRIMARY KEY...
flight_2
SELECT count(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode JOIN AIRLINES AS T3 ON T3.uid = T1.Airline WHERE T2.City = "Aberdeen" AND T3.Airline = "United Airlines"
How many United Airlines flights go to City 'Aberdeen'?
CREATE TABLE 'airlines' ( uid INTEGER PRIMARY KEY, Airline TEXT, Abbreviation TEXT, Country TEXT ); CREATE TABLE 'airports' ( City TEXT, AirportCode TEXT PRIMARY KEY, AirportName TEXT, Country TEXT, CountryAbbrev TEXT ); CREATE TABLE 'flights' ( Airline INTEGER, FlightNo INTEGER, SourceAirport TEXT...
CREATE TABLE airlines (uid INTEGER, Airline TEXT, Abbreviation TEXT, Country TEXT); CREATE TABLE airports (City TEXT, AirportCode TEXT, AirportName TEXT, Country TEXT, CountryAbbrev TEXT); CREATE TABLE flights (Airline INTEGER, FlightNo INTEGER, SourceAirport TEXT, DestAirport 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 'airlines' ( uid INTEGER PRIMARY KEY, Airline TEXT, Abbreviation TEXT, Country TEXT ); CREATE TABLE 'airports' ( City TEXT, AirportCode TEXT PRIMARY KEY...
flight_2
SELECT T1.City FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode = T2.DestAirport GROUP BY T1.City ORDER BY count(*) DESC LIMIT 1
Which city has most number of arriving flights?
CREATE TABLE 'airlines' ( uid INTEGER PRIMARY KEY, Airline TEXT, Abbreviation TEXT, Country TEXT ); CREATE TABLE 'airports' ( City TEXT, AirportCode TEXT PRIMARY KEY, AirportName TEXT, Country TEXT, CountryAbbrev TEXT ); CREATE TABLE 'flights' ( Airline INTEGER, FlightNo INTEGER, SourceAirport TEXT...
CREATE TABLE airlines (uid INTEGER, Airline TEXT, Abbreviation TEXT, Country TEXT); CREATE TABLE airports (City TEXT, AirportCode TEXT, AirportName TEXT, Country TEXT, CountryAbbrev TEXT); CREATE TABLE flights (Airline INTEGER, FlightNo INTEGER, SourceAirport TEXT, DestAirport 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 'airlines' ( uid INTEGER PRIMARY KEY, Airline TEXT, Abbreviation TEXT, Country TEXT ); CREATE TABLE 'airports' ( City TEXT, AirportCode TEXT PRIMARY KEY...
flight_2
SELECT T1.City FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode = T2.SourceAirport GROUP BY T1.City ORDER BY count(*) DESC LIMIT 1
Which city has most number of departing flights?
CREATE TABLE 'airlines' ( uid INTEGER PRIMARY KEY, Airline TEXT, Abbreviation TEXT, Country TEXT ); CREATE TABLE 'airports' ( City TEXT, AirportCode TEXT PRIMARY KEY, AirportName TEXT, Country TEXT, CountryAbbrev TEXT ); CREATE TABLE 'flights' ( Airline INTEGER, FlightNo INTEGER, SourceAirport TEXT...
CREATE TABLE airlines (uid INTEGER, Airline TEXT, Abbreviation TEXT, Country TEXT); CREATE TABLE airports (City TEXT, AirportCode TEXT, AirportName TEXT, Country TEXT, CountryAbbrev TEXT); CREATE TABLE flights (Airline INTEGER, FlightNo INTEGER, SourceAirport TEXT, DestAirport 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 'airlines' ( uid INTEGER PRIMARY KEY, Airline TEXT, Abbreviation TEXT, Country TEXT ); CREATE TABLE 'airports' ( City TEXT, AirportCode TEXT PRIMARY KEY...
flight_2
SELECT T1.AirportCode FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode = T2.DestAirport OR T1.AirportCode = T2.SourceAirport GROUP BY T1.AirportCode ORDER BY count(*) DESC LIMIT 1
What is the code of airport that has the highest number of flights?
CREATE TABLE 'airlines' ( uid INTEGER PRIMARY KEY, Airline TEXT, Abbreviation TEXT, Country TEXT ); CREATE TABLE 'airports' ( City TEXT, AirportCode TEXT PRIMARY KEY, AirportName TEXT, Country TEXT, CountryAbbrev TEXT ); CREATE TABLE 'flights' ( Airline INTEGER, FlightNo INTEGER, SourceAirport TEXT...
CREATE TABLE airlines (uid INTEGER, Airline TEXT, Abbreviation TEXT, Country TEXT); CREATE TABLE airports (City TEXT, AirportCode TEXT, AirportName TEXT, Country TEXT, CountryAbbrev TEXT); CREATE TABLE flights (Airline INTEGER, FlightNo INTEGER, SourceAirport TEXT, DestAirport 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 'airlines' ( uid INTEGER PRIMARY KEY, Airline TEXT, Abbreviation TEXT, Country TEXT ); CREATE TABLE 'airports' ( City TEXT, AirportCode TEXT PRIMARY KEY...
flight_2
SELECT count(*) FROM Flights AS T1 JOIN Airports AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.city = "Aberdeen" OR T2.city = "Abilene"
Find the number of flights landing in the city of Aberdeen or Abilene.
CREATE TABLE 'airlines' ( uid INTEGER PRIMARY KEY, Airline TEXT, Abbreviation TEXT, Country TEXT ); CREATE TABLE 'airports' ( City TEXT, AirportCode TEXT PRIMARY KEY, AirportName TEXT, Country TEXT, CountryAbbrev TEXT ); CREATE TABLE 'flights' ( Airline INTEGER, FlightNo INTEGER, SourceAirport TEXT...
CREATE TABLE airlines (uid INTEGER, Airline TEXT, Abbreviation TEXT, Country TEXT); CREATE TABLE airports (City TEXT, AirportCode TEXT, AirportName TEXT, Country TEXT, CountryAbbrev TEXT); CREATE TABLE flights (Airline INTEGER, FlightNo INTEGER, SourceAirport TEXT, DestAirport 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 'airlines' ( uid INTEGER PRIMARY KEY, Airline TEXT, Abbreviation TEXT, Country TEXT ); CREATE TABLE 'airports' ( City TEXT, AirportCode TEXT PRIMARY KEY...
employee_hire_evaluation
SELECT count(*) FROM employee
How many employees are there?
CREATE TABLE "employee" ( "Employee_ID" int, "Name" text, "Age" int, "City" text, PRIMARY KEY ("Employee_ID") ); CREATE TABLE "shop" ( "Shop_ID" int, "Name" text, "Location" text, "District" text, "Number_products" int, "Manager_name" text, PRIMARY KEY ("Shop_ID") ); CREATE TABLE "hiring" ( "Shop_ID" int, "Employee_ID"...
CREATE TABLE employee (Employee_ID INT, Name TEXT, Age INT, City TEXT); CREATE TABLE shop (Shop_ID INT, Name TEXT, Location TEXT, District TEXT, Number_products INT, Manager_name TEXT); CREATE TABLE hiring (Shop_ID INT, Employee_ID INT, Start_from TEXT, Is_full_time bool); CREATE TABLE evaluation (Employee_ID TEXT, Yea...
easy
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "employee" ( "Employee_ID" int, "Name" text, "Age" int, "City" text, PRIMARY KEY ("Employee_ID") ); CREATE TABLE "shop" ( "Shop_ID" int, "Name" text, "Location" t...
employee_hire_evaluation
SELECT name FROM employee ORDER BY age
Sort employee names by their age in ascending order.
CREATE TABLE "employee" ( "Employee_ID" int, "Name" text, "Age" int, "City" text, PRIMARY KEY ("Employee_ID") ); CREATE TABLE "shop" ( "Shop_ID" int, "Name" text, "Location" text, "District" text, "Number_products" int, "Manager_name" text, PRIMARY KEY ("Shop_ID") ); CREATE TABLE "hiring" ( "Shop_ID" int, "Employee_ID"...
CREATE TABLE employee (Employee_ID INT, Name TEXT, Age INT, City TEXT); CREATE TABLE shop (Shop_ID INT, Name TEXT, Location TEXT, District TEXT, Number_products INT, Manager_name TEXT); CREATE TABLE hiring (Shop_ID INT, Employee_ID INT, Start_from TEXT, Is_full_time bool); CREATE TABLE evaluation (Employee_ID TEXT, Yea...
easy
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "employee" ( "Employee_ID" int, "Name" text, "Age" int, "City" text, PRIMARY KEY ("Employee_ID") ); CREATE TABLE "shop" ( "Shop_ID" int, "Name" text, "Location" t...
employee_hire_evaluation
SELECT count(*) , city FROM employee GROUP BY city
What is the number of employees from each city?
CREATE TABLE "employee" ( "Employee_ID" int, "Name" text, "Age" int, "City" text, PRIMARY KEY ("Employee_ID") ); CREATE TABLE "shop" ( "Shop_ID" int, "Name" text, "Location" text, "District" text, "Number_products" int, "Manager_name" text, PRIMARY KEY ("Shop_ID") ); CREATE TABLE "hiring" ( "Shop_ID" int, "Employee_ID"...
CREATE TABLE employee (Employee_ID INT, Name TEXT, Age INT, City TEXT); CREATE TABLE shop (Shop_ID INT, Name TEXT, Location TEXT, District TEXT, Number_products INT, Manager_name TEXT); CREATE TABLE hiring (Shop_ID INT, Employee_ID INT, Start_from TEXT, Is_full_time bool); CREATE TABLE evaluation (Employee_ID TEXT, Yea...
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "employee" ( "Employee_ID" int, "Name" text, "Age" int, "City" text, PRIMARY KEY ("Employee_ID") ); CREATE TABLE "shop" ( "Shop_ID" int, "Name" text, "Location" t...
employee_hire_evaluation
SELECT city FROM employee WHERE age < 30 GROUP BY city HAVING count(*) > 1
Which cities do more than one employee under age 30 come from?
CREATE TABLE "employee" ( "Employee_ID" int, "Name" text, "Age" int, "City" text, PRIMARY KEY ("Employee_ID") ); CREATE TABLE "shop" ( "Shop_ID" int, "Name" text, "Location" text, "District" text, "Number_products" int, "Manager_name" text, PRIMARY KEY ("Shop_ID") ); CREATE TABLE "hiring" ( "Shop_ID" int, "Employee_ID"...
CREATE TABLE employee (Employee_ID INT, Name TEXT, Age INT, City TEXT); CREATE TABLE shop (Shop_ID INT, Name TEXT, Location TEXT, District TEXT, Number_products INT, Manager_name TEXT); CREATE TABLE hiring (Shop_ID INT, Employee_ID INT, Start_from TEXT, Is_full_time bool); CREATE TABLE evaluation (Employee_ID TEXT, Yea...
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "employee" ( "Employee_ID" int, "Name" text, "Age" int, "City" text, PRIMARY KEY ("Employee_ID") ); CREATE TABLE "shop" ( "Shop_ID" int, "Name" text, "Location" t...
employee_hire_evaluation
SELECT count(*) , LOCATION FROM shop GROUP BY LOCATION
Find the number of shops in each location.
CREATE TABLE "employee" ( "Employee_ID" int, "Name" text, "Age" int, "City" text, PRIMARY KEY ("Employee_ID") ); CREATE TABLE "shop" ( "Shop_ID" int, "Name" text, "Location" text, "District" text, "Number_products" int, "Manager_name" text, PRIMARY KEY ("Shop_ID") ); CREATE TABLE "hiring" ( "Shop_ID" int, "Employee_ID"...
CREATE TABLE employee (Employee_ID INT, Name TEXT, Age INT, City TEXT); CREATE TABLE shop (Shop_ID INT, Name TEXT, Location TEXT, District TEXT, Number_products INT, Manager_name TEXT); CREATE TABLE hiring (Shop_ID INT, Employee_ID INT, Start_from TEXT, Is_full_time bool); CREATE TABLE evaluation (Employee_ID TEXT, Yea...
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "employee" ( "Employee_ID" int, "Name" text, "Age" int, "City" text, PRIMARY KEY ("Employee_ID") ); CREATE TABLE "shop" ( "Shop_ID" int, "Name" text, "Location" t...
employee_hire_evaluation
SELECT name FROM shop WHERE number_products > (SELECT avg(number_products) FROM shop)
Find the names of stores whose number products is more than the average number of products.
CREATE TABLE "employee" ( "Employee_ID" int, "Name" text, "Age" int, "City" text, PRIMARY KEY ("Employee_ID") ); CREATE TABLE "shop" ( "Shop_ID" int, "Name" text, "Location" text, "District" text, "Number_products" int, "Manager_name" text, PRIMARY KEY ("Shop_ID") ); CREATE TABLE "hiring" ( "Shop_ID" int, "Employee_ID"...
CREATE TABLE employee (Employee_ID INT, Name TEXT, Age INT, City TEXT); CREATE TABLE shop (Shop_ID INT, Name TEXT, Location TEXT, District TEXT, Number_products INT, Manager_name TEXT); CREATE TABLE hiring (Shop_ID INT, Employee_ID INT, Start_from TEXT, Is_full_time bool); CREATE TABLE evaluation (Employee_ID TEXT, Yea...
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "employee" ( "Employee_ID" int, "Name" text, "Age" int, "City" text, PRIMARY KEY ("Employee_ID") ); CREATE TABLE "shop" ( "Shop_ID" int, "Name" text, "Location" t...
employee_hire_evaluation
SELECT t1.name FROM employee AS t1 JOIN evaluation AS t2 ON t1.Employee_ID = t2.Employee_ID GROUP BY t2.Employee_ID ORDER BY count(*) DESC LIMIT 1
find the name of employee who was awarded the most times in the evaluation.
CREATE TABLE "employee" ( "Employee_ID" int, "Name" text, "Age" int, "City" text, PRIMARY KEY ("Employee_ID") ); CREATE TABLE "shop" ( "Shop_ID" int, "Name" text, "Location" text, "District" text, "Number_products" int, "Manager_name" text, PRIMARY KEY ("Shop_ID") ); CREATE TABLE "hiring" ( "Shop_ID" int, "Employee_ID"...
CREATE TABLE employee (Employee_ID INT, Name TEXT, Age INT, City TEXT); CREATE TABLE shop (Shop_ID INT, Name TEXT, Location TEXT, District TEXT, Number_products INT, Manager_name TEXT); CREATE TABLE hiring (Shop_ID INT, Employee_ID INT, Start_from TEXT, Is_full_time bool); CREATE TABLE evaluation (Employee_ID TEXT, Yea...
extra
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "employee" ( "Employee_ID" int, "Name" text, "Age" int, "City" text, PRIMARY KEY ("Employee_ID") ); CREATE TABLE "shop" ( "Shop_ID" int, "Name" text, "Location" t...
employee_hire_evaluation
SELECT t1.name FROM employee AS t1 JOIN evaluation AS t2 ON t1.Employee_ID = t2.Employee_ID ORDER BY t2.bonus DESC LIMIT 1
Find the name of the employee who got the highest one time bonus.
CREATE TABLE "employee" ( "Employee_ID" int, "Name" text, "Age" int, "City" text, PRIMARY KEY ("Employee_ID") ); CREATE TABLE "shop" ( "Shop_ID" int, "Name" text, "Location" text, "District" text, "Number_products" int, "Manager_name" text, PRIMARY KEY ("Shop_ID") ); CREATE TABLE "hiring" ( "Shop_ID" int, "Employee_ID"...
CREATE TABLE employee (Employee_ID INT, Name TEXT, Age INT, City TEXT); CREATE TABLE shop (Shop_ID INT, Name TEXT, Location TEXT, District TEXT, Number_products INT, Manager_name TEXT); CREATE TABLE hiring (Shop_ID INT, Employee_ID INT, Start_from TEXT, Is_full_time bool); CREATE TABLE evaluation (Employee_ID TEXT, Yea...
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "employee" ( "Employee_ID" int, "Name" text, "Age" int, "City" text, PRIMARY KEY ("Employee_ID") ); CREATE TABLE "shop" ( "Shop_ID" int, "Name" text, "Location" t...
employee_hire_evaluation
SELECT name FROM employee WHERE Employee_ID NOT IN (SELECT Employee_ID FROM evaluation)
Find the names of employees who never won any award in the evaluation.
CREATE TABLE "employee" ( "Employee_ID" int, "Name" text, "Age" int, "City" text, PRIMARY KEY ("Employee_ID") ); CREATE TABLE "shop" ( "Shop_ID" int, "Name" text, "Location" text, "District" text, "Number_products" int, "Manager_name" text, PRIMARY KEY ("Shop_ID") ); CREATE TABLE "hiring" ( "Shop_ID" int, "Employee_ID"...
CREATE TABLE employee (Employee_ID INT, Name TEXT, Age INT, City TEXT); CREATE TABLE shop (Shop_ID INT, Name TEXT, Location TEXT, District TEXT, Number_products INT, Manager_name TEXT); CREATE TABLE hiring (Shop_ID INT, Employee_ID INT, Start_from TEXT, Is_full_time bool); CREATE TABLE evaluation (Employee_ID TEXT, Yea...
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "employee" ( "Employee_ID" int, "Name" text, "Age" int, "City" text, PRIMARY KEY ("Employee_ID") ); CREATE TABLE "shop" ( "Shop_ID" int, "Name" text, "Location" t...
employee_hire_evaluation
SELECT t2.name FROM hiring AS t1 JOIN shop AS t2 ON t1.shop_id = t2.shop_id GROUP BY t1.shop_id ORDER BY count(*) DESC LIMIT 1
What is the name of the shop that is hiring the largest number of employees?
CREATE TABLE "employee" ( "Employee_ID" int, "Name" text, "Age" int, "City" text, PRIMARY KEY ("Employee_ID") ); CREATE TABLE "shop" ( "Shop_ID" int, "Name" text, "Location" text, "District" text, "Number_products" int, "Manager_name" text, PRIMARY KEY ("Shop_ID") ); CREATE TABLE "hiring" ( "Shop_ID" int, "Employee_ID"...
CREATE TABLE employee (Employee_ID INT, Name TEXT, Age INT, City TEXT); CREATE TABLE shop (Shop_ID INT, Name TEXT, Location TEXT, District TEXT, Number_products INT, Manager_name TEXT); CREATE TABLE hiring (Shop_ID INT, Employee_ID INT, Start_from TEXT, Is_full_time bool); CREATE TABLE evaluation (Employee_ID TEXT, Yea...
extra
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "employee" ( "Employee_ID" int, "Name" text, "Age" int, "City" text, PRIMARY KEY ("Employee_ID") ); CREATE TABLE "shop" ( "Shop_ID" int, "Name" text, "Location" t...
employee_hire_evaluation
SELECT sum(bonus) FROM evaluation
What is total bonus given in all evaluations?
CREATE TABLE "employee" ( "Employee_ID" int, "Name" text, "Age" int, "City" text, PRIMARY KEY ("Employee_ID") ); CREATE TABLE "shop" ( "Shop_ID" int, "Name" text, "Location" text, "District" text, "Number_products" int, "Manager_name" text, PRIMARY KEY ("Shop_ID") ); CREATE TABLE "hiring" ( "Shop_ID" int, "Employee_ID"...
CREATE TABLE employee (Employee_ID INT, Name TEXT, Age INT, City TEXT); CREATE TABLE shop (Shop_ID INT, Name TEXT, Location TEXT, District TEXT, Number_products INT, Manager_name TEXT); CREATE TABLE hiring (Shop_ID INT, Employee_ID INT, Start_from TEXT, Is_full_time bool); CREATE TABLE evaluation (Employee_ID TEXT, Yea...
easy
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "employee" ( "Employee_ID" int, "Name" text, "Age" int, "City" text, PRIMARY KEY ("Employee_ID") ); CREATE TABLE "shop" ( "Shop_ID" int, "Name" text, "Location" t...
cre_Doc_Template_Mgt
SELECT count(*) FROM Documents
How many documents do we have?
CREATE TABLE Ref_Template_Types ( Template_Type_Code CHAR(15) NOT NULL, Template_Type_Description VARCHAR(255) NOT NULL, PRIMARY KEY (Template_Type_Code) ); CREATE TABLE Templates ( Template_ID INTEGER NOT NULL, Version_Number INTEGER NOT NULL, Template_Type_Code CHAR(15) NOT NULL, Date_Effective_From DATETIME, Date_Ef...
CREATE TABLE Ref_Template_Types (Template_Type_Code CHAR(15), Template_Type_Description VARCHAR(255)); CREATE TABLE Templates (Template_ID INTEGER, Version_Number INTEGER, Template_Type_Code CHAR(15), Date_Effective_From DATETIME, Date_Effective_To DATETIME, Template_Details VARCHAR(255)); CREATE TABLE Documents (Docum...
easy
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE Ref_Template_Types ( Template_Type_Code CHAR(15) NOT NULL, Template_Type_Description VARCHAR(255) NOT NULL, PRIMARY KEY (Template_Type_Code) ); CREATE TABLE Templ...
cre_Doc_Template_Mgt
SELECT document_id , document_name , document_description FROM Documents
List document IDs, document names, and document descriptions for all documents.
CREATE TABLE Ref_Template_Types ( Template_Type_Code CHAR(15) NOT NULL, Template_Type_Description VARCHAR(255) NOT NULL, PRIMARY KEY (Template_Type_Code) ); CREATE TABLE Templates ( Template_ID INTEGER NOT NULL, Version_Number INTEGER NOT NULL, Template_Type_Code CHAR(15) NOT NULL, Date_Effective_From DATETIME, Date_Ef...
CREATE TABLE Ref_Template_Types (Template_Type_Code CHAR(15), Template_Type_Description VARCHAR(255)); CREATE TABLE Templates (Template_ID INTEGER, Version_Number INTEGER, Template_Type_Code CHAR(15), Date_Effective_From DATETIME, Date_Effective_To DATETIME, Template_Details VARCHAR(255)); CREATE TABLE Documents (Docum...
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE Ref_Template_Types ( Template_Type_Code CHAR(15) NOT NULL, Template_Type_Description VARCHAR(255) NOT NULL, PRIMARY KEY (Template_Type_Code) ); CREATE TABLE Templ...
cre_Doc_Template_Mgt
SELECT document_name , template_id FROM Documents WHERE Document_Description LIKE "%w%"
What is the document name and template id for document with description with the letter 'w' in it?
CREATE TABLE Ref_Template_Types ( Template_Type_Code CHAR(15) NOT NULL, Template_Type_Description VARCHAR(255) NOT NULL, PRIMARY KEY (Template_Type_Code) ); CREATE TABLE Templates ( Template_ID INTEGER NOT NULL, Version_Number INTEGER NOT NULL, Template_Type_Code CHAR(15) NOT NULL, Date_Effective_From DATETIME, Date_Ef...
CREATE TABLE Ref_Template_Types (Template_Type_Code CHAR(15), Template_Type_Description VARCHAR(255)); CREATE TABLE Templates (Template_ID INTEGER, Version_Number INTEGER, Template_Type_Code CHAR(15), Date_Effective_From DATETIME, Date_Effective_To DATETIME, Template_Details VARCHAR(255)); CREATE TABLE Documents (Docum...
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE Ref_Template_Types ( Template_Type_Code CHAR(15) NOT NULL, Template_Type_Description VARCHAR(255) NOT NULL, PRIMARY KEY (Template_Type_Code) ); CREATE TABLE Templ...
cre_Doc_Template_Mgt
SELECT document_id , template_id , Document_Description FROM Documents WHERE document_name = "Robbin CV"
What is the document id, template id and description for document named "Robbin CV"?
CREATE TABLE Ref_Template_Types ( Template_Type_Code CHAR(15) NOT NULL, Template_Type_Description VARCHAR(255) NOT NULL, PRIMARY KEY (Template_Type_Code) ); CREATE TABLE Templates ( Template_ID INTEGER NOT NULL, Version_Number INTEGER NOT NULL, Template_Type_Code CHAR(15) NOT NULL, Date_Effective_From DATETIME, Date_Ef...
CREATE TABLE Ref_Template_Types (Template_Type_Code CHAR(15), Template_Type_Description VARCHAR(255)); CREATE TABLE Templates (Template_ID INTEGER, Version_Number INTEGER, Template_Type_Code CHAR(15), Date_Effective_From DATETIME, Date_Effective_To DATETIME, Template_Details VARCHAR(255)); CREATE TABLE Documents (Docum...
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE Ref_Template_Types ( Template_Type_Code CHAR(15) NOT NULL, Template_Type_Description VARCHAR(255) NOT NULL, PRIMARY KEY (Template_Type_Code) ); CREATE TABLE Templ...
cre_Doc_Template_Mgt
SELECT count(DISTINCT template_id) FROM Documents
How many different templates do all document use?
CREATE TABLE Ref_Template_Types ( Template_Type_Code CHAR(15) NOT NULL, Template_Type_Description VARCHAR(255) NOT NULL, PRIMARY KEY (Template_Type_Code) ); CREATE TABLE Templates ( Template_ID INTEGER NOT NULL, Version_Number INTEGER NOT NULL, Template_Type_Code CHAR(15) NOT NULL, Date_Effective_From DATETIME, Date_Ef...
CREATE TABLE Ref_Template_Types (Template_Type_Code CHAR(15), Template_Type_Description VARCHAR(255)); CREATE TABLE Templates (Template_ID INTEGER, Version_Number INTEGER, Template_Type_Code CHAR(15), Date_Effective_From DATETIME, Date_Effective_To DATETIME, Template_Details VARCHAR(255)); CREATE TABLE Documents (Docum...
easy
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE Ref_Template_Types ( Template_Type_Code CHAR(15) NOT NULL, Template_Type_Description VARCHAR(255) NOT NULL, PRIMARY KEY (Template_Type_Code) ); CREATE TABLE Templ...
cre_Doc_Template_Mgt
SELECT T1.template_id , T2.Template_Type_Code FROM Documents AS T1 JOIN Templates AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_id ORDER BY count(*) DESC LIMIT 1
What is the id and type code for the template used by the most documents?
CREATE TABLE Ref_Template_Types ( Template_Type_Code CHAR(15) NOT NULL, Template_Type_Description VARCHAR(255) NOT NULL, PRIMARY KEY (Template_Type_Code) ); CREATE TABLE Templates ( Template_ID INTEGER NOT NULL, Version_Number INTEGER NOT NULL, Template_Type_Code CHAR(15) NOT NULL, Date_Effective_From DATETIME, Date_Ef...
CREATE TABLE Ref_Template_Types (Template_Type_Code CHAR(15), Template_Type_Description VARCHAR(255)); CREATE TABLE Templates (Template_ID INTEGER, Version_Number INTEGER, Template_Type_Code CHAR(15), Date_Effective_From DATETIME, Date_Effective_To DATETIME, Template_Details VARCHAR(255)); CREATE TABLE Documents (Docum...
extra
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE Ref_Template_Types ( Template_Type_Code CHAR(15) NOT NULL, Template_Type_Description VARCHAR(255) NOT NULL, PRIMARY KEY (Template_Type_Code) ); CREATE TABLE Templ...
cre_Doc_Template_Mgt
SELECT template_id FROM Documents GROUP BY template_id HAVING count(*) > 1
Show ids for all templates that are used by more than one document.
CREATE TABLE Ref_Template_Types ( Template_Type_Code CHAR(15) NOT NULL, Template_Type_Description VARCHAR(255) NOT NULL, PRIMARY KEY (Template_Type_Code) ); CREATE TABLE Templates ( Template_ID INTEGER NOT NULL, Version_Number INTEGER NOT NULL, Template_Type_Code CHAR(15) NOT NULL, Date_Effective_From DATETIME, Date_Ef...
CREATE TABLE Ref_Template_Types (Template_Type_Code CHAR(15), Template_Type_Description VARCHAR(255)); CREATE TABLE Templates (Template_ID INTEGER, Version_Number INTEGER, Template_Type_Code CHAR(15), Date_Effective_From DATETIME, Date_Effective_To DATETIME, Template_Details VARCHAR(255)); CREATE TABLE Documents (Docum...
easy
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE Ref_Template_Types ( Template_Type_Code CHAR(15) NOT NULL, Template_Type_Description VARCHAR(255) NOT NULL, PRIMARY KEY (Template_Type_Code) ); CREATE TABLE Templ...
cre_Doc_Template_Mgt
SELECT template_id FROM Templates EXCEPT SELECT template_id FROM Documents
Show ids for all templates not used by any document.
CREATE TABLE Ref_Template_Types ( Template_Type_Code CHAR(15) NOT NULL, Template_Type_Description VARCHAR(255) NOT NULL, PRIMARY KEY (Template_Type_Code) ); CREATE TABLE Templates ( Template_ID INTEGER NOT NULL, Version_Number INTEGER NOT NULL, Template_Type_Code CHAR(15) NOT NULL, Date_Effective_From DATETIME, Date_Ef...
CREATE TABLE Ref_Template_Types (Template_Type_Code CHAR(15), Template_Type_Description VARCHAR(255)); CREATE TABLE Templates (Template_ID INTEGER, Version_Number INTEGER, Template_Type_Code CHAR(15), Date_Effective_From DATETIME, Date_Effective_To DATETIME, Template_Details VARCHAR(255)); CREATE TABLE Documents (Docum...
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE Ref_Template_Types ( Template_Type_Code CHAR(15) NOT NULL, Template_Type_Description VARCHAR(255) NOT NULL, PRIMARY KEY (Template_Type_Code) ); CREATE TABLE Templ...
cre_Doc_Template_Mgt
SELECT template_type_code FROM Templates GROUP BY template_type_code ORDER BY count(*) DESC LIMIT 1
Which template type code has most number of templates?
CREATE TABLE Ref_Template_Types ( Template_Type_Code CHAR(15) NOT NULL, Template_Type_Description VARCHAR(255) NOT NULL, PRIMARY KEY (Template_Type_Code) ); CREATE TABLE Templates ( Template_ID INTEGER NOT NULL, Version_Number INTEGER NOT NULL, Template_Type_Code CHAR(15) NOT NULL, Date_Effective_From DATETIME, Date_Ef...
CREATE TABLE Ref_Template_Types (Template_Type_Code CHAR(15), Template_Type_Description VARCHAR(255)); CREATE TABLE Templates (Template_ID INTEGER, Version_Number INTEGER, Template_Type_Code CHAR(15), Date_Effective_From DATETIME, Date_Effective_To DATETIME, Template_Details VARCHAR(255)); CREATE TABLE Documents (Docum...
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE Ref_Template_Types ( Template_Type_Code CHAR(15) NOT NULL, Template_Type_Description VARCHAR(255) NOT NULL, PRIMARY KEY (Template_Type_Code) ); CREATE TABLE Templ...
cre_Doc_Template_Mgt
SELECT T1.template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_type_code ORDER BY count(*) DESC LIMIT 1
Which template type code is used by most number of documents?
CREATE TABLE Ref_Template_Types ( Template_Type_Code CHAR(15) NOT NULL, Template_Type_Description VARCHAR(255) NOT NULL, PRIMARY KEY (Template_Type_Code) ); CREATE TABLE Templates ( Template_ID INTEGER NOT NULL, Version_Number INTEGER NOT NULL, Template_Type_Code CHAR(15) NOT NULL, Date_Effective_From DATETIME, Date_Ef...
CREATE TABLE Ref_Template_Types (Template_Type_Code CHAR(15), Template_Type_Description VARCHAR(255)); CREATE TABLE Templates (Template_ID INTEGER, Version_Number INTEGER, Template_Type_Code CHAR(15), Date_Effective_From DATETIME, Date_Effective_To DATETIME, Template_Details VARCHAR(255)); CREATE TABLE Documents (Docum...
extra
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE Ref_Template_Types ( Template_Type_Code CHAR(15) NOT NULL, Template_Type_Description VARCHAR(255) NOT NULL, PRIMARY KEY (Template_Type_Code) ); CREATE TABLE Templ...
cre_Doc_Template_Mgt
SELECT template_type_code FROM Templates EXCEPT SELECT template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id
Show all template type codes that are not used by any document.
CREATE TABLE Ref_Template_Types ( Template_Type_Code CHAR(15) NOT NULL, Template_Type_Description VARCHAR(255) NOT NULL, PRIMARY KEY (Template_Type_Code) ); CREATE TABLE Templates ( Template_ID INTEGER NOT NULL, Version_Number INTEGER NOT NULL, Template_Type_Code CHAR(15) NOT NULL, Date_Effective_From DATETIME, Date_Ef...
CREATE TABLE Ref_Template_Types (Template_Type_Code CHAR(15), Template_Type_Description VARCHAR(255)); CREATE TABLE Templates (Template_ID INTEGER, Version_Number INTEGER, Template_Type_Code CHAR(15), Date_Effective_From DATETIME, Date_Effective_To DATETIME, Template_Details VARCHAR(255)); CREATE TABLE Documents (Docum...
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE Ref_Template_Types ( Template_Type_Code CHAR(15) NOT NULL, Template_Type_Description VARCHAR(255) NOT NULL, PRIMARY KEY (Template_Type_Code) ); CREATE TABLE Templ...
cre_Doc_Template_Mgt
SELECT T1.document_id , T2.document_name FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id GROUP BY T1.document_id ORDER BY count(*) DESC LIMIT 1
What is the document id and name with greatest number of paragraphs?
CREATE TABLE Ref_Template_Types ( Template_Type_Code CHAR(15) NOT NULL, Template_Type_Description VARCHAR(255) NOT NULL, PRIMARY KEY (Template_Type_Code) ); CREATE TABLE Templates ( Template_ID INTEGER NOT NULL, Version_Number INTEGER NOT NULL, Template_Type_Code CHAR(15) NOT NULL, Date_Effective_From DATETIME, Date_Ef...
CREATE TABLE Ref_Template_Types (Template_Type_Code CHAR(15), Template_Type_Description VARCHAR(255)); CREATE TABLE Templates (Template_ID INTEGER, Version_Number INTEGER, Template_Type_Code CHAR(15), Date_Effective_From DATETIME, Date_Effective_To DATETIME, Template_Details VARCHAR(255)); CREATE TABLE Documents (Docum...
extra
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE Ref_Template_Types ( Template_Type_Code CHAR(15) NOT NULL, Template_Type_Description VARCHAR(255) NOT NULL, PRIMARY KEY (Template_Type_Code) ); CREATE TABLE Templ...
course_teach
SELECT count(*) FROM teacher
How many teachers are there?
CREATE TABLE "course" ( "Course_ID" int, "Staring_Date" text, "Course" text, PRIMARY KEY ("Course_ID") ); CREATE TABLE "teacher" ( "Teacher_ID" int, "Name" text, "Age" text, "Hometown" text, PRIMARY KEY ("Teacher_ID") ); CREATE TABLE "course_arrange" ( "Course_ID" int, "Teacher_ID" int, "Grade" int, PRIMARY KEY ("Cours...
CREATE TABLE course (Course_ID INT, Staring_Date TEXT, Course TEXT); CREATE TABLE teacher (Teacher_ID INT, Name TEXT, Age TEXT, Hometown TEXT); CREATE TABLE course_arrange (Course_ID INT, Teacher_ID INT, Grade INT);
easy
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "course" ( "Course_ID" int, "Staring_Date" text, "Course" text, PRIMARY KEY ("Course_ID") ); CREATE TABLE "teacher" ( "Teacher_ID" int, "Name" text, "Age" text, "...
course_teach
SELECT Name FROM teacher ORDER BY Age ASC
List the names of teachers in ascending order of age.
CREATE TABLE "course" ( "Course_ID" int, "Staring_Date" text, "Course" text, PRIMARY KEY ("Course_ID") ); CREATE TABLE "teacher" ( "Teacher_ID" int, "Name" text, "Age" text, "Hometown" text, PRIMARY KEY ("Teacher_ID") ); CREATE TABLE "course_arrange" ( "Course_ID" int, "Teacher_ID" int, "Grade" int, PRIMARY KEY ("Cours...
CREATE TABLE course (Course_ID INT, Staring_Date TEXT, Course TEXT); CREATE TABLE teacher (Teacher_ID INT, Name TEXT, Age TEXT, Hometown TEXT); CREATE TABLE course_arrange (Course_ID INT, Teacher_ID INT, Grade INT);
easy
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "course" ( "Course_ID" int, "Staring_Date" text, "Course" text, PRIMARY KEY ("Course_ID") ); CREATE TABLE "teacher" ( "Teacher_ID" int, "Name" text, "Age" text, "...
course_teach
SELECT Age , Hometown FROM teacher
What are the age and hometown of teachers?
CREATE TABLE "course" ( "Course_ID" int, "Staring_Date" text, "Course" text, PRIMARY KEY ("Course_ID") ); CREATE TABLE "teacher" ( "Teacher_ID" int, "Name" text, "Age" text, "Hometown" text, PRIMARY KEY ("Teacher_ID") ); CREATE TABLE "course_arrange" ( "Course_ID" int, "Teacher_ID" int, "Grade" int, PRIMARY KEY ("Cours...
CREATE TABLE course (Course_ID INT, Staring_Date TEXT, Course TEXT); CREATE TABLE teacher (Teacher_ID INT, Name TEXT, Age TEXT, Hometown TEXT); CREATE TABLE course_arrange (Course_ID INT, Teacher_ID INT, Grade INT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "course" ( "Course_ID" int, "Staring_Date" text, "Course" text, PRIMARY KEY ("Course_ID") ); CREATE TABLE "teacher" ( "Teacher_ID" int, "Name" text, "Age" text, "...
course_teach
select name from teacher where hometown != "little lever urban district"
List the name of teachers whose hometown is not `` Little Lever Urban District '' .
CREATE TABLE "course" ( "Course_ID" int, "Staring_Date" text, "Course" text, PRIMARY KEY ("Course_ID") ); CREATE TABLE "teacher" ( "Teacher_ID" int, "Name" text, "Age" text, "Hometown" text, PRIMARY KEY ("Teacher_ID") ); CREATE TABLE "course_arrange" ( "Course_ID" int, "Teacher_ID" int, "Grade" int, PRIMARY KEY ("Cours...
CREATE TABLE course (Course_ID INT, Staring_Date TEXT, Course TEXT); CREATE TABLE teacher (Teacher_ID INT, Name TEXT, Age TEXT, Hometown TEXT); CREATE TABLE course_arrange (Course_ID INT, Teacher_ID INT, Grade INT);
easy
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "course" ( "Course_ID" int, "Staring_Date" text, "Course" text, PRIMARY KEY ("Course_ID") ); CREATE TABLE "teacher" ( "Teacher_ID" int, "Name" text, "Age" text, "...
course_teach
SELECT Name FROM teacher WHERE Age = 32 OR Age = 33
Show the name of teachers aged either 32 or 33?
CREATE TABLE "course" ( "Course_ID" int, "Staring_Date" text, "Course" text, PRIMARY KEY ("Course_ID") ); CREATE TABLE "teacher" ( "Teacher_ID" int, "Name" text, "Age" text, "Hometown" text, PRIMARY KEY ("Teacher_ID") ); CREATE TABLE "course_arrange" ( "Course_ID" int, "Teacher_ID" int, "Grade" int, PRIMARY KEY ("Cours...
CREATE TABLE course (Course_ID INT, Staring_Date TEXT, Course TEXT); CREATE TABLE teacher (Teacher_ID INT, Name TEXT, Age TEXT, Hometown TEXT); CREATE TABLE course_arrange (Course_ID INT, Teacher_ID INT, Grade INT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "course" ( "Course_ID" int, "Staring_Date" text, "Course" text, PRIMARY KEY ("Course_ID") ); CREATE TABLE "teacher" ( "Teacher_ID" int, "Name" text, "Age" text, "...
course_teach
SELECT Hometown FROM teacher ORDER BY Age ASC LIMIT 1
What is the hometown of the youngest teacher?
CREATE TABLE "course" ( "Course_ID" int, "Staring_Date" text, "Course" text, PRIMARY KEY ("Course_ID") ); CREATE TABLE "teacher" ( "Teacher_ID" int, "Name" text, "Age" text, "Hometown" text, PRIMARY KEY ("Teacher_ID") ); CREATE TABLE "course_arrange" ( "Course_ID" int, "Teacher_ID" int, "Grade" int, PRIMARY KEY ("Cours...
CREATE TABLE course (Course_ID INT, Staring_Date TEXT, Course TEXT); CREATE TABLE teacher (Teacher_ID INT, Name TEXT, Age TEXT, Hometown TEXT); CREATE TABLE course_arrange (Course_ID INT, Teacher_ID INT, Grade INT);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "course" ( "Course_ID" int, "Staring_Date" text, "Course" text, PRIMARY KEY ("Course_ID") ); CREATE TABLE "teacher" ( "Teacher_ID" int, "Name" text, "Age" text, "...
course_teach
SELECT Hometown FROM teacher GROUP BY Hometown ORDER BY COUNT(*) DESC LIMIT 1
List the most common hometown of teachers.
CREATE TABLE "course" ( "Course_ID" int, "Staring_Date" text, "Course" text, PRIMARY KEY ("Course_ID") ); CREATE TABLE "teacher" ( "Teacher_ID" int, "Name" text, "Age" text, "Hometown" text, PRIMARY KEY ("Teacher_ID") ); CREATE TABLE "course_arrange" ( "Course_ID" int, "Teacher_ID" int, "Grade" int, PRIMARY KEY ("Cours...
CREATE TABLE course (Course_ID INT, Staring_Date TEXT, Course TEXT); CREATE TABLE teacher (Teacher_ID INT, Name TEXT, Age TEXT, Hometown TEXT); CREATE TABLE course_arrange (Course_ID INT, Teacher_ID INT, Grade INT);
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "course" ( "Course_ID" int, "Staring_Date" text, "Course" text, PRIMARY KEY ("Course_ID") ); CREATE TABLE "teacher" ( "Teacher_ID" int, "Name" text, "Age" text, "...
course_teach
SELECT T3.Name , T2.Course FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID = T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID = T3.Teacher_ID ORDER BY T3.Name
Show names of teachers and the courses they are arranged to teach in ascending alphabetical order of the teacher's name.
CREATE TABLE "course" ( "Course_ID" int, "Staring_Date" text, "Course" text, PRIMARY KEY ("Course_ID") ); CREATE TABLE "teacher" ( "Teacher_ID" int, "Name" text, "Age" text, "Hometown" text, PRIMARY KEY ("Teacher_ID") ); CREATE TABLE "course_arrange" ( "Course_ID" int, "Teacher_ID" int, "Grade" int, PRIMARY KEY ("Cours...
CREATE TABLE course (Course_ID INT, Staring_Date TEXT, Course TEXT); CREATE TABLE teacher (Teacher_ID INT, Name TEXT, Age TEXT, Hometown TEXT); CREATE TABLE course_arrange (Course_ID INT, Teacher_ID INT, Grade INT);
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "course" ( "Course_ID" int, "Staring_Date" text, "Course" text, PRIMARY KEY ("Course_ID") ); CREATE TABLE "teacher" ( "Teacher_ID" int, "Name" text, "Age" text, "...
course_teach
SELECT T3.Name FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID = T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID = T3.Teacher_ID WHERE T2.Course = "Math"
Show the name of the teacher for the math course.
CREATE TABLE "course" ( "Course_ID" int, "Staring_Date" text, "Course" text, PRIMARY KEY ("Course_ID") ); CREATE TABLE "teacher" ( "Teacher_ID" int, "Name" text, "Age" text, "Hometown" text, PRIMARY KEY ("Teacher_ID") ); CREATE TABLE "course_arrange" ( "Course_ID" int, "Teacher_ID" int, "Grade" int, PRIMARY KEY ("Cours...
CREATE TABLE course (Course_ID INT, Staring_Date TEXT, Course TEXT); CREATE TABLE teacher (Teacher_ID INT, Name TEXT, Age TEXT, Hometown TEXT); CREATE TABLE course_arrange (Course_ID INT, Teacher_ID INT, Grade INT);
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "course" ( "Course_ID" int, "Staring_Date" text, "Course" text, PRIMARY KEY ("Course_ID") ); CREATE TABLE "teacher" ( "Teacher_ID" int, "Name" text, "Age" text, "...
museum_visit
SELECT count(*) FROM visitor WHERE age < 30
How many visitors below age 30 are there?
CREATE TABLE "museum" ( "Museum_ID" int, "Name" text, "Num_of_Staff" int, "Open_Year" text, PRIMARY KEY ("Museum_ID") ); CREATE TABLE "visitor" ( "ID" int, "Name" text, "Level_of_membership" int, "Age" int, PRIMARY KEY ("ID") ); CREATE TABLE "visit" ( "Museum_ID" int, "visitor_ID" text, "Num_of_Ticket" int, "Total_spen...
CREATE TABLE museum (Museum_ID INT, Name TEXT, Num_of_Staff INT, Open_Year TEXT); CREATE TABLE visitor (ID INT, Name TEXT, Level_of_membership INT, Age INT); CREATE TABLE visit (Museum_ID INT, visitor_ID TEXT, Num_of_Ticket INT, Total_spent 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 "museum" ( "Museum_ID" int, "Name" text, "Num_of_Staff" int, "Open_Year" text, PRIMARY KEY ("Museum_ID") ); CREATE TABLE "visitor" ( "ID" int, "Name" text, "Level...
museum_visit
SELECT name FROM visitor WHERE Level_of_membership > 4 ORDER BY Level_of_membership DESC
Find the names of the visitors whose membership level is higher than 4, and order the results by the level from high to low.
CREATE TABLE "museum" ( "Museum_ID" int, "Name" text, "Num_of_Staff" int, "Open_Year" text, PRIMARY KEY ("Museum_ID") ); CREATE TABLE "visitor" ( "ID" int, "Name" text, "Level_of_membership" int, "Age" int, PRIMARY KEY ("ID") ); CREATE TABLE "visit" ( "Museum_ID" int, "visitor_ID" text, "Num_of_Ticket" int, "Total_spen...
CREATE TABLE museum (Museum_ID INT, Name TEXT, Num_of_Staff INT, Open_Year TEXT); CREATE TABLE visitor (ID INT, Name TEXT, Level_of_membership INT, Age INT); CREATE TABLE visit (Museum_ID INT, visitor_ID TEXT, Num_of_Ticket INT, Total_spent 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 "museum" ( "Museum_ID" int, "Name" text, "Num_of_Staff" int, "Open_Year" text, PRIMARY KEY ("Museum_ID") ); CREATE TABLE "visitor" ( "ID" int, "Name" text, "Level...
museum_visit
SELECT avg(age) FROM visitor WHERE Level_of_membership <= 4
What is the average age of the visitors whose membership level is not higher than 4?
CREATE TABLE "museum" ( "Museum_ID" int, "Name" text, "Num_of_Staff" int, "Open_Year" text, PRIMARY KEY ("Museum_ID") ); CREATE TABLE "visitor" ( "ID" int, "Name" text, "Level_of_membership" int, "Age" int, PRIMARY KEY ("ID") ); CREATE TABLE "visit" ( "Museum_ID" int, "visitor_ID" text, "Num_of_Ticket" int, "Total_spen...
CREATE TABLE museum (Museum_ID INT, Name TEXT, Num_of_Staff INT, Open_Year TEXT); CREATE TABLE visitor (ID INT, Name TEXT, Level_of_membership INT, Age INT); CREATE TABLE visit (Museum_ID INT, visitor_ID TEXT, Num_of_Ticket INT, Total_spent 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 "museum" ( "Museum_ID" int, "Name" text, "Num_of_Staff" int, "Open_Year" text, PRIMARY KEY ("Museum_ID") ); CREATE TABLE "visitor" ( "ID" int, "Name" text, "Level...
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
1