Question:
How many singers do we have?
Additional table information: table: concert_singer

Answer: SELECT COUNT(*) FROM singer


Question:
What is the total number of singers?
Additional table information: table: concert_singer

Answer: SELECT COUNT(*) FROM singer


Question:
Show name, country, age for all singers ordered by age from the oldest to the youngest.
Additional table information: table: concert_singer

Answer: SELECT name, country, age FROM singer ORDER BY age DESC


Question:
What are the names, countries, and ages for every singer in descending order of age?
Additional table information: table: concert_singer

Answer: SELECT name, country, age FROM singer ORDER BY age DESC


Question:
What is the average, minimum, and maximum age of all singers from France?
Additional table information: table: concert_singer

Answer: SELECT AVG(age), MIN(age), MAX(age) FROM singer WHERE country = 'France'


Question:
What is the average, minimum, and maximum age for all French singers?
Additional table information: table: concert_singer

Answer: SELECT AVG(age), MIN(age), MAX(age) FROM singer WHERE country = 'France'


Question:
Show the name and the release year of the song by the youngest singer.
Additional table information: table: concert_singer

Answer: SELECT song_name, song_release_year FROM singer ORDER BY age NULLS FIRST LIMIT 1


Question:
What are the names and release years for all the songs of the youngest singer?
Additional table information: table: concert_singer

Answer: SELECT song_name, song_release_year FROM singer ORDER BY age NULLS FIRST LIMIT 1


Question:
What are all distinct countries where singers above age 20 are from?
Additional table information: table: concert_singer

Answer: SELECT DISTINCT country FROM singer WHERE age > 20


Question:
What are  the different countries with singers above age 20?
Additional table information: table: concert_singer

Answer: SELECT DISTINCT country FROM singer WHERE age > 20


Question:
Show all countries and the number of singers in each country.
Additional table information: table: concert_singer

Answer: SELECT country, COUNT(*) FROM singer GROUP BY country


Question:
How many singers are from each country?
Additional table information: table: concert_singer

Answer: SELECT country, COUNT(*) FROM singer GROUP BY country


Question:
List all song names by singers above the average age.
Additional table information: table: concert_singer

Answer: SELECT song_name FROM singer WHERE age > (SELECT AVG(age) FROM singer)


Question:
What are all the song names by singers who are older than average?
Additional table information: table: concert_singer

Answer: SELECT song_name FROM singer WHERE age > (SELECT AVG(age) FROM singer)


Question:
Show location and name for all stadiums with a capacity between 5000 and 10000.
Additional table information: table: concert_singer

Answer: SELECT LOCATION, name FROM stadium WHERE capacity BETWEEN 5000 AND 10000


Question:
What are the locations and names of all stations with capacity between 5000 and 10000?
Additional table information: table: concert_singer

Answer: SELECT LOCATION, name FROM stadium WHERE capacity BETWEEN 5000 AND 10000


Question:
What is the maximum capacity and the average of all stadiums ?
Additional table information: table: concert_singer

Answer: SELECT MAX(capacity), average FROM stadium


Question:
What is the average and maximum capacities for all stadiums ?
Additional table information: table: concert_singer

Answer: SELECT AVG(capacity), MAX(capacity) FROM stadium


Question:
What is the name and capacity for the stadium with highest average attendance?
Additional table information: table: concert_singer

Answer: SELECT name, capacity FROM stadium ORDER BY average DESC LIMIT 1


Question:
What is the name and capacity for the stadium with the highest average attendance?
Additional table information: table: concert_singer

Answer: SELECT name, capacity FROM stadium ORDER BY average DESC LIMIT 1


Question:
How many concerts are there in year 2014 or 2015?
Additional table information: table: concert_singer

Answer: SELECT COUNT(*) FROM concert WHERE YEAR = 2014 OR YEAR = 2015


Question:
How many concerts occurred in 2014 or 2015?
Additional table information: table: concert_singer

Answer: SELECT COUNT(*) FROM concert WHERE YEAR = 2014 OR YEAR = 2015


Question:
Show the stadium name and the number of concerts in each stadium.
Additional table information: table: concert_singer

Answer: SELECT T2.name, COUNT(*) FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id GROUP BY T1.stadium_id


Question:
For each stadium, how many concerts play there?
Additional table information: table: concert_singer

Answer: SELECT T2.name, COUNT(*) FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id GROUP BY T1.stadium_id


Question:
Show the stadium name and capacity with most number of concerts in year 2014 or after.
Additional table information: table: concert_singer

Answer: SELECT T2.name, T2.capacity FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.year >= 2014 GROUP BY T2.stadium_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the name and capacity of the stadium with the most concerts after 2013?
Additional table information: table: concert_singer

Answer: SELECT t2.name, t2.capacity FROM concert AS t1 JOIN stadium AS t2 ON t1.stadium_id = t2.stadium_id WHERE t1.year > 2013 GROUP BY t2.stadium_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
Which year has most number of concerts?
Additional table information: table: concert_singer

Answer: SELECT YEAR FROM concert GROUP BY YEAR ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the year that had the most concerts?
Additional table information: table: concert_singer

Answer: SELECT YEAR FROM concert GROUP BY YEAR ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show the stadium names without any concert.
Additional table information: table: concert_singer

Answer: SELECT name FROM stadium WHERE NOT stadium_id IN (SELECT stadium_id FROM concert)


Question:
What are the names of the stadiums without any concerts?
Additional table information: table: concert_singer

Answer: SELECT name FROM stadium WHERE NOT stadium_id IN (SELECT stadium_id FROM concert)


Question:
Show countries where a singer above age 40 and a singer below 30 are from.
Additional table information: table: concert_singer

Answer: SELECT country FROM singer WHERE age > 40 INTERSECT SELECT country FROM singer WHERE age < 30


Question:
Show names for all stadiums except for stadiums having a concert in year 2014.
Additional table information: table: concert_singer

Answer: SELECT name FROM stadium EXCEPT SELECT T2.name FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.year = 2014


Question:
What are the names of all stadiums that did not have a concert in 2014?
Additional table information: table: concert_singer

Answer: SELECT name FROM stadium EXCEPT SELECT T2.name FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.year = 2014


Question:
Show the name and theme for all concerts and the number of singers in each concert.
Additional table information: table: concert_singer

Answer: SELECT T2.concert_name, T2.theme, COUNT(*) FROM singer_in_concert AS T1 JOIN concert AS T2 ON T1.concert_id = T2.concert_id GROUP BY T2.concert_id


Question:
What are the names , themes , and number of singers for every concert ?
Additional table information: table: concert_singer

Answer: SELECT t2.concert_name, t2.theme, COUNT(*) FROM singer_in_concert AS t1 JOIN concert AS t2 ON t1.concert_id = t2.concert_id GROUP BY t2.concert_id


Question:
List singer names and number of concerts for each singer.
Additional table information: table: concert_singer

Answer: SELECT T2.name, COUNT(*) FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id = T2.singer_id GROUP BY T2.singer_id


Question:
What are the names of the singers and number of concerts for each person?
Additional table information: table: concert_singer

Answer: SELECT T2.name, COUNT(*) FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id = T2.singer_id GROUP BY T2.singer_id


Question:
List all singer names in concerts in year 2014.
Additional table information: table: concert_singer

Answer: SELECT T2.name FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id = T2.singer_id JOIN concert AS T3 ON T1.concert_id = T3.concert_id WHERE T3.year = 2014


Question:
What are the names of the singers who performed in a concert in 2014?
Additional table information: table: concert_singer

Answer: SELECT T2.name FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id = T2.singer_id JOIN concert AS T3 ON T1.concert_id = T3.concert_id WHERE T3.year = 2014


Question:
what is the name and nation of the singer who have a song having 'Hey' in its name?
Additional table information: table: concert_singer

Answer: SELECT name, country FROM singer WHERE song_name LIKE '%Hey%'


Question:
What is the name and country of origin of every singer who has a song with the word 'Hey' in its title?
Additional table information: table: concert_singer

Answer: SELECT name, country FROM singer WHERE song_name LIKE '%Hey%'


Question:
Find the name and location of the stadiums which some concerts happened in the years of both 2014 and 2015.
Additional table information: table: concert_singer

Answer: SELECT T2.name, T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2014 INTERSECT SELECT T2.name, T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2015


Question:
What are the names and locations of the stadiums that had concerts that occurred in both 2014 and 2015?
Additional table information: table: concert_singer

Answer: SELECT T2.name, T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2014 INTERSECT SELECT T2.name, T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2015


Question:
Find the number of concerts happened in the stadium with the highest capacity .
Additional table information: table: concert_singer

Answer: SELECT COUNT(*) FROM concert WHERE stadium_id = (SELECT stadium_id FROM stadium ORDER BY capacity DESC LIMIT 1)


Question:
What are the number of concerts that occurred in the stadium with the largest capacity ?
Additional table information: table: concert_singer

Answer: SELECT COUNT(*) FROM concert WHERE stadium_id = (SELECT stadium_id FROM stadium ORDER BY capacity DESC LIMIT 1)


Question:
Find the number of pets whose weight is heavier than 10.
Additional table information: table: pets_1

Answer: SELECT COUNT(*) FROM pets WHERE weight > 10


Question:
How many pets have a greater weight than 10?
Additional table information: table: pets_1

Answer: SELECT COUNT(*) FROM pets WHERE weight > 10


Question:
Find the weight of the youngest dog.
Additional table information: table: pets_1

Answer: SELECT weight FROM pets ORDER BY pet_age NULLS FIRST LIMIT 1


