niryuu/sni-each-converted huggingface dataset:
What are the names of colleges in LA that have more than 15,000 students and of colleges in AZ with less than 13,000 students?
Output: SELECT cName FROM College WHERE enr  <  13000 AND state = "AZ" UNION SELECT cName FROM College WHERE enr  >  15000 AND state = "LA"
Return the titles of films that include 'Deleted Scenes' in their special feature section.
Output: SELECT title FROM film WHERE special_features LIKE '%Deleted Scenes%'
Which programs' origins are not "Beijing"? Give me the program names.
Output: SELECT name FROM program WHERE origin != 'Beijing'
Find the number of medications prescribed for each brand.
Output: SELECT count(*) ,  T1.name FROM medication AS T1 JOIN prescribes AS T2 ON T1.code = T2.medication GROUP BY T1.brand
Which attribute definitions have attribute value 0? Give me the attribute name and attribute ID.
Output: SELECT t1.attribute_name ,  t1.attribute_id FROM Attribute_Definitions AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.attribute_id  =  t2.attribute_id WHERE t2.attribute_value  =  0
What are the names of races held after 12:00:00 or before 09:00:00?
Output: SELECT name FROM races WHERE TIME > "12:00:00" OR TIME < "09:00:00"
Find the name and address of the customers who have both New and Pending orders.
Output: SELECT T1.customer_name ,  T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.order_status_code  =  "New" INTERSECT SELECT T1.customer_name ,  T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.order_status_code  =  "Pending"
Find the names of the top 3 departments that provide the largest amount of courses?
Output: SELECT dept_name FROM course GROUP BY dept_name ORDER BY count(*) DESC LIMIT 3
Find the number of schools that have more than one donator whose donation amount is less than 8.5.
Output: SELECT count(*) FROM (SELECT * FROM endowment WHERE amount  >  8.5 GROUP BY school_id HAVING count(*)  >  1)
What is the name of the most common genre in all tracks?
Output: SELECT T1.Name FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId GROUP BY T2.GenreId ORDER BY COUNT(*) DESC LIMIT 1
Find the state and country of all cities with post code starting with 4.
Output: SELECT state_province_county ,  country FROM addresses WHERE zip_postcode LIKE "4%"
List the names, color descriptions and product descriptions of products with category "Herbs".
Output: SELECT T1.product_name ,  T2.color_description ,  T1.product_description FROM products AS T1 JOIN Ref_colors AS T2 ON T1.color_code  =  T2.color_code WHERE product_category_code  =  "Herbs"
For each manufacturer name, what are the names and prices of their most expensive product?
Output: SELECT T1.Name ,  max(T1.Price) ,  T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer  =  T2.code GROUP BY T2.name
Find the first name of students who are living in the Smith Hall.
Output: SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid  =  T2.stuid JOIN dorm AS T3 ON T3.dormid  =  T2.dormid WHERE T3.dorm_name  =  'Smith Hall'
How many employees have certificate.
Output: SELECT count(DISTINCT eid) FROM Certificate
What is the average distance and average price for flights from Los Angeles.
Output: SELECT avg(distance) ,  avg(price) FROM Flight WHERE origin  =  "Los Angeles"
What is the channel code and contact number of the customer contact channel that was active for the longest time?
Output: SELECT channel_code ,  contact_number FROM customer_contact_channels WHERE active_to_date - active_from_date  =  (SELECT active_to_date - active_from_date FROM customer_contact_channels ORDER BY (active_to_date - active_from_date) DESC LIMIT 1)
What are the ids of the students who either registered or attended a course?
Output: SELECT student_id FROM student_course_registrations UNION SELECT student_id FROM student_course_attendance
What is the description and code of the type of service that is performed the most often?
Output: SELECT T1.Service_Type_Description , T1.Service_Type_Code FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code  =  T2.Service_Type_Code GROUP BY T1.Service_Type_Code ORDER BY COUNT(*) DESC LIMIT 1
What are the ids of the top three products that were purchased in the largest amount?
Output: SELECT product_id FROM product_suppliers ORDER BY total_amount_purchased DESC LIMIT 3
Which party has the largest number of delegates?
Output: SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID GROUP BY T1.Party ORDER BY COUNT(*) DESC LIMIT 1
Which programs are never broadcasted in the morning? Give me the names of the programs.
Output: SELECT name FROM program EXCEPT SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id  =  t2.program_id WHERE t2.Time_of_day  =  "Morning"
Find the name of dorms which have TV Lounge but no Study Room as amenity.
Output: SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid WHERE T3.amenity_name  =  'TV Lounge' EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid WHERE T3.amenity_name  =  'Study Room'
What are the distinct names of customers who have purchased a keyboard?
Output: SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id JOIN order_items AS T3 ON T2.order_id  =  T3.order_id JOIN products AS T4 ON T3.product_id  =  T4.product_id WHERE T4.product_name  =  "keyboard"
How many different majors are there and how many different city codes are there for each student?
Output: SELECT count(DISTINCT major) ,  count(DISTINCT city_code) FROM student
What is the color description of the product with name "catnip"?
Output: SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code  =  t2.color_code WHERE t1.product_name  =  "catnip"
Return the product type, name, and price for products supplied by supplier 3.
Output: SELECT T2.product_type_code ,  T2.product_name ,  T2.product_price FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id  =  T2.product_id WHERE T1.supplier_id  =  3
What are the names of customers who have purchased both products Latte and Americano?
Output: SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id  =  t2.customer_id JOIN order_items AS t3 ON t2.order_id  =  t3.order_id JOIN products AS t4 ON t3.product_id  =  t4.product_id WHERE t4.product_details  =  'Latte' INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id  =  t2.customer_id JOIN order_items AS t3 ON t2.order_id  =  t3.order_id JOIN products AS t4 ON t3.product_id  =  t4.product_id WHERE t4.product_details  =  'Americano'
What is the characteristic name used by most number of the products?
Output: SELECT 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 GROUP BY t3.characteristic_name ORDER BY count(*) DESC LIMIT 1
Count the number of characteristics.
Output: SELECT count(*) FROM CHARACTERISTICS
Show the park of the roller coaster with the highest speed.
Output: SELECT Park FROM roller_coaster ORDER BY Speed DESC LIMIT 1
Which reign is the most common among wrestlers?
Output: SELECT Reign FROM wrestler GROUP BY Reign ORDER BY COUNT(*) DESC LIMIT 1
Give the name of the student in the History department with the most credits.
Output: SELECT name FROM student WHERE dept_name  =  'History' ORDER BY tot_cred DESC LIMIT 1
Find the number of the products that have their color described as "red" and have a characteristic named "slow".
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 JOIN ref_colors AS t4 ON t1.color_code  =  t4.color_code WHERE t4.color_description  =  "red" AND t3.characteristic_name  =  "slow"
Find the names of the top 10 airlines that operate the most number of routes.
Output: SELECT T1.name ,  T2.alid FROM airlines AS T1 JOIN routes AS T2 ON T1.alid  =  T2.alid GROUP BY T2.alid ORDER BY count(*) DESC LIMIT 10
What are the names of tracks that contain the the word you in them?
Output: SELECT Name FROM TRACK WHERE Name LIKE '%you%'
How many different instructors have taught some course?
Output: SELECT COUNT (DISTINCT id) FROM teaches
How many storms had death records?
Output: SELECT count(*) FROM storm WHERE Number_Deaths  >  0
Show aircraft names and number of flights for each aircraft.
Output: SELECT T2.name ,  count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid GROUP BY T1.aid
What is the location of the party with the most hosts?
Output: SELECT LOCATION FROM party ORDER BY Number_of_hosts DESC LIMIT 1
Find the name and position of the head of the department with the least employees.
Output: SELECT T2.name ,  T2.position FROM department AS T1 JOIN physician AS T2 ON T1.head  =  T2.EmployeeID GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1
Find the name of students who didn't take any course from Biology department.
Output: SELECT name FROM student WHERE id NOT IN (SELECT T1.id FROM takes AS T1 JOIN course AS T2 ON T1.course_id  =  T2.course_id WHERE T2.dept_name  =  'Biology')
Find courses that ran in Fall 2009 but not in Spring 2010.
Output: SELECT course_id FROM SECTION WHERE semester  =  'Fall' AND YEAR  =  2009 EXCEPT SELECT course_id FROM SECTION WHERE semester  =  'Spring' AND YEAR  =  2010
Which people severed as comptroller most frequently? Give me the name of the person and the frequency count.
Output: SELECT Comptroller ,  COUNT(*) FROM party GROUP BY Comptroller ORDER BY COUNT(*) DESC LIMIT 1
What are the mission codes, fates, and names of the ships involved?
Output: SELECT T1.Code ,  T1.Fate ,  T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID  =  T2.Ship_ID
Find the number of rooms for different block code?
Output: SELECT count(*) ,  T1.blockcode FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor  =  T2.blockfloor AND T1.blockcode  =  T2.blockcode GROUP BY T1.blockcode
List the names of departments where some physicians are primarily affiliated with.
Output: SELECT DISTINCT T2.name FROM affiliated_with AS T1 JOIN department AS T2 ON T1.department = T2.departmentid WHERE PrimaryAffiliation  =  1
What is the entry name of the most expensive catalog (in USD)?
Output: SELECT catalog_entry_name FROM catalog_contents ORDER BY price_in_dollars DESC LIMIT 1
What are the product ids and color descriptions for products with two or more characteristics?
Output: SELECT t1.product_id ,  t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code  =  t2.color_code JOIN product_characteristics AS t3 ON t1.product_id  =  t3.product_id GROUP BY t1.product_id HAVING count(*)  >=  2
For each delegate, find the names of the party they are part of.
Output: SELECT T1.Delegate ,  T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID
What is the county that produces the most wines scoring higher than 90?
Output: SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation  =  T2.Appelation WHERE T2.Score  >  90 GROUP BY T1.County ORDER BY count(*) DESC LIMIT 1
Show ids for the faculty members who don't advise any student.
Output: SELECT FacID FROM Faculty EXCEPT SELECT advisor FROM Student
Count the number of tracks that are of the media type "AAC audio file".
Output: SELECT COUNT(*) FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId  =  T2.MediaTypeId WHERE T1.Name  =  "AAC audio file"
What is the total kills of the perpetrators with height more than 1.84.
Output: SELECT sum(T2.Killed) FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID  =  T2.People_ID WHERE T1.Height  >  1.84
Find the name of all students who were in the tryout sorted in alphabetic order.
Output: SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID  =  T2.pID ORDER BY T1.pName
What are the different card types, and how many cards are there of each?
Output: SELECT card_type_code ,  count(*) FROM Customers_cards GROUP BY card_type_code
What are the catalog entry names of the products with next entry ID above 8?
Output: SELECT catalog_entry_name FROM catalog_contents WHERE next_entry_id  >  8
What are the names of the members that have never registered at any branch?
Output: SELECT name FROM member WHERE member_id NOT IN (SELECT member_id FROM membership_register_branch)
What is the description of the most popular role among users that have logged in?
Output: SELECT role_description FROM ROLES WHERE role_code  =  (SELECT role_code FROM users WHERE user_login  =  1 GROUP BY role_code ORDER BY count(*) DESC LIMIT 1)
Count the number of distinct channel owners.
Output: SELECT count(DISTINCT OWNER) FROM channel
Show the id and salary of Mark Young.
Output: SELECT eid ,  salary FROM Employee WHERE name  =  'Mark Young'
Show all city with a branch opened in 2001 and a branch with more than 100 membership.
Output: SELECT city FROM branch WHERE open_year  =  2001 AND membership_amount  >  100
List the name and phone number of all suppliers in the alphabetical order of their addresses.
Output: SELECT T1.supplier_name ,  T1.supplier_phone FROM Suppliers AS T1 JOIN supplier_addresses AS T2 ON T1.supplier_id  =  T2.supplier_id JOIN addresses AS T3 ON T2.address_id  =  T3.address_id ORDER BY T3.address_details
What are the names of enzymes who does not produce 'Heme'?
Output: SELECT name FROM enzyme WHERE product != 'Heme'
Find the physicians who are trained in a procedure that costs more than 5000.
Output: SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T3.cost  >  5000
Where does the customer with the first name Linda live? And what is her email?
Output: SELECT T2.address ,  T1.email FROM customer AS T1 JOIN address AS T2 ON T2.address_id  =  T1.address_id WHERE T1.first_name  =  'LINDA'
List the time of elimination of the wrestlers with largest days held.
Output: SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID  =  T2.Wrestler_ID ORDER BY T2.Days_held DESC LIMIT 1
Return the category code and typical price of 'cumin'.
Output: SELECT product_category_code ,  typical_buying_price FROM products WHERE product_name  =  "cumin"
What are the names of the characteristics of the product 'sesame' that have the characteristic type code 'Grade'?
Output: SELECT 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" AND t3.characteristic_type_code  =  "Grade"
How many parties are there?
Output: SELECT count(*) FROM party
List the names of all the physicians who prescribe Thesisin as medication.
Output: SELECT DISTINCT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.name  =  "Thesisin"
List the season, home team, away team of all the games.
Output: SELECT season ,  home_team ,  away_team FROM game
What is the film title and inventory id of the item in the inventory which was rented most frequently?
Output: SELECT T1.title ,  T2.inventory_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id  =  T2.film_id JOIN rental AS T3 ON T2.inventory_id  =  T3.inventory_id GROUP BY T2.inventory_id ORDER BY count(*) DESC LIMIT 1
Return the number of accounts that the customer with the first name Art and last name Turcotte has.
Output: SELECT count(*) FROM Accounts 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"
Give the neames of wines with prices below 50 and with appelations in Monterey county.
Output: SELECT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation  =  T2.Appelation WHERE T1.County  =  "Monterey" AND T2.price  <  50
Return the official native languages of countries who have players from Maryland or Duke colleges.
Output: SELECT T1.Official_native_language FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country WHERE T2.College  =  "Maryland" OR T2.College  =  "Duke"
Show the name and distance of the aircrafts with more than 5000 distance and which at least 5 people have its certificate.
Output: SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid  =  T1.aid WHERE T2.distance  >  5000 GROUP BY T1.aid ORDER BY count(*)  >=  5
Show the names of players and names of their coaches in descending order of the votes of players.
Output: SELECT T3.Player_name ,  T2.coach_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID  =  T2.Coach_ID JOIN player AS T3 ON T1.Player_ID  =  T3.Player_ID ORDER BY T3.Votes DESC
What is the first name and the last name of the customer who made the earliest rental?
Output: SELECT T1.first_name ,  T1.last_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id  =  T2.customer_id ORDER BY T2.rental_date ASC LIMIT 1
What are the average and minimum price (in Euro) of all products?
Output: SELECT avg(price_in_euros) ,  min(price_in_euros) FROM catalog_contents
Give the names of tracks that do not have a race in the class 'GT'.
Output: SELECT name FROM track EXCEPT SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id WHERE T1.class  =  'GT'
Show the ids for all the students who participate in an activity and are under 20.
Output: SELECT StuID FROM Participates_in INTERSECT SELECT StuID FROM Student WHERE age  <  20
how many ships are there?
Output: SELECT count(*) FROM ship
Find the average price of wines that are not produced from Sonoma county.
Output: SELECT avg(price) FROM wine WHERE Appelation NOT IN (SELECT T1.Appelation FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation  =  T2.Appelation WHERE T1.County  =  'Sonoma')
What are the name and publication date of the catalogs with catalog level number above 5?
Output: SELECT t1.catalog_name ,  t1.date_of_publication FROM catalogs AS t1 JOIN catalog_structure AS t2 ON t1.catalog_id  =  t2.catalog_id WHERE catalog_level_number  >  5
Show all storm names affecting region "Denmark".
Output: SELECT T3.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 T2.region_name  =  'Denmark'
Find the title of course whose prerequisite is course Differential Geometry.
Output: SELECT title FROM course WHERE course_id IN (SELECT T1.course_id FROM prereq AS T1 JOIN course AS T2 ON T1.prereq_id  =  T2.course_id WHERE T2.title  =  'Differential Geometry')
How many customers are living in city "Lake Geovannyton"?
Output: SELECT count(*) FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id  =  t2.customer_id JOIN addresses AS t3 ON t2.address_id  =  t3.address_id WHERE t3.city  =  "Lake Geovannyton"
Return the average total amount purchased and total value purchased for the supplier who supplies the greatest number of products.
Output: SELECT avg(total_amount_purchased) ,  avg(total_value_purchased) FROM Product_Suppliers WHERE supplier_id  =  (SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id ORDER BY count(*) DESC LIMIT 1)
Find the number of patients' prescriptions physician John Dorian made.
Output: SELECT count(T1.SSN) FROM patient AS T1 JOIN prescribes AS T2 ON T1.SSN  =  T2.patient JOIN physician AS T3 ON T2.physician  =  T3.employeeid WHERE T3.name = "John Dorian"
Which film has the most copies in the inventory? List both title and id.
Output: SELECT T1.title ,  T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id  =  T2.film_id GROUP BY T1.film_id ORDER BY count(*) DESC LIMIT 1
Tell me the number of orders with "Second time" as order detail.
Output: SELECT count(*) FROM customer_orders WHERE order_details  =  "Second time"
What are the cities no customers live in?
Output: SELECT city FROM addresses WHERE city NOT IN ( SELECT DISTINCT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id  =  t2.customer_id JOIN addresses AS t3 ON t2.address_id  =  t3.address_id)
What are the country names, area and population which has both roller coasters with speed higher
Output: SELECT T1.name ,  T1.area ,  T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID WHERE T2.speed  >  60 INTERSECT SELECT T1.name ,  T1.area ,  T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID WHERE T2.speed  <  55
How many kinds of different ratings are listed?
Output: SELECT count(DISTINCT rating) FROM film
What are the minimum, average, and maximum quantities ordered? Check all the invoices.
Output: SELECT min(Order_Quantity) ,  avg(Order_Quantity) ,  max(Order_Quantity) FROM INVOICES
What is the average weight of all players?
Output: SELECT avg(weight) FROM Player
What is the total budget amount for school "Glenn" in all years?
Output: SELECT sum(T1.budgeted) FROM budget AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T2.school_name  =  'Glenn'
What is the aircraft name for the flight with number 99
Output: SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid WHERE T1.flno  =  99
How many cities are in Australia?
Output: SELECT count(*) FROM city AS T1 JOIN country AS T2 ON T1.country_id  =  T2.country_id WHERE T2.country  =  'Australia'
How many aircrafts exist in the database?
Output: SELECT count(*) FROM Aircraft
What is the interaction type of the enzyme named 'ALA synthase' and the medicine named 'Aripiprazole'?
Output: SELECT T1.interaction_type FROM medicine_enzyme_interaction AS T1 JOIN medicine AS T2 ON T1.medicine_id  =  T2.id JOIN enzyme AS T3 ON T1.enzyme_id  =  T3.id WHERE T3.name  =  'ALA synthase' AND T2.name  =  'Aripiprazole'
List the names of all left-footed players who have overall rating between 85 and 90.
Output: SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.preferred_foot  =  "left" AND T2.overall_rating  >=  85 AND T2.overall_rating  <=  90
List the name of physicians who took some appointment.
Output: SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician  =  T2.EmployeeID
What are the building, room number, semester and year of courses in the Psychology department, sorted using course title?
Output: SELECT T2.building ,  T2.room_number ,  T2.semester ,  T2.year FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id  =  T2.course_id WHERE T1.dept_name  =  'Psychology' ORDER BY T1.title
Show the draft pick numbers and draft classes of players whose positions are defenders.
Output: SELECT Draft_Pick_Number ,  Draft_Class FROM match_season WHERE POSITION  =  "Defender"
Find the entry names of the catalog with the attribute that have the most entries.
Output: SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id  =  t2.catalog_entry_id WHERE t2.attribute_value  =  (SELECT attribute_value FROM Catalog_Contents_Additional_Attributes GROUP BY attribute_value ORDER BY count(*) DESC LIMIT 1)
What are the positions of players whose average number of points scored by that position is larger than 20?
Output: SELECT POSITION FROM player GROUP BY name HAVING avg(Points)  >=  20
What are the total number of students who are living in a male dorm?
Output: SELECT count(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid  =  T2.stuid JOIN dorm AS T3 ON T3.dormid  =  T2.dormid WHERE T3.gender  =  'M'
What are the names of wines made from red grapes and with prices above 50?
Output: SELECT T2.Name FROM Grapes AS T1 JOIN WINE AS T2 ON T1.Grape  =  T2.Grape WHERE T1.Color  =  "Red" AND T2.price  >  50
Find the average number of followers for the users who had some tweets.
Output: SELECT avg(followers) FROM user_profiles WHERE UID IN (SELECT UID FROM tweets)
Count the number of different statuses.
Output: SELECT count(DISTINCT Status) FROM city
Find the name of physicians who are in charge of more than one patient.
Output: SELECT T1.name FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid  =  T2.PCP GROUP BY T1.employeeid HAVING count(*)  >  1
Find the id and name of the staff who has been assigned for the shortest period.
Output: SELECT T1.staff_id ,  T1.staff_name FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id  =  T2.staff_id ORDER BY date_assigned_to - date_assigned_from LIMIT 1
What is the id and market share of the browser Safari?
Output: SELECT id ,  market_share FROM browser WHERE name  =  'Safari'
What are the names of teams from universities that have a below average enrollment?
Output: SELECT t2.team_name FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id WHERE enrollment  <  (SELECT avg(enrollment) FROM university)
What is the list of program names, sorted by the order of launch date?
Output: SELECT name FROM program ORDER BY launch
What are the maximum and minimum number of silver medals for all the clubs?
Output: SELECT max(Silver) ,  min(Silver) FROM club_rank
Count how many appointments have been made in total.
Output: SELECT count(*) FROM appointment
What is the average quantities ordered with payment method code "MasterCard" on invoices?
Output: SELECT avg(Order_Quantity) FROM Invoices WHERE payment_method_code  =  "MasterCard"
Count the products that have the color description "white" or have the characteristic name "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 JOIN ref_colors AS t4 ON t1.color_code  =  t4.color_code WHERE t4.color_description  =  "white" OR t3.characteristic_name  =  "hot"
Select the names of manufacturer whose products have an average price higher than or equal to $150.
Output: SELECT avg(T1.Price) ,  T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer  =  T2.code GROUP BY T2.name HAVING avg(T1.price) >= 150
Find distinct cities of address of students?
Output: SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id JOIN students AS T3 ON T2.person_id = T3.student_id
Find the names of nurses who are nursing an undergoing treatment.
Output: SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN nurse AS T2 ON T1.AssistingNurse  =  T2.EmployeeID
What are the names of all the players who received a yes during tryouts, and also what are the names of their colleges?
Output: SELECT T1.pName ,  T2.cName FROM player AS T1 JOIN tryout AS T2 ON T1.pID  =  T2.pID WHERE T2.decision  =  'yes'
What are the names of all aircrafts that John Williams have certificates to be able to fly?
Output: SELECT T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T1.name  =  "John Williams"
What are the ids, names and FDA approval status of medicines in descending order of the number of enzymes that it can interact with.
Output: SELECT T1.id ,  T1.Name ,  T1.FDA_approved FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id  =  T1.id GROUP BY T1.id ORDER BY count(*) DESC
What are the names of staff who have been assigned multiple jobs?
Output: SELECT T1.staff_name FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id  =  T2.staff_id GROUP BY T2.staff_id HAVING COUNT (*)  >  1
List the names of all distinct nurses ordered by alphabetical order?
Output: SELECT DISTINCT name FROM nurse ORDER BY name
Find the number of albums by the artist "Metallica".
Output: SELECT COUNT(*) FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId WHERE T2.Name  =  "Metallica"
On which days more than one revisions were made on catalogs.
Output: SELECT date_of_latest_revision FROM Catalogs GROUP BY date_of_latest_revision HAVING count(*)  >  1
Find the id and name of the stadium where the largest number of injury accidents occurred.
Output: SELECT T1.id ,  T1.name FROM stadium AS T1 JOIN game AS T2 ON T1.id  =  T2.stadium_id JOIN injury_accident AS T3 ON T2.id  =  T3.game_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1
How many proteins are associated with an institution founded after 1880 or an institution with type "Private"?
Output: SELECT count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id  =  T2.institution_id WHERE T1.founded  >  1880 OR T1.type  =  'Private'
Show the protein name and the institution name.
Output: SELECT T2.protein_name ,  T1.institution FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id  =  T2.institution_id
What are the ids and trade names of the medicine that can interact with at least 3 enzymes?
Output: SELECT T1.id ,  T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id  =  T1.id GROUP BY T1.id HAVING COUNT(*)  >=  3
What is the salaray and name of the employee with the most certificates to fly planes more than 5000?
Output: SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.distance  >  5000 GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1
Show the names of schools with a total budget amount greater than 100 or a total endowment greater than 10.
Output: SELECT T2.school_name FROM budget AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id JOIN endowment AS T3 ON T2.school_id  =  T3.school_id GROUP BY T2.school_name HAVING sum(T1.budgeted)  >  100 OR sum(T3.amount)  >  10
What are the numbers of all flights that can cover a distance of more than 2000?
Output: SELECT flno FROM Flight WHERE distance  >  2000
What are the ids of instructors who taught in the Fall of 2009 but not in the Spring of 2010?
Output: SELECT id FROM teaches WHERE semester  =  'Fall' AND YEAR  =  2009 EXCEPT SELECT id FROM teaches WHERE semester  =  'Spring' AND YEAR  =  2010
List the grape, appelation and name of wines whose score is higher than 93 ordered by Name.
Output: SELECT Grape ,  Appelation ,  Name FROM WINE WHERE Score  >  93 ORDER BY Name
How many instructors teach a course in the Spring of 2010?
Output: SELECT COUNT (DISTINCT ID) FROM teaches WHERE semester  =  'Spring' AND YEAR  =  2010
Find the number of courses provided in each semester and year.
Output: SELECT count(*) ,  semester ,  YEAR FROM SECTION GROUP BY semester ,  YEAR
What is the number of technicians?
Output: SELECT count(*) FROM technician
Find the average age and number of male students (with sex M) from each city.
Output: SELECT count(*) ,  avg(age) ,  city_code FROM student WHERE sex  =  'M' GROUP BY city_code
Find the names of stadiums that some Australian swimmers have been to.
Output: SELECT t4.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id  =  t2.swimmer_id JOIN event AS t3 ON t2.event_id  =  t3.id JOIN stadium AS t4 ON t4.id  =  t3.stadium_id WHERE t1.nationality  =  'Australia'
What is the id of the candidate who most recently accessed the course?
Output: SELECT candidate_id FROM candidate_assessments ORDER BY assessment_date DESC LIMIT 1
What are the names and salaries of instructors who advise students in the Math 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  =  'Math'
Which shipping agent shipped the most documents? List the shipping agent name and the number of documents.
Output: SELECT Ref_Shipping_Agents.shipping_agent_name , count(Documents.document_id) FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code GROUP BY Ref_Shipping_Agents.shipping_agent_code ORDER BY count(Documents.document_id) DESC LIMIT 1
Find the name of branches where have some members whose hometown is in Louisville, Kentucky and some in Hiram, Georgia.
Output: SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id  =  T2.branch_id JOIN member AS T3 ON T1.member_id  =  T3.member_id WHERE T3.Hometown  =  'Louisville ,  Kentucky' INTERSECT SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id  =  T2.branch_id JOIN member AS T3 ON T1.member_id  =  T3.member_id WHERE T3.Hometown  =  'Hiram ,  Georgia'
Find the name and capacity of products with price greater than 700 (in USD).
Output: SELECT catalog_entry_name ,  capacity FROM Catalog_Contents WHERE price_in_dollars  >  700
What is the employee id of the head whose department has the least number of employees?
Output: SELECT head FROM department GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1
List the name, location, mascot for all schools.
Output: SELECT school_name ,  LOCATION ,  mascot FROM school
List all of the ids for left-footed players with a height between 180cm and 190cm.
Output: SELECT player_api_id FROM Player WHERE height  >=  180 AND height  <=  190 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE preferred_foot  =  "left"
List the nominees that have been nominated more than two musicals.
Output: SELECT Nominee FROM musical GROUP BY Nominee HAVING COUNT(*)  >  2
How many products are there for each manufacturer?
Output: SELECT count(*) ,  T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.name
How many medicines have the FDA approval status 'No' ?
Output: SELECT count(*) FROM medicine WHERE FDA_approved  =  'No'
Who is the nominee who has been nominated for the most musicals?
Output: SELECT Nominee FROM musical GROUP BY Nominee ORDER BY COUNT(*) DESC LIMIT 1
What is the average fastest lap speed in race named 'Monaco Grand Prix' in 2008 ?
Output: SELECT avg(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"
Return the names of products that have had complaints filed by the customer who has filed the fewest complaints.
Output: SELECT DISTINCT t1.product_name FROM products AS t1 JOIN complaints AS t2 ON t1.product_id  =  t2.product_id JOIN customers AS t3 GROUP BY t3.customer_id ORDER BY count(*) LIMIT 1
List total amount of  invoice from Chicago, IL.
Output: SELECT sum(total) FROM invoices WHERE billing_city  =  "Chicago" AND billing_state  =  "IL"
How many students are affected by each allergy type?
Output: SELECT T2.allergytype ,  count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy  =  T2.allergy GROUP BY T2.allergytype
Show the company name with the number of gas station.
Output: SELECT T2.company ,  count(*) FROM station_company AS T1 JOIN company AS T2 ON T1.company_id  =  T2.company_id GROUP BY T1.company_id
Find the name and checking balance of the account with the lowest savings balance.
Output: SELECT T1.name ,  T2.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 T3.balance LIMIT 1
List the top 5 genres by number of tracks. List genres name and total tracks.
Output: SELECT T1.name ,  COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id  =  T1.id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 5
What is the name of the customer who has made the largest amount of claim in a single claim?
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_claimed  =  (SELECT max(amount_claimed) FROM claim_headers)
How much is the track Fast As a Shark?
Output: SELECT unit_price FROM tracks WHERE name = "Fast As a Shark"
What are the titles of all albums that start with A in alphabetical order?
Output: SELECT title FROM albums WHERE title LIKE 'A%' ORDER BY title
What is the total and maximum duration for all trips with the bike id 636?
Output: SELECT sum(duration) ,  max(duration) FROM trip WHERE bike_id  =  636
What is the average latitude and longitude of stations located in San Jose city?
Output: SELECT avg(lat) ,  avg(long) FROM station WHERE city  =  "San Jose"
find the rank, company names, market values of the companies in the banking industry order by their sales and profits in billion.
Output: SELECT rank ,  company ,  market_value FROM company WHERE main_industry  =  'Banking' ORDER BY sales_billion ,  profits_billion
What are the 3 most common cloud covers in the zip code of 94107?
Output: SELECT cloud_cover FROM weather WHERE zip_code  =  94107 GROUP BY cloud_cover ORDER BY COUNT (*) DESC LIMIT 3
Show the names of pilots and the number of records they have.
Output: SELECT T2.Pilot_name ,  COUNT(*) FROM pilot_record AS T1 JOIN pilot AS T2 ON T1.pilot_ID  =  T2.pilot_ID GROUP BY T2.Pilot_name
Find the description of the claim status "Open".
Output: SELECT claim_status_description FROM claims_processing_stages WHERE claim_status_name  =  "Open"
On which day has it neither been foggy nor rained in the zip code of 94107?
Output: SELECT date FROM weather WHERE zip_code  =  94107 AND EVENTS != "Fog" AND EVENTS != "Rain"
How many pilots are there?
Output: SELECT count(*) FROM pilot
What is the average bike availablility for stations not in Palo Alto?
Output: SELECT avg(bikes_available) FROM status WHERE station_id NOT IN (SELECT id FROM station WHERE city  =  "Palo Alto")
What are the name, latitude, and city of the station with the lowest latitude?
Output: SELECT name ,  lat ,  city FROM station ORDER BY lat LIMIT 1
What is the title, phone and hire date of Nancy Edwards?
Output: SELECT title ,  phone ,  hire_date FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"
What are the names of customers with accounts, and how many checking accounts do each of them have?
Output: SELECT count(*) ,  T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid GROUP BY T1.name
What are the names and ids of all stations that have more than 14 bikes available on average or had bikes installed in December?
Output: SELECT T1.name ,  T1.id FROM station AS T1 JOIN status AS T2 ON T1.id  =  T2.station_id GROUP BY T2.station_id HAVING avg(T2.bikes_available)  >  14 UNION SELECT name ,  id FROM station WHERE installation_date LIKE "12/%"
What is the total number of students?
Output: SELECT count(*) FROM Student
What are names of stations that have average bike availability above 10 and are not located in San Jose city?
Output: SELECT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id  =  T2.station_id GROUP BY T2.station_id HAVING avg(bikes_available)  >  10 EXCEPT SELECT name FROM station WHERE city  =  "San Jose"
Show minimum, maximum, and average market value for all companies.
Output: SELECT min(market_value) ,  max(market_value) ,  avg(market_value) FROM company
What are the start station's name and id for the one that had the most start trips in August?
Output: SELECT start_station_name ,  start_station_id FROM trip WHERE start_date LIKE "8/%" GROUP BY start_station_name ORDER BY COUNT(*) DESC LIMIT 1
What are the names of modern rooms that have a base price lower than $160 and two beds.
Output: SELECT roomName FROM Rooms WHERE basePrice  <  160 AND beds =  2 AND decor  =  'modern'
Find the name of tracks which are in Movies playlist but not in music playlist.
Output: SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id  =  T2.track_id JOIN playlists AS T3 ON T2.playlist_id  =  T3.id WHERE T3.name  =  'Movies' EXCEPT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id  =  T2.track_id JOIN playlists AS T3 ON T2.playlist_id  =  T3.id WHERE T3.name  =  'Music'
Find the names of the customers who have an deputy policy.
Output: SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id  =  t2.customer_id WHERE t1.policy_type_code  =  "Deputy"
What are the first and last names of all the employees and how many people report to them?
Output: SELECT T2.first_name , T2.last_name ,  count(T1.reports_to) FROM employees AS T1 JOIN employees AS T2 ON T1.reports_to = T2.id GROUP BY T1.reports_to ORDER BY count(T1.reports_to) DESC LIMIT 1
Which allergy has most number of students affected?
Output: SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY count(*) DESC LIMIT 1
Find the zip code in which the average mean visibility is lower than 10.
Output: SELECT zip_code FROM weather GROUP BY zip_code HAVING avg(mean_visibility_miles)  <  10
How many students have each different allergy?
Output: SELECT Allergy ,  count(*) FROM Has_allergy GROUP BY Allergy
What is the id of the bike that traveled the most in 94002?
Output: SELECT bike_id FROM trip WHERE zip_code  =  94002 GROUP BY bike_id ORDER BY COUNT(*) DESC LIMIT 1
What are the student ids for students over 20 years old?
Output: SELECT StuID FROM Student WHERE age  >  20
What is the average and minimum age of all artists from United States.
Output: SELECT avg(age) ,  min(age) FROM artist WHERE country  =  'United States'
find all dependent names who have a spouse relation with some employee.
Output: SELECT Dependent_name FROM dependent WHERE relationship  =  'Spouse'
What are the names of candidates who have a lower support rate than oppose rate?
Output: SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id  =  t2.people_id WHERE t2.support_rate  <  t2.oppose_rate
What are the first name and gender of the students who have allergy to milk but can put up with cats?
Output: SELECT fname ,  sex FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy  =  "Milk" EXCEPT SELECT StuID FROM Has_allergy WHERE Allergy  =  "Cat")
List Aerosmith's albums.
Output: SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON  T1.artist_id = T2.id WHERE T2.name = "Aerosmith"
What are the names of all tracks that belong to the Rock genre and whose media type is MPEG?
Output: SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = "Rock" OR T3.name = "MPEG audio file"
For each zip code, return how many times max wind speed reached 25?
Output: SELECT zip_code , count(*) FROM weather WHERE max_wind_Speed_mph  >=  25 GROUP BY zip_code
Find the number of times ROY SWEAZY has reserved a room.
Output: SELECT count(*) FROM Reservations WHERE FirstName = "ROY" AND LastName  =  "SWEAZY"
Find the name and savings balance of the top 3 accounts with the highest saving balance sorted by savings balance in descending order.
Output: SELECT T1.name ,  T2.balance FROM accounts AS T1 JOIN savings AS T2 ON T1.custid  =  T2.custid ORDER BY T2.balance DESC LIMIT 3
What are the different parties of representative? Show the party name and the number of representatives in each party.
Output: SELECT Party ,  COUNT(*) FROM representative GROUP BY Party
Find the name of tracks which are in both Movies and music playlists.
Output: SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id  =  T2.track_id JOIN playlists AS T3 ON T2.playlist_id  =  T3.id WHERE T3.name  =  'Movies' INTERSECT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id  =  T2.track_id JOIN playlists AS T3 ON T2.playlist_id  =  T3.id WHERE T3.name  =  'Music'
What are the full names and ages for all female students whose sex is F?
Output: SELECT Fname ,  Lname ,  Age FROM Student WHERE Sex  =  'F'
List the name of playlist which has number of tracks greater than 100.
Output: SELECT T2.name FROM playlist_tracks AS T1 JOIN playlists AS T2 ON T2.id = T1.playlist_id GROUP BY T1.playlist_id HAVING count(T1.track_id)  >  100
Give me ids for all the trip that took place in a zip code area with average mean temperature above 60.
Output: SELECT T1.id FROM trip AS T1 JOIN weather AS T2 ON T1.zip_code  =  T2.zip_code GROUP BY T2.zip_code HAVING avg(T2.mean_temperature_f)  >  60
List the name of albums that are released by aritist whose name has 'Led'
Output: SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id  =  T2.artist_id WHERE T1.name LIKE '%Led%'
What are the names of stations that are located in Palo Alto city but have never been the ending point of trips more than 100 times?
Output: SELECT name FROM station WHERE city  =  "Palo Alto" EXCEPT SELECT end_station_name FROM trip GROUP BY end_station_name HAVING count(*)  >  100
What is title of album which track Balls to the Wall belongs to?
Output: SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T2.name = "Balls to the Wall"
List the main industry with highest total market value and its number of companies.
Output: SELECT main_industry ,  count(*) FROM company GROUP BY main_industry ORDER BY sum(market_value) DESC LIMIT 1
Show all student IDs who have at least two allergies.
Output: SELECT StuID FROM Has_allergy GROUP BY StuID HAVING count(*)  >=  2
Return the number of kids for the room reserved and checked in by DAMIEN TRACHSEL on  Sep 21, 2010.
Output: SELECT Kids FROM Reservations WHERE CheckIn  =  "2010-09-21" AND FirstName  =  "DAMIEN" AND LastName  =  "TRACHSEL"
Find all the rooms that have a price higher than 160 and can accommodate more than 2 people. Report room names and ids.
Output: SELECT roomName ,  RoomId FROM Rooms WHERE basePrice  >  160 AND maxOccupancy  >  2
What are the locations and representatives' names of the gas stations owned by the companies with the 3 largest amounts of assets?
Output: SELECT T3.location ,  T3.Representative_Name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id  =  T2.company_id JOIN gas_station AS T3 ON T1.station_id  =  T3.station_id ORDER BY T2.Assets_billion DESC LIMIT 3
List the number of invoices from the US, grouped by state.
Output: SELECT billing_state ,  COUNT(*) FROM invoices WHERE billing_country  =  "USA" GROUP BY billing_state
What are the names of all Rock tracks that are stored on MPEG audio files?
Output: SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = "Rock" AND T3.name = "MPEG audio file"
Eduardo Martins is a customer at which company?
Output: SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins"
For each zip code, return the average mean temperature of August there.
Output: SELECT zip_code  ,  avg(mean_temperature_f) FROM weather WHERE date LIKE "8/%" GROUP BY zip_code
What are the names of people who have a height greater than 200 or less than 190?
Output: SELECT name FROM people WHERE height  >  200 OR height  <  190
How many king beds are there?
Output: SELECT sum(beds) FROM Rooms WHERE bedtype  =  'King'
Which room has the largest number of reservations?
Output: SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId GROUP BY T1.Room ORDER BY count(*) DESC LIMIT 1
What are all the distinct participant ids who attended any events?
Output: SELECT count(DISTINCT participant_id) FROM participants_in_Events
What are the student ids of students who don't have any allergies?
Output: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Has_allergy
What is the id of the shortest trip?
Output: SELECT id FROM trip ORDER BY duration LIMIT 1
How many tracks are in each genre?
Output: SELECT count(*) ,  T1.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id GROUP BY T1.name
List the state in the US with the most invoices.
Output: SELECT billing_state ,  COUNT(*) FROM invoices WHERE billing_country  =  "USA" GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1
Find the names of customers who either have an deputy policy or uniformed policy.
Output: SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id  =  t2.customer_id WHERE t1.policy_type_code  =  "Deputy" OR t1.policy_type_code  =  "Uniform"
For each station, return its longitude and the average duration of trips that started from the station.
Output: SELECT T1.name ,  T1.long ,  avg(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id  =  T2.start_station_id GROUP BY T2.start_station_id
How many distinct allergies are there?
Output: SELECT count(DISTINCT allergytype) FROM Allergy_type
Find the number of employees whose title is IT Staff from each city?
Output: SELECT count(*) ,  city FROM employees WHERE title  =  'IT Staff' GROUP BY city
Give me the dates when the max temperature was higher than 85.
Output: SELECT date FROM weather WHERE max_temperature_f  >  85