niryuu/sni-each-converted huggingface dataset:
Count the number of exhibitions that have had an attendnance of over 100 or a ticket prices under 10.
Output: SELECT count(*) FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id WHERE T1.attendance  >  100 OR T2.ticket_price  <  10
What are the room name and base price of the room with the lowest base price?
Output: SELECT roomName ,  basePrice FROM Rooms ORDER BY basePrice ASC LIMIT 1
What are the dates that had the top 5 cloud cover rates? Also tell me the cloud cover rate.
Output: SELECT date ,  cloud_cover FROM weather ORDER BY cloud_cover DESC LIMIT 5
What is the mean longitude for all stations that have never had more than 10 bikes available?
Output: SELECT avg(long) FROM station WHERE id NOT IN (SELECT station_id FROM status GROUP BY station_id HAVING max(bikes_available)  >  10)
For each trip, return its ending station's installation date.
Output: SELECT T1.id ,  T2.installation_date FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id  =  T2.id
What is the name and country for the artist with most number of exhibitions?
Output: SELECT T2.name , T2.country FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id  =  T2.artist_id GROUP BY T1.artist_id ORDER BY count(*) DESC LIMIT 1
What are the ages of all music artists?
Output: SELECT Age FROM artist
What are the three largest cities in terms of regional population?
Output: SELECT city FROM city ORDER BY regional_population DESC LIMIT 3
What are the dates in which the mean sea level pressure was between 30.3 and 31?
Output: SELECT date FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31
What are the names and headquarters of all companies ordered by descending market value?
Output: SELECT company ,  headquarters FROM company ORDER BY market_value DESC
Where is the club "Pen and Paper Gaming" located?
Output: SELECT clublocation FROM club WHERE clubname  =  "Pen and Paper Gaming"
What is Nancy Edwards's address?
Output: SELECT address FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"
Find the names of the buildings in "on-hold" status, and sort them in ascending order of building stories.
Output: SELECT name FROM buildings WHERE Status  =  "on-hold" ORDER BY Stories ASC
How many songs have used the instrument "drums"?
Output: SELECT count(*) FROM instruments WHERE instrument  =  "drums"
How many submissions are there?
Output: SELECT count(*) FROM submission
How many adults stay in the room CONRAD SELBIG checked in on Oct 23, 2010?
Output: SELECT Adults FROM Reservations WHERE CheckIn  =  "2010-10-23" AND FirstName  =  "CONRAD" AND LastName  =  "SELBIG"
Find the first name and last name for the "CTO" of the club "Hopkins Student Enterprises"?
Output: 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"
What are the ids and details of all statements?
Output: SELECT STATEMENT_ID ,  statement_details FROM Statements
Which kind of part has the least number of faults? List the part name.
Output: SELECT T1.part_name FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id  =  T2.part_id GROUP BY T1.part_name ORDER BY count(*) ASC LIMIT 1
What are the last names and ages of the students who are allergic to milk and cat?
Output: SELECT lname ,  age FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy  =  "Milk" INTERSECT SELECT StuID FROM Has_allergy WHERE Allergy  =  "Cat")
How many musicians play in the song "Flash"?
Output: SELECT count(*) 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  =  "Flash"
What are the ids of all the employees who have destroyed documents?
Output: SELECT DISTINCT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed
Show the denomination shared by more than one school.
Output: SELECT Denomination FROM school GROUP BY Denomination HAVING COUNT(*)  >  1
Find the number of scientists involved for the projects that require more than 300 hours.
Output: SELECT count(*) ,  T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code  =  T2.project WHERE T1.hours  >  300 GROUP BY T1.name
List all the scientists' names, their projects' names, and the hours worked by that scientist on each project, in alphabetical order of project name, and then scientist name.
Output: SELECT T1.Name ,  T3.Name ,  T3.Hours FROM Scientists AS T1 JOIN AssignedTo AS T2 ON T1.SSN = T2.Scientist JOIN Projects AS T3 ON T2.Project = T3.Code ORDER BY T3.Name ,  T1.Name
What are the names and sum of checking and savings balances for accounts with savings balances higher than the average savings balance?
Output: SELECT T1.name ,  T2.balance + T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid WHERE T3.balance  >  (SELECT avg(balance) FROM savings)
What is the zip code in which the average mean sea level pressure is the lowest?
Output: SELECT zip_code FROM weather GROUP BY zip_code ORDER BY avg(mean_sea_level_pressure_inches) LIMIT 1
How many students who are female are allergic to milk or eggs?
Output: SELECT count(*) FROM has_allergy AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID WHERE T2.sex  =  "F" AND T1.allergy  =  "Milk" OR T1.allergy  =  "Eggs"
How many roles are there?
Output: SELECT count(*) FROM ROLES
What are each document's location code, and starting date and ending data in that location?
Output: SELECT location_code ,  date_in_location_from ,  date_in_locaton_to FROM Document_locations
What instruments did the musician with the last name "Heilo" play in the song "Le Pop"?
Output: SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId JOIN Instruments AS T4 ON T4.songid  =  T3.songid AND T4.bandmateid  =  T2.id WHERE T2.lastname  =  "Heilo" AND T3.title  =  "Le Pop"
Find the names of departments that are either in division AS or in division EN and in Building NEB.
Output: SELECT DName FROM DEPARTMENT WHERE Division  =  "AS" UNION SELECT DName FROM DEPARTMENT WHERE Division  =  "EN" AND Building  =  "NEB"
How many customers does Steve Johnson support?
Output: SELECT count(*) FROM employees AS T1 JOIN customers AS T2 ON T2.support_rep_id = T1.id WHERE T1.first_name = "Steve" AND T1.last_name = "Johnson"
Find the name of the customer that has been involved in the most policies.
Output: SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id  =  t2.customer_id GROUP BY t2.customer_details ORDER BY count(*) DESC LIMIT 1
Find the number of songs in all the studio albums.
Output: SELECT count(DISTINCT 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.type  =  "Studio"
What are the ids of stations that have latitude above 37.4 and never had bike availability below 7?
Output: SELECT id FROM station WHERE lat  >  37.4 EXCEPT SELECT station_id FROM status GROUP BY station_id HAVING min(bikes_available)  <  7
display the full name (first and last name ) of employee with ID and name of the country presently where (s)he is working.
Output: SELECT T1.first_name ,  T1.last_name , 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
Return the decor of the room named "Recluse and defiance".
Output: SELECT decor FROM Rooms WHERE roomName  =  "Recluse and defiance"
What are the ids of documents with the type code CV that do not have expenses.
Output: SELECT document_id FROM Documents WHERE document_type_code  =  "CV" EXCEPT SELECT document_id FROM Documents_with_expenses
What is the denomination of the school the most players belong to?
Output: SELECT T2.Denomination FROM player AS T1 JOIN school AS T2 ON T1.School_ID  =  T2.School_ID GROUP BY T1.School_ID ORDER BY COUNT(*) DESC LIMIT 1
How many statements do we have?
Output: SELECT count(*) FROM Statements
What is the name of the project that requires the fewest number of hours, and the names of the scientists assigned to it?
Output: SELECT T2.name ,  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 min(hours) FROM projects)
What are the date, mean temperature and mean humidity for the top 3 days with the largest max gust speeds?
Output: SELECT date ,  mean_temperature_f ,  mean_humidity FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3
What is the list of distinct product names sorted by product id?
Output: SELECT DISTINCT product_name FROM product ORDER BY product_id
Count the number of artists who have had volumes.
Output: SELECT COUNT(DISTINCT Artist_ID) FROM volume
What is the budget type code with most number of documents.
Output: SELECT budget_type_code FROM Documents_with_expenses GROUP BY budget_type_code ORDER BY count(*) DESC LIMIT 1
What are the venues of all the matches? Sort them in the descending order of match date.
Output: SELECT venue FROM MATCH ORDER BY date DESC
What is the average latitude and longitude of the starting points of all trips?
Output: SELECT avg(T1.lat) ,  avg(T1.long) FROM station AS T1 JOIN trip AS T2 ON T1.id  =  T2.start_station_id
For each city, return the highest latitude among its stations.
Output: SELECT city ,  max(lat) FROM station GROUP BY city
get the details of employees who manage a department.
Output: SELECT DISTINCT * FROM employees AS T1 JOIN departments AS T2 ON T1.department_id  =  T2.department_id WHERE T1.employee_id  =  T2.manager_id
What are all the different zip codes that have a maximum dew point that was always below 70?
Output: SELECT DISTINCT zip_code FROM weather EXCEPT SELECT DISTINCT zip_code FROM weather WHERE max_dew_point_f  >=  70
Find the number of kids staying in the rooms reserved by a person called ROY SWEAZ.
Output: SELECT kids FROM Reservations WHERE FirstName = "ROY" AND LastName  =  "SWEAZY"
What is the id of the trip that started from the station with the highest dock count?
Output: SELECT T1.id FROM trip AS T1 JOIN station AS T2 ON T1.start_station_id  =  T2.id ORDER BY T2.dock_count DESC LIMIT 1
How many exhibition are there in year 2005 or after?
Output: SELECT count(*) FROM exhibition WHERE YEAR  >=  2005
What instrument did the musician with last name "Heilo" use in the song "Badlands"?
Output: SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId JOIN Instruments AS T4 ON T4.songid  =  T3.songid AND T4.bandmateid  =  T2.id WHERE T2.lastname  =  "Heilo" AND T3.title  =  "Badlands"
What is the total checking balance in all accounts?
Output: SELECT sum(balance) FROM checking
display the department name, city, and state province for each department.
Output: SELECT T1.department_name ,  T2.city ,  T2.state_province FROM departments AS T1 JOIN locations AS T2 ON T2.location_id  =  T1.location_id
What are the names of stations that have latitude lower than 37.5?
Output: SELECT name FROM station WHERE lat  <  37.5
How many students are affected by cat allergies?
Output: SELECT count(*) FROM Has_allergy WHERE Allergy  =  "Cat"
Find the name of scientists who are assigned to some project.
Output: SELECT T2.name FROM assignedto AS T1 JOIN scientists AS T2 ON T1.scientist  =  T2.ssn
Show the denomination shared by schools founded before 1890 and schools founded after 1900
Output: SELECT Denomination FROM school WHERE Founded  <  1890 INTERSECT SELECT Denomination FROM school WHERE Founded  >  1900
What is the minimum salary in each department?
Output: SELECT MIN(salary) ,  department_id FROM employees GROUP BY department_id
What are the dates for the documents with both 'GV' type and 'SF' type expenses?
Output: SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id  =  T2.document_id WHERE T2.budget_type_code  =  'GV' INTERSECT SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id  =  T2.document_id WHERE T2.budget_type_code  =  'SF'
Please show the date of ceremony of the volumes that last more than 2 weeks on top.
Output: SELECT T1.Date_of_ceremony FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume  =  T2.Volume_ID WHERE T2.Weeks_on_Top  >  2
Give the names of the courses with at least five enrollments.
Output: SELECT T1.CName FROM COURSE AS T1 JOIN ENROLLED_IN AS T2 ON T1.CID  =  T2.CID GROUP BY T2.CID HAVING COUNT(*)  >=  5
Show the student id of the oldest student.
Output: SELECT StuID FROM Student WHERE age  =  (SELECT max(age) FROM Student)
What are the names of rooms whose reservation frequency exceeds 60 times?
Output: SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId GROUP BY T1.Room HAVING count(*)  >  60
How many calendar items do we have?
Output: SELECT count(*) FROM Ref_calendar
Which assets have 2 parts and have less than 2 fault logs? List the asset id and detail.
Output: SELECT T1.asset_id ,  T1.asset_details FROM Assets AS T1 JOIN Asset_Parts AS T2 ON T1.asset_id  =  T2.asset_id GROUP BY T1.asset_id HAVING count(*)  =  2 INTERSECT SELECT T1.asset_id ,  T1.asset_details FROM Assets AS T1 JOIN Fault_Log AS T2 ON T1.asset_id  =  T2.asset_id GROUP BY T1.asset_id HAVING count(*)  <  2
What is the match id of the competition called "1994 FIFA World Cup qualification"?
Output: SELECT match_id FROM MATCH WHERE competition = "1994 FIFA World Cup qualification"
What is the name and checking balance of the account which has the lowest savings balance?
Output: SELECT T2.balance ,  T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid ORDER BY T3.balance LIMIT 1
How many documents are with document type code BK for each product id?
Output: SELECT count(*) ,  project_id FROM Documents WHERE document_type_code  =  "BK" GROUP BY project_id
Find the ids of the departments where any manager is managing 4 or more employees.
Output: SELECT DISTINCT department_id FROM employees GROUP BY department_id ,  manager_id HAVING COUNT(employee_id)  >= 4
Count the number of trips that did not end in San Francisco city.
Output: SELECT count(*) FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id  =  T2.id WHERE T2.city !=  "San Francisco"
What is the number of departments in Division "AS"?
Output: SELECT count(*) FROM DEPARTMENT WHERE Division  =  "AS"
Which customer made the smallest amount of claim in one claim? Return the customer details.
Output: SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id  =  t2.policy_id JOIN customers AS t3 ON t2.customer_id  =  t3.customer_id WHERE t1.amount_piad  =  (SELECT min(amount_piad) FROM claim_headers)
What is the first name and job id for all employees in the Finance department?
Output: SELECT T1.first_name ,  T1.job_id FROM employees AS T1 JOIN departments AS T2 ON T1.department_id  =  T2.department_id WHERE T2.department_name  =  'Finance'
Find the distinct student first names of all students that have grade point at least 3.8 in one course.
Output: SELECT DISTINCT T3.Fname FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade  =  T2.lettergrade AND T1.StuID  =  T3.StuID WHERE T2.gradepoint  >=  3.8
Which city has the lowest GDP? Please list the city name and its GDP.
Output: SELECT city ,  GDP FROM city ORDER BY GDP LIMIT 1
Find the name, age, and job title of persons who are friends with Alice for the longest years.
Output: SELECT T1.name ,  T1.age ,  T1.job FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.name WHERE T2.friend =  'Alice' AND T2.year  =  (SELECT max(YEAR) FROM PersonFriend WHERE friend =  'Alice')
What are the names of the scientists, and how many projects are each of them working on?
Output: SELECT count(*) ,  T1.name FROM scientists AS T1 JOIN assignedto AS T2 ON T1.ssn  =  T2.scientist GROUP BY T1.name
What are the phones of departments in Room 268?
Output: SELECT DPhone FROM DEPARTMENT WHERE Room  =  268
What are the details for statements with the details 'Private Project', and what are the names of the corresponding documents?
Output: SELECT T1.statement_details ,  T2.document_name FROM Statements AS T1 JOIN Documents AS T2 ON T1.statement_id  =  T2.document_id WHERE T1.statement_details  =  'Private Project'
Which of the mill names contains the french word 'Moulin'?
Output: SELECT name FROM mill WHERE name LIKE '%Moulin%'
Give the name of each department and the number of employees in each.
Output: SELECT T2.department_name ,  COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id  =  T2.department_id GROUP BY T2.department_name
How many different instruments does the musician with the last name "Heilo" use?
Output: SELECT count(DISTINCT instrument) FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid  =  T2.id WHERE T2.lastname  =  "Heilo"
Which staff have contacted which engineers? List the staff name and the engineer first name and last name.
Output: SELECT T1.staff_name ,  T3.first_name ,  T3.last_name FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id  =  T2.contact_staff_id JOIN Maintenance_Engineers AS T3 ON T2.engineer_id  =  T3.engineer_id
display the department ID, full name (first and last name), salary for those employees who is highest salary in every department.
Output: SELECT first_name ,   last_name ,   salary ,  department_id ,  MAX(salary) FROM employees GROUP BY department_id
What are the first and last names of the artist who perfomed 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"
display those employees who joined after 7th September, 1987.
Output: SELECT * FROM employees WHERE hire_date  >  '1987-09-07'
How many students have a food allergy?
Output: SELECT count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy  =  T2.allergy WHERE T2.allergytype  =  "food"
Find the number of bands.
Output: SELECT count(*) FROM Band
What is the total number of people who has no friend living in the city of Austin.
Output: SELECT count(DISTINCT name) FROM PersonFriend WHERE friend NOT IN (SELECT name FROM person WHERE city  =  'Austin')
What are the famous title of the artists associated with volumes with more 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
Show the nicknames of schools that are not in division 1.
Output: SELECT Nickname FROM school_details WHERE Division != "Division 1"
What are the id and name of the stations that have ever had more than 12 bikes available?
Output: SELECT DISTINCT T1.id ,  T1.name FROM station AS T1 JOIN status AS T2 ON T1.id  =  T2.station_id WHERE T2.bikes_available  >  12
display those departments where more than ten employees work who got a commission percentage.
Output: SELECT department_id FROM employees GROUP BY department_id HAVING COUNT(commission_pct) > 10
What are the names of artists who did not have an exhibition in 2004?
Output: SELECT name FROM artist EXCEPT SELECT T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id  =  T2.artist_id WHERE T1.year  =  2004
What are all the different start station names for a trip that lasted less than 100?
Output: SELECT DISTINCT start_station_name FROM trip WHERE duration  <  100
What are the ids of all the employees who authorize document destruction?
Output: SELECT DISTINCT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed
List the name of a building along with the name of a company whose office is in the building.
Output: SELECT T3.name ,  T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id  =  T2.id JOIN Companies AS T3 ON T1.company_id  =  T3.id
Find the name and price of the product that has been ordered the greatest number of times.
Output: SELECT t1.product_name ,   t1.product_price FROM products AS t1 JOIN regular_order_products AS t2 ON t1.product_id  =  t2.product_id GROUP BY t2.product_id ORDER BY count(*) DESC LIMIT 1
What is the full name of the employee who has the most customers?
Output: SELECT T1.first_name , T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id  =  T2.support_rep_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1
What is the composer who created the track "Fast As a Shark"?
Output: SELECT composer FROM tracks WHERE name = "Fast As a Shark"
What are the issue dates of volumes associated with the artist aged 23 or younger?
Output: SELECT Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T1.age  <=  23
display the employee number and name( first name and last name ) for all employees who work in a department with any employee whose name contains a ’T’.
Output: SELECT employee_id ,  first_name ,  last_name FROM employees WHERE department_id IN ( SELECT department_id FROM employees WHERE first_name LIKE '%T%' )
What is all the information about all people?
Output: SELECT * FROM people
What are all the employees without a department number?
Output: SELECT * FROM employees WHERE department_id  =  "null"
Find the saving balance of the account with the highest checking balance.
Output: SELECT T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid ORDER BY T2.balance DESC LIMIT 1
What are the first and last name of the president of the club "Bootup Baltimore"?
Output: 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"
In which year did the most recent crime happen?
Output: SELECT max(YEAR) FROM perpetrator
Which catalog publishers have substring "Murray" in their names?
Output: SELECT distinct(catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE "%Murray%"
What are the names of all cities and states?
Output: SELECT town_city FROM addresses UNION SELECT state_province_county FROM addresses
What is the highest acc percent score in the competition?
Output: SELECT acc_percent FROM basketball_match ORDER BY acc_percent DESC LIMIT 1
What are the countries for appelations with at most 3 wines?
Output: SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation  =  T2.Appelation GROUP BY T2.Appelation HAVING count(*)  <=  3
Which publishers did not publish a book in 1989?
Output: SELECT publisher FROM book_club EXCEPT SELECT publisher FROM book_club WHERE YEAR  =  1989
How many residents does each property have? List property id and resident count.
Output: SELECT T1.property_id ,  count(*) FROM properties AS T1 JOIN residents AS T2 ON T1.property_id  =  T2.property_id GROUP BY T1.property_id
Count the number of climbers.
Output: SELECT count(*) FROM climber
Show the season, the player, and the name of the team that players belong to.
Output: SELECT T1.Season ,  T1.Player ,  T2.Name FROM match_season AS T1 JOIN team AS T2 ON T1.Team  =  T2.Team_id
What is the total number of routes for each country and airline in that country?
Output: SELECT T1.country ,  T1.name ,  count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid  =  T2.alid GROUP BY T1.country ,  T1.name
How many events are there?
Output: SELECT count(*) FROM event
What are the name, origin and owner of each program?
Output: SELECT name ,  origin ,  OWNER FROM program
Give the maximum price and score for wines produced in the appelation St. Helena.
Output: SELECT max(Price) ,  max(Score) FROM WINE WHERE Appelation  =  "St. Helena"
Which catalog contents have a product stock number that starts from "2"? Show the catalog entry names.
Output: SELECT catalog_entry_name FROM catalog_contents WHERE product_stock_number LIKE "2%"
What is all the customer information for customers in NY state?
Output: SELECT * FROM CUSTOMER WHERE State  =  "NY"
Find all the customer last names that do not have invoice totals larger than 20.
Output: SELECT LastName FROM CUSTOMER EXCEPT SELECT T1.LastName FROM CUSTOMER AS T1 JOIN Invoice AS T2 ON T1.CustomerId  =  T2.CustomerId WHERE T2.total  >  20
How many distinct locations have the things with service detail 'Unsatisfied' been located in?
Output: SELECT count(DISTINCT T2.Location_Code) FROM Things AS T1 JOIN Timed_Locations_of_Things AS T2 ON T1.thing_id  =  T2.thing_id WHERE T1.service_details  =  'Unsatisfied'
What are the distinct names of nurses on call?
Output: SELECT DISTINCT T1.name FROM nurse AS T1 JOIN on_call AS T2 ON T1.EmployeeID  =  T2.nurse
What are the distinct reigns of wrestlers whose location is not "Tokyo,Japan" ?
Output: SELECT DISTINCT Reign FROM wrestler WHERE LOCATION != "Tokyo , Japan"
Return the names of teams that have no match season record.
Output: SELECT Name FROM team WHERE Team_id NOT IN (SELECT Team FROM match_season)
For each product, return its id and the number of times it was ordered.
Output: SELECT count(*) ,  T3.product_id FROM orders AS T1 JOIN order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id
Find the number of characteristics that the product "flax" has.
Output: SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id  =  t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id  =  t3.characteristic_id WHERE t1.product_name  =  "flax"
How many proteins are associated with an institution in a building with at least 20 floors?
Output: SELECT count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id  =  T2.institution_id JOIN building AS T3 ON T3.building_id  =  T1.building_id WHERE T3.floors  >=  20
Please list the name and id of all artists that have at least 3 albums in alphabetical order.
Output: SELECT T2.Name ,  T1.ArtistId FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistID GROUP BY T1.ArtistId HAVING COUNT(*)  >=  3 ORDER BY T2.Name
What is the id of the instructor who advises of all students from History department?
Output: SELECT i_id FROM advisor AS T1 JOIN student AS T2 ON T1.s_id  =  T2.id WHERE T2.dept_name  =  'History'
Which physicians prescribe a medication of brand X? Tell me the name and position of those physicians.
Output: SELECT DISTINCT T1.name ,  T1.position FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.Brand  =  "X"
What is the salaray and name of the employee that is certified to fly the most planes?
Output: SELECT T1.name ,  T1.salary FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1
What is the year and semester with the most courses?
Output: SELECT semester ,  YEAR FROM SECTION GROUP BY semester ,  YEAR ORDER BY count(*) DESC LIMIT 1
Count the number of courses without prerequisites.
Output: SELECT count(*) FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)
How many regions do we have?
Output: SELECT count(*) FROM region
Count the number of different characteristic names the product 'cumin' has.
Output: SELECT count(DISTINCT t3.characteristic_name) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id  =  t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id  =  t3.characteristic_id WHERE t1.product_name  =  "sesame"
What is the name of the medication used for the patient staying in room 111?
Output: SELECT T4.name FROM stay AS T1 JOIN patient AS T2 ON T1.Patient  =  T2.SSN JOIN Prescribes AS T3 ON T3.Patient  =  T2.SSN JOIN Medication AS T4 ON T3.Medication  =  T4.Code WHERE room  =  111
Return the most common full name among all actors.
Output: SELECT first_name ,  last_name FROM actor GROUP BY first_name ,  last_name ORDER BY count(*) DESC LIMIT 1
What are the maximum and minimum number of cows across all farms.
Output: SELECT max(Cows) ,  min(Cows) FROM farm
What is the id of the student who most recently registered course 301?
Output: SELECT student_id FROM student_course_attendance WHERE course_id = 301 ORDER BY date_of_attendance DESC LIMIT 1
Count the number of stores the chain South has.
Output: SELECT count(*) FROM department_stores AS T1 JOIN department_store_chain AS T2 ON T1.dept_store_chain_id  =  T2.dept_store_chain_id WHERE T2.dept_store_chain_name  =  "South"
What are each physician's employee id and department id primarily affiliated.
Output: SELECT physician ,  department FROM affiliated_with WHERE primaryaffiliation  =  1
What is the id of the patient who stayed in room 111 most recently?
Output: SELECT patient FROM stay WHERE room  =  111 ORDER BY staystart DESC LIMIT 1
Which department has the largest number of employees?
Output: SELECT name FROM department GROUP BY departmentID ORDER BY count(departmentID) DESC LIMIT 1
Which wineries produce at least four wines?
Output: SELECT Winery FROM WINE GROUP BY Winery HAVING count(*)  >=  4
Find the first and last name of students who are not in the largest major.
Output: SELECT fname ,  lname FROM student WHERE major != (SELECT major FROM student GROUP BY major ORDER BY count(*) DESC LIMIT 1)
Find the first names of all customers that live in Brazil and have an invoice.
Output: SELECT DISTINCT T1.FirstName FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId  =  T2.CustomerId WHERE T1.country  =  "Brazil"
Which catalog content has the smallest capacity? Return the catalog entry name.
Output: SELECT catalog_entry_name FROM catalog_contents ORDER BY capacity ASC LIMIT 1
What are card ids, customer ids, card types, and card numbers for each customer card?
Output: SELECT card_id ,  customer_id ,  card_type_code ,  card_number FROM Customers_cards
What are the id and the amount of refund of the booking that incurred the most times of payments?
Output: SELECT T1.booking_id ,  T1.amount_of_refund FROM Bookings AS T1 JOIN Payments AS T2 ON T1.booking_id  =  T2.booking_id GROUP BY T1.booking_id ORDER BY count(*) DESC LIMIT 1
Return the address of store 1.
Output: SELECT T2.address FROM store AS T1 JOIN address AS T2 ON T1.address_id  =  T2.address_id WHERE store_id  =  1
Give me all the phone numbers and email addresses of the workshop groups where services are performed.
Output: SELECT T1.Store_Phone ,  T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID  =  T2.Workshop_Group_ID
What are the card numbers of members from Kentucky?
Output: SELECT card_number FROM member WHERE Hometown LIKE "%Kentucky%"
How many products are there in the records?
Output: SELECT count(*) FROM catalog_contents
What is the first and last name of all the German drivers?
Output: SELECT forename ,  surname FROM drivers WHERE nationality = "German"
What are the ids and names of department stores with both marketing and managing departments?
Output: SELECT T2.dept_store_id ,  T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id  =  T2.dept_store_id WHERE T1.department_name  =  "marketing" INTERSECT SELECT T2.dept_store_id ,  T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id  =  T2.dept_store_id WHERE T1.department_name  =  "managing"
Find the average order quantity per order.
Output: SELECT avg(order_quantity) FROM order_items
What are the distinct ids of customers who made an order after any order that was Cancelled?
Output: SELECT DISTINCT customer_id FROM Customer_Orders WHERE order_date  >  (SELECT min(order_date) FROM Customer_Orders WHERE order_status_code  =  "Cancelled")
Find the name of each user and number of tweets tweeted by each of them.
Output: SELECT T1.name ,  count(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid  =  T2.uid GROUP BY T2.uid
Who is the delegate of district 1 in the elections?
Output: SELECT Delegate FROM election WHERE District  =  1
What are the distinct id and type of the thing that has the status 'Close' or has a status record before the date '2017-06-19 02:59:21'
Output: SELECT DISTINCT T2.thing_id ,  T2.Type_of_Thing_Code FROM Timed_Status_of_Things AS T1 JOIN Things AS T2 ON T1.thing_id  =  T2.thing_id WHERE T1.Status_of_Thing_Code  =  'Close' OR T1.Date_and_Date  <  '2017-06-19 02:59:21'
How many followers does each user have?
Output: SELECT count(*) FROM follows
Count the number of budgets in year 2001 or before whose budgeted amount is greater than 3000
Output: SELECT count(*) FROM budget WHERE budgeted  >  3000 AND YEAR  <=  2001
How many different card types are there?
Output: SELECT count(DISTINCT card_type_code) FROM Customers_Cards
Find the states where have some college students in tryout.
Output: SELECT DISTINCT state FROM college AS T1 JOIN tryout AS T2 ON T1.cName  =  T2.cName
What is the unit of measurement of product named "cumin"?
Output: SELECT t2.unit_of_measure FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code  =  t2.product_category_code WHERE t1.product_name  =  "cumin"
Find the name of the customer who made an order most recently.
Output: SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id  =  t2.customer_id ORDER BY t2.order_date DESC LIMIT 1
How many entrepreneurs are there?
Output: SELECT count(*) FROM entrepreneur
Count the number of different languages in these films.
Output: SELECT count(DISTINCT language_id) FROM film
Show different nominees and the number of musicals they have been nominated.
Output: SELECT Nominee ,  COUNT(*) FROM musical GROUP BY Nominee
What are the id and name of the photos for mountains?
Output: SELECT T1.id ,  T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id WHERE T1.height  >  4000
List the name of actors whose age is not 20.
Output: SELECT Name FROM actor WHERE Age != 20
What are the distinct names of customers with an order status of Pending, sorted by customer id?
Output: SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.order_status_code  =  "Pending" ORDER BY T2.customer_id
What are the names and types of the dorms that have a capacity greater than 300 or less than 100?
Output: SELECT dorm_name ,  gender FROM dorm WHERE student_capacity  >  300 OR student_capacity  <  100
Find the names of Japanese constructors that have once earned more than 5 points?
Output: SELECT T1.name FROM constructors AS T1 JOIN constructorstandings AS T2 ON T1.constructorid = T2.constructorid WHERE T1.nationality = "Japanese" AND T2.points > 5
Find the name and email of the user followed by the least number of people.
Output: SELECT name ,  email FROM user_profiles ORDER BY followers LIMIT 1
Who are the different players and how many years has each played?
Output: SELECT Player ,  Years_Played FROM player
How many dorms have amenities?
Output: SELECT count(DISTINCT dormid) FROM has_amenity
What is the first name of the students who are in age 20 to 25 and living in PHL city?
Output: SELECT fname FROM student WHERE city_code  =  'PHL' AND age BETWEEN 20 AND 25
Which product's detail contains the word "Latte" or "Americano"? Return the full detail.
Output: SELECT product_details FROM products WHERE product_details LIKE "%Latte%" OR product_details LIKE "%Americano%"
Find all 200 meter and 300 meter results of swimmers with nationality "Australia".
Output: SELECT meter_200 ,  meter_300 FROM swimmer WHERE nationality  =  'Australia'
What are the different cities that have more than 100 memberships?
Output: SELECT DISTINCT city FROM branch WHERE membership_amount  >=  100
Return the id of the staff whose Staff Department Assignment was earlier than that of any Clerical Staff.
Output: SELECT staff_id FROM Staff_Department_Assignments WHERE date_assigned_to  <  (SELECT max(date_assigned_to) FROM Staff_Department_Assignments WHERE job_title_code  =  'Clerical Staff')
What are the names of customers who never made an order.
Output: SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id  =  t2.customer_id
List the names and locations of all stations ordered by their yearly entry exit and interchange amounts.
Output: SELECT name ,  LOCATION FROM station ORDER BY Annual_entry_exit ,  Annual_interchanges
Count the number of different colleges that players who play for Columbus Crew are from.
Output: SELECT count(DISTINCT T1.College) FROM match_season AS T1 JOIN team AS T2 ON T1.Team  =  T2.Team_id WHERE T2.Name  =  "Columbus Crew"
Return the name, phone number and email address for the customer with the most orders.
Output: SELECT T1.customer_name ,  T1.customer_phone ,  T1.customer_email FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T2.customer_id ORDER BY count(*) DESC LIMIT 1
How many books fall into each category?
Output: SELECT category ,  count(*) FROM book_club GROUP BY category
What college has a student who successfully made the team in the role of a goalie?
Output: SELECT cName FROM  tryout WHERE decision  =  'yes' AND pPos  =  'goalie'
Tell me the total quantity of products bought by the customer called "Rodrick Heaney".
Output: SELECT sum(t3.order_quantity) 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 WHERE t1.customer_name  =  "Rodrick Heaney"
Show the carriers that have both phones with memory smaller than 32 and phones with memory bigger than 64.
Output: SELECT Carrier FROM phone WHERE Memory_in_G  <  32 INTERSECT SELECT Carrier FROM phone WHERE Memory_in_G  >  64
How many different genders are there in the dorms?
Output: SELECT count(DISTINCT gender) FROM dorm
Which delegates are from counties with population smaller than 100000?
Output: SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id  =  T2.District WHERE T1.Population  <  100000
Which organizations are not a parent organization of others? List the organization id.
Output: SELECT organization_id FROM organizations EXCEPT SELECT parent_organization_id FROM organizations
What are the names of regions with two or more storms?
Output: SELECT T1.region_name FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id HAVING count(*)  >=  2
Find the names of the products with length smaller than 3 or height greater than 5.
Output: SELECT catalog_entry_name FROM catalog_contents WHERE LENGTH  <  3 OR width  >  5
Find the name of the instructors who taught C Programming course before.
Output: SELECT T1.name FROM instructor AS T1 JOIN teaches AS T2 ON T1.id  =  T2.id JOIN course AS T3 ON T2.course_id  =  T3.course_id WHERE T3.title  =  'C Programming'
Find the patient who has the most recent undergoing treatment?
Output: SELECT patient FROM undergoes ORDER BY dateundergoes LIMIT 1
What is the most frequently ordered product? Tell me the detail of the product
Output: SELECT t2.product_details FROM order_items AS t1 JOIN products AS t2 ON t1.product_id  =  t2.product_id GROUP BY t1.product_id ORDER BY count(*) DESC LIMIT 1
What are the names of the products that have a color description of 'red' and the 'fast' characteristic?
Output: SELECT product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id  =  t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id  =  t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code  =  t4.color_code WHERE t4.color_description  =  "red" AND t3.characteristic_name  =  "fast"
List the names of all courses ordered by their titles and credits.
Output: SELECT title FROM course ORDER BY title ,  credits
What are the name and level of catalog structure with level number between 5 and 10
Output: SELECT catalog_level_name ,  catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10
What are the names of the workshop groups that have bookings with status code "stop"?
Output: SELECT T2.Store_Name FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID  =  T2.Workshop_Group_ID WHERE T1.Status_Code  =  "stop"
What is the total revenue of each manufacturer?
Output: SELECT sum(revenue) ,  name FROM manufacturers GROUP BY name
Which countries do not have a stadium that was opened after 2006?
Output: SELECT country FROM stadium EXCEPT SELECT country FROM stadium WHERE opening_year  >  2006
How many products have the characteristic named "hot"?
Output: SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id  =  t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id  =  t3.characteristic_id WHERE t3.characteristic_name  =  "hot"
Which colleges does each player with a name that starts with the letter D  who tried out go to?
Output: SELECT T1.cName FROM  tryout AS T1 JOIN player AS T2 ON T1.pID  =  T2.pID WHERE T2.pName LIKE 'D%'
What is the origin and destination for all flights whose price is higher than 300?
Output: SELECT origin ,  destination FROM Flight WHERE price  >  300
What are the names and years of all races that had a driver with the last name Lewis?
Output: SELECT T2.name ,  T2.year FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T1.driverid = T3.driverid WHERE T3.forename = "Lewis"
What are the names of all races held between 2009 and 2011?
Output: SELECT name FROM races WHERE YEAR BETWEEN 2009 AND 2011
What is the code of the product type with an average price higher than the average price of all products?
Output: SELECT product_type_code FROM products GROUP BY product_type_code HAVING avg(product_price)  >  (SELECT avg(product_price) FROM products)
How many diffrent dorm amenities are there?
Output: SELECT count(*) FROM dorm_amenity
What are the official native languages that contain the string "English".
Output: SELECT Official_native_language FROM country WHERE Official_native_language LIKE "%English%"
Find the names of states that have some college students playing in the mid position but not in the goalie position.
Output: SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName  =  T2.cName WHERE T2.pPos  =  'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName  =  T2.cName WHERE T2.pPos  =  'goalie'
Find the names of users whose emails contain ‘superstar’ or ‘edu’.
Output: SELECT name FROM user_profiles WHERE email LIKE '%superstar%' OR email LIKE '%edu%'
Count the number of tracks that are part of the rock genre.
Output: SELECT COUNT(*) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId WHERE T1.Name  =  "Rock"
Return the id of the department with the fewest staff assignments.
Output: SELECT department_id FROM staff_department_assignments GROUP BY department_id ORDER BY count(*) LIMIT 1
Return the colleges that have players who play the Midfielder position, as well as players who play the Defender position.
Output: SELECT College FROM match_season WHERE POSITION  =  "Midfielder" INTERSECT SELECT College FROM match_season WHERE POSITION  =  "Defender"
List the grape, winery and year of the wines whose price is bigger than 100 ordered by year.
Output: SELECT Grape ,  Winery ,  YEAR FROM WINE WHERE Price  >   100 ORDER BY YEAR
What are the name and typical buying and selling prices of the products that have color described as "yellow"?
Output: SELECT t1.product_name ,  t1.typical_buying_price ,  t1.typical_selling_price FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code  =  t2.color_code WHERE t2.color_description  =  "yellow"
What are the titles of films that are either longer than 100 minutes or rated PG other than those that cost more than 200 to replace?
Output: SELECT title FROM film WHERE LENGTH  >  100 OR rating  =  'PG' EXCEPT SELECT title FROM film WHERE replacement_cost  >  200
What is the description of the color for most products?
Output: SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code  =  t2.color_code GROUP BY t2.color_description ORDER BY count(*) DESC LIMIT 1
Who were the governors of the parties associated with delegates from district 1?
Output: SELECT T2.Governor FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID WHERE T1.District  =  1
Which people severed as governor most frequently?
Output: SELECT Governor FROM party GROUP BY Governor ORDER BY COUNT(*) DESC LIMIT 1
Which employee has showed up in most circulation history documents. List the employee's name and the number of drafts and copies.
Output: SELECT Employees.employee_name , count(*) FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id GROUP BY Circulation_History.document_id , Circulation_History.draft_number , Circulation_History.copy_number ORDER BY count(*) DESC LIMIT 1
Show the name of colleges that have at least two players in descending alphabetical order.
Output: SELECT College FROM match_season GROUP BY College HAVING count(*)  >=  2 ORDER BY College DESC
Find the average and total capacity of dorms for the students with gender X.
Output: SELECT avg(student_capacity) ,  sum(student_capacity) FROM dorm WHERE gender  =  'X'
Find number of products which Sony does not make.
Output: SELECT count(DISTINCT name) FROM products WHERE name NOT IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Sony')
Find the name of physicians who are affiliated with both Surgery and Psychiatry departments.
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' INTERSECT 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  =  'Psychiatry'
How many students attend course English?
Output: SELECT count(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "English"
What are the order ids and customer ids for orders that have been Cancelled, sorted by their order dates?
Output: SELECT order_id ,  customer_id FROM customer_orders WHERE order_status_code  =   "Cancelled" ORDER BY order_date
Count the number of customers who are active.
Output: SELECT count(*) FROM customer WHERE active = '1'
List the id of students who attended  statistics courses in the order of attendance date.
Output: SELECT T2.student_id FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "statistics" ORDER BY T2.date_of_attendance
Find the first name of students who are living in the dorm that has most number of amenities.
Output: SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid  =  T2.stuid WHERE T2.dormid IN (SELECT T2.dormid FROM dorm AS T3 JOIN has_amenity AS T4 ON T3.dormid  =  T4.dormid JOIN dorm_amenity AS T5 ON T4.amenid  =  T5.amenid GROUP BY T3.dormid ORDER BY count(*) DESC LIMIT 1)
Who is the founder of Sony?
Output: SELECT founder FROM manufacturers WHERE name  =  'Sony'
What are the all games score and location of the school called Clemson?
Output: SELECT t2.All_Games ,  t1.location FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id WHERE team_name  =  'Clemson'
What is the name of the youngest editor?
Output: SELECT Name FROM editor ORDER BY Age ASC LIMIT 1
How many debit cards do we have?
Output: SELECT count(*) FROM Customers_cards WHERE card_type_code  =  "Debit"
What are the times of elimination for any instances in which the elimination was done by Punk or Orton?
Output: SELECT TIME FROM elimination WHERE Eliminated_By  =  "Punk" OR Eliminated_By  =  "Orton"
What are the names of perpetrators?
Output: SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID  =  T2.People_ID
How many different courses offered by Physics department?
Output: SELECT count(DISTINCT course_id) FROM course WHERE dept_name  =  'Physics'
List all channel names ordered by their rating in percent from big to small.
Output: SELECT name FROM channel ORDER BY rating_in_percent DESC
What are the ids of all products that were either ordered more than 3 times or have a cumulative amount purchased of above 80000?
Output: SELECT product_id FROM Order_Items GROUP BY product_id HAVING count(*)  >  3 UNION SELECT product_id FROM Product_Suppliers GROUP BY product_id HAVING sum(total_amount_purchased)  >  80000