Question:
How much does the youngest dog weigh?
Additional table information: table: pets_1

Answer: SELECT weight FROM pets ORDER BY pet_age NULLS FIRST LIMIT 1


Question:
Find the maximum weight for each type of pet. List the maximum weight and pet type.
Additional table information: table: pets_1

Answer: SELECT MAX(weight), petType FROM pets GROUP BY petType


Question:
List the maximum weight and type for each type of pet.
Additional table information: table: pets_1

Answer: SELECT MAX(weight), petType FROM pets GROUP BY petType


Question:
Find number of pets owned by students who are older than 20.
Additional table information: table: pets_1

Answer: SELECT COUNT(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid WHERE T1.age > 20


Question:
How many pets are owned by students that have an age greater than 20?
Additional table information: table: pets_1

Answer: SELECT COUNT(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid WHERE T1.age > 20


Question:
Find the number of dog pets that are raised by female students (with sex F).
Additional table information: table: pets_1

Answer: SELECT COUNT(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T2.petid = T3.petid WHERE T1.sex = 'F' AND T3.pettype = 'dog'


Question:
How many dog pets are raised by female students?
Additional table information: table: pets_1

Answer: SELECT COUNT(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T2.petid = T3.petid WHERE T1.sex = 'F' AND T3.pettype = 'dog'


Question:
Find the number of distinct type of pets.
Additional table information: table: pets_1

Answer: SELECT COUNT(DISTINCT pettype) FROM pets


Question:
How many different types of pet are there?
Additional table information: table: pets_1

Answer: SELECT COUNT(DISTINCT pettype) FROM pets


Question:
Find the first name of students who have cat or dog pet.
Additional table information: table: pets_1

Answer: SELECT DISTINCT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat' OR T3.pettype = 'dog'


Question:
What are the first names of every student who has a cat or dog as a pet?
Additional table information: table: pets_1

Answer: SELECT DISTINCT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat' OR T3.pettype = 'dog'


Question:
Find the first name of students who have both cat and dog pets .
Additional table information: table: pets_1

Answer: SELECT t1.fname FROM student AS t1 JOIN has_pet AS t2 ON t1.stuid = t2.stuid JOIN pets AS t3 ON t3.petid = t2.petid WHERE t3.pettype = 'cat' INTERSECT SELECT t1.fname FROM student AS t1 JOIN has_pet AS t2 ON t1.stuid = t2.stuid JOIN pets AS t3 ON t3.petid = t2.petid WHERE t3.pettype = 'dog'


Question:
What are the students' first names who have both cats and dogs as pets?
Additional table information: table: pets_1

Answer: SELECT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat' INTERSECT SELECT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'dog'


Question:
Find the major and age of students who do not have a cat pet.
Additional table information: table: pets_1

Answer: SELECT major, age FROM student WHERE NOT stuid IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat')


Question:
What major is every student who does not own a cat as a pet, and also how old are they?
Additional table information: table: pets_1

Answer: SELECT major, age FROM student WHERE NOT stuid IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat')


Question:
Find the id of students who do not have a cat pet.
Additional table information: table: pets_1

Answer: SELECT stuid FROM student EXCEPT SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat'


Question:
What are the ids of the students who do not own cats as pets?
Additional table information: table: pets_1

Answer: SELECT stuid FROM student EXCEPT SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat'


Question:
Find the first name and age of students who have a dog but do not have a cat as a pet.
Additional table information: table: pets_1

Answer: 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 NOT T1.stuid IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat')


Question:
What is the first name of every student who has a dog but does not have a cat?
Additional table information: table: pets_1

Answer: 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 NOT T1.stuid IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat')


Question:
Find the type and weight of the youngest pet.
Additional table information: table: pets_1

Answer: SELECT pettype, weight FROM pets ORDER BY pet_age NULLS FIRST LIMIT 1


Question:
What type of pet is the youngest animal, and how much does it weigh?
Additional table information: table: pets_1

Answer: SELECT pettype, weight FROM pets ORDER BY pet_age NULLS FIRST LIMIT 1


Question:
Find the id and weight of all pets whose age is older than 1.
Additional table information: table: pets_1

Answer: SELECT petid, weight FROM pets WHERE pet_age > 1


Question:
What is the id and weight of every pet who is older than 1?
Additional table information: table: pets_1

Answer: SELECT petid, weight FROM pets WHERE pet_age > 1


Question:
Find the average and maximum age for each type of pet.
Additional table information: table: pets_1

Answer: SELECT AVG(pet_age), MAX(pet_age), pettype FROM pets GROUP BY pettype


Question:
What is the average and maximum age for each pet type?
Additional table information: table: pets_1

Answer: SELECT AVG(pet_age), MAX(pet_age), pettype FROM pets GROUP BY pettype


Question:
Find the average weight for each pet type.
Additional table information: table: pets_1

Answer: SELECT AVG(weight), pettype FROM pets GROUP BY pettype


Question:
What is the average weight for each type of pet?
Additional table information: table: pets_1

Answer: SELECT AVG(weight), pettype FROM pets GROUP BY pettype


Question:
Find the first name and age of students who have a pet.
Additional table information: table: pets_1

Answer: SELECT DISTINCT T1.fname, T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid


Question:
What are the different first names and ages of the students who do have pets?
Additional table information: table: pets_1

Answer: SELECT DISTINCT T1.fname, T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid


Question:
Find the id of the pet owned by student whose last name is ‘Smith’.
Additional table information: table: pets_1

Answer: SELECT T2.petid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid WHERE T1.Lname = 'Smith'


Question:
What is the id of the pet owned by the student whose last name is 'Smith'?
Additional table information: table: pets_1

Answer: SELECT T2.petid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid WHERE T1.Lname = 'Smith'


Question:
Find the number of pets for each student who has any pet and student id.
Additional table information: table: pets_1

Answer: SELECT COUNT(*), T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid GROUP BY T1.stuid


Question:
For students who have pets , how many pets does each student have ? list their ids instead of names .
Additional table information: table: pets_1

Answer: SELECT COUNT(*), t1.stuid FROM student AS t1 JOIN has_pet AS t2 ON t1.stuid = t2.stuid GROUP BY t1.stuid


Question:
Find the first name and gender of student who have more than one pet.
Additional table information: table: pets_1

Answer: 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


Question:
What is the first name and gender of the all the students who have more than one pet?
Additional table information: table: pets_1

Answer: 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


Question:
Find the last name of the student who has a cat that is age 3.
Additional table information: table: pets_1

Answer: 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'


Question:
What is the last name of the student who has a cat that is 3 years old?
Additional table information: table: pets_1

Answer: 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'


Question:
Find the average age of students who do not have any pet .
Additional table information: table: pets_1

Answer: SELECT AVG(age) FROM student WHERE NOT stuid IN (SELECT stuid FROM has_pet)


Question:
What is the average age for all students who do not own any pets ?
Additional table information: table: pets_1

Answer: SELECT AVG(age) FROM student WHERE NOT stuid IN (SELECT stuid FROM has_pet)


Question:
How many continents are there?
Additional table information: table: car_1

Answer: SELECT COUNT(*) FROM CONTINENTS


Question:
What is the number of continents?
Additional table information: table: car_1

Answer: SELECT COUNT(*) FROM CONTINENTS


Question:
How many countries does each continent have? List the continent id, continent name and the number of countries.
Additional table information: table: car_1

Answer: SELECT T1.ContId, T1.Continent, COUNT(*) FROM CONTINENTS AS T1 JOIN COUNTRIES AS T2 ON T1.ContId = T2.Continent GROUP BY T1.ContId


Question:
For each continent, list its id, name, and how many countries it has?
Additional table information: table: car_1

Answer: SELECT T1.ContId, T1.Continent, COUNT(*) FROM CONTINENTS AS T1 JOIN COUNTRIES AS T2 ON T1.ContId = T2.Continent GROUP BY T1.ContId


Question:
How many countries are listed?
Additional table information: table: car_1

Answer: SELECT COUNT(*) FROM COUNTRIES


Question:
How many countries exist?
Additional table information: table: car_1

Answer: SELECT COUNT(*) FROM COUNTRIES


Question:
How many models does each car maker produce? List maker full name, id and the number.
Additional table information: table: car_1

Answer: 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


Question:
What is the full name of each car maker, along with its id and how many models it produces?
Additional table information: table: car_1

Answer: 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


Question:
Which model of the car has the minimum horsepower?
Additional table information: table: car_1

Answer: SELECT T1.Model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id ORDER BY T2.horsepower ASC NULLS FIRST LIMIT 1


Question:
What is the model of the car with the smallest amount of horsepower?
Additional table information: table: car_1

Answer: SELECT T1.Model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id ORDER BY T2.horsepower ASC NULLS FIRST LIMIT 1


Question:
Find the model of the car whose weight is below the average weight.
Additional table information: table: car_1

Answer: 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)


Question:
What is the model for the car with a weight smaller than the average?
Additional table information: table: car_1

Answer: 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)


Question:
Find the name of the makers that produced some cars in the year of 1970?
Additional table information: table: car_1

Answer: 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'


Question:
What is the name of the different car makers who produced a car in 1970?
Additional table information: table: car_1

Answer: 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'


Question:
Find the make and production time of the cars that were produced in the earliest year?
Additional table information: table: car_1

Answer: 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)


Question:
What is the maker of the carr produced in the earliest year and what year was it?
Additional table information: table: car_1

Answer: 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)


Question:
Which distinct car models are the produced after 1980?
Additional table information: table: car_1

