Question:
Find the names of nurses who are on call.
Additional table information: table: hospital_1

Answer: SELECT DISTINCT T1.name FROM nurse AS T1 JOIN on_call AS T2 ON T1.EmployeeID = T2.nurse


Question:
What are the distinct names of nurses on call?
Additional table information: table: hospital_1

Answer: SELECT DISTINCT T1.name FROM nurse AS T1 JOIN on_call AS T2 ON T1.EmployeeID = T2.nurse


Question:
How many ships are there?
Additional table information: table: ship_mission

Answer: SELECT COUNT(*) FROM ship


Question:
What is the number of ships?
Additional table information: table: ship_mission

Answer: SELECT COUNT(*) FROM ship


Question:
List the name of ships in ascending order of tonnage.
Additional table information: table: ship_mission

Answer: SELECT Name FROM ship ORDER BY Tonnage ASC NULLS FIRST


Question:
what are the names of the ships ordered by ascending tonnage?
Additional table information: table: ship_mission

Answer: SELECT Name FROM ship ORDER BY Tonnage ASC NULLS FIRST


Question:
What are the type and nationality of ships?
Additional table information: table: ship_mission

Answer: SELECT TYPE, Nationality FROM ship


Question:
What are the types and nationalities of every ship?
Additional table information: table: ship_mission

Answer: SELECT TYPE, Nationality FROM ship


Question:
List the name of ships whose nationality is not 'United States'.
Additional table information: table: ship_mission

Answer: SELECT Name FROM ship WHERE Nationality <> 'United States'


Question:
What are the names of the ships that are not from the United States?
Additional table information: table: ship_mission

Answer: SELECT Name FROM ship WHERE Nationality <> 'United States'


Question:
Show the name of ships whose nationality is either United States or United Kingdom.
Additional table information: table: ship_mission

Answer: SELECT Name FROM ship WHERE Nationality = 'United States' OR Nationality = 'United Kingdom'


Question:
What are the names of the ships  that are from either the US or the UK?
Additional table information: table: ship_mission

Answer: SELECT Name FROM ship WHERE Nationality = 'United States' OR Nationality = 'United Kingdom'


Question:
What is the name of the ship with the largest tonnage?
Additional table information: table: ship_mission

Answer: SELECT Name FROM ship ORDER BY Tonnage DESC LIMIT 1


Question:
What is the ship with the largest amount of tonnage called?
Additional table information: table: ship_mission

Answer: SELECT Name FROM ship ORDER BY Tonnage DESC LIMIT 1


Question:
Show different types of ships and the number of ships of each type.
Additional table information: table: ship_mission

Answer: SELECT TYPE, COUNT(*) FROM ship GROUP BY TYPE


Question:
For each type, how many ships are there?
Additional table information: table: ship_mission

Answer: SELECT TYPE, COUNT(*) FROM ship GROUP BY TYPE


Question:
Please show the most common type of ships.
Additional table information: table: ship_mission

Answer: SELECT TYPE FROM ship GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the most common type of ships?
Additional table information: table: ship_mission

Answer: SELECT TYPE FROM ship GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1


Question:
List the nations that have more than two ships.
Additional table information: table: ship_mission

Answer: SELECT Nationality FROM ship GROUP BY Nationality HAVING COUNT(*) > 2


Question:
What are the nations that have more than two ships?
Additional table information: table: ship_mission

Answer: SELECT Nationality FROM ship GROUP BY Nationality HAVING COUNT(*) > 2


Question:
Show different types of ships and the average tonnage of ships of each type.
Additional table information: table: ship_mission

Answer: SELECT TYPE, AVG(Tonnage) FROM ship GROUP BY TYPE


Question:
For each type, what is the average tonnage?
Additional table information: table: ship_mission

Answer: SELECT TYPE, AVG(Tonnage) FROM ship GROUP BY TYPE


Question:
Show codes and fates of missions, and names of ships involved.
Additional table information: table: ship_mission

Answer: SELECT T1.Code, T1.Fate, T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID


Question:
What are the mission codes, fates, and names of the ships involved?
Additional table information: table: ship_mission

Answer: SELECT T1.Code, T1.Fate, T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID


Question:
Show names of ships involved in a mission launched after 1928.
Additional table information: table: ship_mission

Answer: SELECT T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T1.Launched_Year > 1928


Question:
What are the names of ships that were involved in a mission launched after 1928?
Additional table information: table: ship_mission

Answer: SELECT T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T1.Launched_Year > 1928


Question:
Show the distinct fate of missions that involve ships with nationality 'United States'
Additional table information: table: ship_mission

Answer: SELECT DISTINCT T1.Fate FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T2.Nationality = 'United States'


Question:
What are the different fates of the mission that involved ships from the United States?
Additional table information: table: ship_mission

Answer: SELECT DISTINCT T1.Fate FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T2.Nationality = 'United States'


Question:
List the name of ships that are not involved in any mission
Additional table information: table: ship_mission

Answer: SELECT Name FROM ship WHERE NOT Ship_ID IN (SELECT Ship_ID FROM mission)


Question:
What are the names of the ships that are not involved in any missions?
Additional table information: table: ship_mission

Answer: SELECT Name FROM ship WHERE NOT Ship_ID IN (SELECT Ship_ID FROM mission)


Question:
Show the types of ships that have both ships with tonnage larger than 6000 and ships with tonnage smaller than 4000.
Additional table information: table: ship_mission

Answer: SELECT TYPE FROM ship WHERE Tonnage > 6000 INTERSECT SELECT TYPE FROM ship WHERE Tonnage < 4000


Question:
What are the types of the ships that have both shiips with tonnage more than 6000 and those with tonnage less than 4000?
Additional table information: table: ship_mission

Answer: SELECT TYPE FROM ship WHERE Tonnage > 6000 INTERSECT SELECT TYPE FROM ship WHERE Tonnage < 4000


Question:
Find the number of students in total.
Additional table information: table: student_1

Answer: SELECT COUNT(*) FROM list


Question:
How many students are there?
Additional table information: table: student_1

Answer: SELECT COUNT(*) FROM list


Question:
Find the last names of students studying in room 111.
Additional table information: table: student_1

Answer: SELECT lastname FROM list WHERE classroom = 111


Question:
What are the last names of students in room 111?
Additional table information: table: student_1

Answer: SELECT lastname FROM list WHERE classroom = 111


Question:
Find the first names of students studying in room 108.
Additional table information: table: student_1

Answer: SELECT firstname FROM list WHERE classroom = 108


Question:
What are the first names of students in room 108?
Additional table information: table: student_1

Answer: SELECT firstname FROM list WHERE classroom = 108


Question:
What are the first names of students studying in room 107?
Additional table information: table: student_1

Answer: SELECT DISTINCT firstname FROM list WHERE classroom = 107


Question:
List the first names of all the students in room 107.
Additional table information: table: student_1

Answer: SELECT DISTINCT firstname FROM list WHERE classroom = 107


Question:
For each classroom report the grade that is taught in it. Report just the classroom number and the grade number.
Additional table information: table: student_1

Answer: SELECT DISTINCT classroom, grade FROM list


Question:
What are the grade number and classroom number of each class in the list?
Additional table information: table: student_1

Answer: SELECT DISTINCT classroom, grade FROM list


Question:
Which grade is studying in classroom 103?
Additional table information: table: student_1

Answer: SELECT DISTINCT grade FROM list WHERE classroom = 103


Question:
Find the grade taught in classroom 103.
Additional table information: table: student_1

Answer: SELECT DISTINCT grade FROM list WHERE classroom = 103


Question:
Find the grade studying in room 105.
Additional table information: table: student_1

Answer: SELECT DISTINCT grade FROM list WHERE classroom = 105


Question:
Which grade is studying in room 105?
Additional table information: table: student_1

Answer: SELECT DISTINCT grade FROM list WHERE classroom = 105


Question:
Which classrooms are used by grade 4?
Additional table information: table: student_1

Answer: SELECT DISTINCT classroom FROM list WHERE grade = 4


Question:
Find the classrooms in which grade 4 is studying.
Additional table information: table: student_1

Answer: SELECT DISTINCT classroom FROM list WHERE grade = 4


Question:
Which classrooms are used by grade 5?
Additional table information: table: student_1

Answer: SELECT DISTINCT classroom FROM list WHERE grade = 5


Question:
Show me the classrooms grade 5 is using.
Additional table information: table: student_1

