niryuu/sni-each-converted huggingface dataset:
Show all locations where a gas station for company with market value greater than 100 is located.
Output: SELECT T3.location FROM station_company AS T1 JOIN company AS T2 ON T1.company_id  =  T2.company_id JOIN gas_station AS T3 ON T1.station_id  =  T3.station_id WHERE T2.market_value  >  100
What are the different names for each station that has ever had 7 bikes available?
Output: SELECT DISTINCT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id  =  T2.station_id WHERE T2.bikes_available  =  7
Show the pilot positions that have both pilots joining after year 2005 and pilots joining before 2000.
Output: SELECT POSITION FROM pilot WHERE Join_Year	 <  2000 INTERSECT SELECT POSITION FROM pilot WHERE Join_Year	 >  2005
Find the number of students who are older than 18 and do not have allergy to either food or animal.
Output: SELECT count(*) FROM Student WHERE age  >  18 AND StuID NOT IN ( SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy  =  T2.Allergy WHERE T2.allergytype  =  "food" OR T2.allergytype  =  "animal")
List the name of all playlist.
Output: SELECT name FROM playlists
What are the ids and details of events that have more than one participants?
Output: SELECT T1.event_id ,  T1.event_details FROM EVENTS AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID  =  T2.Event_ID GROUP BY T1.Event_ID HAVING count(*)  >  1
What is the number of invoices and total money billed in them from CA?
Output: SELECT billing_state ,  COUNT(*) ,  SUM(total) FROM invoices WHERE billing_state  =  "CA"
How many advisors are there?
Output: SELECT count(DISTINCT advisor) FROM Student
How many events had participants whose details had the substring 'Dr.'
Output: SELECT count(*) FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID  =  T2.Participant_ID WHERE T1.participant_details LIKE '%Dr.%'
What are the first and last names of the top 10 longest-serving employees?
Output: SELECT first_name , last_name FROM employees ORDER BY hire_date ASC LIMIT 10
Show all headquarters with both a company in banking industry and a company in Oil and gas.
Output: SELECT headquarters FROM company WHERE main_industry  =  'Banking' INTERSECT SELECT headquarters FROM company WHERE main_industry  =  'Oil and gas'
How much money did Lucas Mancini spend?
Output: SELECT sum(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = "Lucas" AND T1.last_name = "Mancini"
What are all the different food allergies?
Output: SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype  =  "food"
What are the ids and names of the architects who built at least 3 bridges ?
Output: SELECT T1.id ,  T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id  =  T2.architect_id GROUP BY T1.id HAVING count(*)  >=  3
What is the first and last name of artist who performed "Le Pop"?
Output: SELECT T2.firstname ,  T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId WHERE T3.Title  =  "Le Pop"
What is the name of the department htat has no students minoring in it?
Output: SELECT DName FROM DEPARTMENT EXCEPT SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO  =  T2.DNO
What are the famous titles of the artist "Triumfall"?
Output: SELECT Famous_Title FROM artist WHERE Artist  =  "Triumfall"
List the type of bed and name of all traditional rooms.
Output: SELECT roomName ,  bedType FROM Rooms WHERE decor = "traditional"
display the employee number, name( first name and last name ) and job title for all employees whose salary is more than any salary of those employees whose job title is PU_MAN.
Output: SELECT employee_id ,  first_name ,  last_name ,  job_id FROM employees WHERE salary  >  ( SELECT max(salary) FROM employees WHERE job_id  =  'PU_MAN' )
What are the codes, names, and descriptions of the different document types?
Output: SELECT document_type_code ,  document_type_name ,  document_type_description FROM Ref_document_types
What are the full name (first and last name) and salary for all employees who does not have any value for commission?
Output: SELECT first_name ,  last_name ,  salary FROM  employees WHERE commission_pct  =  "null"
How many times the number of adults and kids staying in a room reached the maximum capacity of the room?
Output: SELECT count(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId WHERE T2.maxOccupancy  =  T1.Adults + T1.Kids
What are the first and last names of the performer who was in the back stage position for the song "Badlands"?
Output: SELECT T2.firstname ,  T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId WHERE T3.Title  =  "Badlands" AND T1.StagePosition  =  "back"
How many problems did the product called "voluptatem" have in record?
Output: SELECT count(*) FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id WHERE T1.product_name = "voluptatem"
For each product that has problems, find the number of problems reported after 1986-11-13 and the product id?
Output: SELECT count(*) ,  T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T1.date_problem_reported > "1986-11-13" GROUP BY T2.product_id
List the all the assets make, model, details by the disposed date ascendingly.
Output: SELECT asset_make ,  asset_model ,  asset_details FROM Assets ORDER BY asset_disposed_date ASC
What are project ids of projects that have 2 or more corresponding documents?
Output: SELECT project_id FROM Documents GROUP BY project_id HAVING count(*)  >=  2
What is the first and last name of the artist who performed back stage for the song "Der Kapitan"?
Output: SELECT T2.firstname ,  T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId WHERE T3.Title  =  "Der Kapitan" AND T1.StagePosition  =  "back"
Find the number of customers in total.
Output: SELECT count(*) FROM customers
Find the female friends of Alice.
Output: SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.friend WHERE T2.name  =  'Alice' AND T1.gender  =  'female'
Find the names of females who are friends with Zach
Output: SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.name WHERE T2.friend  =  'Zach' AND T1.gender  =  'female'
Which problems are reported by the staff with first name "Christop"? Show the descriptions of the problems.
Output: SELECT T1.problem_description FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Christop"
How many different jobs are listed?
Output: SELECT count(DISTINCT job) FROM Person
What is the temperature of "Shanghai" city in January?
Output: SELECT T2.Jan FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T1.city = "Shanghai"
Which cities have regional population above 8000000 or below 5000000?
Output: SELECT city FROM city WHERE regional_population  >  10000000 UNION SELECT city FROM city WHERE regional_population  <  5000000
Find the number of students that have at least one grade "B".
Output: SELECT COUNT(DISTINCT StuID) FROM ENROLLED_IN WHERE Grade  =  "B"
What are the first and last names of the instructors who teach the top 3 number of courses?
Output: SELECT T2.Fname ,  T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor  =  T2.FacID GROUP BY T1.Instructor ORDER BY count(*) DESC LIMIT 3
Count the number of documents with expenses.
Output: SELECT count(*) FROM Documents_with_expenses
HOw many engineers are older than 30?
Output: SELECT count(*) FROM Person WHERE age  >  30 AND job  =  'engineer'
How many companies operates airlines in each airport?
Output: SELECT T3.id ,  count(*) FROM operate_company AS T1 JOIN flight AS t2 ON T1.id  =  T2.company_id JOIN airport AS T3 ON T2.airport_id  =  T3.id GROUP BY T3.id
What is all the information about employees with D or S in their first name, ordered by salary descending?
Output: SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' ORDER BY salary DESC
Find the average grade point of student whose last name is Smith.
Output: SELECT avg(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade  =  T2.lettergrade AND T1.StuID  =  T3.StuID WHERE T3.LName  =  "Smith"
List the asset id, details, make and model for every asset.
Output: SELECT asset_id ,  asset_details ,  asset_make ,  asset_model FROM Assets
What are the names of all of Alice's friends of friends?
Output: SELECT DISTINCT T4.name FROM PersonFriend AS T1 JOIN Person AS T2 ON T1.name  =  T2.name JOIN PersonFriend AS T3 ON T1.friend  =  T3.name JOIN PersonFriend AS T4 ON T3.friend  =  T4.name WHERE T2.name  =  'Alice' AND T4.name != 'Alice'
Find the products which have problems reported by both Lacey Bosco and Kenton Champlin?
Output: SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T3.staff_first_name = "Lacey" AND T3.staff_last_name = "Bosco" INTERSECT SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T3.staff_first_name = "Kenton" AND T3.staff_last_name = "Champlin"
What are the names of the employees who authorised the destruction and the employees who destroyed the corresponding documents?
Output: 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
What are the employee ids of the employees whose role name is "Human Resource" or "Manager"?
Output: 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"
What are the full names and hire dates for employees in the same department as someone with the first name Clara?
Output: SELECT first_name ,  last_name ,  hire_date FROM employees WHERE department_id  =  (SELECT department_id FROM employees WHERE first_name  =  "Clara")
List the clubs having "Davis Steven" as a member.
Output: 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"
Show the ids of the employees who don't authorize destruction for any document.
Output: SELECT employee_id FROM Employees EXCEPT SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed
Find the name and age of all males in order of their age.
Output: SELECT name FROM Person WHERE gender  =  'male' ORDER BY age
Return the song in the volume that has spent the most weeks on top?
Output: SELECT Song FROM volume ORDER BY Weeks_on_Top DESC LIMIT 1
How many members of "Bootup Baltimore" are older than 18?
Output: 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
What are the full names and cities of employees who have the letter Z in their first names?
Output: SELECT T1.first_name ,  T1.last_name ,  T3.city FROM employees AS T1 JOIN departments AS T2 ON T1.department_id  =  T2.department_id JOIN locations AS T3 ON T2.location_id  =  T3.location_id WHERE T1.first_name LIKE '%z%'
Find the number of clubs where "Tracy Kim" is a member.
Output: 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"
What are the names of departments that have at least one employee.
Output: SELECT DISTINCT T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id  =  T2.department_id
Find the rooms of faculties with rank professor who live in building NEB.
Output: SELECT Room FROM FACULTY WHERE Rank  =  "Professor" AND Building  =  "NEB"
what is the GDP of the city with the largest population.
Output: SELECT gdp FROM city ORDER BY Regional_Population DESC LIMIT 1
Please show the industries of companies in descending order of the number of companies.
Output: SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC
Give the ids for documents that have the budget description 'Government'.
Output: SELECT T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_code  =  T2.Budget_Type_code WHERE T2.budget_type_Description  =  "Government"
How many assets does each maintenance contract contain? List the number and the contract id.
Output: SELECT count(*) ,  T1.maintenance_contract_id FROM Maintenance_Contracts AS T1 JOIN Assets AS T2 ON T1.maintenance_contract_id  =  T2.maintenance_contract_id GROUP BY T1.maintenance_contract_id
display the emails of the employees who have no commission percentage and salary within the range 7000 to 12000 and works in that department which number is 50.
Output: SELECT email FROM employees WHERE commission_pct  =  "null" AND salary BETWEEN 7000 AND 12000 AND department_id = 50
What is the name of all the people who are older than at least one engineer? Order them by age.
Output: SELECT name FROM Person WHERE age  >  (SELECT min(age) FROM person WHERE job  =  'engineer') ORDER BY age
What is the song with the most vocals?
Output: SELECT title FROM vocals AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid GROUP BY T1.songid ORDER BY count(*) DESC LIMIT 1
What are all the employee ids and the names of the countries in which they work?
Output: SELECT T1.employee_id ,  T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id  =  T2.department_id JOIN locations AS T3 ON T2.location_id  =  T3.location_id JOIN countries AS T4 ON T3.country_id  =  T4.country_id
Show the authors of submissions and the acceptance results of their submissions.
Output: SELECT T2.Author ,  T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID  =  T2.Submission_ID
What are the document ids for the budget type code 'SF'?
Output: SELECT document_id FROM Documents_with_expenses WHERE budget_type_code  =  'SF'
Which company started the earliest the maintenance contract? Show the company name.
Output: SELECT T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Contracts AS T2 ON T1.company_id  =  T2.maintenance_contract_company_id ORDER BY T2.contract_start_date ASC LIMIT 1
Find the venue of the competition "1994 FIFA World Cup qualification" which was hosted by "Nanjing ( Jiangsu )".
Output: SELECT T3.venue FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city JOIN MATCH AS T3 ON T2.match_id = T3.match_id WHERE T1.city = "Nanjing ( Jiangsu )" AND T3.competition = "1994 FIFA World Cup qualification"
Please list the countries and years of film market estimations.
Output: SELECT T2.Country ,  T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID  =  T2.Market_ID
How many different songs have shared vocals?
Output: SELECT count(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid WHERE TYPE  =  "shared"
Return the ids and details corresponding to projects for which there are more than two documents.
Output: SELECT T1.project_id ,  T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id  =  T2.project_id GROUP BY T1.project_id HAVING count(*)  >  2
Which engineers have never visited to maintain the assets? List the engineer first name and last name.
Output: SELECT first_name ,  last_name FROM Maintenance_Engineers WHERE engineer_id NOT IN (SELECT engineer_id FROM Engineer_Visits)
Whah are the name of each industry and the number of companies in that industry?
Output: SELECT Industry ,  COUNT(*) FROM Companies GROUP BY Industry
Find the first and last names of people who payed more than the rooms' base prices.
Output: SELECT T1.firstname ,  T1.lastname FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId WHERE T1.Rate - T2.basePrice  >  0
Find the number of employees we have.
Output: SELECT count(*) FROM Employees
How many people are under 40 for each gender?
Output: SELECT count(*) ,  gender FROM Person WHERE age  <  40 GROUP BY gender
What is the id, name and nationality of the architect who built most mills?
Output: SELECT T1.id ,  T1.name ,  T1.nationality FROM architect AS T1 JOIN mill AS T2 ON T1.id  =  T2.architect_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1
What is the day Number and date of all the documents?
Output: SELECT T2.day_Number ,  T1.Date_Stored FROM All_documents AS T1 JOIN Ref_calendar AS T2 ON T1.date_stored  =  T2.calendar_date
What are the job ids for jobs done more than once for a period of more than 300 days?
Output: SELECT job_id FROM job_history WHERE end_date - start_date  > 300 GROUP BY job_id HAVING COUNT(*) >= 2
What are the distinct name of the mills built by the architects who have also built a bridge longer than 80 meters?
Output: SELECT DISTINCT T1.name FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id  =  T2.id JOIN bridge AS T3 ON T3.architect_id  =  T2.id WHERE T3.length_meters  >  80
What is the name of the room that can accommodate the most people?
Output: SELECT roomName FROM Rooms ORDER BY maxOccupancy DESC LIMIT 1
What is the total number of rooms available in this inn?
Output: SELECT count(*) FROM Rooms
what are the employee ids and job titles for employees in department 80?
Output: SELECT T1.employee_id ,  T2.job_title FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id  =  T2.job_id WHERE T1.department_id = 80
Find all the songs that do not have a back vocal.
Output: SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid  =  t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid  =  t2.songid WHERE TYPE  =  "back"
Return all information about employees with salaries between 8000 and 12000 for which commission is not null or where their department id is not 40.
Output: SELECT * FROM employees WHERE salary BETWEEN 8000 AND 12000 AND commission_pct != "null" OR  department_id != 40
How many airports haven't the pilot 'Thompson' driven an aircraft?
Output: SELECT count(*) FROM airport WHERE id NOT IN ( SELECT airport_id FROM flight WHERE pilot  =  'Thompson' )
Find the names of scientists who are not working on the project with the highest hours.
Output: SELECT name FROM scientists EXCEPT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project  =  T2.code JOIN scientists AS T3 ON T1.scientist  =  T3.SSN WHERE T2.hours  =  (SELECT max(hours) FROM projects)
Find the employee id for all employees who earn more than the average salary.
Output: SELECT employee_id FROM employees WHERE salary  >  (SELECT AVG(salary) FROM employees)
What is id of the city that hosted events in the most recent year?
Output: SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1
Which cities have higher temperature in Feb than in Jun or have once served as host cities?
Output: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id WHERE T2.Feb  >  T2.Jun UNION SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id  =  T4.host_city
Give me the name and description of the document type code RV.
Output: SELECT document_type_name ,  document_type_description FROM Ref_document_types WHERE document_type_code  =  "RV"
Which city has hosted the most events?
Output: SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id  =  T2.host_city GROUP BY T2.host_city ORDER BY count(*) DESC LIMIT 1
Show each author and the number of workshops they submitted to.
Output: SELECT T2.Author ,  COUNT(DISTINCT T1.workshop_id) FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID  =  T2.Submission_ID GROUP BY T2.Author
What are the distinct names and nationalities of the architects who have ever built a mill?
Output: SELECT DISTINCT T1.name ,  T1.nationality FROM architect AS T1 JOIN mill AS t2 ON T1.id  =  T2.architect_id
display the employee name ( first name and last name ) and hire date for all employees in the same department as Clara excluding Clara.
Output: SELECT first_name ,  last_name ,  hire_date FROM employees WHERE department_id  =  ( SELECT department_id FROM employees WHERE first_name  =  "Clara") AND first_name != "Clara"
Show the location codes with at least 3 documents.
Output: SELECT location_code FROM Document_locations GROUP BY location_code HAVING count(*)  >=  3
Which problems were reported before the date of any problem reported by the staff Lysanne Turcotte? Give me the ids of the problems.
Output: SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported  <  ( SELECT min(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = "Lysanne" AND T4.staff_last_name = "Turcotte" )
What are the famous titles of artists who do not have any volumes?
Output: SELECT Famous_Title FROM artist WHERE Artist_ID NOT IN(SELECT Artist_ID FROM volume)
Which staff members who reported problems from the product "rem" but not "aut"? Give me their first and last names.
Output: SELECT T3.staff_first_name ,  T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = "rem" EXCEPT SELECT T3.staff_first_name ,  T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = "aut"
What are all the distinct asset models?
Output: SELECT DISTINCT asset_model FROM Assets
What are the first names and last names of the students that minor in the department with DNO 140.
Output: SELECT T2.Fname ,  T2.Lname FROM MINOR_IN AS T1 JOIN STUDENT AS T2 ON T1.StuID  =  T2.StuID WHERE T1.DNO  =  140
Return the code of the document type that is most common.
Output: SELECT document_type_code FROM Documents GROUP BY document_type_code ORDER BY count(*) DESC LIMIT 1
Which cities' temperature in March is lower than that in July or higher than that in Oct?
Output: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id WHERE T2.Mar  <  T2.Jul OR T2.Mar  >  T2.Oct
What are the type come, name, and description of the document that has either the name 'Noel CV' or 'King Book'?
Output: SELECT document_type_code ,  document_name ,  document_description FROM Documents WHERE document_name  =  'Noel CV' OR document_name  =  'King Book'
What is the maximum length in meters for the bridges and what are the architects' names?
Output: SELECT max(T1.length_meters) ,  T2.name FROM bridge AS T1 JOIN architect AS T2 ON T1.architect_id  =  T2.id
What are the names of every person who has a friend over 40 and under 30?
Output: SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age  >  40) INTERSECT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age  <  30)
Find the author for each submission and list them in ascending order of submission score.
Output: SELECT Author FROM submission ORDER BY Scores ASC
What is all the information about employees hired before June 21, 2002?
Output: SELECT * FROM employees WHERE hire_date  <  '2002-06-21'
Return the issue date of the volume that has spent the fewest weeks on top.
Output: SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top ASC LIMIT 1
What are the full names of faculties with sex M and who live in building NEB?
Output: SELECT Fname ,  Lname FROM FACULTY WHERE sex  =  "M" AND Building  =  "NEB"
Find the job ID for those jobs which average salary is above 8000.
Output: SELECT job_id FROM employees GROUP BY job_id HAVING AVG(salary) > 8000
Give the ids of documents that have expenses and contain the letter s in their names.
Output: SELECT T1.document_id FROM Documents AS T1 JOIN Documents_with_expenses AS T2 ON T1.document_id  =  T2.document_id WHERE T1.document_name LIKE '%s%'
What are the department names and how many employees work in each of them?
Output: SELECT department_name ,  COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id  =  T2.department_id GROUP BY department_name
What is the code of each location and the number of documents in that location?
Output: SELECT location_code ,  count(*) FROM Document_locations GROUP BY location_code
Show the authors who have submissions to more than one workshop.
Output: SELECT T2.Author FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID  =  T2.Submission_ID GROUP BY T2.Author HAVING COUNT(DISTINCT T1.workshop_id)  >  1
What is the school color of the school with the largest enrollment?
Output: SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1
List the name of the pilots who have flied for both a company that mainly provide 'Cargo' services and a company that runs 'Catering services' activities.
Output: SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id  =  T2.company_id WHERE T1.principal_activities  =  'Cargo' INTERSECT SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id  =  T2.company_id WHERE T1.principal_activities  =  'Catering services'
Which team has the oldest player?
Output: SELECT Team FROM player ORDER BY Age DESC LIMIT 1
Which schools have more than 1 player? Give me the school locations.
Output: SELECT T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID  =  T2.School_ID GROUP BY T1.School_ID HAVING COUNT(*)  >  1
What are the names and ages of every person who is a friend of both Dan and Alice?
Output: SELECT T1.name ,  T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.name WHERE T2.friend  =  'Dan' INTERSECT SELECT T1.name ,   T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.name WHERE T2.friend  =  'Alice'
Return the issue dates of volumes that are by the artist named Gorgoroth.
Output: SELECT T2.Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T1.Artist  =  "Gorgoroth"
List the name of film studio that have the most number of films.
Output: SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1
Which part has the least chargeable amount? List the part id and amount.
Output: SELECT part_id ,  chargeable_amount FROM Parts ORDER BY chargeable_amount ASC LIMIT 1
Give me a list of cities whose temperature in Mar is lower than that in July and which have also served as host cities?
Output: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id WHERE T2.Mar  <  T2.Jul INTERSECT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id  =  T4.host_city
Find the SSN and name of scientists who are assigned to the project with the longest hours.
Output: SELECT T3.ssn ,  T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project  =  T2.code JOIN scientists AS T3 ON T1.scientist  =  T3.SSN WHERE T2.hours  =  (SELECT max(hours) FROM projects)
List the first and last names of all distinct staff members who are assigned to the problem whose id is 1.
Output: SELECT DISTINCT staff_first_name ,  staff_last_name FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T2.problem_id = 1
What are the full names and salaries for any employees earning less than 6000?
Output: SELECT first_name ,  last_name ,  salary FROM employees WHERE salary  <  6000
What are the employee ids for each employee and final dates of employment at their last job?
Output: SELECT employee_id ,  MAX(end_date) FROM job_history GROUP BY employee_id
What are the full name, hire date, salary, and department id for employees without the letter M in their first name?
Output: SELECT first_name ,  last_name ,  hire_date ,  salary ,  department_id FROM employees WHERE first_name NOT LIKE '%M%'
Show the location name and code with the least documents.
Output: 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 LIMIT 1
What are the different instruments listed in the database?
Output: SELECT DISTINCT instrument FROM Instruments
What is the name of the department with the most students minoring in it?
Output: SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO  =  T2.DNO GROUP BY T2.DNO ORDER BY count(*) DESC LIMIT 1
What is the average weeks on top of volumes associated with the artist aged 25 or younger?
Output: SELECT avg(T2.Weeks_on_Top) FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T1.age  <=  25
What are the statement ids, statement details, and account details, for all accounts?
Output: SELECT T1.statement_id ,  T2.statement_details ,  T1.account_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id  =  T2.statement_id
What are the names and dates for documents corresponding to project that has the details 'Graph Database project'?
Output: SELECT document_name ,  document_date FROM Documents AS T1 JOIN projects AS T2 ON T1.project_id  =  T2.project_id WHERE T2.project_details  =  'Graph Database project'
What is the least popular kind of decor?
Output: SELECT T2.decor FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId GROUP BY T2.decor ORDER BY count(T2.decor) ASC LIMIT 1
list the name, job title of all people ordered by their names.
Output: SELECT name ,  job FROM Person ORDER BY name
How many people have membership in the club "Pen and Paper Gaming"?
Output: 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"
Which fault log included the most number of faulty parts? List the fault log id, description and record time.
Output: SELECT T1.fault_log_entry_id ,  T1.fault_description ,  T1.fault_log_entry_datetime FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id  =  T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY count(*) DESC LIMIT 1
Which person whose friends have the oldest average age?
Output: SELECT T2.name ,  avg(T1.age) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.friend GROUP BY T2.name ORDER BY avg(T1.age) DESC LIMIT 1
Please show different denominations and the corresponding number of schools.
Output: SELECT Denomination ,  COUNT(*) FROM school GROUP BY Denomination
Return the account details with the greatest value, as well as those that include the character 5.
Output: SELECT max(Account_details) FROM Accounts UNION SELECT Account_details FROM Accounts WHERE Account_details LIKE "%5%"
How many clubs does "Linda Smith" belong to?
Output: 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"
What are the log id and entry description of each problem?
Output: SELECT problem_log_id ,  log_entry_description FROM problem_log
Return the dates of ceremony corresponding to music festivals that had the category "Best Song" and result "Awarded".
Output: SELECT Date_of_ceremony FROM music_festival WHERE Category  =  "Best Song" AND RESULT  =  "Awarded"
What are the distinct types of the companies that have operated any flights with velocity less than 200?
Output: SELECT DISTINCT T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id  =  T2.company_id WHERE T2.velocity  <  200
Give the maximum and minimum weeks on top across all volumes.
Output: SELECT max(Weeks_on_Top) ,  min(Weeks_on_Top) FROM volume
Sort all the rooms according to the price. Just report the room names.
Output: SELECT roomName FROM Rooms ORDER BY basePrice
How many instruments does the song "Le Pop" use?
Output: SELECT count(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid WHERE title  =  "Le Pop"
What are the songs in album "A Kiss Before You Go: Live in Hamburg"?
Output: SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid  =  T2.albumid JOIN songs AS T3 ON T2.songid  =  T3.songid WHERE T1.title  =  "A Kiss Before You Go: Live in Hamburg"
List all every engineer's first name, last name, details and coresponding skill description.
Output: SELECT T1.first_name ,  T1.last_name ,  T1.other_details ,  T3.skill_description FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id  =  T2.engineer_id JOIN Skills AS T3 ON T2.skill_id  =  T3.skill_id
What are the three products that have the most problems?s
Output: SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name ORDER BY count(*) DESC LIMIT 3
What are the full names of employees who with in department 70 or 90?
Output: SELECT first_name ,  last_name FROM employees WHERE department_id  =  70 OR department_id  =  90
How many clubs does the student named "Eric Tai" belong to?
Output: 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"
Which product has the most problems? Give me the number of problems and the product name.
Output: SELECT count(*) ,  T1.product_name FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name ORDER BY count(*) DESC LIMIT 1
What are the ids, names and genders of the architects who built two bridges or one mill?
Output: SELECT T1.id ,  T1.name ,  T1.gender FROM architect AS T1 JOIN bridge AS T2 ON T1.id  =  T2.architect_id GROUP BY T1.id HAVING count(*)  =  2 UNION SELECT T1.id ,  T1.name ,  T1.gender FROM architect AS T1 JOIN mill AS T2 ON T1.id  =  T2.architect_id GROUP BY T1.id HAVING count(*)  =  1
Show the name, role code, and date of birth for the employee with name 'Armani'.
Output: SELECT employee_name ,  role_code ,  date_of_birth FROM Employees WHERE employee_Name  =  'Armani'
What are the types of vocals that the musician with the first name "Solveig" played in the song "A Bar in Amsterdam"?
Output: SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid JOIN band AS T3 ON T1.bandmate  =  T3.id WHERE T3.firstname  =  "Solveig" AND T2.title  =  "A Bar In Amsterdam"
What is the name and id of the staff who recorded the fault log but has not contacted any visiting engineers?
Output: SELECT T1.staff_name ,  T1.staff_id FROM Staff AS T1 JOIN Fault_Log AS T2 ON T1.staff_id  =  T2.recorded_by_staff_id EXCEPT SELECT T3.staff_name ,  T3.staff_id FROM Staff AS T3 JOIN Engineer_Visits AS T4 ON T3.staff_id  =  T4.contact_staff_id
Find the first names of students whose first names contain letter "a".
Output: SELECT DISTINCT Fname FROM STUDENT WHERE Fname LIKE '%a%'
For all the faults of different parts, what are all the decriptions of the skills required to fix them? List the name of the faults and the skill description.
Output: SELECT T1.fault_short_name ,  T3.skill_description FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id  =  T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id  =  T3.skill_id
What are the famous titles of artists who have not only had volumes that spent more than 2 weeks on top but also volumes that spent less than 2 weeks on top?
Output: SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T2.Weeks_on_Top  >  2 INTERSECT SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T2.Weeks_on_Top  <  2
Find the name of route that has the highest number of deliveries.
Output: SELECT t1.route_name FROM Delivery_Routes AS t1 JOIN Delivery_Route_Locations AS t2 ON t1.route_id  =  t2.route_id GROUP BY t1.route_id ORDER BY count(*) DESC LIMIT 1
Find the author who achieved the highest score in a submission.
Output: SELECT Author FROM submission ORDER BY Scores DESC LIMIT 1
How old is the youngest person for each job?
Output: SELECT min(age) ,  job FROM Person GROUP BY job
Return the type name, type description, and date of creation for each document.
Output: SELECT T1.document_type_name ,  T1.document_type_description ,  T2.Document_date FROM Ref_document_types AS T1 JOIN Documents AS T2 ON T1.document_type_code  =  T2.document_type_code
What is the age of the doctor named Zach?
Output: SELECT age FROM Person WHERE job  =  'doctor' AND name  =  'Zach'
How many fault status codes are recorded in the fault log parts table?
Output: SELECT DISTINCT fault_status FROM Fault_Log_Parts
Who has friends that are older than the average age? Print their friends and their ages as well
Output: SELECT DISTINCT T2.name ,  T2.friend ,  T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.friend WHERE T1.age  >  (SELECT avg(age) FROM person)
What are the songs in volumes that have resulted in a nomination at music festivals?
Output: SELECT T2.Song FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume  =  T2.Volume_ID WHERE T1.Result  =  "Nominated"
How many document types are there?
Output: SELECT count(*) FROM Ref_document_types
List the state names and the number of customers living in each state.
Output: SELECT t2.state_province_county ,  count(*) FROM customer_addresses AS t1 JOIN addresses AS t2 ON t1.address_id  =  t2.address_id GROUP BY t2.state_province_county
What are the name of rooms booked by customers whose first name has "ROY" in part?
Output: SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId WHERE firstname LIKE '%ROY%'
Find the number of followers for each user.
Output: SELECT count(*) FROM follows GROUP BY f1
Show all flight number from Los Angeles.
Output: SELECT flno FROM Flight WHERE origin  =  "Los Angeles"
What are the numbers of the shortest flights?
Output: SELECT flno FROM Flight ORDER BY distance ASC LIMIT 3
How many distinct governors are there?
Output: SELECT count(DISTINCT Governor) FROM party
Show the distinct position of players from college UCLA or Duke.
Output: SELECT DISTINCT POSITION FROM match_season WHERE College  =  "UCLA" OR College  =  "Duke"
How many stores are there?
Output: SELECT count(*) FROM store
Find the names of patients who are not using the medication of Procrastin-X.
Output: SELECT name FROM patient EXCEPT SELECT T1.name FROM patient AS T1 JOIN Prescribes AS T2 ON T2.Patient  =  T1.SSN JOIN Medication AS T3 ON T2.Medication  =  T3.Code WHERE T3.name  =  'Procrastin-X'
Find the id of suppliers whose average amount purchased for each product is above 50000 or below 30000.
Output: SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id HAVING avg(total_amount_purchased)  >  50000 OR avg(total_amount_purchased)  <  30000
List all the names of schools with an endowment amount smaller than or equal to 10.
Output: SELECT T2.school_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id GROUP BY T1.school_id HAVING sum(T1.amount)  <=  10
Show the teams that have both wrestlers eliminated by "Orton" and wrestlers eliminated by "Benjamin".
Output: SELECT Team FROM Elimination WHERE Eliminated_By  =  "Orton" INTERSECT SELECT Team FROM Elimination WHERE Eliminated_By  =  "Benjamin"
Which countries have at least 3 cities?
Output: SELECT T2.country FROM city AS T1 JOIN country AS T2 ON T1.country_id  =  T2.country_id GROUP BY T2.country_id HAVING count(*)  >=  3
How many leagues are there in England?
Output: SELECT count(*) FROM Country AS T1 JOIN League AS T2 ON T1.id  =  T2.country_id WHERE T1.name  =  "England"
What are the ids of the two department store chains with the largest number of department stores?
Output: SELECT dept_store_chain_id FROM department_stores GROUP BY dept_store_chain_id ORDER BY count(*) DESC LIMIT 2
What are the census rankings of cities that do not have the status "Village"?
Output: SELECT Census_Ranking FROM city WHERE Status !=  "Village"
Show the id and name of the employee with maximum salary.
Output: SELECT eid ,  name FROM Employee ORDER BY salary DESC LIMIT 1
How many distinct official languages are there among countries of players whose positions are defenders.
Output: SELECT count(DISTINCT T1.Official_native_language) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country WHERE T2.Position  =  "Defender"
Find the number of users who posted some tweets.
Output: SELECT count(DISTINCT UID) FROM tweets
Return the name of each physician and the number of patients he or she treats.
Output: SELECT T1.name ,  count(*) FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid  =  T2.PCP GROUP BY T1.employeeid
What are the names of the physicians who have 'senior' in their titles.
Output: SELECT name FROM physician WHERE POSITION LIKE '%senior%'
Return the names of wrestlers with fewer than 100 days held.
Output: SELECT Name FROM wrestler WHERE Days_held  <  100
Tell me the distinct block codes where some rooms are available.
Output: SELECT DISTINCT blockcode FROM room WHERE unavailable  =  0
Which channels are not owned by CCTV? Give me the channel names.
Output: SELECT name FROM channel WHERE OWNER != 'CCTV'
What are id and name of the products whose price is lower than 600 or higher than 900?
Output: SELECT product_id ,  product_name FROM products WHERE product_price  <  600 OR product_price  >  900
What is the average number of employees of the departments whose rank is between 10 and 15?
Output: SELECT avg(num_employees) FROM department WHERE ranking BETWEEN 10 AND 15
Show names for all employees who do not have certificate of Boeing 737-800.
Output: SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Boeing 737-800"
What is the name of the nurse has the most appointments?
Output: SELECT T1.name FROM nurse AS T1 JOIN appointment AS T2 ON T1.employeeid  =  T2.prepnurse GROUP BY T1.employeeid ORDER BY count(*) DESC LIMIT 1
Count the number of items store 1 has in stock.
Output: SELECT count(*) FROM inventory WHERE store_id  =  1
What are the id and name of the mountains that have at least 2 photos?
Output: SELECT T1.id ,  T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id GROUP BY T1.id HAVING count(*)  >=  2
Return the name and gender of the staff who was assigned in 2016.
Output: SELECT T1.staff_name ,  T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id  =  T2.staff_id WHERE T2.date_assigned_from LIKE "2016%"
Give the product id for the product that was ordered most frequently.
Output: SELECT product_id FROM order_items GROUP BY product_id ORDER BY count(*) DESC LIMIT 1
List the names of buildings with at least 200 feet of height and with at least 20 floors.
Output: SELECT name FROM building WHERE height_feet  >=  200 AND floors  >=  20
Find the names of schools that have more than one donator with donation amount above 8.5.
Output: SELECT T2.School_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T1.amount  >  8.5 GROUP BY T1.school_id HAVING count(*)  >  1
How many distinct delegates are from counties with population larger than 50000?
Output: SELECT count(DISTINCT T2.Delegate) FROM county AS T1 JOIN election AS T2 ON T1.County_id  =  T2.District WHERE T1.Population  >  50000
What are the distinct names of customers who have purchased at least three different products?
Output: SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id JOIN order_items AS T3 ON T2.order_id  =  T3.order_id GROUP BY T1.customer_id HAVING COUNT (DISTINCT T3.product_id)  >=  3
Return the different statuses of cities, ascending by frequency.
Output: SELECT Status FROM city GROUP BY Status ORDER BY COUNT(*) ASC
Who were the comptrollers of the parties associated with the delegates from district 1 or district 2?
Output: SELECT T2.Comptroller FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID WHERE T1.District  =  1 OR T1.District  =  2
Return the text of tweets about the topic 'intern'.
Output: SELECT text FROM tweets WHERE text LIKE '%intern%'
What are names of patients who made an appointment?
Output: SELECT name FROM appointment AS T1 JOIN patient AS T2 ON T1.patient  =  T2.ssn
Find the number of tweets in record.
Output: SELECT count(*) FROM tweets
What is the most popular first name of the actors?
Output: SELECT first_name FROM actor GROUP BY first_name ORDER BY count(*) DESC LIMIT 1
Show names for all aircraft with at least two flights.
Output: SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid GROUP BY T1.aid HAVING count(*)  >= 2
What is the average price for flights from LA to Honolulu?
Output: SELECT avg(price) FROM Flight WHERE origin  =  "Los Angeles" AND destination  =  "Honolulu"
Find the name of physicians who are affiliated with Surgery or Psychiatry department.
Output: SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID  =  T2.physician JOIN department AS T3 ON T2.department  =  T3.DepartmentID WHERE T3.name  =  'Surgery' OR T3.name  =  'Psychiatry'
Of all players with an overall rating greater than 80, how many are right-footed and left-footed?
Output: SELECT preferred_foot ,  count(*) FROM Player_Attributes WHERE overall_rating  >  80 GROUP BY preferred_foot
Show institution names along with the number of proteins for each institution.
Output: SELECT T1.institution ,  count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id  =  T2.institution_id GROUP BY T1.institution_id
Find the physician who prescribed the highest dose. What is his or her name?
Output: SELECT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician ORDER BY T2.dose DESC LIMIT 1
For each party, return the name of the party and the number of delegates from that party.
Output: SELECT T2.Party ,  COUNT(*) FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID GROUP BY T1.Party
How many distinct programs are broadcast at "Night" time?
Output: SELECT count(DISTINCT program_id) FROM broadcast WHERE time_of_day  =  'Night'
For each county, find the name of the county and the number of delegates from that county.
Output: SELECT T1.County_name ,  COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_id  =  T2.District GROUP BY T1.County_id
What are the names of all the clubs starting with the oldest?
Output: SELECT name FROM club ORDER BY Start_year ASC
What is the name of the wrestler with the fewest days held?
Output: SELECT Name FROM wrestler ORDER BY Days_held ASC LIMIT 1
Who are the owners of the programs that broadcast both in the morning and at night?
Output: SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id  =  t2.program_id WHERE t2.Time_of_day  =  "Morning" INTERSECT SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id  =  t2.program_id WHERE t2.Time_of_day  =  "Night"
Which destination has least number of flights?
Output: SELECT destination FROM Flight GROUP BY destination ORDER BY count(*) LIMIT 1
Return all the information for each election record.
Output: SELECT * FROM election
Which physician was trained in the procedure that costs the most.
Output: SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment ORDER BY T3.cost DESC LIMIT 1
How many patients stay in room 112?
Output: SELECT count(patient) FROM stay WHERE room  =  112
Find the names of the users whose number of followers is greater than that of the user named "Tyler Swift".
Output: SELECT T1.name FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid  =  T2.f1 GROUP BY T2.f1 HAVING count(*)  >  (SELECT count(*) FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid  =  T2.f1 WHERE T1.name  =  'Tyler Swift')
What is the genre name of the film HUNGER ROOF?
Output: SELECT T1.name FROM category AS T1 JOIN film_category AS T2 ON T1.category_id  =  T2.category_id JOIN film AS T3 ON T2.film_id  =  T3.film_id WHERE T3.title  =  'HUNGER ROOF'
Which patients made more than one appointment? Tell me the name and phone number of these patients.
Output: SELECT name ,  phone FROM appointment AS T1 JOIN patient AS T2 ON T1.patient  =  T2.ssn GROUP BY T1.patient HAVING count(*)  >  1