Answer: 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


Question:
What are the different models for the cards produced after 1980?
Additional table information: table: car_1

Answer: 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


Question:
How many car makers are there in each continents? List the continent name and the count.
Additional table information: table: car_1

Answer: 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


Question:
What is the name of each continent and how many car makers are there in each one?
Additional table information: table: car_1

Answer: 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


Question:
Which of the countries has the most car makers? List the country name.
Additional table information: table: car_1

Answer: SELECT T2.CountryName FROM CAR_MAKERS AS T1 JOIN COUNTRIES AS T2 ON T1.Country = T2.CountryId GROUP BY T1.Country ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the name of the country with the most car makers?
Additional table information: table: car_1

Answer: SELECT T2.CountryName FROM CAR_MAKERS AS T1 JOIN COUNTRIES AS T2 ON T1.Country = T2.CountryId GROUP BY T1.Country ORDER BY COUNT(*) DESC LIMIT 1


Question:
How many car models are produced by each maker ? Only list the count and the maker full name .
Additional table information: table: car_1

Answer: SELECT COUNT(*), t2.fullname FROM model_list AS t1 JOIN car_makers AS t2 ON t1.maker = t2.id GROUP BY t2.id


Question:
What is the number of car models that are produced by each maker and what is the id and full name of each maker?
Additional table information: table: car_1

Answer: SELECT COUNT(*), T2.FullName, T2.id FROM MODEL_LIST AS T1 JOIN CAR_MAKERS AS T2 ON T1.Maker = T2.Id GROUP BY T2.id


Question:
What is the accelerate of the car make amc hornet sportabout (sw)?
Additional table information: table: car_1

Answer: SELECT T1.Accelerate FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id = T2.MakeId WHERE T2.Make = 'amc hornet sportabout (sw)'


Question:
How much does the car accelerate that makes amc hornet sportabout (sw)?
Additional table information: table: car_1

Answer: SELECT T1.Accelerate FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id = T2.MakeId WHERE T2.Make = 'amc hornet sportabout (sw)'


Question:
How many car makers are there in france?
Additional table information: table: car_1

Answer: SELECT COUNT(*) FROM CAR_MAKERS AS T1 JOIN COUNTRIES AS T2 ON T1.Country = T2.CountryId WHERE T2.CountryName = 'france'


Question:
What is the number of makers of care in France?
Additional table information: table: car_1

Answer: SELECT COUNT(*) FROM CAR_MAKERS AS T1 JOIN COUNTRIES AS T2 ON T1.Country = T2.CountryId WHERE T2.CountryName = 'france'


Question:
How many car models are produced in the usa?
Additional table information: table: car_1

Answer: SELECT COUNT(*) FROM MODEL_LIST AS T1 JOIN CAR_MAKERS AS T2 ON T1.Maker = T2.Id JOIN COUNTRIES AS T3 ON T2.Country = T3.CountryId WHERE T3.CountryName = 'usa'


Question:
What is the count of the car models produced in the United States?
Additional table information: table: car_1

Answer: SELECT COUNT(*) FROM MODEL_LIST AS T1 JOIN CAR_MAKERS AS T2 ON T1.Maker = T2.Id JOIN COUNTRIES AS T3 ON T2.Country = T3.CountryId WHERE T3.CountryName = 'usa'


Question:
What is the average miles per gallon(mpg) of the cars with 4 cylinders?
Additional table information: table: car_1

Answer: SELECT AVG(mpg) FROM CARS_DATA WHERE Cylinders = 4


Question:
What is the average miles per gallon of all the cards with 4 cylinders?
Additional table information: table: car_1

Answer: SELECT AVG(mpg) FROM CARS_DATA WHERE Cylinders = 4


Question:
What is the smallest weight of the car produced with 8 cylinders on 1974 ?
Additional table information: table: car_1

Answer: SELECT MIN(weight) FROM cars_data WHERE cylinders = 8 AND year = 1974


Question:
What is the minimum weight of the car with 8 cylinders produced in 1974 ?
Additional table information: table: car_1

Answer: SELECT MIN(weight) FROM cars_data WHERE cylinders = 8 AND year = 1974


Question:
What are all the makers and models?
Additional table information: table: car_1

Answer: SELECT Maker, Model FROM MODEL_LIST


Question:
What are the makers and models?
Additional table information: table: car_1

Answer: SELECT Maker, Model FROM MODEL_LIST


Question:
What are the countries having at least one car maker? List name and id.
Additional table information: table: car_1

Answer: SELECT T1.CountryName, T1.CountryId FROM COUNTRIES AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId = T2.Country GROUP BY T1.CountryId HAVING COUNT(*) >= 1


Question:
What are the names and ids of all countries with at least one car maker?
Additional table information: table: car_1

Answer: SELECT T1.CountryName, T1.CountryId FROM COUNTRIES AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId = T2.Country GROUP BY T1.CountryId HAVING COUNT(*) >= 1


Question:
What is the number of the cars with horsepower more than 150?
Additional table information: table: car_1

Answer: SELECT COUNT(*) FROM CARS_DATA WHERE horsepower > 150


Question:
What is the number of cars with a horsepower greater than 150?
Additional table information: table: car_1

Answer: SELECT COUNT(*) FROM CARS_DATA WHERE horsepower > 150


Question:
What is the average weight of cars each year?
Additional table information: table: car_1

Answer: SELECT AVG(Weight), YEAR FROM CARS_DATA GROUP BY YEAR


Question:
What is the average weight and year for each year?
Additional table information: table: car_1

Answer: SELECT AVG(Weight), YEAR FROM CARS_DATA GROUP BY YEAR


Question:
Which countries in europe have at least 3 car manufacturers?
Additional table information: table: car_1

Answer: SELECT T1.CountryName FROM COUNTRIES AS T1 JOIN CONTINENTS AS T2 ON T1.Continent = T2.ContId JOIN CAR_MAKERS AS T3 ON T1.CountryId = T3.Country WHERE T2.Continent = 'europe' GROUP BY T1.CountryName HAVING COUNT(*) >= 3


Question:
What are the names of all European countries with at least 3 manufacturers?
Additional table information: table: car_1

Answer: SELECT T1.CountryName FROM COUNTRIES AS T1 JOIN CONTINENTS AS T2 ON T1.Continent = T2.ContId JOIN CAR_MAKERS AS T3 ON T1.CountryId = T3.Country WHERE T2.Continent = 'europe' GROUP BY T1.CountryName HAVING COUNT(*) >= 3


Question:
What is the maximum horsepower and the make of the car models with 3 cylinders?
Additional table information: table: car_1

Answer: SELECT T2.horsepower, T1.Make FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id WHERE T2.cylinders = 3 ORDER BY T2.horsepower DESC LIMIT 1


Question:
What is the largest amount of horsepower for the models with 3 cylinders and what make is it?
Additional table information: table: car_1

Answer: SELECT T2.horsepower, T1.Make FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id WHERE T2.cylinders = 3 ORDER BY T2.horsepower DESC LIMIT 1


Question:
Which model saves the most gasoline? That is to say, have the maximum miles per gallon.
Additional table information: table: car_1

Answer: SELECT T1.Model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id ORDER BY T2.mpg DESC LIMIT 1


Question:
What is the car model with the highest mpg ?
Additional table information: table: car_1

Answer: SELECT t1.model FROM car_names AS t1 JOIN cars_data AS t2 ON t1.makeid = t2.id ORDER BY t2.mpg DESC LIMIT 1


Question:
What is the average horsepower of the cars before 1980?
Additional table information: table: car_1

Answer: SELECT AVG(horsepower) FROM CARS_DATA WHERE YEAR < 1980


Question:
What is the average horsepower for all cars produced before 1980 ?
Additional table information: table: car_1

Answer: SELECT AVG(horsepower) FROM cars_data WHERE year < 1980


Question:
What is the average edispl of the cars of model volvo?
Additional table information: table: car_1

Answer: SELECT AVG(T2.edispl) FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id WHERE T1.Model = 'volvo'


Question:
What is the average edispl for all volvos?
Additional table information: table: car_1

Answer: SELECT AVG(T2.edispl) FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id WHERE T1.Model = 'volvo'


Question:
What is the maximum accelerate for different number of cylinders?
Additional table information: table: car_1

Answer: SELECT MAX(Accelerate), Cylinders FROM CARS_DATA GROUP BY Cylinders


Question:
What is the maximum accelerate for all the different cylinders?
Additional table information: table: car_1

Answer: SELECT MAX(Accelerate), Cylinders FROM CARS_DATA GROUP BY Cylinders


Question:
Which model has the most version(make) of cars?
Additional table information: table: car_1

Answer: SELECT Model FROM CAR_NAMES GROUP BY Model ORDER BY COUNT(*) DESC LIMIT 1


Question:
What model has the most different versions?
Additional table information: table: car_1

Answer: SELECT Model FROM CAR_NAMES GROUP BY Model ORDER BY COUNT(*) DESC LIMIT 1


Question:
How many cars have more than 4 cylinders?
Additional table information: table: car_1

Answer: SELECT COUNT(*) FROM CARS_DATA WHERE Cylinders > 4


Question:
What is the number of cars with more than 4 cylinders?
Additional table information: table: car_1

Answer: SELECT COUNT(*) FROM CARS_DATA WHERE Cylinders > 4


Question:
how many cars were produced in 1980?
Additional table information: table: car_1

Answer: SELECT COUNT(*) FROM CARS_DATA WHERE YEAR = 1980


Question:
In 1980, how many cars were made?
Additional table information: table: car_1