Answer: SELECT DISTINCT classroom FROM list WHERE grade = 5


Question:
Find the last names of the teachers that teach fifth grade.
Additional table information: table: student_1

Answer: SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 5


Question:
what are the last names of the teachers who teach grade 5?
Additional table information: table: student_1

Answer: SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 5


Question:
Find the first names of the teachers that teach first grade.
Additional table information: table: student_1

Answer: SELECT DISTINCT T2.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 1


Question:
What are the first names of the teachers who teach grade 1?
Additional table information: table: student_1

Answer: SELECT DISTINCT T2.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 1


Question:
Find the first names of all the teachers that teach in classroom 110.
Additional table information: table: student_1

Answer: SELECT firstname FROM teachers WHERE classroom = 110


Question:
Which teachers teach in classroom 110? Give me their first names.
Additional table information: table: student_1

Answer: SELECT firstname FROM teachers WHERE classroom = 110


Question:
Find the last names of teachers teaching in classroom 109.
Additional table information: table: student_1

Answer: SELECT lastname FROM teachers WHERE classroom = 109


Question:
Which teachers teach in classroom 109? Give me their last names.
Additional table information: table: student_1

Answer: SELECT lastname FROM teachers WHERE classroom = 109


Question:
Report the first name and last name of all the teachers.
Additional table information: table: student_1

Answer: SELECT DISTINCT firstname, lastname FROM teachers


Question:
What are the first name and last name of all the teachers?
Additional table information: table: student_1

Answer: SELECT DISTINCT firstname, lastname FROM teachers


Question:
Report the first name and last name of all the students.
Additional table information: table: student_1

Answer: SELECT DISTINCT firstname, lastname FROM list


Question:
Show each student's first name and last name.
Additional table information: table: student_1

Answer: SELECT DISTINCT firstname, lastname FROM list


Question:
Find all students taught by OTHA MOYER. Output the first and last names of the students.
Additional table information: table: student_1

Answer: SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'OTHA' AND T2.lastname = 'MOYER'


Question:
Which students study under the teacher named OTHA MOYER? Give me the first and last names of the students.
Additional table information: table: student_1

Answer: SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'OTHA' AND T2.lastname = 'MOYER'


Question:
Find all students taught by MARROTTE KIRK. Output first and last names of students.
Additional table information: table: student_1

Answer: SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'MARROTTE' AND T2.lastname = 'KIRK'


Question:
Which are the first and last names of the students taught by MARROTTE KIRK?
Additional table information: table: student_1

Answer: SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'MARROTTE' AND T2.lastname = 'KIRK'


Question:
Find the first and last name of all the teachers that teach EVELINA BROMLEY.
Additional table information: table: student_1

Answer: SELECT T2.firstname, T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = 'EVELINA' AND T1.lastname = 'BROMLEY'


Question:
Which teachers teach the student named EVELINA BROMLEY? Give me the first and last name  of the teachers.
Additional table information: table: student_1

Answer: SELECT T2.firstname, T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = 'EVELINA' AND T1.lastname = 'BROMLEY'


Question:
Find the last names of all the teachers that teach GELL TAMI.
Additional table information: table: student_1

Answer: SELECT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = 'GELL' AND T1.lastname = 'TAMI'


Question:
What are the last names of the teachers who teach the student called GELL TAMI?
Additional table information: table: student_1

Answer: SELECT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = 'GELL' AND T1.lastname = 'TAMI'


Question:
How many students does LORIA ONDERSMA teaches?
Additional table information: table: student_1

Answer: SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'LORIA' AND T2.lastname = 'ONDERSMA'


Question:
Count the number of students the teacher LORIA ONDERSMA teaches.
Additional table information: table: student_1

Answer: SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'LORIA' AND T2.lastname = 'ONDERSMA'


Question:
How many students does KAWA GORDON teaches?
Additional table information: table: student_1

Answer: SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'KAWA' AND T2.lastname = 'GORDON'


Question:
Find the number of students taught by the teacher KAWA GORDON.
Additional table information: table: student_1

Answer: SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'KAWA' AND T2.lastname = 'GORDON'


Question:
Find the number of students taught by TARRING LEIA.
Additional table information: table: student_1

Answer: SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'TARRING' AND T2.lastname = 'LEIA'


Question:
How many students are taught by teacher TARRING LEIA?
Additional table information: table: student_1

Answer: SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'TARRING' AND T2.lastname = 'LEIA'


Question:
How many teachers does the student named CHRISSY NABOZNY have?
Additional table information: table: student_1

Answer: SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = 'CHRISSY' AND T1.lastname = 'NABOZNY'


Question:
Find the number of teachers who teach the student called CHRISSY NABOZNY.
Additional table information: table: student_1

Answer: SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = 'CHRISSY' AND T1.lastname = 'NABOZNY'


Question:
How many teachers does the student named MADLOCK RAY have?
Additional table information: table: student_1

Answer: SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = 'MADLOCK' AND T1.lastname = 'RAY'


Question:
Find the number of teachers who teach the student called MADLOCK RAY.
Additional table information: table: student_1

Answer: SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = 'MADLOCK' AND T1.lastname = 'RAY'


Question:
Find all first-grade students who are NOT taught by OTHA MOYER. Report their first and last names.
Additional table information: table: student_1

Answer: SELECT DISTINCT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 1 EXCEPT SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'OTHA' AND T2.lastname = 'MOYER'


Question:
What are the first and last names of the first-grade students who are NOT taught by teacher OTHA MOYER?
Additional table information: table: student_1

Answer: SELECT DISTINCT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 1 EXCEPT SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'OTHA' AND T2.lastname = 'MOYER'


Question:
Find the last names of the students in third grade that are not taught by COVIN JEROME.
Additional table information: table: student_1

Answer: SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 3 AND T2.firstname <> 'COVIN' AND T2.lastname <> 'JEROME'


Question:
Which students in third grade are not taught by teacher COVIN JEROME? Give me the last names of the students.
Additional table information: table: student_1

Answer: SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 3 AND T2.firstname <> 'COVIN' AND T2.lastname <> 'JEROME'


Question:
For each grade, report the grade, the number of classrooms in which it is taught and the total number of students in the grade.
Additional table information: table: student_1

Answer: SELECT grade, COUNT(DISTINCT classroom), COUNT(*) FROM list GROUP BY grade


Question:
For each grade, return the grade number, the number of classrooms used for the grade, and the total number of students enrolled in the grade.
Additional table information: table: student_1

Answer: SELECT grade, COUNT(DISTINCT classroom), COUNT(*) FROM list GROUP BY grade


Question:
For each classroom, report the classroom number and the number of grades using it.
Additional table information: table: student_1

Answer: SELECT classroom, COUNT(DISTINCT grade) FROM list GROUP BY classroom


Question:
For each classroom, show the classroom number and count the number of distinct grades that use the room.
Additional table information: table: student_1

Answer: SELECT classroom, COUNT(DISTINCT grade) FROM list GROUP BY classroom


Question:
Which classroom has the most students?
Additional table information: table: student_1

Answer: SELECT classroom FROM list GROUP BY classroom ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the classroom that the most students use.
Additional table information: table: student_1

Answer: SELECT classroom FROM list GROUP BY classroom ORDER BY COUNT(*) DESC LIMIT 1


Question:
Report the number of students in each classroom.
Additional table information: table: student_1

Answer: SELECT classroom, COUNT(*) FROM list GROUP BY classroom


Question:
For each classroom, show the classroom number and find how many students are using it.
Additional table information: table: student_1

Answer: SELECT classroom, COUNT(*) FROM list GROUP BY classroom


Question:
For each grade 0 classroom, report the total number of students.
Additional table information: table: student_1

Answer: SELECT classroom, COUNT(*) FROM list WHERE grade = '0' GROUP BY classroom


Question:
For each grade 0 classroom, return the classroom number and the count of students.
Additional table information: table: student_1

Answer: SELECT classroom, COUNT(*) FROM list WHERE grade = '0' GROUP BY classroom


Question:
Report the total number of students for each fourth-grade classroom.
Additional table information: table: student_1

Answer: SELECT classroom, COUNT(*) FROM list WHERE grade = '4' GROUP BY classroom


Question:
For each fourth-grade classroom, show the classroom number and the total number of students using it.
Additional table information: table: student_1

Answer: SELECT classroom, COUNT(*) FROM list WHERE grade = '4' GROUP BY classroom


