niryuu/sni-each-converted huggingface dataset:
For each branch id, what are the names of the branches that were registered after 2015?
Output: SELECT T2.name ,  count(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id  =  T2.branch_id WHERE T1.register_year  >  2015 GROUP BY T2.branch_id
Select the name of the products with a price less than or equal to $200.
Output: SELECT name FROM products WHERE price  <=  200
Find the name of the swimmer who has the most records.
Output: SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id  =  t2.swimmer_id GROUP BY t2.swimmer_id ORDER BY count(*) DESC LIMIT 1
How many different colleges are there?
Output: SELECT count(*) FROM College
What are the product names with average product price smaller than 1000000?
Output: SELECT Product_Name FROM PRODUCTS GROUP BY Product_Name HAVING avg(Product_Price)  <  1000000
Find the name and gender of the staff who has been assigned the job of Sales Person but never Clerical Staff.
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.job_title_code  =  "Sales Person" EXCEPT 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.job_title_code  =  "Clerical Staff"
Find all manufacturers' names and their headquarters, sorted by the ones with highest revenue first.
Output: SELECT name ,  headquarter FROM manufacturers ORDER BY revenue DESC
For each dorm, how many amenities does it have?
Output: SELECT count(*) ,  T1.dormid FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid WHERE T1.student_capacity  >  100 GROUP BY T1.dormid
What are the names and buying prices of all the products?
Output: SELECT product_name ,  typical_buying_price FROM products
What is the name of the stadium which held the most events?
Output: SELECT t1.name FROM stadium AS t1 JOIN event AS t2 ON t1.id  =  t2.stadium_id GROUP BY t2.stadium_id ORDER BY count(*) DESC LIMIT 1
How many countries do not have an roller coaster longer than 3000?
Output: SELECT count(*) FROM country WHERE country_id NOT IN ( SELECT country_id FROM roller_coaster WHERE LENGTH  >  3000 )
Show the name of the customer who has the most orders.
Output: SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1
How many movie directors are there?
Output: SELECT COUNT (DISTINCT director) FROM movie
List the wheels and locations of the railways.
Output: SELECT Wheels ,  LOCATION FROM railway
List all the event names by year from the most recent to the oldest.
Output: SELECT name FROM event ORDER BY YEAR DESC
How many girl students who are younger than 25?
Output: SELECT count(*) FROM student WHERE sex  =  'F' AND age  <  25
What are the starting years shared by the technicians from the team "CLE" or "CWS"?
Output: SELECT Starting_Year FROM technician WHERE Team  =  "CLE" INTERSECT SELECT Starting_Year FROM technician WHERE Team  =  "CWS"
What is the document status description of the document with id 1?
Output: SELECT Ref_Document_Status.document_status_description FROM Ref_Document_Status JOIN Documents ON Documents.document_status_code = Ref_Document_Status.document_status_code WHERE Documents.document_id = 1
What is the name of the shipping agent of the document with id 2?
Output: SELECT Ref_Shipping_Agents.shipping_agent_name FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Documents.document_id = 2
Find distinct cities of addresses of people?
Output: SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id
List name, dates active, and number of deaths for all storms with at least 1 death.
Output: SELECT name ,  dates_active ,  number_deaths FROM storm WHERE number_deaths  >=  1
Show the nominees that have nominated musicals for both "Tony Award" and "Drama Desk Award".
Output: SELECT Nominee FROM musical WHERE Award  =  "Tony Award" INTERSECT SELECT Nominee FROM musical WHERE Award  =  "Drama Desk Award"
How many customers have an account?
Output: SELECT count(DISTINCT customer_id) FROM Accounts
What are the names of students and their respective departments, ordered by number of credits from least to greatest?
Output: SELECT name ,  dept_name FROM student ORDER BY tot_cred
Find the name of the department that offers the highest total credits?
Output: SELECT dept_name FROM course GROUP BY dept_name ORDER BY sum(credits) DESC LIMIT 1
Find the maximum and minimum millisecond lengths of pop tracks.
Output: SELECT max(Milliseconds) ,  min(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId WHERE T1.Name  =  "Pop"
For each document, list the number of employees who have showed up in the circulation history of that document. List the document ids and number of employees.
Output: SELECT document_id ,  count(DISTINCT employee_id) FROM Circulation_History GROUP BY document_id
List names of all teams in the basketball competition, ordered by all home scores in descending order.
Output: SELECT team_name FROM basketball_match ORDER BY All_Home DESC
What are the coupon amount of the coupons owned by both good and bad customers?
Output: SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id  =  T2.coupon_id WHERE T2.good_or_bad_customer  =  'good' INTERSECT SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id  =  T2.coupon_id WHERE T2.good_or_bad_customer  =  'bad'
What is the maximum fastest lap speed in race named 'Monaco Grand Prix' in 2008 ?
Output: SELECT max(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = "Monaco Grand Prix"
What are the different names of all the races in reverse alphabetical order?
Output: SELECT DISTINCT name FROM races ORDER BY name DESC
Return the names of entrepreneurs do no not have the investor Rachel Elnaugh.
Output: SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID WHERE T1.Investor != "Rachel Elnaugh"
Find the average millisecond length of Latin and Pop tracks.
Output: SELECT AVG(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId WHERE T1.Name  =  "Latin" OR T1.Name  =  "Pop"
What are the ids of the students who registered for course 301?
Output: SELECT student_id FROM student_course_attendance WHERE course_id  =  301
Show names of musicals and the number of actors who have appeared in the musicals.
Output: SELECT T2.Name ,  COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID GROUP BY T1.Musical_ID
what are the first name and last name of all candidates?
Output: SELECT T2.first_name ,  T2.last_name FROM candidates AS T1 JOIN people AS T2 ON T1.candidate_id = T2.person_id
What is the id and last name of the driver with the longest laptime?
Output: SELECT T1.driverid ,  T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds DESC LIMIT 1
What is the id and name of the browser that is compatible with the most web accelerators?
Output: SELECT T1.id ,  T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id  =  T2.browser_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1
What are the schools that were either founded before 1850 or are public?
Output: SELECT school FROM university WHERE founded  >  1850 OR affiliation  =  'Public'
Find the distinct names of all races held between 2014 and 2017?
Output: SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017
Which cmi cross reference id is not related to any parking taxes?
Output: SELECT cmi_cross_ref_id FROM cmi_cross_references EXCEPT SELECT cmi_cross_ref_id FROM parking_fines
What is the average and maximum damage in millions for storms that had a max speed over 1000?
Output: SELECT avg(damage_millions_USD) ,  max(damage_millions_USD) FROM storm WHERE max_speed  >  1000
What are the names of races that were held after 2017 and the circuits were in the country of Spain?
Output: SELECT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2017
Return the name of the heaviest entrepreneur.
Output: SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T2.Weight DESC LIMIT 1
Show names of actors and names of musicals they are in.
Output: SELECT T1.Name ,  T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID
Count the number of different affected regions.
Output: SELECT count(DISTINCT region_id) FROM affected_region
What are the weights of entrepreneurs in descending order of money requested?
Output: SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T1.Money_Requested DESC
What is the product description of the product booked with an amount of 102.76?
Output: SELECT T2.product_description FROM products_booked AS T1 JOIN products_for_hire AS T2 ON T1.product_id  =  T2.product_id WHERE T1.booked_amount  =  102.76
What is the membership card held by both members living in Hartford and ones living in Waterbury address?
Output: SELECT membership_card FROM member WHERE address  =  'Hartford' INTERSECT SELECT membership_card FROM member WHERE address  =  'Waterbury'
What are the first and last names of all drivers who participated in the Australian Grand Prix but not the Chinese Grand Prix?
Output: SELECT T3.forename ,  T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Australian Grand Prix" EXCEPT SELECT T3.forename ,  T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Chinese Grand Prix"
What are the different names, locations, and products of the enzymes that are capable inhibitor interactions?
Output: SELECT DISTINCT T1.name ,  T1.location ,  T1.product FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.enzyme_id  =  T1.id WHERE T2.interaction_type  =  'inhibitor'
Show the enrollment and primary_conference of the oldest college.
Output: SELECT enrollment ,  primary_conference FROM university ORDER BY founded LIMIT 1
What are the names of instructors who didn't teach?
Output: SELECT name FROM instructor WHERE id NOT IN (SELECT id FROM teaches)
What are all info of students who registered courses but not attended courses?
Output: SELECT * FROM student_course_registrations WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance)
What are the numbers of races for each constructor id?
Output: SELECT count(*) ,  constructorid FROM constructorStandings GROUP BY constructorid
For each nationality, how many different constructors are there?
Output: SELECT count(*) ,  nationality FROM constructors GROUP BY nationality
What is the name of the race that occurred most recently?
Output: SELECT name FROM races ORDER BY date DESC LIMIT 1
Which student visited restaurant most often? List student's first name and last name.
Output: SELECT Student.Fname , Student.Lname FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID GROUP BY Student.StuID ORDER BY count(*) DESC LIMIT 1
List all female students age is older than 18 who is not majoring in 600. List students' first name and last name.
Output: SELECT Fname , Lname FROM Student WHERE Age  >  18 AND Major != 600 AND Sex = 'F'
In which season and which stadium did any player have an injury of 'Foot injury' or 'Knee problem'?
Output: SELECT T1.season ,  T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id  =  T2.id JOIN injury_accident AS T3 ON T1.id  =  T3.game_id WHERE T3.injury  =  'Foot injury' OR T3.injury  =  'Knee problem'
List the distinct carriers of phones with memories bigger than 32.
Output: SELECT DISTINCT Carrier FROM phone WHERE Memory_in_G  >  32
Find courses that ran in Fall 2009 and in Spring 2010.
Output: SELECT course_id FROM SECTION WHERE semester  =  'Fall' AND YEAR  =  2009 INTERSECT SELECT course_id FROM SECTION WHERE semester  =  'Spring' AND YEAR  =  2010
What is the role of the employee named Koby?
Output: SELECT T1.role_description FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code WHERE T2.employee_name = "Koby"
Return the investor who have invested in the greatest number of entrepreneurs.
Output: SELECT Investor FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC LIMIT 1
How many drivers were in the Australian Grand Prix held in 2009?
Output: SELECT count(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = "Australian Grand Prix" AND YEAR = 2009
What is the storm name and max speed which affected the greatest number of regions?
Output: SELECT T1.name ,  T1.max_speed FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id  =  T2.storm_id GROUP BY T1.storm_id ORDER BY count(*) DESC LIMIT 1
What is the party of the youngest people?
Output: SELECT Party FROM people ORDER BY Age ASC LIMIT 1
Show the names of phones that have total number of stocks bigger than 2000, in descending order of the total number of stocks.
Output: SELECT T2.Name FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID  =  T2.Phone_ID GROUP BY T2.Name HAVING sum(T1.Num_of_stock)  >=  2000 ORDER BY sum(T1.Num_of_stock) DESC
Show the names of sponsors of players whose residence is either "Brandon" or "Birtle".
Output: SELECT Sponsor_name FROM player WHERE Residence  =  "Brandon" OR Residence  =  "Birtle"
List the names of people that have not been on the affirmative side of debates.
Output: SELECT Name FROM people WHERE People_id NOT IN (SELECT Affirmative FROM debate_people)
Return the average transaction amount, as well as the total amount of all transactions.
Output: SELECT avg(transaction_amount) ,  sum(transaction_amount) FROM Financial_transactions
What are the name and os of web client accelerators that do not work with only a 'Broadband' type connection?
Output: SELECT name ,  operating_system FROM web_client_accelerator WHERE CONNECTION != 'Broadband'
Find the name of department has the highest amount of students?
Output: SELECT dept_name FROM student GROUP BY dept_name ORDER BY count(*) DESC LIMIT 1
give me names of all compatible browsers and accelerators in the descending order of compatible year
Output: SELECT T2.name ,  T3.name FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id  =  T2.id JOIN web_client_accelerator AS T3 ON T1.accelerator_id  =  T3.id ORDER BY T1.compatible_since_year DESC
How many customers do not have an account?
Output: SELECT count(*) FROM Customers WHERE customer_id NOT IN (SELECT customer_id FROM Accounts)
Find the total number of students in each department.
Output: SELECT count(*) ,  dept_name FROM student GROUP BY dept_name
Find the address of all customers that live in Germany and have invoice.
Output: SELECT DISTINCT T1.Address FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId  =  T2.CustomerId WHERE T1.country  =  "Germany"
Find the names of all races held in 2017.
Output: SELECT name FROM races WHERE YEAR = 2017
List the name of browsers in descending order by market share.
Output: SELECT name FROM browser ORDER BY market_share DESC
Show the investors shared by entrepreneurs that requested more than 140000 and entrepreneurs that requested less than 120000.
Output: SELECT Investor FROM entrepreneur WHERE Money_Requested  >  140000 INTERSECT SELECT Investor FROM entrepreneur WHERE Money_Requested  <  120000
What is the name of the perpetrator with the biggest weight.
Output: SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T1.Weight DESC LIMIT 1
What are the ids and first names of customers who do not hold a credit card?
Output: SELECT customer_id ,  customer_first_name FROM Customers EXCEPT SELECT T1.customer_id ,  T2.customer_first_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE card_type_code  =  "Credit"
What are the ids of instructors who didnt' teach?
Output: SELECT id FROM instructor EXCEPT SELECT id FROM teaches
Find the title, credit, and department name of courses that have more than one prerequisites?
Output: SELECT T1.title ,  T1.credits , T1.dept_name FROM course AS T1 JOIN prereq AS T2 ON T1.course_id  =  T2.course_id GROUP BY T2.course_id HAVING count(*)  >  1
What is the weight of the shortest person?
Output: SELECT Weight FROM people ORDER BY Height ASC LIMIT 1
What are the ids and full names of customers who hold two or more cards?
Output: SELECT T1.customer_id ,  T2.customer_first_name ,  T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id HAVING count(*)  >=  2
Give the title of the course offered in Chandler during the Fall of 2010.
Output: SELECT T1.title FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id  =  T2.course_id WHERE building  =  'Chandler' AND semester  =  'Fall' AND YEAR  =  2010
How many students and instructors are in each department?
Output: SELECT count(DISTINCT T2.id) ,  count(DISTINCT T3.id) ,  T3.dept_name FROM department AS T1 JOIN student AS T2 ON T1.dept_name  =  T2.dept_name JOIN instructor AS T3 ON T1.dept_name  =  T3.dept_name GROUP BY T3.dept_name
Which membership card has more than 5 members?
Output: SELECT Membership_card FROM member GROUP BY Membership_card HAVING count(*)  >  5
Find the name of instructors who are advising more than one student.
Output: SELECT T1.name FROM instructor AS T1 JOIN advisor AS T2 ON T1.id  =  T2.i_id GROUP BY T2.i_id HAVING count(*)  >  1
What is draft detail of the document with id 7?
Output: SELECT draft_details FROM Document_Drafts WHERE document_id = 7
Find the name of students who took any class in the years of 2009 and 2010.
Output: SELECT DISTINCT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id  =  T2.id WHERE YEAR  =  2009 OR YEAR  =  2010
What are the cell phone numbers of the candidates that received an assessment code of "Fail"?
Output: SELECT T3.cell_mobile_number FROM candidates AS T1 JOIN candidate_assessments AS T2 ON T1.candidate_id = T2.candidate_id JOIN people AS T3 ON T1.candidate_id = T3.person_id WHERE T2.asessment_outcome_code = "Fail"
What are the names of countains that no climber has climbed?
Output: SELECT Name FROM mountain WHERE Mountain_ID NOT IN (SELECT Mountain_ID FROM climber)
Count the number of actors.
Output: SELECT count(*) FROM actor
list in alphabetic order all course names and their instructors' names in year 2008.
Output: SELECT T1.title ,  T3.name FROM course AS T1 JOIN teaches AS T2 ON T1.course_id  =  T2.course_id JOIN instructor AS T3 ON T2.id  =  T3.id WHERE YEAR  =  2008 ORDER BY T1.title
Count the number of tracks.
Output: SELECT count(*) FROM track
Find the name of students who took some course offered by Statistics department.
Output: SELECT T3.name FROM course AS T1 JOIN takes AS T2 ON T1.course_id  =  T2.course_id JOIN student AS T3 ON T2.id  =  T3.id WHERE T1.dept_name  =  'Statistics'
What is the id of the candidate whose email is stanley.monahan@example.org?
Output: SELECT T2.candidate_id FROM people AS T1 JOIN candidates AS T2 ON T1.person_id = T2.candidate_id WHERE T1.email_address = "stanley.monahan@example.org"
Find the names of instructors who didn't each any courses in any Spring semester.
Output: SELECT name FROM instructor WHERE id NOT IN (SELECT id FROM teaches WHERE semester  =  'Spring')
Show the name and date for each race and its track name.
Output: SELECT T1.name ,  T1.date ,  T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id
Show storm name with at least two regions and 10 cities affected.
Output: SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id  =  T2.storm_id GROUP BY T1.storm_id HAVING count(*)  >=  2 INTERSECT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id  =  T2.storm_id GROUP BY T1.storm_id HAVING sum(T2.number_city_affected)  >=  10
What are the characters of actors in descending order of age?
Output: SELECT Character FROM actor ORDER BY age DESC
What is the primary conference of the school that has the lowest acc percent score in the competition?
Output: SELECT t1.Primary_conference FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id ORDER BY t2.acc_percent LIMIT 1
Wat is the tax source system code and master customer id of the taxes related to each parking fine id?
Output: SELECT T1.source_system_code ,  T1.master_customer_id ,  T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Parking_Fines AS T2 ON T1.cmi_cross_ref_id  =  T2.cmi_cross_ref_id
What are the full names of customers who have accounts?
Output: SELECT DISTINCT T1.customer_first_name ,  T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id  =  T2.customer_id
Give the name of the lowest earning instructor in the Statistics department.
Output: SELECT name FROM instructor WHERE dept_name  =  'Statistics' ORDER BY salary LIMIT 1
Find all the forenames of distinct drivers who won in position 1 as driver standing and had more than 20 points?
Output: SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 AND T2.points > 20
What is the title of the prerequisite class of International Finance course?
Output: SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id  =  T2.course_id WHERE T2.title  =  'International Finance')
List document id of documents status is done and document type is Paper and the document is shipped by shipping agent named USPS.
Output: SELECT document_id FROM Documents WHERE document_status_code  =  "done" AND document_type_code = "Paper" INTERSECT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = "USPS"
What are the unique names of races that held after 2000 and the circuits were in Spain?
Output: SELECT DISTINCT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2000
How many different source system code for the cmi cross references are there?
Output: SELECT count(DISTINCT source_system_code) FROM CMI_cross_references
Which year had the greatest number of courses?
Output: SELECT YEAR FROM SECTION GROUP BY YEAR ORDER BY count(*) DESC LIMIT 1
How many medicines are offered by each trade name?
Output: SELECT trade_name ,  count(*) FROM medicine GROUP BY trade_name
Find the semester and year which has the least number of student taking any class.
Output: SELECT semester ,  YEAR FROM takes GROUP BY semester ,  YEAR ORDER BY count(*) LIMIT 1
What are the names and budgets of departments with budgets greater than the average?
Output: SELECT dept_name ,  budget FROM department WHERE budget  >  (SELECT avg(budget) FROM department)
What are the ids, scores, and dates of the games which caused at least two injury accidents?
Output: SELECT T1.id ,  T1.score ,  T1.date FROM game AS T1 JOIN injury_accident AS T2 ON T2.game_id  =  T1.id GROUP BY T1.id HAVING count(*)  >=  2
What is the team name and acc regular season score of the school that was founded for the longest time?
Output: SELECT t2.team_name ,  t2.ACC_Regular_Season FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id ORDER BY t1.founded LIMIT 1
Count the number of cards the customer with the first name Art and last name Turcotte has.
Output: SELECT count(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.customer_first_name  =  "Art" AND T2.customer_last_name  =  "Turcotte"
How many students have advisors?
Output: SELECT count(DISTINCT s_id) FROM advisor
Find the id of courses which are registered or attended by student whose id is 121?
Output: SELECT course_id FROM student_course_registrations WHERE student_id = 121 UNION SELECT course_id FROM student_course_attendance WHERE student_id = 121
For every medicine id, what are the names of the medicines that can interact with more than one enzyme?
Output: SELECT T1.id ,  T1.Name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id  =  T1.id GROUP BY T1.id HAVING count(*)  >=  2
what is id of students who registered some courses but the least number of courses in these students?
Output: SELECT student_id FROM student_course_registrations GROUP BY student_id ORDER BY count(*) LIMIT 1
Please show the employee first names and ids of employees who serve at least 10 customers.
Output: SELECT T1.FirstName ,  T1.SupportRepId FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId  =  T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*)  >=  10
For each party, find its location and the name of its host. Sort the result in ascending order of the age of the host.
Output: SELECT T3.Location ,  T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID  =  T2.Host_ID JOIN party AS T3 ON T1.Party_ID  =  T3.Party_ID ORDER BY T2.Age
List the forename and surname of all distinct drivers who once had laptime less than 93000 milliseconds?
Output: SELECT DISTINCT T1.forename ,  T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000
which course has most number of registered students?
Output: SELECT T1.course_name FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_Id GROUP BY T1.course_id ORDER BY count(*) DESC LIMIT 1
What are the account ids, customer ids, and account names for all the accounts?
Output: SELECT account_id ,  customer_id ,  account_name FROM Accounts
How many debates are there?
Output: SELECT count(*) FROM debate
How many distinct kinds of injuries happened after season 2010?
Output: SELECT count(DISTINCT T1.injury) FROM injury_accident AS T1 JOIN game AS T2 ON T1.game_id  =  T2.id WHERE T2.season  >  2010
Show year where a track with a seating at least 5000 opened and a track with seating no more than 4000 opened.
Output: SELECT year_opened FROM track WHERE seating BETWEEN 4000 AND 5000
How many restaurant is the Sandwich type restaurant?
Output: SELECT count(*) FROM Restaurant JOIN Type_Of_Restaurant ON Restaurant.ResID =  Type_Of_Restaurant.ResID JOIN Restaurant_Type ON Type_Of_Restaurant.ResTypeID = Restaurant_Type.ResTypeID GROUP BY Type_Of_Restaurant.ResTypeID HAVING Restaurant_Type.ResTypeName = 'Sandwich'
What are the different driver ids and nationalities of all drivers who had a laptime of more than 100000 milliseconds?
Output: SELECT DISTINCT T1.driverid ,  T1.nationality FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds >  100000
Find the name of instructor who is the advisor of the student who has the highest number of total credits.
Output: SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id  =  T2.id JOIN student AS T3 ON T1.s_id  =  T3.id ORDER BY T3.tot_cred DESC LIMIT 1
What are the ids for courses in the Fall of 2009 or the Spring of 2010?
Output: SELECT course_id FROM SECTION WHERE semester  =  'Fall' AND YEAR  =  2009 UNION SELECT course_id FROM SECTION WHERE semester  =  'Spring' AND YEAR  =  2010
What are the different names of mountains ascended by climbers from the country of West Germany?
Output: SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID  =  T2.Mountain_ID WHERE T1.Country  =  "West Germany"
What is the sum of budgets of the Marketing and Finance departments?
Output: SELECT sum(budget) FROM department WHERE dept_name  =  'Marketing' OR dept_name  =  'Finance'
When did Linda Smith visit Subway?
Output: SELECT TIME FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith" AND Restaurant.ResName = "Subway"
What is the average unit price of rock tracks?
Output: SELECT AVG(T2.UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId WHERE T1.Name  =  "Rock"
What are the titles for courses with two prerequisites?
Output: SELECT T1.title FROM course AS T1 JOIN prereq AS T2 ON T1.course_id  =  T2.course_id GROUP BY T2.course_id HAVING count(*)  =  2
How many customer cards are there?
Output: SELECT count(*) FROM Customers_cards
List the id of students who registered course statistics in the order of registration date.
Output: SELECT T2.student_id FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "statistics" ORDER BY T2.registration_date
What is the name and date of the race that occurred most recently?
Output: SELECT name ,  date FROM races ORDER BY date DESC LIMIT 1
List all students' first names and last names who majored in 600.
Output: SELECT Fname , Lname FROM Student WHERE Major  =  600
What are the codes of card types that have 5 or more cards?
Output: SELECT card_type_code FROM Customers_cards GROUP BY card_type_code HAVING count(*)  >=  5
What are the public schools and what are their locations?
Output: SELECT school ,  LOCATION FROM university WHERE affiliation  =  'Public'
What is the cmi cross reference id that is related to at least one council tax entry? List the cross reference id and source system code.
Output: SELECT T1.cmi_cross_ref_id ,  T1.source_system_code FROM CMI_Cross_References AS T1 JOIN Council_Tax AS T2 ON T1.cmi_cross_ref_id  =  T2.cmi_cross_ref_id GROUP BY T1.cmi_cross_ref_id HAVING count(*)  >=  1
What are the start date and end date of the booking that has booked the product named 'Book collection A'?
Output: SELECT T3.booking_start_date ,   T3.booking_end_date FROM Products_for_hire AS T1 JOIN products_booked AS T2 ON T1.product_id  =  T2.product_id JOIN bookings AS T3 ON T2.booking_id  =  T3.booking_id WHERE T1.product_name  =  'Book collection A'
What is the count of enzymes without any interactions?
Output: SELECT count(*) FROM enzyme WHERE id NOT IN ( SELECT enzyme_id FROM medicine_enzyme_interaction )
What are the ids and locations of all circuits in France or Belgium?
Output: SELECT circuitid ,  LOCATION FROM circuits WHERE country = "France" OR country = "Belgium"
What are the names of enzymes in the medicine named 'Amisulpride' that can serve as an 'inhibitor'?
Output: SELECT T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id  =  T2.enzyme_id JOIN medicine AS T3 ON T2.medicine_id  =  T3.id WHERE T3.name  =  'Amisulpride' AND T2.interaction_type  =  'inhibitor'
What are the names of students who have taken the prerequisite for the course International Finance?
Output: SELECT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id  =  T2.id WHERE T2.course_id IN (SELECT T4.prereq_id FROM course AS T3 JOIN prereq AS T4 ON T3.course_id  =  T4.course_id WHERE T3.title  =  'International Finance')
What are the names of enzymes that include the string 'ALA'?
Output: SELECT name FROM enzyme WHERE name LIKE "%ALA%"
For each course id, how many students are registered and what are the course names?
Output: SELECT T3.course_name ,  count(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id JOIN courses AS T3 ON T2.course_id = T3.course_id GROUP BY T2.course_id
What are the first names of all the different drivers in alphabetical order?
Output: SELECT DISTINCT forename FROM drivers ORDER BY forename ASC
Show the nations that have both hosts older than 45 and hosts younger than 35.
Output: SELECT Nationality FROM HOST WHERE Age  >  45 INTERSECT SELECT Nationality FROM HOST WHERE Age  <  35
List the names and buildings of all departments sorted by the budget from large to small.
Output: SELECT dept_name ,  building FROM department ORDER BY budget DESC
What are the dates of birth of entrepreneurs with investor "Simon Woodroffe" or "Peter Jones"?
Output: SELECT T2.Date_of_Birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID WHERE T1.Investor  =  "Simon Woodroffe" OR T1.Investor  =  "Peter Jones"
How many drivers did not participate in the races held in 2009?
Output: SELECT count(DISTINCT driverId) FROM results WHERE raceId NOT IN( SELECT raceId FROM races WHERE YEAR != 2009 )
What is the season of the game which causes the player 'Walter Samuel' to get injured?
Output: SELECT T1.season FROM game AS T1 JOIN injury_accident AS T2 ON T1.id  =  T2.game_id WHERE T2.player  =  'Walter Samuel'
Show the names of people and the number of times they have been on the affirmative side of debates.
Output: SELECT T2.Name ,  COUNT(*) FROM debate_people AS T1 JOIN people AS T2 ON T1.Affirmative  =  T2.People_ID GROUP BY T2.Name
List the document ids of documents with the status done and type Paper, which not shipped by the shipping agent named USPS.
Output: SELECT document_id FROM Documents WHERE document_status_code  =  "done" AND document_type_code = "Paper" EXCEPT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = "USPS"
Return the investors who have invested in two or more entrepreneurs.
Output: SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*)  >=  2
Show names of technicians and the number of machines they are assigned to repair.
Output: SELECT T2.Name ,  COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_ID  =  T2.technician_ID GROUP BY T2.Name
What are the durations of the longest and the shortest tracks in milliseconds?
Output: SELECT max(Milliseconds) ,  min(Milliseconds) FROM TRACK
What are the names of entrepreneurs?
Output: SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID
How many customers are there?
Output: SELECT sum(no_of_customers) FROM bank
List the name of the stadium where both the player 'Walter Samuel' and the player 'Thiago Motta' got injured.
Output: SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id  =  T2.id JOIN injury_accident AS T3 ON T1.id  =  T3.game_id WHERE T3.player  =  'Walter Samuel' INTERSECT SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id  =  T2.id JOIN injury_accident AS T3 ON T1.id  =  T3.game_id WHERE T3.player  =  'Thiago Motta'
Find id of candidates whose assessment code is "Pass"?
Output: SELECT candidate_id FROM candidate_assessments WHERE asessment_outcome_code = "Pass"
What are the different card types, and how many transactions have been made with each?
Output: SELECT T2.card_type_code ,  count(*) FROM Financial_transactions AS T1 JOIN Customers_cards AS T2 ON T1.card_id  =  T2.card_id GROUP BY T2.card_type_code
Find the id of the courses that do not have any prerequisite?
Output: SELECT course_id FROM course EXCEPT SELECT course_id FROM prereq
Show all storm names except for those with at least two affected regions.
Output: SELECT name FROM storm EXCEPT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id  =  T2.storm_id GROUP BY T1.storm_id HAVING count(*)  >=  2
What is the course title of the prerequisite of course Mobile Computing?
Output: SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id  =  T2.course_id WHERE T2.title  =  'Mobile Computing')
What are the names and trade names of the medcines that are FDA approved?
Output: SELECT name ,  trade_name FROM medicine WHERE FDA_approved  =  'Yes'
What is the starting year of the oldest technicians?
Output: SELECT Starting_Year FROM technician ORDER BY Age DESC LIMIT 1
List the employees who have not showed up in any circulation history of documents. List the employee's name.
Output: SELECT employee_name FROM Employees EXCEPT SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id
Show the name for regions and the number of storms for each region.
Output: SELECT T1.region_name ,  count(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id
Find the names of artists that do not have any albums.
Output: SELECT Name FROM ARTIST EXCEPT SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId
What is the shipping agent code of shipping agent UPS?
Output: SELECT shipping_agent_code FROM Ref_Shipping_Agents WHERE shipping_agent_name = "UPS"
What are the forename and surname of the driver who has the smallest laptime?
Output: SELECT T1.forename ,  T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds LIMIT 1
What are the names and locations of tracks that have had exactly 1 race?
Output: SELECT T2.name ,  T2.location FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id GROUP BY T1.track_id HAVING count(*)  =  1
List the name and residence for players whose occupation is not "Researcher".
Output: SELECT Player_name ,  residence FROM player WHERE Occupation != "Researcher"
What are the renting arrears tax ids related to the customer master index whose detail is not 'Schmidt, Kertzmann and Lubowitz'?
Output: SELECT T1.council_tax_id FROM Rent_Arrears AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id  =  T2.cmi_cross_ref_id JOIN Customer_Master_Index AS T3 ON T3.master_customer_id  =  T2.master_customer_id WHERE T3.cmi_details != 'Schmidt ,  Kertzmann and Lubowitz'
Find the founded year of the newest non public school.
Output: SELECT founded FROM university WHERE affiliation != 'Public' ORDER BY founded DESC LIMIT 1
How many employees does each role have? List role description, id and number of employees.
Output: SELECT T1.role_description ,  T2.role_code ,  count(*) FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code
What is the location of the perpetrator with the largest kills.
Output: SELECT LOCATION FROM perpetrator ORDER BY Killed DESC LIMIT 1
What are the titles of courses that are in the Statistics department but not the Psychology department?
Output: SELECT title FROM course WHERE dept_name  =  'Statistics' EXCEPT SELECT title FROM course WHERE dept_name  =  'Psychology'
Show names for all regions except for Denmark.
Output: SELECT region_name FROM region WHERE region_name != 'Denmark'
Which parties have more than 20 hosts? Give me the host names for these parties.
Output: SELECT T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID  =  T2.Host_ID JOIN party AS T3 ON T1.Party_ID  =  T3.Party_ID WHERE T3.Number_of_hosts  >  20
Count the number of credit cards that the customer with first name Blanche and last name Huels has.
Output: SELECT count(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.customer_first_name  =  "Blanche" AND T2.customer_last_name  =  "Huels" AND T1.card_type_code  =  "Credit"
Advisor 1121 has how many students?
Output: SELECT count(*) FROM Student WHERE Advisor =  1121
What are the heights of perpetrators in descending order of the number of people they injured?
Output: SELECT T1.Height FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T2.Injured DESC
How many universities have a location that contains NY?
Output: SELECT count(*) FROM university WHERE LOCATION LIKE "%NY%"
Find the name of instructors who are advisors of the students from the Math department, and sort the results by students' total credit.
Output: SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id  =  T2.id JOIN student AS T3 ON T1.s_id  =  T3.id WHERE T3.dept_name  =  'Math' ORDER BY T3.tot_cred
How many times has the student Linda Smith visited Subway?
Output: SELECT count(*) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith" AND Restaurant.ResName = "Subway"
Show all card type codes and the number of customers holding cards in each type.
Output: SELECT card_type_code ,  count(DISTINCT customer_id) FROM Customers_cards GROUP BY card_type_code
What is the customer id, first and last name with least number of accounts.
Output: SELECT T1.customer_id ,  T2.customer_first_name ,  T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) ASC LIMIT 1
What are the names of perpetrators in country "China" or "Japan"?
Output: SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID  =  T2.People_ID WHERE T2.Country  =  "China" OR T2.Country  =  "Japan"
What are the names of musicals who have no actors?
Output: SELECT Name FROM musical WHERE Musical_ID NOT IN (SELECT Musical_ID FROM actor)
Find the room number of the rooms which can sit 50 to 100 students and their buildings.
Output: SELECT building ,  room_number FROM classroom WHERE capacity BETWEEN 50 AND 100
What is the product, chromosome and porphyria related to the enzymes which take effect at the location 'Cytosol'?
Output: SELECT product ,  chromosome ,  porphyria FROM enzyme WHERE LOCATION  =  'Cytosol'
List the id of students who registered some courses and the number of their registered courses?
Output: SELECT T1.student_id ,  count(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id
What is the tax source system code related to the benefits and overpayments? List the code and the benifit id, order by benifit id.
Output: SELECT T1.source_system_code ,  T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Benefits_Overpayments AS T2 ON T1.cmi_cross_ref_id  =  T2.cmi_cross_ref_id ORDER BY T2.council_tax_id
Return the code of the card type that is most common.
Output: SELECT card_type_code FROM Customers_cards GROUP BY card_type_code ORDER BY count(*) DESC LIMIT 1
How many draft copies does the document with id 2 have?
Output: SELECT count(*) FROM Draft_Copies WHERE document_id = 2
List the names of the browser that are compatible with both 'CACHEbox' and 'Fasterfox'.
Output: SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id  =  T1.id JOIN browser AS T3 ON T2.browser_id  =  T3.id WHERE T1.name  =  'CACHEbox' INTERSECT SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id  =  T1.id JOIN browser AS T3 ON T2.browser_id  =  T3.id WHERE T1.name  =  'Fasterfox'
Count the number of rooms in Lamberton with capacity lower than 50.
Output: SELECT count(*) FROM classroom WHERE building  =  'Lamberton' AND capacity  <  50
What are the names of musicals with nominee "Bob Fosse"?
Output: SELECT Name FROM musical WHERE Nominee  =  "Bob Fosse"
What are the ids and names of the web accelerators that are compatible with two or more browsers?
Output: SELECT T1.id ,  T1.Name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id  =  T1.id GROUP BY T1.id HAVING count(*)  >=  2
What are the region names affected by the storm with a number of deaths of least 10?
Output: SELECT T2.region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id  =  T2.region_id JOIN storm AS T3 ON T1.storm_id  =  T3.storm_id WHERE T3.number_deaths  >=  10
What is the id and name of the enzyme that can interact with the most medicines as an activator?
Output: SELECT T1.id ,  T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id  =  T2.enzyme_id WHERE T2.interaction_type  =  'activitor' GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1
What are the names of the instructors in the Comp. Sci. department who earn more than 80000?
Output: SELECT name FROM instructor WHERE dept_name  =  'Comp. Sci.'  AND salary  >  80000
What are the times used by climbers who climbed mountains in the country of Uganda?
Output: SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID  =  T2.Mountain_ID WHERE T2.Country  =  "Uganda"
How many different kinds of clients are supported by the web clients accelerators?
Output: SELECT count(DISTINCT client) FROM web_client_accelerator
Find the average unit price of jazz tracks.
Output: SELECT AVG(UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId WHERE T1.Name  =  "Jazz"
What are the names of all instructors in the Comp. Sci. department?
Output: SELECT name FROM instructor WHERE dept_name  =  'Comp. Sci.'
Who are the nominees who were nominated for either of the Bob Fosse or Cleavant Derricks awards?
Output: SELECT Nominee FROM musical WHERE Award  =  "Tony Award" OR Award  =  "Cleavant Derricks"
List the council tax ids and their related cmi cross references of all the parking fines.
Output: SELECT council_tax_id ,  cmi_cross_ref_id FROM parking_fines
Which parties have hosts of age above 50? Give me the party locations.
Output: SELECT T3.Location FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID  =  T2.Host_ID JOIN party AS T3 ON T1.Party_ID  =  T3.Party_ID WHERE T2.Age  >  50
What is the duration of the oldest actor?
Output: SELECT Duration FROM actor ORDER BY Age DESC LIMIT 1
Find the purchase time, age and address of each member, and show the results in the order of purchase time.
Output: SELECT Time_of_purchase ,  age ,  address FROM member ORDER BY Time_of_purchase
What are all the different first names of the drivers who are in position as standing and won?
Output: SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1
Find the total number of students enrolled in the colleges that were founded after the year of 1850 for each affiliation type.
Output: SELECT sum(Enrollment) ,  affiliation FROM university WHERE founded  >  1850 GROUP BY affiliation
Find the names of students who have taken any course in the fall semester of year 2003.
Output: SELECT name FROM student WHERE id IN (SELECT id FROM takes WHERE semester  =  'Fall' AND YEAR  =  2003)
How many games are free of injury accidents?
Output: SELECT count(*) FROM game WHERE id NOT IN ( SELECT game_id FROM injury_accident )
How many council taxes are collected for renting arrears ?
Output: SELECT count(*) FROM rent_arrears
Show the date of the tallest perpetrator.
Output: SELECT T2.Date FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T1.Height DESC LIMIT 1
Find the name and salary of the instructors who are advisors of any student from History department?
Output: SELECT T2.name ,  T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id  =  T2.id JOIN student AS T3 ON T1.s_id  =  T3.id WHERE T3.dept_name  =  'History'
List the number of people injured by perpetrators in ascending order.
Output: SELECT Injured FROM perpetrator ORDER BY Injured ASC
What are the player name, number of matches, and information source for players who do not suffer from injury of 'Knee problem'?
Output: SELECT player ,  number_of_matches ,  SOURCE FROM injury_accident WHERE injury != 'Knee problem'
What are the distinct cross reference source system codes which are related to the master customer details 'Gottlieb, Becker and Wyman'?
Output: SELECT DISTINCT T2.source_system_code FROM customer_master_index AS T1 JOIN cmi_cross_references AS T2 ON T1.master_customer_id  =  T2.master_customer_id WHERE T1.cmi_details  =  'Gottlieb ,  Becker and Wyman'
What are the names of entrepreneurs and their corresponding investors, ordered descending by the amount of money requested?
Output: SELECT T2.Name ,  T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T1.Money_Requested
Show the names of people who have been on the negative side of debates at least twice.
Output: SELECT T2.Name FROM debate_people AS T1 JOIN people AS T2 ON T1.Negative  =  T2.People_ID GROUP BY T2.Name HAVING COUNT(*)  >=  2
List the medicine name and trade name which can both interact as 'inhibitor' and 'activitor' with enzymes.
Output: SELECT T1.name ,  T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id  =  T1.id WHERE interaction_type  =  'inhibitor' INTERSECT SELECT T1.name ,  T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id  =  T1.id WHERE interaction_type  =  'activitor'
What is the total count of enzymes?
Output: SELECT count(*) FROM enzyme