Answer: SELECT COUNT(*) FROM CARS_DATA WHERE YEAR = 1980


Question:
How many car models were produced by the maker with full name American Motor Company?
Additional table information: table: car_1

Answer: SELECT COUNT(*) FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker WHERE T1.FullName = 'American Motor Company'


Question:
What is the number of car models created by the car maker American Motor Company?
Additional table information: table: car_1

Answer: SELECT COUNT(*) FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker WHERE T1.FullName = 'American Motor Company'


Question:
Which makers designed more than 3 car models? List full name and the id.
Additional table information: table: car_1

Answer: SELECT T1.FullName, T1.Id FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker GROUP BY T1.Id HAVING COUNT(*) > 3


Question:
What are the names and ids of all makers with more than 3 models?
Additional table information: table: car_1

Answer: SELECT T1.FullName, T1.Id FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker GROUP BY T1.Id HAVING COUNT(*) > 3


Question:
Which distinctive models are produced by maker with the full name General Motors or weighing more than 3500?
Additional table information: table: car_1

Answer: SELECT DISTINCT T2.Model FROM CAR_NAMES AS T1 JOIN MODEL_LIST AS T2 ON T1.Model = T2.Model JOIN CAR_MAKERS AS T3 ON T2.Maker = T3.Id JOIN CARS_DATA AS T4 ON T1.MakeId = T4.Id WHERE T3.FullName = 'General Motors' OR T4.weight > 3500


Question:
What are the different models created by either the car maker General Motors or weighed more than 3500?
Additional table information: table: car_1

Answer: SELECT DISTINCT T2.Model FROM CAR_NAMES AS T1 JOIN MODEL_LIST AS T2 ON T1.Model = T2.Model JOIN CAR_MAKERS AS T3 ON T2.Maker = T3.Id JOIN CARS_DATA AS T4 ON T1.MakeId = T4.Id WHERE T3.FullName = 'General Motors' OR T4.weight > 3500


Question:
In which years cars were produced weighing no less than 3000 and no more than 4000 ?
Additional table information: table: car_1

Answer: SELECT DISTINCT year FROM cars_data WHERE weight BETWEEN 3000 AND 4000


Question:
What are the different years in which there were cars produced that weighed less than 4000 and also cars that weighted more than 3000 ?
Additional table information: table: car_1

Answer: SELECT DISTINCT year FROM cars_data WHERE weight BETWEEN 3000 AND 4000


Question:
What is the horsepower of the car with the largest accelerate?
Additional table information: table: car_1

Answer: SELECT T1.horsepower FROM CARS_DATA AS T1 ORDER BY T1.accelerate DESC LIMIT 1


Question:
What is the horsepower of the car with the greatest accelerate?
Additional table information: table: car_1

Answer: SELECT T1.horsepower FROM CARS_DATA AS T1 ORDER BY T1.accelerate DESC LIMIT 1


Question:
For model volvo, how many cylinders does the car with the least accelerate have?
Additional table information: table: car_1

Answer: SELECT T1.cylinders FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id = T2.MakeId WHERE T2.Model = 'volvo' ORDER BY T1.accelerate ASC NULLS FIRST LIMIT 1


Question:
For a volvo model, how many cylinders does the version with least accelerate have?
Additional table information: table: car_1

Answer: SELECT T1.cylinders FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id = T2.MakeId WHERE T2.Model = 'volvo' ORDER BY T1.accelerate ASC NULLS FIRST LIMIT 1


Question:
How many cars have a larger accelerate than the car with the largest horsepower?
Additional table information: table: car_1

Answer: SELECT COUNT(*) FROM CARS_DATA WHERE Accelerate > (SELECT Accelerate FROM CARS_DATA ORDER BY Horsepower DESC LIMIT 1)


Question:
What is the number of cars with a greater accelerate than the one with the most horsepower?
Additional table information: table: car_1

Answer: SELECT COUNT(*) FROM CARS_DATA WHERE Accelerate > (SELECT Accelerate FROM CARS_DATA ORDER BY Horsepower DESC LIMIT 1)


Question:
How many countries has more than 2 car makers ?
Additional table information: table: car_1

Answer: SELECT COUNT(*) FROM countries AS t1 JOIN car_makers AS t2 ON t1.countryid = t2.country GROUP BY t1.countryid HAVING COUNT(*) > 2


Question:
What is the number of countries with more than 2 car makers ?
Additional table information: table: car_1

Answer: SELECT COUNT(*) FROM countries AS t1 JOIN car_makers AS t2 ON t1.countryid = t2.country GROUP BY t1.countryid HAVING COUNT(*) > 2


Question:
How many cars has over 6 cylinders?
Additional table information: table: car_1

Answer: SELECT COUNT(*) FROM CARS_DATA WHERE Cylinders > 6


Question:
What is the number of carsw ith over 6 cylinders?
Additional table information: table: car_1

Answer: SELECT COUNT(*) FROM CARS_DATA WHERE Cylinders > 6


Question:
For the cars with 4 cylinders, which model has the largest horsepower?
Additional table information: table: car_1

Answer: SELECT T1.Model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id WHERE T2.Cylinders = 4 ORDER BY T2.horsepower DESC LIMIT 1


Question:
For all of the 4 cylinder cars, which model has the most horsepower?
Additional table information: table: car_1

Answer: SELECT T1.Model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id WHERE T2.Cylinders = 4 ORDER BY T2.horsepower DESC LIMIT 1


Question:
Among the cars with more than lowest horsepower, which ones do not have more than 3 cylinders? List the car makeid and make name.
Additional table information: table: car_1

Answer: SELECT T2.MakeId, T2.Make FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id = T2.MakeId WHERE T1.Horsepower > (SELECT MIN(Horsepower) FROM CARS_DATA) AND T1.Cylinders <= 3


Question:
Among the cars that do not have the minimum horsepower , what are the make ids and names of all those with less than 4 cylinders ?
Additional table information: table: car_1

Answer: SELECT t2.makeid, t2.make FROM cars_data AS t1 JOIN car_names AS t2 ON t1.id = t2.makeid WHERE t1.horsepower > (SELECT MIN(horsepower) FROM cars_data) AND t1.cylinders < 4


Question:
What is the maximum miles per gallon of the car with 8 cylinders or produced before 1980 ?
Additional table information: table: car_1

Answer: SELECT MAX(mpg) FROM cars_data WHERE cylinders = 8 OR year < 1980


Question:
What is the maximum mpg of the cars that had 8 cylinders or that were produced before 1980 ?
Additional table information: table: car_1

Answer: SELECT MAX(mpg) FROM cars_data WHERE cylinders = 8 OR year < 1980


Question:
Which models are lighter than 3500 but not built by the 'Ford Motor Company'?
Additional table information: table: car_1

Answer: 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 JOIN CAR_MAKERS AS T4 ON T1.Maker = T4.Id WHERE T3.weight < 3500 AND T4.FullName <> 'Ford Motor Company'


Question:
What are the different models wthat are lighter than 3500 but were not built by the Ford Motor Company?
Additional table information: table: car_1

Answer: 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 JOIN CAR_MAKERS AS T4 ON T1.Maker = T4.Id WHERE T3.weight < 3500 AND T4.FullName <> 'Ford Motor Company'


Question:
What are the name of the countries where there is not a single car maker?
Additional table information: table: car_1

Answer: SELECT CountryName FROM countries EXCEPT SELECT T1.CountryName FROM countries AS T1 JOIN CAR_MAKERS AS T2 ON T1.countryId = T2.Country


Question:
What are the names of the countries with no car makers?
Additional table information: table: car_1

Answer: SELECT CountryName FROM countries EXCEPT SELECT T1.CountryName FROM countries AS T1 JOIN CAR_MAKERS AS T2 ON T1.countryId = T2.Country


Question:
Which are the car makers which produce at least 2 models and more than 3 car makers ? List the id and the maker .
Additional table information: table: car_1

Answer: SELECT t1.id, t1.maker FROM car_makers AS t1 JOIN model_list AS t2 ON t1.id = t2.maker GROUP BY t1.id HAVING COUNT(*) >= 2 INTERSECT SELECT t1.id, 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 GROUP BY t1.id HAVING COUNT(*) > 3


Question:
What are the ids and makers of all car makers that produce at least 2 models and make more than 3 cars?
Additional table information: table: car_1

Answer: SELECT T1.Id, T1.Maker FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker GROUP BY T1.Id HAVING COUNT(*) >= 2 INTERSECT SELECT T1.Id, 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 GROUP BY T1.Id HAVING COUNT(*) > 3


Question:
What are the id and names of the countries which have more than 3 car makers or produce the 'fiat' model?
Additional table information: table: car_1

Answer: SELECT T1.countryId, T1.CountryName FROM Countries AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId = T2.Country GROUP BY T1.countryId HAVING COUNT(*) > 3 UNION SELECT T1.countryId, T1.CountryName FROM Countries AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId = T2.Country JOIN MODEL_LIST AS T3 ON T2.Id = T3.Maker WHERE T3.Model = 'fiat'


Question:
What are the ids and names of all countries that either have more than 3 car makers or produce fiat model ?
Additional table information: table: car_1

Answer: SELECT t1.countryid, t1.countryname FROM countries AS t1 JOIN car_makers AS t2 ON t1.countryid = t2.country GROUP BY t1.countryid HAVING COUNT(*) > 3 UNION SELECT t1.countryid, t1.countryname FROM countries AS t1 JOIN car_makers AS t2 ON t1.countryid = t2.country JOIN model_list AS t3 ON t2.id = t3.maker WHERE t3.model = 'fiat'