Question:
Find the name of the teacher who teaches the largest number of students.
Additional table information: table: student_1

Answer: SELECT T2.firstname, T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom GROUP BY T2.firstname, T2.lastname ORDER BY COUNT(*) DESC LIMIT 1


Question:
Which teacher teaches the most students? Give me the first name and last name of the teacher.
Additional table information: table: student_1

Answer: SELECT T2.firstname, T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom GROUP BY T2.firstname, T2.lastname ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the number of students in one classroom.
Additional table information: table: student_1

Answer: SELECT COUNT(*), classroom FROM list GROUP BY classroom


Question:
How many students does one classroom have?
Additional table information: table: student_1

Answer: SELECT COUNT(*), classroom FROM list GROUP BY classroom


Question:
How many companies are headquartered in the US?
Additional table information: table: company_employee

Answer: SELECT COUNT(*) FROM company WHERE Headquarters = 'USA'


Question:
List the names of companies by ascending number of sales.
Additional table information: table: company_employee

Answer: SELECT Name FROM company ORDER BY Sales_in_Billion ASC NULLS FIRST


Question:
What are the headquarters and industries of all companies?
Additional table information: table: company_employee

Answer: SELECT Headquarters, Industry FROM company


Question:
Show the names of companies in the banking or retailing industry?
Additional table information: table: company_employee

Answer: SELECT Name FROM company WHERE Industry = 'Banking' OR Industry = 'Retailing'


Question:
What is the maximum and minimum market value of companies?
Additional table information: table: company_employee

Answer: SELECT MAX(Market_Value_in_Billion), MIN(Market_Value_in_Billion) FROM company


Question:
What is the headquarter of the company with the largest sales?
Additional table information: table: company_employee

Answer: SELECT Headquarters FROM company ORDER BY Sales_in_Billion DESC LIMIT 1


Question:
Show the different headquarters and number of companies at each headquarter.
Additional table information: table: company_employee

Answer: SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters


Question:
Show the most common headquarter for companies.
Additional table information: table: company_employee

Answer: SELECT Headquarters FROM company GROUP BY Headquarters ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show the headquarters that have at least two companies.
Additional table information: table: company_employee

Answer: SELECT Headquarters FROM company GROUP BY Headquarters HAVING COUNT(*) >= 2


Question:
Show the headquarters that have both companies in banking industry and companies in oil and gas industry.
Additional table information: table: company_employee

Answer: SELECT Headquarters FROM company WHERE Industry = 'Banking' INTERSECT SELECT Headquarters FROM company WHERE Industry = 'Oil and gas'


Question:
Show the names of companies and of employees.
Additional table information: table: company_employee

Answer: SELECT T3.Name, T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID


Question:
Show names of companies and that of employees in descending order of number of years working for that employee.
Additional table information: table: company_employee

Answer: SELECT T3.Name, T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID ORDER BY T1.Year_working NULLS FIRST


Question:
Show the names of employees that work for companies with sales bigger than 200.
Additional table information: table: company_employee

Answer: SELECT T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID WHERE T3.Sales_in_Billion > 200


Question:
Show the names of companies and the number of employees they have
Additional table information: table: company_employee

Answer: SELECT T3.Name, COUNT(*) FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID GROUP BY T3.Name


Question:
List the names of people that are not employed by any company
Additional table information: table: company_employee

Answer: SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM employment)


Question:
list the names of the companies with more than 200 sales in the descending order of sales and profits.
Additional table information: table: company_employee

Answer: SELECT name FROM company WHERE Sales_in_Billion > 200 ORDER BY Sales_in_Billion NULLS FIRST, Profits_in_Billion DESC


Question:
How many film are there?
Additional table information: table: film_rank

Answer: SELECT COUNT(*) FROM film


Question:
Count the number of films.
Additional table information: table: film_rank

Answer: SELECT COUNT(*) FROM film


Question:
List the distinct director of all films.
Additional table information: table: film_rank

Answer: SELECT DISTINCT Director FROM film


Question:
What are the different film Directors?
Additional table information: table: film_rank

Answer: SELECT DISTINCT Director FROM film


Question:
What is the average ticket sales gross in dollars of films?
Additional table information: table: film_rank

Answer: SELECT AVG(Gross_in_dollar) FROM film


Question:
Return the average gross sales in dollars across all films.
Additional table information: table: film_rank

Answer: SELECT AVG(Gross_in_dollar) FROM film


Question:
What are the low and high estimates of film markets?
Additional table information: table: film_rank

Answer: SELECT Low_Estimate, High_Estimate FROM film_market_estimation


Question:
Return the low and high estimates for all film markets.
Additional table information: table: film_rank

Answer: SELECT Low_Estimate, High_Estimate FROM film_market_estimation


Question:
What are the types of film market estimations in year 1995?
Additional table information: table: film_rank

Answer: SELECT TYPE FROM film_market_estimation WHERE YEAR = 1995


Question:
Return the types of film market estimations in 1995.
Additional table information: table: film_rank

Answer: SELECT TYPE FROM film_market_estimation WHERE YEAR = 1995


Question:
What are the maximum and minimum number of cities in all markets.
Additional table information: table: film_rank

Answer: SELECT MAX(Number_cities), MIN(Number_cities) FROM market


Question:
Return the maximum and minimum number of cities across all markets.
Additional table information: table: film_rank

Answer: SELECT MAX(Number_cities), MIN(Number_cities) FROM market


Question:
How many markets have number of cities smaller than 300?
Additional table information: table: film_rank

Answer: SELECT COUNT(*) FROM market WHERE Number_cities < 300


Question:
Count the number of markets that have a number of cities lower than 300.
Additional table information: table: film_rank

Answer: SELECT COUNT(*) FROM market WHERE Number_cities < 300


Question:
List all countries of markets in ascending alphabetical order.
Additional table information: table: film_rank

Answer: SELECT Country FROM market ORDER BY Country ASC NULLS FIRST


Question:
What are the countries for each market, ordered alphabetically?
Additional table information: table: film_rank

Answer: SELECT Country FROM market ORDER BY Country ASC NULLS FIRST


Question:
List all countries of markets in descending order of number of cities.
Additional table information: table: film_rank

Answer: SELECT Country FROM market ORDER BY Number_cities DESC


Question:
What are the countries for each market ordered by decreasing number of cities?
Additional table information: table: film_rank

Answer: SELECT Country FROM market ORDER BY Number_cities DESC


Question:
Please show the titles of films and the types of market estimations.
Additional table information: table: film_rank

Answer: SELECT T1.Title, T2.Type FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID


Question:
What are the titles of films and corresponding types of market estimations?
Additional table information: table: film_rank

Answer: SELECT T1.Title, T2.Type FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID


Question:
Show the distinct director of films with market estimation in the year of 1995.
Additional table information: table: film_rank

Answer: SELECT DISTINCT T1.Director FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID WHERE T2.Year = 1995


Question:
Who are the different directors of films which had market estimation in 1995?
Additional table information: table: film_rank

Answer: SELECT DISTINCT T1.Director FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID WHERE T2.Year = 1995


Question:
What is the average number of cities of markets with low film market estimate bigger than 10000?
Additional table information: table: film_rank

Answer: SELECT AVG(T2.Number_cities) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T1.Low_Estimate > 10000


Question:
Give the average number of cities within markets that had a low market estimation larger than 10000?
Additional table information: table: film_rank

Answer: SELECT AVG(T2.Number_cities) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T1.Low_Estimate > 10000


Question:
Please list the countries and years of film market estimations.
Additional table information: table: film_rank

Answer: SELECT T2.Country, T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID


Question:
What are the countries of markets and their corresponding years of market estimation?
Additional table information: table: film_rank

Answer: SELECT T2.Country, T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID


Question:
Please list the years of film market estimations when the market is in country 'Japan' in descending order.
Additional table information: table: film_rank

Answer: SELECT T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = 'Japan' ORDER BY T1.Year DESC


Question:
What are the years of film market estimation for the market of Japan, ordered by year descending?
Additional table information: table: film_rank

Answer: SELECT T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = 'Japan' ORDER BY T1.Year DESC


Question:
List the studios of each film and the number of films produced by that studio.
Additional table information: table: film_rank

Answer: SELECT Studio, COUNT(*) FROM film GROUP BY Studio


Question:
How films are produced by each studio?
Additional table information: table: film_rank

Answer: SELECT Studio, COUNT(*) FROM film GROUP BY Studio


Question:
List the name of film studio that have the most number of films.
Additional table information: table: film_rank

Answer: SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the name of teh studio that created the most films?
Additional table information: table: film_rank

Answer: SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1


Question:
List the names of studios that have at least two films.
Additional table information: table: film_rank

Answer: SELECT Studio FROM film GROUP BY Studio HAVING COUNT(*) >= 2


Question:
What are the names of studios that have made two or more films?
Additional table information: table: film_rank

Answer: SELECT Studio FROM film GROUP BY Studio HAVING COUNT(*) >= 2


Question:
List the title of films that do not have any market estimation.
Additional table information: table: film_rank

Answer: SELECT Title FROM film WHERE NOT Film_ID IN (SELECT Film_ID FROM film_market_estimation)


Question:
What are the titles of films that do not have a film market estimation?
Additional table information: table: film_rank

Answer: SELECT Title FROM film WHERE NOT Film_ID IN (SELECT Film_ID FROM film_market_estimation)


Question:
Show the studios that have produced films with director 'Nicholas Meyer' and 'Walter Hill'.
Additional table information: table: film_rank

Answer: SELECT Studio FROM film WHERE Director = 'Nicholas Meyer' INTERSECT SELECT Studio FROM film WHERE Director = 'Walter Hill'


Question:
What are the names of studios that have produced films with both Nicholas Meyer and Walter Hill?
Additional table information: table: film_rank

Answer: SELECT Studio FROM film WHERE Director = 'Nicholas Meyer' INTERSECT SELECT Studio FROM film WHERE Director = 'Walter Hill'


Question:
Find the titles and studios of the films that are produced by some film studios that contained the word 'Universal'.
Additional table information: table: film_rank

Answer: SELECT title, Studio FROM film WHERE Studio LIKE '%Universal%'


Question:
What are the titles and studios of films that have been produced by a studio whose name contains 'Universal'?
Additional table information: table: film_rank

Answer: SELECT title, Studio FROM film WHERE Studio LIKE '%Universal%'


Question:
Show the studios that have not produced films with director 'Walter Hill'.
Additional table information: table: film_rank

Answer: SELECT Studio FROM film EXCEPT SELECT Studio FROM film WHERE Director = 'Walter Hill'


Question:
Which studios have never worked with the director Walter Hill?
Additional table information: table: film_rank

Answer: SELECT Studio FROM film EXCEPT SELECT Studio FROM film WHERE Director = 'Walter Hill'


Question:
List the studios which average gross is above 4500000.
Additional table information: table: film_rank

Answer: SELECT Studio FROM film GROUP BY Studio HAVING AVG(Gross_in_dollar) >= 4500000


Question:
Which studios have an average gross of over 4500000?
Additional table information: table: film_rank

Answer: SELECT Studio FROM film GROUP BY Studio HAVING AVG(Gross_in_dollar) >= 4500000


Question:
What is the title of the film that has the highest high market estimation.
Additional table information: table: film_rank

Answer: SELECT t1.title FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID ORDER BY high_estimate DESC LIMIT 1


Question:
Return the title of the film with the highest high estimate?
Additional table information: table: film_rank

Answer: SELECT t1.title FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID ORDER BY high_estimate DESC LIMIT 1


Question:
What are the titles and directors of the films were never presented in China?
Additional table information: table: film_rank

Answer: SELECT title, director FROM film WHERE NOT film_id IN (SELECT film_id FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id = T2.Market_ID WHERE country = 'China')


Question:
Return the titles and directors of films that were never in the market of China.
Additional table information: table: film_rank

Answer: SELECT title, director FROM film WHERE NOT film_id IN (SELECT film_id FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id = T2.Market_ID WHERE country = 'China')


Question:
How many calendar items do we have?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT COUNT(*) FROM Ref_calendar


Question:
Count the number of all the calendar items.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT COUNT(*) FROM Ref_calendar


Question:
Show all calendar dates and day Numbers.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT calendar_date, day_Number FROM Ref_calendar


Question:
What are all the calendar dates and day Numbers?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT calendar_date, day_Number FROM Ref_calendar


Question:
Show the number of document types.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT COUNT(*) FROM Ref_document_types


Question:
How many document types are there?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT COUNT(*) FROM Ref_document_types


Question:
List all document type codes and document type names.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT document_type_code, document_type_name FROM Ref_document_types


Question:
What are all the document type codes and document type names?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT document_type_code, document_type_name FROM Ref_document_types


Question:
What is the name and description for document type code RV?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT document_type_name, document_type_description FROM Ref_document_types WHERE document_type_code = 'RV'


Question:
Give me the name and description of the document type code RV.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT document_type_name, document_type_description FROM Ref_document_types WHERE document_type_code = 'RV'


Question:
What is the document type code for document type 'Paper'?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT document_type_code FROM Ref_document_types WHERE document_type_name = 'Paper'


Question:
Find the code of the document type 'Paper'.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT document_type_code FROM Ref_document_types WHERE document_type_name = 'Paper'


Question:
Show the number of documents with document type code CV or BK.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT COUNT(*) FROM All_documents WHERE document_type_code = 'CV' OR document_type_code = 'BK'


Question:
How many documents have document type code CV or BK?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT COUNT(*) FROM All_documents WHERE document_type_code = 'CV' OR document_type_code = 'BK'


Question:
What is the date when the document 'Marry CV' was stored?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT date_stored FROM All_documents WHERE Document_name = 'Marry CV'


Question:
When was the document named 'Marry CV' stored? Give me the date.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT date_stored FROM All_documents WHERE Document_name = 'Marry CV'


Question:
What is the day Number and date of all the documents?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT T2.day_Number, T1.Date_Stored FROM All_documents AS T1 JOIN Ref_calendar AS T2 ON T1.date_stored = T2.calendar_date


Question:
Return the day Number and stored date for all the documents.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT T2.day_Number, T1.Date_Stored FROM All_documents AS T1 JOIN Ref_calendar AS T2 ON T1.date_stored = T2.calendar_date


Question:
What is the document type name for the document with name 'How to read a book'?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT T2.document_type_name FROM All_documents AS T1 JOIN Ref_document_types AS T2 ON T1.document_type_code = T2.document_type_code WHERE T1.document_name = 'How to read a book'


Question:
Find the document type name of the document named 'How to read a book'.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT T2.document_type_name FROM All_documents AS T1 JOIN Ref_document_types AS T2 ON T1.document_type_code = T2.document_type_code WHERE T1.document_name = 'How to read a book'


Question:
Show the number of locations.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT COUNT(*) FROM Ref_locations


Question:
How many locations are listed in the database?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT COUNT(*) FROM Ref_locations


Question:
List all location codes and location names.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT location_code, location_name FROM Ref_locations


Question:
What are all the location codes and location names?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT location_code, location_name FROM Ref_locations


Question:
What are the name and description for location code x?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT location_name, location_description FROM Ref_locations WHERE location_code = 'x'


Question:
Give me the name and description of the location with code x.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT location_name, location_description FROM Ref_locations WHERE location_code = 'x'


Question:
What is the location code for the country 'Canada'?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT location_code FROM Ref_locations WHERE location_name = 'Canada'


Question:
Show the location code of the country 'Canada'.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT location_code FROM Ref_locations WHERE location_name = 'Canada'


Question:
How many roles are there?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT COUNT(*) FROM ROLES


Question:
Count the total number of roles listed.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT COUNT(*) FROM ROLES


Question:
List all role codes, role names, and role descriptions.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT role_code, role_name, role_description FROM ROLES


Question:
What are all the role codes, role names, and role descriptions?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT role_code, role_name, role_description FROM ROLES


Question:
What are the name and description for role code 'MG'?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT role_name, role_description FROM ROLES WHERE role_code = 'MG'


Question:
Find the name and description of the role with code 'MG'.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT role_name, role_description FROM ROLES WHERE role_code = 'MG'


Question:
Show the description for role name 'Proof Reader'.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT role_description FROM ROLES WHERE role_name = 'Proof Reader'


Question:
What is the description of the role named 'Proof Reader'?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT role_description FROM ROLES WHERE role_name = 'Proof Reader'


Question:
How many employees do we have?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT COUNT(*) FROM Employees


Question:
Find the number of employees we have.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT COUNT(*) FROM Employees