Question:
Which country does Airline 'JetBlue Airways' belong to?
Additional table information: table: flight_2

Answer: SELECT Country FROM AIRLINES WHERE Airline = 'JetBlue Airways'


Question:
What country is Jetblue Airways affiliated with?
Additional table information: table: flight_2

Answer: SELECT Country FROM AIRLINES WHERE Airline = 'JetBlue Airways'


Question:
What is the abbreviation of Airline 'JetBlue Airways'?
Additional table information: table: flight_2

Answer: SELECT Abbreviation FROM AIRLINES WHERE Airline = 'JetBlue Airways'


Question:
Which abbreviation corresponds to Jetblue Airways?
Additional table information: table: flight_2

Answer: SELECT Abbreviation FROM AIRLINES WHERE Airline = 'JetBlue Airways'


Question:
List all airline names and their abbreviations in 'USA'.
Additional table information: table: flight_2

Answer: SELECT Airline, Abbreviation FROM AIRLINES WHERE Country = 'USA'


Question:
What are the airline names and abbreviations for airlines in the USA?
Additional table information: table: flight_2

Answer: SELECT Airline, Abbreviation FROM AIRLINES WHERE Country = 'USA'


Question:
List the airport code and name in the city of Anthony.
Additional table information: table: flight_2

Answer: SELECT AirportCode, AirportName FROM AIRPORTS WHERE city = 'Anthony'


Question:
Give the airport code and airport name corresonding to the city Anthony.
Additional table information: table: flight_2

Answer: SELECT AirportCode, AirportName FROM AIRPORTS WHERE city = 'Anthony'


Question:
How many airlines do we have?
Additional table information: table: flight_2

Answer: SELECT COUNT(*) FROM AIRLINES


Question:
What is the total number of airlines?
Additional table information: table: flight_2

Answer: SELECT COUNT(*) FROM AIRLINES


Question:
How many airports do we have?
Additional table information: table: flight_2

Answer: SELECT COUNT(*) FROM AIRPORTS


Question:
Return the number of  airports.
Additional table information: table: flight_2

Answer: SELECT COUNT(*) FROM AIRPORTS


Question:
How many flights do we have?
Additional table information: table: flight_2

Answer: SELECT COUNT(*) FROM FLIGHTS


Question:
Return the number of flights.
Additional table information: table: flight_2

Answer: SELECT COUNT(*) FROM FLIGHTS


Question:
Which airline has abbreviation 'UAL'?
Additional table information: table: flight_2

Answer: SELECT Airline FROM AIRLINES WHERE Abbreviation = 'UAL'


Question:
Give the airline with abbreviation 'UAL'.
Additional table information: table: flight_2

Answer: SELECT Airline FROM AIRLINES WHERE Abbreviation = 'UAL'


Question:
How many airlines are from USA?
Additional table information: table: flight_2

Answer: SELECT COUNT(*) FROM AIRLINES WHERE Country = 'USA'


Question:
Return the number of airlines in the USA.
Additional table information: table: flight_2

Answer: SELECT COUNT(*) FROM AIRLINES WHERE Country = 'USA'


Question:
Which city and country is the Alton airport at?
Additional table information: table: flight_2

Answer: SELECT City, Country FROM AIRPORTS WHERE AirportName = 'Alton'


Question:
Give the city and country for the Alton airport.
Additional table information: table: flight_2

Answer: SELECT City, Country FROM AIRPORTS WHERE AirportName = 'Alton'


Question:
What is the airport name for airport 'AKO'?
Additional table information: table: flight_2

Answer: SELECT AirportName FROM AIRPORTS WHERE AirportCode = 'AKO'


Question:
Return the name of the airport with code 'AKO'.
Additional table information: table: flight_2

Answer: SELECT AirportName FROM AIRPORTS WHERE AirportCode = 'AKO'


Question:
What are airport names at City 'Aberdeen'?
Additional table information: table: flight_2

Answer: SELECT AirportName FROM AIRPORTS WHERE City = 'Aberdeen'


Question:
What are the names of airports in Aberdeen?
Additional table information: table: flight_2

Answer: SELECT AirportName FROM AIRPORTS WHERE City = 'Aberdeen'


Question:
How many flights depart from 'APG'?
Additional table information: table: flight_2

Answer: SELECT COUNT(*) FROM FLIGHTS WHERE SourceAirport = 'APG'


Question:
Count the number of flights departing from 'APG'.
Additional table information: table: flight_2

Answer: SELECT COUNT(*) FROM FLIGHTS WHERE SourceAirport = 'APG'


Question:
How many flights have destination ATO?
Additional table information: table: flight_2

Answer: SELECT COUNT(*) FROM FLIGHTS WHERE DestAirport = 'ATO'


Question:
Count the number of flights into ATO.
Additional table information: table: flight_2

Answer: SELECT COUNT(*) FROM FLIGHTS WHERE DestAirport = 'ATO'


Question:
How many flights depart from City Aberdeen?
Additional table information: table: flight_2