Question:
Show the name, role code, and date of birth for the employee with name 'Armani'.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT employee_name, role_code, date_of_birth FROM Employees WHERE employee_Name = 'Armani'


Question:
What are the name, role code, and date of birth of the employee named 'Armani'?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT employee_name, role_code, date_of_birth FROM Employees WHERE employee_Name = 'Armani'


Question:
What is the id for the employee called Ebba?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT employee_ID FROM Employees WHERE employee_name = 'Ebba'


Question:
Show the id of the employee named Ebba.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT employee_ID FROM Employees WHERE employee_name = 'Ebba'


Question:
Show the names of all the employees with role 'HR'.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT employee_name FROM Employees WHERE role_code = 'HR'


Question:
Which employees have the role with code 'HR'? Find their names.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT employee_name FROM Employees WHERE role_code = 'HR'


Question:
Show all role codes and the number of employees in each role.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT role_code, COUNT(*) FROM Employees GROUP BY role_code


Question:
What is the code of each role and the number of employees in each role?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT role_code, COUNT(*) FROM Employees GROUP BY role_code


Question:
What is the role code with the largest number of employees?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT role_code FROM Employees GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the code of the role that have the most employees.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT role_code FROM Employees GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show all role codes with at least 3 employees.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT role_code FROM Employees GROUP BY role_code HAVING COUNT(*) >= 3


Question:
What are the roles with three or more employees? Give me the role codes.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT role_code FROM Employees GROUP BY role_code HAVING COUNT(*) >= 3


Question:
Show the role code with the least employees.
Additional table information: table: cre_Doc_Tracking_DB

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


Question:
What is the role with the smallest number of employees? Find the role codes.
Additional table information: table: cre_Doc_Tracking_DB

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


Question:
What is the role name and role description for employee called Ebba?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT T2.role_name, T2.role_description FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T1.employee_name = 'Ebba'


Question:
Show the name and description of the role played by the employee named Ebba.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT T2.role_name, T2.role_description FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T1.employee_name = 'Ebba'


Question:
Show the names of employees with role name Editor.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT T1.employee_name FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = 'Editor'


Question:
Find the names of all the employees whose the role name is 'Editor'.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT T1.employee_name FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = 'Editor'


Question:
Show the employee ids for all employees with role name 'Human Resource' or 'Manager'.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT T1.employee_id FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = 'Human Resource' OR T2.role_name = 'Manager'


Question:
What are the employee ids of the employees whose role name is 'Human Resource' or 'Manager'?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT T1.employee_id FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = 'Human Resource' OR T2.role_name = 'Manager'


Question:
What are the different location codes for documents?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT DISTINCT location_code FROM Document_locations


Question:
Give me all the distinct location codes for documents.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT DISTINCT location_code FROM Document_locations


Question:
Show the location name for document 'Robin CV'.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT T3.location_name FROM All_documents AS T1 JOIN Document_locations AS T2 ON T1.document_id = T2.document_id JOIN Ref_locations AS T3 ON T2.location_code = T3.location_code WHERE T1.document_name = 'Robin CV'


Question:
What is the location name of the document 'Robin CV'?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT T3.location_name FROM All_documents AS T1 JOIN Document_locations AS T2 ON T1.document_id = T2.document_id JOIN Ref_locations AS T3 ON T2.location_code = T3.location_code WHERE T1.document_name = 'Robin CV'


Question:
Show the location code, the starting date and ending data in that location for all the documents.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT location_code, date_in_location_from, date_in_locaton_to FROM Document_locations


Question:
What are each document's location code, and starting date and ending data in that location?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT location_code, date_in_location_from, date_in_locaton_to FROM Document_locations


Question:
What is 'the date in location from' and 'the date in location to' for the document with name 'Robin CV'?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT T1.date_in_location_from, T1.date_in_locaton_to FROM Document_locations AS T1 JOIN All_documents AS T2 ON T1.document_id = T2.document_id WHERE T2.document_name = 'Robin CV'


Question:
Find the starting date and ending data in location for the document named 'Robin CV'.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT T1.date_in_location_from, T1.date_in_locaton_to FROM Document_locations AS T1 JOIN All_documents AS T2 ON T1.document_id = T2.document_id WHERE T2.document_name = 'Robin CV'


Question:
Show the location codes and the number of documents in each location.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT location_code, COUNT(*) FROM Document_locations GROUP BY location_code


Question:
What is the code of each location and the number of documents in that location?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT location_code, COUNT(*) FROM Document_locations GROUP BY location_code


Question:
What is the location code with the most documents?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT location_code FROM Document_locations GROUP BY location_code ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the code of the location with the largest number of documents.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT location_code FROM Document_locations GROUP BY location_code ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show the location codes with at least 3 documents.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT location_code FROM Document_locations GROUP BY location_code HAVING COUNT(*) >= 3


Question:
What are the codes of the locations with at least three documents?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT location_code FROM Document_locations GROUP BY location_code HAVING COUNT(*) >= 3


Question:
Show the location name and code with the least documents.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT T2.location_name, T1.location_code FROM Document_locations AS T1 JOIN Ref_locations AS T2 ON T1.location_code = T2.location_code GROUP BY T1.location_code ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1


Question:
What are the name and code of the location with the smallest number of documents?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT T2.location_name, T1.location_code FROM Document_locations AS T1 JOIN Ref_locations AS T2 ON T1.location_code = T2.location_code GROUP BY T1.location_code ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1


Question:
What are the names of the employees who authorised the destruction and the employees who destroyed the corresponding documents?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT T2.employee_name, T3.employee_name FROM Documents_to_be_destroyed AS T1 JOIN Employees AS T2 ON T1.Destruction_Authorised_by_Employee_ID = T2.employee_id JOIN Employees AS T3 ON T1.Destroyed_by_Employee_ID = T3.employee_id


Question:
List the names of the employees who authorized the destruction of documents and the employees who destroyed the corresponding documents.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT T2.employee_name, T3.employee_name FROM Documents_to_be_destroyed AS T1 JOIN Employees AS T2 ON T1.Destruction_Authorised_by_Employee_ID = T2.employee_id JOIN Employees AS T3 ON T1.Destroyed_by_Employee_ID = T3.employee_id


Question:
Show the id of each employee and the number of document destruction authorised by that employee.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT Destruction_Authorised_by_Employee_ID, COUNT(*) FROM Documents_to_be_destroyed GROUP BY Destruction_Authorised_by_Employee_ID


Question:
What are the id of each employee and the number of document destruction authorised by that employee?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT Destruction_Authorised_by_Employee_ID, COUNT(*) FROM Documents_to_be_destroyed GROUP BY Destruction_Authorised_by_Employee_ID


Question:
Show the employee ids and the number of documents destroyed by each employee.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT Destroyed_by_Employee_ID, COUNT(*) FROM Documents_to_be_destroyed GROUP BY Destroyed_by_Employee_ID


Question:
What are the id of each employee and the number of document destroyed by that employee?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT Destroyed_by_Employee_ID, COUNT(*) FROM Documents_to_be_destroyed GROUP BY Destroyed_by_Employee_ID


Question:
Show the ids of the employees who don't authorize destruction for any document.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT employee_id FROM Employees EXCEPT SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed


Question:
Which employees do not authorize destruction for any document? Give me their employee ids.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT employee_id FROM Employees EXCEPT SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed


Question:
Show the ids of all employees who have authorized destruction.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT DISTINCT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed


Question:
What are the ids of all the employees who authorize document destruction?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT DISTINCT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed


Question:
Show the ids of all employees who have destroyed a document.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT DISTINCT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed


Question:
What are the ids of all the employees who have destroyed documents?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT DISTINCT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed


Question:
Show the ids of all employees who don't destroy any document.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT employee_id FROM Employees EXCEPT SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed


Question:
Which employees do not destroy any document? Find their employee ids.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT employee_id FROM Employees EXCEPT SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed


Question:
Show the ids of all employees who have either destroyed a document or made an authorization to do this.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed UNION SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed


Question:
Which employees have either destroyed a document or made an authorization to do so? Return their employee ids.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed UNION SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed


Question:
How many clubs are there?
Additional table information: table: club_1

Answer: SELECT COUNT(*) FROM club


Question:
Count the total number of clubs.
Additional table information: table: club_1

Answer: SELECT COUNT(*) FROM club


Question:
What are the names of all clubs?
Additional table information: table: club_1

Answer: SELECT clubname FROM club


Question:
Give me the name of each club.
Additional table information: table: club_1

Answer: SELECT clubname FROM club


Question:
How many students are there?
Additional table information: table: club_1

Answer: SELECT COUNT(*) FROM student


Question:
Count the total number of students.
Additional table information: table: club_1

Answer: SELECT COUNT(*) FROM student


Question:
What are the first names of all the students?
Additional table information: table: club_1

Answer: SELECT DISTINCT fname FROM student


Question:
Find each student's first name.
Additional table information: table: club_1

Answer: SELECT DISTINCT fname FROM student


Question:
Find the last names of the members of the club 'Bootup Baltimore'.
Additional table information: table: club_1

Answer: SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore'


Question:
Who are the members of the club named 'Bootup Baltimore'? Give me their last names.
Additional table information: table: club_1

Answer: SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore'


Question:
Who are the members of the club named 'Hopkins Student Enterprises'? Show the last name.
Additional table information: table: club_1

Answer: SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Hopkins Student Enterprises'


Question:
Return the last name for the members of the club named 'Hopkins Student Enterprises'.
Additional table information: table: club_1

Answer: SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Hopkins Student Enterprises'


Question:
How many members does the club 'Tennis Club' has?
Additional table information: table: club_1

Answer: SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Tennis Club'


Question:
Count the members of the club 'Tennis Club'.
Additional table information: table: club_1

Answer: SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Tennis Club'


Question:
Find the number of members of club 'Pen and Paper Gaming'.
Additional table information: table: club_1

Answer: SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Pen and Paper Gaming'


Question:
How many people have membership in the club 'Pen and Paper Gaming'?
Additional table information: table: club_1

Answer: SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Pen and Paper Gaming'


Question:
How many clubs does 'Linda Smith' belong to?
Additional table information: table: club_1

Answer: SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = 'Linda' AND t3.lname = 'Smith'


Question:
How many clubs does 'Linda Smith' have membership for?
Additional table information: table: club_1

Answer: SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = 'Linda' AND t3.lname = 'Smith'


Question:
Find the number of clubs where 'Tracy Kim' is a member.
Additional table information: table: club_1

Answer: SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = 'Tracy' AND t3.lname = 'Kim'


Question:
For how many clubs is 'Tracy Kim' a member?
Additional table information: table: club_1

Answer: SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = 'Tracy' AND t3.lname = 'Kim'


Question:
Find all the female members of club 'Bootup Baltimore'. Show the first name and last name.
Additional table information: table: club_1

Answer: SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore' AND t3.sex = 'F'


Question:
Give me the first name and last name for all the female members of the club 'Bootup Baltimore'.
Additional table information: table: club_1

Answer: SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore' AND t3.sex = 'F'


Question:
Find all the male members of club 'Hopkins Student Enterprises'. Show the first name and last name.
Additional table information: table: club_1

Answer: SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Hopkins Student Enterprises' AND t3.sex = 'M'


Question:
What are the first name and last name of each male member in club 'Hopkins Student Enterprises'?
Additional table information: table: club_1

Answer: SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Hopkins Student Enterprises' AND t3.sex = 'M'


Question:
Find all members of 'Bootup Baltimore' whose major is '600'. Show the first name and last name.
Additional table information: table: club_1

Answer: SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore' AND t3.major = '600'


Question:
Which members of 'Bootup Baltimore' major in '600'? Give me their first names and last names.
Additional table information: table: club_1

Answer: SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore' AND t3.major = '600'


Question:
Which club has the most members majoring in '600'?
Additional table information: table: club_1

Answer: SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.major = '600' GROUP BY t1.clubname ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the club which has the largest number of members majoring in '600'.
Additional table information: table: club_1

Answer: SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.major = '600' GROUP BY t1.clubname ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the name of the club that has the most female students.
Additional table information: table: club_1

Answer: SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.sex = 'F' GROUP BY t1.clubname ORDER BY COUNT(*) DESC LIMIT 1


Question:
Which club has the most female students as their members? Give me the name of the club.
Additional table information: table: club_1

Answer: SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.sex = 'F' GROUP BY t1.clubname ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the description of the club named 'Tennis Club'?
Additional table information: table: club_1

Answer: SELECT clubdesc FROM club WHERE clubname = 'Tennis Club'


Question:
Find the description of the club called 'Tennis Club'.
Additional table information: table: club_1

Answer: SELECT clubdesc FROM club WHERE clubname = 'Tennis Club'


Question:
Find the description of the club 'Pen and Paper Gaming'.
Additional table information: table: club_1

Answer: SELECT clubdesc FROM club WHERE clubname = 'Pen and Paper Gaming'


Question:
What is the description of the club 'Pen and Paper Gaming'?
Additional table information: table: club_1

Answer: SELECT clubdesc FROM club WHERE clubname = 'Pen and Paper Gaming'


Question:
What is the location of the club named 'Tennis Club'?
Additional table information: table: club_1

Answer: SELECT clublocation FROM club WHERE clubname = 'Tennis Club'


Question:
Where us the club named 'Tennis Club' located?
Additional table information: table: club_1

Answer: SELECT clublocation FROM club WHERE clubname = 'Tennis Club'


Question:
Find the location of the club 'Pen and Paper Gaming'.
Additional table information: table: club_1

Answer: SELECT clublocation FROM club WHERE clubname = 'Pen and Paper Gaming'


Question:
Where is the club 'Pen and Paper Gaming' located?
Additional table information: table: club_1

Answer: SELECT clublocation FROM club WHERE clubname = 'Pen and Paper Gaming'


Question:
Where is the club 'Hopkins Student Enterprises' located?
Additional table information: table: club_1

Answer: SELECT clublocation FROM club WHERE clubname = 'Hopkins Student Enterprises'


Question:
Tell me the location of the club 'Hopkins Student Enterprises'.
Additional table information: table: club_1

Answer: SELECT clublocation FROM club WHERE clubname = 'Hopkins Student Enterprises'


Question:
Find the name of all the clubs at 'AKW'.
Additional table information: table: club_1

Answer: SELECT clubname FROM club WHERE clublocation = 'AKW'


Question:
Which clubs are located at 'AKW'? Return the club names.
Additional table information: table: club_1

Answer: SELECT clubname FROM club WHERE clublocation = 'AKW'


Question:
How many clubs are located at 'HHH'?
Additional table information: table: club_1

Answer: SELECT COUNT(*) FROM club WHERE clublocation = 'HHH'


Question:
Count the number of clubs located at 'HHH'.
Additional table information: table: club_1

Answer: SELECT COUNT(*) FROM club WHERE clublocation = 'HHH'


Question:
What are the first and last name of the president of the club 'Bootup Baltimore'?
Additional table information: table: club_1

Answer: SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore' AND t2.position = 'President'


Question:
Who is the president of the club 'Bootup Baltimore'? Give me the first and last name.
Additional table information: table: club_1

Answer: SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore' AND t2.position = 'President'


Question:
Who is the 'CTO' of club 'Hopkins Student Enterprises'? Show the first name and last name.
Additional table information: table: club_1

Answer: SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Hopkins Student Enterprises' AND t2.position = 'CTO'


Question:
Find the first name and last name for the 'CTO' of the club 'Hopkins Student Enterprises'?
Additional table information: table: club_1

Answer: SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Hopkins Student Enterprises' AND t2.position = 'CTO'


Question:
How many different roles are there in the club 'Bootup Baltimore'?
Additional table information: table: club_1

Answer: SELECT COUNT(DISTINCT t2.position) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid WHERE t1.clubname = 'Bootup Baltimore'


Question:
Count the number of different positions in the club 'Bootup Baltimore'.
Additional table information: table: club_1

Answer: SELECT COUNT(DISTINCT t2.position) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid WHERE t1.clubname = 'Bootup Baltimore'


Question:
How many members of 'Bootup Baltimore' are older than 18?
Additional table information: table: club_1

Answer: SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore' AND t3.age > 18


Question:
Count the number of members in club 'Bootup Baltimore' whose age is above 18.
Additional table information: table: club_1

Answer: SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore' AND t3.age > 18


Question:
How many members of club 'Bootup Baltimore' are younger than 18?
Additional table information: table: club_1

Answer: SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore' AND t3.age < 18


Question:
Count the number of members in club 'Bootup Baltimore' whose age is below 18.
Additional table information: table: club_1

Answer: SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore' AND t3.age < 18