Answer: SELECT COUNT(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.SourceAirport = T2.AirportCode WHERE T2.City = 'Aberdeen'


Question:
Return the number of flights departing from Aberdeen.
Additional table information: table: flight_2

Answer: SELECT COUNT(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.SourceAirport = T2.AirportCode WHERE T2.City = 'Aberdeen'


Question:
How many flights arriving in Aberdeen city?
Additional table information: table: flight_2

Answer: SELECT COUNT(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.City = 'Aberdeen'


Question:
Return the number of flights arriving in Aberdeen.
Additional table information: table: flight_2

Answer: SELECT COUNT(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.City = 'Aberdeen'


Question:
How many flights depart from City 'Aberdeen' and have destination City 'Ashley'?
Additional table information: table: flight_2

Answer: 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'


Question:
How many flights fly from Aberdeen to Ashley?
Additional table information: table: flight_2

Answer: 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'


Question:
How many flights does airline 'JetBlue Airways' have?
Additional table information: table: flight_2

Answer: SELECT COUNT(*) FROM FLIGHTS AS T1 JOIN AIRLINES AS T2 ON T1.Airline = T2.uid WHERE T2.Airline = 'JetBlue Airways'


Question:
Give the number of Jetblue Airways flights.
Additional table information: table: flight_2

Answer: SELECT COUNT(*) FROM FLIGHTS AS T1 JOIN AIRLINES AS T2 ON T1.Airline = T2.uid WHERE T2.Airline = 'JetBlue Airways'


Question:
How many 'United Airlines' flights go to Airport 'ASY'?
Additional table information: table: flight_2

Answer: SELECT COUNT(*) FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T2.Airline = T1.uid WHERE T1.Airline = 'United Airlines' AND T2.DestAirport = 'ASY'


Question:
Count the number of United Airlines flights arriving in ASY Airport.
Additional table information: table: flight_2

Answer: SELECT COUNT(*) FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T2.Airline = T1.uid WHERE T1.Airline = 'United Airlines' AND T2.DestAirport = 'ASY'


Question:
How many 'United Airlines' flights depart from Airport 'AHD'?
Additional table information: table: flight_2

Answer: SELECT COUNT(*) FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T2.Airline = T1.uid WHERE T1.Airline = 'United Airlines' AND T2.SourceAirport = 'AHD'


Question:
Return the number of United Airlines flights leaving from AHD Airport.
Additional table information: table: flight_2

Answer: SELECT COUNT(*) FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T2.Airline = T1.uid WHERE T1.Airline = 'United Airlines' AND T2.SourceAirport = 'AHD'


Question:
How many United Airlines flights go to City 'Aberdeen'?
Additional table information: table: flight_2

Answer: 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'


Question:
Count the number of United Airlines flights that arrive in Aberdeen.
Additional table information: table: flight_2

Answer: 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'


Question:
Which city has most number of arriving flights?
Additional table information: table: flight_2

Answer: 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


Question:
Which city has the most frequent destination airport?
Additional table information: table: flight_2

Answer: 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


Question:
Which city has most number of departing flights?
Additional table information: table: flight_2

Answer: 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


Question:
Which city is the most frequent source airport?
Additional table information: table: flight_2

Answer: 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


Question:
What is the code of airport that has the highest number of flights?
Additional table information: table: flight_2

Answer: 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


Question:
What is the airport code of the airport with the most flights?
Additional table information: table: flight_2

Answer: 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


Question:
What is the code of airport that has fewest number of flights?
Additional table information: table: flight_2

Answer: 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(*) NULLS FIRST LIMIT 1


Question:
Give the code of the airport with the least flights.
Additional table information: table: flight_2

Answer: 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(*) NULLS FIRST LIMIT 1


Question:
Which airline has most number of flights?
Additional table information: table: flight_2

Answer: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline ORDER BY COUNT(*) DESC LIMIT 1


Question:
What airline serves the most flights?
Additional table information: table: flight_2

Answer: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the abbreviation and country of the airline that has fewest number of flights?
Additional table information: table: flight_2

Answer: SELECT T1.Abbreviation, T1.Country FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline ORDER BY COUNT(*) NULLS FIRST LIMIT 1


Question:
What is the abbreviation of the airilne has the fewest flights and what country is it in?
Additional table information: table: flight_2

Answer: SELECT T1.Abbreviation, T1.Country FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline ORDER BY COUNT(*) NULLS FIRST LIMIT 1


Question:
What are airlines that have some flight departing from airport 'AHD'?
Additional table information: table: flight_2

Answer: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = 'AHD'


Question:
Which airlines have a flight with source airport AHD?
Additional table information: table: flight_2

Answer: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = 'AHD'


Question:
What are airlines that have flights arriving at airport 'AHD'?
Additional table information: table: flight_2

Answer: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.DestAirport = 'AHD'


Question:
Which airlines have a flight with destination airport AHD?
Additional table information: table: flight_2

Answer: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.DestAirport = 'AHD'


Question:
Find all airlines that have flights from both airports 'APG' and 'CVO'.
Additional table information: table: flight_2

Answer: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = 'APG' INTERSECT SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = 'CVO'


Question:
Which airlines have departing flights from both APG and CVO airports?
Additional table information: table: flight_2

Answer: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = 'APG' INTERSECT SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = 'CVO'


Question:
Find all airlines that have flights from airport 'CVO' but not from 'APG'.
Additional table information: table: flight_2

Answer: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = 'CVO' EXCEPT SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = 'APG'


Question:
Which airlines have departures from CVO but not from APG airports?
Additional table information: table: flight_2

Answer: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = 'CVO' EXCEPT SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = 'APG'


Question:
Find all airlines that have at least 10 flights.
Additional table information: table: flight_2

Answer: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline HAVING COUNT(*) > 10


Question:
Which airlines have at least 10 flights?
Additional table information: table: flight_2

Answer: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline HAVING COUNT(*) > 10


Question:
Find all airlines that have fewer than 200 flights.
Additional table information: table: flight_2

Answer: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline HAVING COUNT(*) < 200


Question:
Which airlines have less than 200 flights?
Additional table information: table: flight_2

Answer: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline HAVING COUNT(*) < 200


Question:
What are flight numbers of Airline 'United Airlines'?
Additional table information: table: flight_2

Answer: SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRLINES AS T2 ON T2.uid = T1.Airline WHERE T2.Airline = 'United Airlines'


Question:
Which flight numbers correspond to United Airlines flights?
Additional table information: table: flight_2

Answer: SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRLINES AS T2 ON T2.uid = T1.Airline WHERE T2.Airline = 'United Airlines'


Question:
What are flight numbers of flights departing from Airport 'APG'?
Additional table information: table: flight_2

Answer: SELECT FlightNo FROM FLIGHTS WHERE SourceAirport = 'APG'


Question:
Give the flight numbers of flights leaving from APG.
Additional table information: table: flight_2

Answer: SELECT FlightNo FROM FLIGHTS WHERE SourceAirport = 'APG'


Question:
What are flight numbers of flights arriving at Airport 'APG'?
Additional table information: table: flight_2

Answer: SELECT FlightNo FROM FLIGHTS WHERE DestAirport = 'APG'


Question:
Give the flight numbers of flights landing at APG.
Additional table information: table: flight_2

Answer: SELECT FlightNo FROM FLIGHTS WHERE DestAirport = 'APG'


Question:
What are flight numbers of flights departing from City 'Aberdeen '?
Additional table information: table: flight_2

Answer: SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.SourceAirport = T2.AirportCode WHERE T2.City = 'Aberdeen'


Question:
Give the flight numbers of flights leaving from Aberdeen.
Additional table information: table: flight_2

Answer: SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.SourceAirport = T2.AirportCode WHERE T2.City = 'Aberdeen'


Question:
What are flight numbers of flights arriving at City 'Aberdeen'?
Additional table information: table: flight_2

Answer: SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.City = 'Aberdeen'


Question:
Give the flight numbers of flights arriving in Aberdeen.
Additional table information: table: flight_2

Answer: SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.City = 'Aberdeen'


Question:
Find the number of flights landing in the city of Aberdeen or Abilene.
Additional table information: table: flight_2

Answer: SELECT COUNT(*) FROM Flights AS T1 JOIN Airports AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.city = 'Aberdeen' OR T2.city = 'Abilene'


Question:
How many flights land in Aberdeen or Abilene?
Additional table information: table: flight_2

Answer: SELECT COUNT(*) FROM Flights AS T1 JOIN Airports AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.city = 'Aberdeen' OR T2.city = 'Abilene'


Question:
Find the name of airports which do not have any flight in and out.
Additional table information: table: flight_2

Answer: SELECT AirportName FROM Airports WHERE NOT AirportCode IN (SELECT SourceAirport FROM Flights UNION SELECT DestAirport FROM Flights)


Question:
Which airports do not have departing or arriving flights?
Additional table information: table: flight_2

Answer: SELECT AirportName FROM Airports WHERE NOT AirportCode IN (SELECT SourceAirport FROM Flights UNION SELECT DestAirport FROM Flights)


Question:
How many employees are there?
Additional table information: table: employee_hire_evaluation

Answer: SELECT COUNT(*) FROM employee


Question:
Count the number of employees
Additional table information: table: employee_hire_evaluation

Answer: SELECT COUNT(*) FROM employee


Question:
Sort employee names by their age in ascending order.
Additional table information: table: employee_hire_evaluation

Answer: SELECT name FROM employee ORDER BY age NULLS FIRST


Question:
List the names of employees and sort in ascending order of age.
Additional table information: table: employee_hire_evaluation

Answer: SELECT name FROM employee ORDER BY age NULLS FIRST


Question:
What is the number of employees from each city?
Additional table information: table: employee_hire_evaluation

Answer: SELECT COUNT(*), city FROM employee GROUP BY city


Question:
Count the number of employees for each city.
Additional table information: table: employee_hire_evaluation

Answer: SELECT COUNT(*), city FROM employee GROUP BY city


Question:
Which cities do more than one employee under age 30 come from?
Additional table information: table: employee_hire_evaluation

Answer: SELECT city FROM employee WHERE age < 30 GROUP BY city HAVING COUNT(*) > 1


Question:
Find the cities that have more than one employee under age 30.
Additional table information: table: employee_hire_evaluation

Answer: SELECT city FROM employee WHERE age < 30 GROUP BY city HAVING COUNT(*) > 1


Question:
Find the number of shops in each location.
Additional table information: table: employee_hire_evaluation

Answer: SELECT COUNT(*), LOCATION FROM shop GROUP BY LOCATION


Question:
How many shops are there in each location?
Additional table information: table: employee_hire_evaluation

Answer: SELECT COUNT(*), LOCATION FROM shop GROUP BY LOCATION


Question:
Find the manager name and district of the shop whose number of products is the largest.
Additional table information: table: employee_hire_evaluation

Answer: SELECT manager_name, district FROM shop ORDER BY number_products DESC LIMIT 1


Question:
What are the manager name and district of the shop that sells the largest number of products?
Additional table information: table: employee_hire_evaluation

Answer: SELECT manager_name, district FROM shop ORDER BY number_products DESC LIMIT 1


Question:
find the minimum and maximum number of products of all stores.
Additional table information: table: employee_hire_evaluation

Answer: SELECT MIN(Number_products), MAX(Number_products) FROM shop


Question:
What are the minimum and maximum number of products across all the shops?
Additional table information: table: employee_hire_evaluation

Answer: SELECT MIN(Number_products), MAX(Number_products) FROM shop


Question:
Return the name, location and district of all shops in descending order of number of products.
Additional table information: table: employee_hire_evaluation

Answer: SELECT name, LOCATION, district FROM shop ORDER BY number_products DESC


Question:
Sort all the shops by number products in descending order, and return the name, location and district of each shop.
Additional table information: table: employee_hire_evaluation

Answer: SELECT name, LOCATION, district FROM shop ORDER BY number_products DESC


Question:
Find the names of stores whose number products is more than the average number of products.
Additional table information: table: employee_hire_evaluation

Answer: SELECT name FROM shop WHERE number_products > (SELECT AVG(number_products) FROM shop)


Question:
Which shops' number products is above the average? Give me the shop names.
Additional table information: table: employee_hire_evaluation

Answer: SELECT name FROM shop WHERE number_products > (SELECT AVG(number_products) FROM shop)


Question:
find the name of employee who was awarded the most times in the evaluation.
Additional table information: table: employee_hire_evaluation

Answer: 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


Question:
Which employee received the most awards in evaluations? Give me the employee name.
Additional table information: table: employee_hire_evaluation

Answer: 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


Question:
Find the name of the employee who got the highest one time bonus.
Additional table information: table: employee_hire_evaluation

Answer: 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


Question:
Which employee received the biggest bonus? Give me the employee name.
Additional table information: table: employee_hire_evaluation

Answer: 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


Question:
Find the names of employees who never won any award in the evaluation.
Additional table information: table: employee_hire_evaluation

Answer: SELECT name FROM employee WHERE NOT Employee_ID IN (SELECT Employee_ID FROM evaluation)


Question:
What are the names of the employees who never received any evaluation?
Additional table information: table: employee_hire_evaluation

Answer: SELECT name FROM employee WHERE NOT Employee_ID IN (SELECT Employee_ID FROM evaluation)


Question:
What is the name of the shop that is hiring the largest number of employees?
Additional table information: table: employee_hire_evaluation

Answer: 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


Question:
Which shop has the most employees? Give me the shop name.
Additional table information: table: employee_hire_evaluation

Answer: 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


Question:
Find the name of the shops that do not hire any employee.
Additional table information: table: employee_hire_evaluation

Answer: SELECT name FROM shop WHERE NOT shop_id IN (SELECT shop_id FROM hiring)


Question:
Which shops run with no employees? Find the shop names
Additional table information: table: employee_hire_evaluation

Answer: SELECT name FROM shop WHERE NOT shop_id IN (SELECT shop_id FROM hiring)


Question:
Find the number of employees hired in each shop; show the shop name as well.
Additional table information: table: employee_hire_evaluation

Answer: SELECT COUNT(*), t2.name FROM hiring AS t1 JOIN shop AS t2 ON t1.shop_id = t2.shop_id GROUP BY t2.name


Question:
For each shop, return the number of employees working there and the name of the shop.
Additional table information: table: employee_hire_evaluation

Answer: SELECT COUNT(*), t2.name FROM hiring AS t1 JOIN shop AS t2 ON t1.shop_id = t2.shop_id GROUP BY t2.name


Question:
What is total bonus given in all evaluations?
Additional table information: table: employee_hire_evaluation

Answer: SELECT SUM(bonus) FROM evaluation


Question:
Find the total amount of bonus given in all the evaluations.
Additional table information: table: employee_hire_evaluation

Answer: SELECT SUM(bonus) FROM evaluation


Question:
Give me all the information about hiring.
Additional table information: table: employee_hire_evaluation

Answer: SELECT * FROM hiring


Question:
What is all the information about hiring?
Additional table information: table: employee_hire_evaluation

Answer: SELECT * FROM hiring


Question:
Which district has both stores with less than 3000 products and stores with more than 10000 products?
Additional table information: table: employee_hire_evaluation

Answer: SELECT district FROM shop WHERE Number_products < 3000 INTERSECT SELECT district FROM shop WHERE Number_products > 10000


Question:
Find the districts in which there are both shops selling less than 3000 products and shops selling more than 10000 products.
Additional table information: table: employee_hire_evaluation

Answer: SELECT district FROM shop WHERE Number_products < 3000 INTERSECT SELECT district FROM shop WHERE Number_products > 10000


Question:
How many different store locations are there?
Additional table information: table: employee_hire_evaluation

Answer: SELECT COUNT(DISTINCT LOCATION) FROM shop


Question:
Count the number of distinct store locations.
Additional table information: table: employee_hire_evaluation

Answer: SELECT COUNT(DISTINCT LOCATION) FROM shop


Question:
How many documents do we have?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT COUNT(*) FROM Documents


Question:
Count the number of documents.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT COUNT(*) FROM Documents


Question:
List document IDs, document names, and document descriptions for all documents.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT document_id, document_name, document_description FROM Documents


Question:
What are the ids, names, and descriptions for all documents?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT document_id, document_name, document_description FROM Documents


Question:
What is the document name and template id for document with description with the letter 'w' in it?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT document_name, template_id FROM Documents WHERE Document_Description LIKE '%w%'


Question:
Return the names and template ids for documents that contain the letter w in their description.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT document_name, template_id FROM Documents WHERE Document_Description LIKE '%w%'


Question:
What is the document id, template id and description for document named 'Robbin CV'?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT document_id, template_id, Document_Description FROM Documents WHERE document_name = 'Robbin CV'


Question:
Return the document id, template id, and description for the document with the name Robbin CV.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT document_id, template_id, Document_Description FROM Documents WHERE document_name = 'Robbin CV'


Question:
How many different templates do all document use?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT COUNT(DISTINCT template_id) FROM Documents


Question:
Count the number of different templates used for documents.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT COUNT(DISTINCT template_id) FROM Documents


Question:
How many documents are using the template with type code 'PPT'?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT COUNT(*) FROM Documents AS T1 JOIN Templates AS T2 ON T1.Template_ID = T2.Template_ID WHERE T2.Template_Type_Code = 'PPT'


Question:
Count the number of documents that use the PPT template type.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT COUNT(*) FROM Documents AS T1 JOIN Templates AS T2 ON T1.Template_ID = T2.Template_ID WHERE T2.Template_Type_Code = 'PPT'


Question:
Show all template ids and number of documents using each template.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT template_id, COUNT(*) FROM Documents GROUP BY template_id


Question:
What are all different template ids used for documents, and how many times were each of them used?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT template_id, COUNT(*) FROM Documents GROUP BY template_id


Question:
What is the id and type code for the template used by the most documents?
Additional table information: table: cre_Doc_Template_Mgt

Answer: 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


Question:
Return the id and type code of the template that is used for the greatest number of documents.
Additional table information: table: cre_Doc_Template_Mgt

Answer: 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


Question:
Show ids for all templates that are used by more than one document.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT template_id FROM Documents GROUP BY template_id HAVING COUNT(*) > 1


Question:
What are the template ids of any templates used in more than a single document?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT template_id FROM Documents GROUP BY template_id HAVING COUNT(*) > 1


Question:
Show ids for all templates not used by any document.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT template_id FROM Templates EXCEPT SELECT template_id FROM Documents


Question:
What are the ids for templates that are not used in any documents?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT template_id FROM Templates EXCEPT SELECT template_id FROM Documents


Question:
How many templates do we have?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT COUNT(*) FROM Templates


Question:
Count the number of templates.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT COUNT(*) FROM Templates


Question:
Show template ids, version numbers, and template type codes for all templates.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT template_id, version_number, template_type_code FROM Templates


Question:
What are the ids, version numbers, and type codes for each template?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT template_id, version_number, template_type_code FROM Templates


Question:
Show all distinct template type codes for all templates.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT DISTINCT template_type_code FROM Templates


Question:
What are the different template type codes?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT DISTINCT template_type_code FROM Templates


Question:
What are the ids of templates with template type code PP or PPT?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT template_id FROM Templates WHERE template_type_code = 'PP' OR template_type_code = 'PPT'


Question:
Return the ids of templates that have the code PP or PPT.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT template_id FROM Templates WHERE template_type_code = 'PP' OR template_type_code = 'PPT'


Question:
How many templates have template type code CV?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT COUNT(*) FROM Templates WHERE template_type_code = 'CV'


Question:
Count the number of templates of the type CV.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT COUNT(*) FROM Templates WHERE template_type_code = 'CV'


Question:
What is the version number and template type code for the template with version number later than 5?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT version_number, template_type_code FROM Templates WHERE version_number > 5


Question:
Return the version numbers and template type codes of templates with a version number greater than 5.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT version_number, template_type_code FROM Templates WHERE version_number > 5


Question:
Show all template type codes and number of templates for each.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT template_type_code, COUNT(*) FROM Templates GROUP BY template_type_code


Question:
What are the different template type codes, and how many templates correspond to each?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT template_type_code, COUNT(*) FROM Templates GROUP BY template_type_code


Question:
Which template type code has most number of templates?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT template_type_code FROM Templates GROUP BY template_type_code ORDER BY COUNT(*) DESC LIMIT 1


Question:
Return the type code of the template type that the most templates belong to.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT template_type_code FROM Templates GROUP BY template_type_code ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show all template type codes with less than three templates.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT template_type_code FROM Templates GROUP BY template_type_code HAVING COUNT(*) < 3


Question:
What are the codes of template types that have fewer than 3 templates?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT template_type_code FROM Templates GROUP BY template_type_code HAVING COUNT(*) < 3


Question:
What the smallest version number and its template type code?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT MIN(Version_Number), template_type_code FROM Templates


Question:
Return the lowest version number, along with its corresponding template type code.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT MIN(Version_Number), template_type_code FROM Templates


Question:
What is the template type code of the template used by document with the name 'Data base'?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT T1.template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id WHERE T2.document_name = 'Data base'


Question:
Return the template type code of the template that is used by a document named Data base.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT T1.template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id WHERE T2.document_name = 'Data base'


Question:
Show all document names using templates with template type code BK.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT T2.document_name FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id WHERE T1.template_type_code = 'BK'


Question:
What are the names of documents that use templates with the code BK?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT T2.document_name FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id WHERE T1.template_type_code = 'BK'


Question:
Show all template type codes and the number of documents using each type.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT T1.template_type_code, COUNT(*) FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_type_code


Question:
What are the different template type codes, and how many documents use each type?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT T1.template_type_code, COUNT(*) FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_type_code


Question:
Which template type code is used by most number of documents?
Additional table information: table: cre_Doc_Template_Mgt

Answer: 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


Question:
Return the code of the template type that is most commonly used in documents.
Additional table information: table: cre_Doc_Template_Mgt

Answer: 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


Question:
Show all template type codes that are not used by any document.
Additional table information: table: cre_Doc_Template_Mgt

Answer: 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


Question:
What are the codes of template types that are not used for any document?
Additional table information: table: cre_Doc_Template_Mgt

Answer: 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


Question:
Show all template type codes and descriptions.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT template_type_code, template_type_description FROM Ref_template_types


Question:
What are the type codes and descriptions for all template types?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT template_type_code, template_type_description FROM Ref_template_types


Question:
What is the template type descriptions for template type code 'AD'.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT template_type_description FROM Ref_template_types WHERE template_type_code = 'AD'


Question:
Return the template type description of the template type with the code AD.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT template_type_description FROM Ref_template_types WHERE template_type_code = 'AD'


Question:
What is the template type code for template type description 'Book'.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT template_type_code FROM Ref_template_types WHERE template_type_description = 'Book'


Question:
Return the type code of the template type with the description 'Book'.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT template_type_code FROM Ref_template_types WHERE template_type_description = 'Book'


Question:
What are the distinct template type descriptions for the templates ever used by any document?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT DISTINCT T1.template_type_description FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code = T2.template_type_code JOIN Documents AS T3 ON T2.Template_ID = T3.template_ID


Question:
Return the different descriptions for templates that have been used in a document.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT DISTINCT T1.template_type_description FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code = T2.template_type_code JOIN Documents AS T3 ON T2.Template_ID = T3.template_ID


Question:
What are the template ids with template type description 'Presentation'.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT T2.template_id FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code = T2.template_type_code WHERE T1.template_type_description = 'Presentation'


Question:
Return the ids corresponding to templates with the description 'Presentation'.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT T2.template_id FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code = T2.template_type_code WHERE T1.template_type_description = 'Presentation'


Question:
How many paragraphs in total?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT COUNT(*) FROM Paragraphs


Question:
Count the number of paragraphs.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT COUNT(*) FROM Paragraphs


Question:
How many paragraphs for the document with name 'Summer Show'?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT COUNT(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_ID = T2.document_ID WHERE T2.document_name = 'Summer Show'


Question:
Count the number of paragraphs in the document named 'Summer Show'.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT COUNT(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_ID = T2.document_ID WHERE T2.document_name = 'Summer Show'


Question:
Show paragraph details for paragraph with text 'Korea ' .
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT other_details FROM paragraphs WHERE paragraph_text LIKE 'korea'


Question:
What are the details for the paragraph that includes the text 'Korea ' ?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT other_details FROM paragraphs WHERE paragraph_text LIKE 'korea'


Question:
Show all paragraph ids and texts for the document with name 'Welcome to NY'.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT T1.paragraph_id, T1.paragraph_text FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id WHERE T2.Document_Name = 'Welcome to NY'


Question:
What are the ids and texts of paragraphs in the document titled 'Welcome to NY'?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT T1.paragraph_id, T1.paragraph_text FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id WHERE T2.Document_Name = 'Welcome to NY'


Question:
Show all paragraph texts for the document 'Customer reviews'.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT T1.paragraph_text FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id WHERE T2.document_name = 'Customer reviews'


Question:
What are the paragraph texts for the document with the name 'Customer reviews'?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT T1.paragraph_text FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id WHERE T2.document_name = 'Customer reviews'


Question:
Show all document ids and the number of paragraphs in each document. Order by document id.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT document_id, COUNT(*) FROM Paragraphs GROUP BY document_id ORDER BY document_id NULLS FIRST


Question:
Return the different document ids along with the number of paragraphs corresponding to each, ordered by id.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT document_id, COUNT(*) FROM Paragraphs GROUP BY document_id ORDER BY document_id NULLS FIRST


Question:
Show all document ids, names and the number of paragraphs in each document.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT T1.document_id, T2.document_name, COUNT(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id GROUP BY T1.document_id


Question:
What are the ids and names of each document, as well as the number of paragraphs in each?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT T1.document_id, T2.document_name, COUNT(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id GROUP BY T1.document_id


Question:
List all document ids with at least two paragraphs.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT document_id FROM Paragraphs GROUP BY document_id HAVING COUNT(*) >= 2


Question:
What are the ids of documents that have 2 or more paragraphs?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT document_id FROM Paragraphs GROUP BY document_id HAVING COUNT(*) >= 2


Question:
What is the document id and name with greatest number of paragraphs?
Additional table information: table: cre_Doc_Template_Mgt

Answer: 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


Question:
Return the id and name of the document with the most paragraphs.
Additional table information: table: cre_Doc_Template_Mgt

Answer: 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


Question:
What is the document id with least number of paragraphs?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT document_id FROM Paragraphs GROUP BY document_id ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1


Question:
Return the id of the document with the fewest paragraphs.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT document_id FROM Paragraphs GROUP BY document_id ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1


Question:
What is the document id with 1 to 2 paragraphs?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT document_id FROM Paragraphs GROUP BY document_id HAVING COUNT(*) BETWEEN 1 AND 2


Question:
Give the ids of documents that have between one and two paragraphs.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT document_id FROM Paragraphs GROUP BY document_id HAVING COUNT(*) BETWEEN 1 AND 2


Question:
Show the document id with paragraph text 'Brazil' and 'Ireland'.
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT document_id FROM Paragraphs WHERE paragraph_text = 'Brazil' INTERSECT SELECT document_id FROM Paragraphs WHERE paragraph_text = 'Ireland'


Question:
What are the ids of documents that contain the paragraph text 'Brazil' and 'Ireland'?
Additional table information: table: cre_Doc_Template_Mgt

Answer: SELECT document_id FROM Paragraphs WHERE paragraph_text = 'Brazil' INTERSECT SELECT document_id FROM Paragraphs WHERE paragraph_text = 'Ireland'


Question:
How many teachers are there?
Additional table information: table: course_teach

Answer: SELECT COUNT(*) FROM teacher


Question:
What is the total count of teachers?
Additional table information: table: course_teach

Answer: SELECT COUNT(*) FROM teacher


Question:
List the names of teachers in ascending order of age.
Additional table information: table: course_teach

Answer: SELECT Name FROM teacher ORDER BY Age ASC NULLS FIRST


Question:
What are the names of the teachers ordered by ascending age?
Additional table information: table: course_teach

Answer: SELECT Name FROM teacher ORDER BY Age ASC NULLS FIRST


Question:
What are the age and hometown of teachers?
Additional table information: table: course_teach

Answer: SELECT Age, Hometown FROM teacher


Question:
What is the age and hometown of every teacher?
Additional table information: table: course_teach

Answer: SELECT Age, Hometown FROM teacher


Question:
List the name of teachers whose hometown is not `` Little Lever Urban District '' .
Additional table information: table: course_teach

Answer: SELECT name FROM teacher WHERE hometown <> 'little lever urban district'


Question:
What are the names of the teachers whose hometown is not `` Little Lever Urban District '' ?
Additional table information: table: course_teach

Answer: SELECT name FROM teacher WHERE hometown <> 'little lever urban district'


Question:
Show the name of teachers aged either 32 or 33?
Additional table information: table: course_teach

Answer: SELECT Name FROM teacher WHERE Age = 32 OR Age = 33


Question:
What are the names of the teachers who are aged either 32 or 33?
Additional table information: table: course_teach

Answer: SELECT Name FROM teacher WHERE Age = 32 OR Age = 33


Question:
What is the hometown of the youngest teacher?
Additional table information: table: course_teach

Answer: SELECT Hometown FROM teacher ORDER BY Age ASC NULLS FIRST LIMIT 1


Question:
Where is the youngest teacher from?
Additional table information: table: course_teach

Answer: SELECT Hometown FROM teacher ORDER BY Age ASC NULLS FIRST LIMIT 1


Question:
Show different hometown of teachers and the number of teachers from each hometown.
Additional table information: table: course_teach

Answer: SELECT Hometown, COUNT(*) FROM teacher GROUP BY Hometown


Question:
For each hometown, how many teachers are there?
Additional table information: table: course_teach

Answer: SELECT Hometown, COUNT(*) FROM teacher GROUP BY Hometown


Question:
List the most common hometown of teachers.
Additional table information: table: course_teach

Answer: SELECT Hometown FROM teacher GROUP BY Hometown ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the most commmon hometowns for teachers?
Additional table information: table: course_teach

Answer: SELECT Hometown FROM teacher GROUP BY Hometown ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show the hometowns shared by at least two teachers.
Additional table information: table: course_teach

Answer: SELECT Hometown FROM teacher GROUP BY Hometown HAVING COUNT(*) >= 2


Question:
What are the towns from which at least two teachers come from?
Additional table information: table: course_teach

Answer: SELECT Hometown FROM teacher GROUP BY Hometown HAVING COUNT(*) >= 2


Question:
Show names of teachers and the courses they are arranged to teach.
Additional table information: table: course_teach

Answer: 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


Question:
What is the name of each teacher and what course they teach?
Additional table information: table: course_teach

Answer: 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


Question:
Show names of teachers and the courses they are arranged to teach in ascending alphabetical order of the teacher's name.
Additional table information: table: course_teach

Answer: 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 NULLS FIRST


Question:
What are the names of the teachers and the courses they teach in ascending alphabetical order by the name of the teacher?
Additional table information: table: course_teach

Answer: 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 NULLS FIRST


Question:
Show the name of the teacher for the math course.
Additional table information: table: course_teach

Answer: 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'


Question:
What are the names of the people who teach math courses?
Additional table information: table: course_teach

Answer: 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'


Question:
Show names of teachers and the number of courses they teach.
Additional table information: table: course_teach

Answer: SELECT T2.Name, COUNT(*) FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T2.Teacher_ID GROUP BY T2.Name


Question:
What are the names of the teachers and how many courses do they teach?
Additional table information: table: course_teach

Answer: SELECT T2.Name, COUNT(*) FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T2.Teacher_ID GROUP BY T2.Name


Question:
Show names of teachers that teach at least two courses.
Additional table information: table: course_teach

Answer: SELECT T2.Name FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T2.Teacher_ID GROUP BY T2.Name HAVING COUNT(*) >= 2


Question:
What are the names of the teachers who teach at least two courses?
Additional table information: table: course_teach

Answer: SELECT T2.Name FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T2.Teacher_ID GROUP BY T2.Name HAVING COUNT(*) >= 2


Question:
List the names of teachers who have not been arranged to teach courses.
Additional table information: table: course_teach

Answer: SELECT Name FROM teacher WHERE NOT Teacher_id IN (SELECT Teacher_id FROM course_arrange)


Question:
What are the names of the teachers whose courses have not been arranged?
Additional table information: table: course_teach

Answer: SELECT Name FROM teacher WHERE NOT Teacher_id IN (SELECT Teacher_id FROM course_arrange)


Question:
How many visitors below age 30 are there?
Additional table information: table: museum_visit

Answer: SELECT COUNT(*) FROM visitor WHERE age < 30