Question:
Find the names of all the clubs that have at least a member from the city with city code 'BAL'.
Additional table information: table: club_1

Answer: SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = 'BAL'


Question:
Which clubs have one or more members from the city with code 'BAL'? Give me the names of the clubs.
Additional table information: table: club_1

Answer: SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = 'BAL'


Question:
Find the names of the clubs that have at least a member from the city with city code 'HOU'.
Additional table information: table: club_1

Answer: SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = 'HOU'


Question:
Which clubs have one or more members from the city with code 'HOU'? Give me the names of the clubs.
Additional table information: table: club_1

Answer: SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = 'HOU'


Question:
How many clubs does the student named 'Eric Tai' belong to?
Additional table information: table: club_1

Answer: SELECT COUNT(DISTINCT t1.clubname) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = 'Eric' AND t3.lname = 'Tai'


Question:
Count the number of clubs for which the student named 'Eric Tai' is a member.
Additional table information: table: club_1

Answer: SELECT COUNT(DISTINCT t1.clubname) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = 'Eric' AND t3.lname = 'Tai'


Question:
List the clubs having 'Davis Steven' as a member.
Additional table information: table: club_1

Answer: SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = 'Davis' AND t3.lname = 'Steven'


Question:
What are the names of the clubs that have 'Davis Steven' as a member?
Additional table information: table: club_1

Answer: SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = 'Davis' AND t3.lname = 'Steven'


Question:
List the clubs that have at least a member with advisor '1121'.
Additional table information: table: club_1

Answer: SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.advisor = 1121


Question:
Which clubs have one or more members whose advisor is '1121'?
Additional table information: table: club_1

Answer: SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.advisor = 1121


Question:
What is the average age of the members of the club 'Bootup Baltimore'?
Additional table information: table: club_1

Answer: SELECT AVG(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore'


Question:
Find the average age of the members in the club 'Bootup Baltimore'.
Additional table information: table: club_1

Answer: SELECT AVG(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore'


Question:
Find the average age of members of the club 'Hopkins Student Enterprises'.
Additional table information: table: club_1

Answer: SELECT AVG(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Hopkins Student Enterprises'


Question:
On average, how old are the members in the club 'Hopkins Student Enterprises'?
Additional table information: table: club_1

Answer: SELECT AVG(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Hopkins Student Enterprises'


Question:
Retrieve the average age of members of the club 'Tennis Club'.
Additional table information: table: club_1

Answer: SELECT AVG(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Tennis Club'


Question:
Compute the average age of the members in the club 'Tennis Club'.
Additional table information: table: club_1

Answer: SELECT AVG(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Tennis Club'


Question:
What are the distinct grant amount for the grants where the documents were sent before '1986-08-26 20:49:27' and grant were ended after '1989-03-16 18:27:16'?
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.grant_amount FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id WHERE T2.sent_date < '1986-08-26 20:49:27' INTERSECT SELECT grant_amount FROM grants WHERE grant_end_date > '1989-03-16 18:27:16'


Question:
What are the different grant amounts for documents sent before '1986-08-26 20:49:27' and after the grant ended on '1989-03-16 18:27:16'?
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.grant_amount FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id WHERE T2.sent_date < '1986-08-26 20:49:27' INTERSECT SELECT grant_amount FROM grants WHERE grant_end_date > '1989-03-16 18:27:16'


Question:
List the project details of the project both producing patent and paper as outcomes.
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id WHERE T2.outcome_code = 'Paper' INTERSECT SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id WHERE T2.outcome_code = 'Patent'


Question:
What are the details of the project that is producing both patents and papers as outcomes?
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id WHERE T2.outcome_code = 'Paper' INTERSECT SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id WHERE T2.outcome_code = 'Patent'


Question:
What is the total grant amount of the organisations described as research?
Additional table information: table: tracking_grants_for_research

Answer: SELECT SUM(grant_amount) FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id JOIN organisation_Types AS T3 ON T2.organisation_type = T3.organisation_type WHERE T3.organisation_type_description = 'Research'


Question:
What is the total amount of grant money for research?
Additional table information: table: tracking_grants_for_research

Answer: SELECT SUM(grant_amount) FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id JOIN organisation_Types AS T3 ON T2.organisation_type = T3.organisation_type WHERE T3.organisation_type_description = 'Research'


Question:
List from which date and to which date these staff work: project staff of the project which hires the most staffs
Additional table information: table: tracking_grants_for_research

Answer: SELECT date_from, date_to FROM Project_Staff WHERE project_id IN (SELECT project_id FROM Project_Staff GROUP BY project_id ORDER BY COUNT(*) DESC LIMIT 1) UNION SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'leader'


Question:
From what date and to what date do the staff work on a project that has the most staff and has staff in a leader role?
Additional table information: table: tracking_grants_for_research

Answer: SELECT date_from, date_to FROM Project_Staff WHERE project_id IN (SELECT project_id FROM Project_Staff GROUP BY project_id ORDER BY COUNT(*) DESC LIMIT 1) UNION SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'leader'


Question:
Find the organisation ids and details of the organisations which are involved in
Additional table information: table: tracking_grants_for_research

Answer: SELECT T2.organisation_id, T2.organisation_details FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_id HAVING SUM(T1.grant_amount) > 6000


Question:
What are the ids and details for all organizations that have grants of more than 6000 dollars?
Additional table information: table: tracking_grants_for_research

Answer: SELECT T2.organisation_id, T2.organisation_details FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_id HAVING SUM(T1.grant_amount) > 6000


Question:
What is the organisation type and id of the organisation which has the most number of research staff?
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.organisation_type, T1.organisation_id FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the type and id of the organization that has the most research staff?
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.organisation_type, T1.organisation_id FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
Which organisation type hires most research staff?
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.organisation_type FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_type ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the type of the organization with the most research staff?
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.organisation_type FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_type ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find out the send dates of the documents with the grant amount of more than 5000 were granted by organisation type described
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.sent_date FROM documents AS T1 JOIN Grants AS T2 ON T1.grant_id = T2.grant_id JOIN Organisations AS T3 ON T2.organisation_id = T3.organisation_id JOIN organisation_Types AS T4 ON T3.organisation_type = T4.organisation_type WHERE T2.grant_amount > 5000 AND T4.organisation_type_description = 'Research'


Question:
What are the send dates for all documents that have a grant amount of more than 5000 and are involved in research?
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.sent_date FROM documents AS T1 JOIN Grants AS T2 ON T1.grant_id = T2.grant_id JOIN Organisations AS T3 ON T2.organisation_id = T3.organisation_id JOIN organisation_Types AS T4 ON T3.organisation_type = T4.organisation_type WHERE T2.grant_amount > 5000 AND T4.organisation_type_description = 'Research'


Question:
What are the response received dates for the documents described as 'Regular' or granted with more than 100?
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.response_received_date FROM Documents AS T1 JOIN Document_Types AS T2 ON T1.document_type_code = T2.document_type_code JOIN Grants AS T3 ON T1.grant_id = T3.grant_id WHERE T2.document_description = 'Regular' OR T3.grant_amount > 100


Question:
What is the response received date for the document described as Regular that was granted more than 100 dollars?
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.response_received_date FROM Documents AS T1 JOIN Document_Types AS T2 ON T1.document_type_code = T2.document_type_code JOIN Grants AS T3 ON T1.grant_id = T3.grant_id WHERE T2.document_description = 'Regular' OR T3.grant_amount > 100


Question:
List the project details of the projects which did not hire any staff for a researcher role.
Additional table information: table: tracking_grants_for_research

Answer: SELECT project_details FROM Projects WHERE NOT project_id IN (SELECT project_id FROM Project_Staff WHERE role_code = 'researcher')


Question:
What are the details for all projects that did not hire any staff in a research role?
Additional table information: table: tracking_grants_for_research

Answer: SELECT project_details FROM Projects WHERE NOT project_id IN (SELECT project_id FROM Project_Staff WHERE role_code = 'researcher')


Question:
What are the task details, task id and project id for the projects which are detailed as 'omnis' or  have more than 2 outcomes?
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.task_details, T1.task_id, T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id WHERE T2.project_details = 'omnis' UNION SELECT T1.task_details, T1.task_id, T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.project_id HAVING COUNT(*) > 2


Question:
What are the task details, task ids, and project ids for the progrects that are detailed as 'omnis' or have at least 3 outcomes?
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.task_details, T1.task_id, T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id WHERE T2.project_details = 'omnis' UNION SELECT T1.task_details, T1.task_id, T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.project_id HAVING COUNT(*) > 2


Question:
When do all the researcher role staff start to work, and when do they stop working?
Additional table information: table: tracking_grants_for_research

Answer: SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'researcher'


Question:
When did researchers start and stop working?
Additional table information: table: tracking_grants_for_research

Answer: SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'researcher'


Question:
How many kinds of roles are there for the staff?
Additional table information: table: tracking_grants_for_research

Answer: SELECT COUNT(DISTINCT role_code) FROM Project_Staff


Question:
How many different roles are there on the project staff?
Additional table information: table: tracking_grants_for_research

Answer: SELECT COUNT(DISTINCT role_code) FROM Project_Staff


Question:
What is the total amount of grants given by each organisations? Also list the organisation id.
Additional table information: table: tracking_grants_for_research

Answer: SELECT SUM(grant_amount), organisation_id FROM Grants GROUP BY organisation_id


Question:
What is the total amount of grant money given to each organization and what is its id?
Additional table information: table: tracking_grants_for_research

Answer: SELECT SUM(grant_amount), organisation_id FROM Grants GROUP BY organisation_id


Question:
List the project details of the projects with the research outcome described with the substring 'Published'.
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id JOIN Research_outcomes AS T3 ON T2.outcome_code = T3.outcome_code WHERE T3.outcome_description LIKE '%Published%'


Question:
What are the details for the project whose research has been published?
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id JOIN Research_outcomes AS T3 ON T2.outcome_code = T3.outcome_code WHERE T3.outcome_description LIKE '%Published%'


Question:
How many staff does each project has? List the project id and the number in an ascending order.
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.project_id, COUNT(*) FROM Project_Staff AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*) ASC NULLS FIRST


Question:
For each project id, how many staff does it have? List them in increasing order.
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.project_id, COUNT(*) FROM Project_Staff AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*) ASC NULLS FIRST


Question:
What is the complete description of the researcher role.
Additional table information: table: tracking_grants_for_research

Answer: SELECT role_description FROM Staff_Roles WHERE role_code = 'researcher'


Question:
What is the complete description of the job of a researcher?
Additional table information: table: tracking_grants_for_research

Answer: SELECT role_description FROM Staff_Roles WHERE role_code = 'researcher'


Question:
When did the first staff for the projects started working?
Additional table information: table: tracking_grants_for_research

Answer: SELECT date_from FROM Project_Staff ORDER BY date_from ASC NULLS FIRST LIMIT 1


Question:
When did the first staff member start working?
Additional table information: table: tracking_grants_for_research

Answer: SELECT date_from FROM Project_Staff ORDER BY date_from ASC NULLS FIRST LIMIT 1


Question:
Which project made the most number of outcomes? List the project details and the project id.
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.project_details, T1.project_id FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
What are the details and id of the project with the most outcomes?
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.project_details, T1.project_id FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
Which projects have no outcome? List the project details.
Additional table information: table: tracking_grants_for_research

Answer: SELECT project_details FROM Projects WHERE NOT project_id IN (SELECT project_id FROM Project_outcomes)


Question:
What are the details of the project with no outcomes?
Additional table information: table: tracking_grants_for_research

Answer: SELECT project_details FROM Projects WHERE NOT project_id IN (SELECT project_id FROM Project_outcomes)


Question:
Which organisation hired the most number of research staff? List the organisation id, type and detail.
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.organisation_id, T1.organisation_type, T1.organisation_details FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
What are the ids, types, and details of the organization with the most research staff?
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.organisation_id, T1.organisation_type, T1.organisation_details FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show the role description and the id of the project staff involved in most number of project outcomes?
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.role_description, T2.staff_id FROM Staff_Roles AS T1 JOIN Project_Staff AS T2 ON T1.role_code = T2.role_code JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.staff_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
For each staff id, what is the description of the role that is involved with the most number of projects?
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.role_description, T2.staff_id FROM Staff_Roles AS T1 JOIN Project_Staff AS T2 ON T1.role_code = T2.role_code JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.staff_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
Which document type is described with the prefix 'Initial'?
Additional table information: table: tracking_grants_for_research

Answer: SELECT document_type_code FROM Document_Types WHERE document_description LIKE 'Initial%'


Question:
What is the type of the document whose description starts with the word 'Initial'?
Additional table information: table: tracking_grants_for_research

Answer: SELECT document_type_code FROM Document_Types WHERE document_description LIKE 'Initial%'


Question:
For grants with both documents described as 'Regular' and documents described as 'Initial Application', list its start date.
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Regular' INTERSECT SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Initial Application'


Question:
For grants that have descriptions of Regular and Initial Applications, what are their start dates?
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Regular' INTERSECT SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Initial Application'


Question:
How many documents can one grant have at most? List the grant id and number.
Additional table information: table: tracking_grants_for_research

Answer: SELECT grant_id, COUNT(*) FROM Documents GROUP BY grant_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
For each grant id, how many documents does it have, and which one has the most?
Additional table information: table: tracking_grants_for_research

Answer: SELECT grant_id, COUNT(*) FROM Documents GROUP BY grant_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the organisation type description of the organisation detailed as 'quo'.
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.organisation_type_description FROM organisation_Types AS T1 JOIN Organisations AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_details = 'quo'


Question:
What is the type description of the organization whose detail is listed as 'quo'?
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.organisation_type_description FROM organisation_Types AS T1 JOIN Organisations AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_details = 'quo'


Question:
What are all the details of the organisations described as 'Sponsor'? Sort the result in an ascending order.
Additional table information: table: tracking_grants_for_research

Answer: SELECT organisation_details FROM Organisations AS T1 JOIN organisation_Types AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_type_description = 'Sponsor' ORDER BY organisation_details NULLS FIRST


Question:
What are the details of all organizations that are described as Sponsors and sort the results in ascending order?
Additional table information: table: tracking_grants_for_research

Answer: SELECT organisation_details FROM Organisations AS T1 JOIN organisation_Types AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_type_description = 'Sponsor' ORDER BY organisation_details NULLS FIRST


Question:
How many Patent outcomes are generated from all the projects?
Additional table information: table: tracking_grants_for_research

Answer: SELECT COUNT(*) FROM Project_outcomes WHERE outcome_code = 'Patent'


Question:
How many patents outcomes were listed for all the projects?
Additional table information: table: tracking_grants_for_research

Answer: SELECT COUNT(*) FROM Project_outcomes WHERE outcome_code = 'Patent'


Question:
How many project staff worked as leaders or started working before '1989-04-24 23:51:54'?
Additional table information: table: tracking_grants_for_research

Answer: SELECT COUNT(*) FROM Project_Staff WHERE role_code = 'leader' OR date_from < '1989-04-24 23:51:54'


Question:
How many project members were leaders or started working before '1989-04-24 23:51:54'?
Additional table information: table: tracking_grants_for_research

Answer: SELECT COUNT(*) FROM Project_Staff WHERE role_code = 'leader' OR date_from < '1989-04-24 23:51:54'


Question:
What is the last date of the staff leaving the projects?
Additional table information: table: tracking_grants_for_research

Answer: SELECT date_to FROM Project_Staff ORDER BY date_to DESC LIMIT 1


Question:
What is the last date that a staff member left a project?
Additional table information: table: tracking_grants_for_research

Answer: SELECT date_to FROM Project_Staff ORDER BY date_to DESC LIMIT 1


Question:
What are the result description of the project whose detail is 'sint'?
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code JOIN Projects AS T3 ON T2.project_id = T3.project_id WHERE T3.project_details = 'sint'


Question:
What is the description for the results whose project detail is 'sint'?
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code JOIN Projects AS T3 ON T2.project_id = T3.project_id WHERE T3.project_details = 'sint'


Question:
List the organisation id with the maximum outcome count, and the count.
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.organisation_id, COUNT(*) FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the id of the organization with the maximum number of outcomes and how many outcomes are there?
Additional table information: table: tracking_grants_for_research

Answer: SELECT T1.organisation_id, COUNT(*) FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
List the project details of the projects launched by the organisation
Additional table information: table: tracking_grants_for_research

Answer: SELECT project_details FROM Projects WHERE organisation_id IN (SELECT organisation_id FROM Projects GROUP BY organisation_id ORDER BY COUNT(*) DESC LIMIT 1)