niryuu/sni-each-converted huggingface dataset:
Show me the departure date and arrival date for all flights from Los Angeles to Honolulu.
Output: SELECT departure_date ,  arrival_date FROM Flight WHERE origin  =  "Los Angeles" AND destination  =  "Honolulu"
Find the number of patients who are not using the medication of Procrastin-X.
Output: SELECT count(*) FROM patient WHERE SSN NOT IN ( SELECT T1.patient FROM Prescribes AS T1 JOIN Medication AS T2 ON T1.Medication  =  T2.Code WHERE T2.name  =  'Procrastin-X' )
Find the names of all the catalog entries.
Output: SELECT distinct(catalog_entry_name) FROM catalog_contents
What are the names of catalog entries with level number 8?
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.catalog_level_number  =  "8"
Show the institution type with an institution founded after 1990 and an institution with at least 1000 enrollment.
Output: SELECT TYPE FROM institution WHERE founded  >  1990 AND enrollment  >=  1000
Find the name and partition id for users who tweeted less than twice.
Output: SELECT T1.name ,  T1.partitionid FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid  =  T2.uid GROUP BY T2.uid HAVING count(*)  <  2
List the name, born state and age of the heads of departments ordered by age.
Output: SELECT name ,  born_state ,  age FROM head ORDER BY age
What are the name and primarily affiliated department name of each physician?
Output: SELECT T1.name ,  T3.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID  =  T2.physician JOIN department AS T3 ON T2.department  =  T3.DepartmentID WHERE T2.PrimaryAffiliation  =  1
What is the flight number and its distance for the one with the maximum price?
Output: SELECT flno ,  distance FROM Flight ORDER BY price DESC LIMIT 1
What is the average number of gold medals for clubs?
Output: SELECT avg(Gold) FROM club_rank
Find the names of products that were bought by at least two distinct customers.
Output: SELECT DISTINCT T3.product_name FROM customer_orders AS T1 JOIN order_items AS T2 ON T1.order_id  =  T2.order_id JOIN products AS T3 ON T2.product_id  =  T3.product_id GROUP BY T3.product_id HAVING COUNT (DISTINCT T1.customer_id)  >=  2
How many camera lenses are not used in taking any photos?
Output: SELECT count(*) FROM camera_lens WHERE id NOT IN ( SELECT camera_lens_id FROM photos )
How many performances are there?
Output: SELECT count(*) FROM performance
In which year were most departments established?
Output: SELECT creation FROM department GROUP BY creation ORDER BY count(*) DESC LIMIT 1
What is the id and name of the aircraft that can cover the maximum distance?
Output: SELECT aid ,  name FROM Aircraft ORDER BY distance DESC LIMIT 1
What is the name of each camera lens and the number of photos taken by it? Order the result by the count of photos.
Output: SELECT T1.name ,  count(*) FROM camera_lens AS T1 JOIN photos AS T2 ON T1.id  =  T2.camera_lens_id GROUP BY T1.id ORDER BY count(*)
Which parties have delegates in both the "Appropriations" committee and the "Economic Matters" committee?
Output: SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID WHERE T1.Committee  =  "Appropriations" INTERSECT SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID WHERE T1.Committee  =  "Economic Matters"
Find the maximum and total number of followers of all users.
Output: SELECT max(followers) ,  sum(followers) FROM user_profiles
Which program was launched most recently? Return the program name.
Output: SELECT name FROM program ORDER BY launch DESC LIMIT 1
How many players are from each country?
Output: SELECT Country_name ,  COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country GROUP BY T1.Country_name
List the camera lens names containing substring "Digital".
Output: SELECT name FROM camera_lens WHERE name LIKE "%Digital%"
What is the level name of the cheapest catalog (in USD)?
Output: SELECT t2.catalog_level_name FROM catalog_contents AS t1 JOIN catalog_structure AS t2 ON t1.catalog_level_number  =  t2.catalog_level_number ORDER BY t1.price_in_dollars LIMIT 1
How many users are there?
Output: SELECT count(*) FROM user_profiles
Who are the lieutenant governor and comptroller from the democratic party?
Output: SELECT Lieutenant_Governor ,  Comptroller FROM party WHERE Party  =  "Democratic"
Return ids of all the products that are supplied by supplier id 2 and are more expensive than the average price of all products.
Output: SELECT T1.product_id FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id  =  T2.product_id WHERE T1.supplier_id  =  2 AND T2.product_price  >  (SELECT avg(product_price) FROM products)
Show the names of all the donors except those whose donation amount less than 9.
Output: SELECT donator_name FROM endowment EXCEPT SELECT donator_name FROM endowment WHERE amount  <  9
Which film has the highest rental rate? And what is the rate?
Output: SELECT title ,  rental_rate FROM film ORDER BY rental_rate DESC LIMIT 1
What is the total horses record for each farm, sorted ascending?
Output: SELECT Total_Horses FROM farm ORDER BY Total_Horses ASC
List all country and league names.
Output: SELECT T1.name ,  T2.name FROM Country AS T1 JOIN League AS T2 ON T1.id  =  T2.country_id
What are all the players who played in match season, sorted by college in ascending alphabetical order?
Output: SELECT player FROM match_season ORDER BY College ASC
Show the names of counties that have at least two delegates.
Output: SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id  =  T2.District GROUP BY T1.County_id HAVING COUNT(*)  >=  2
Return the staff ids and genders for any staff with the title Department Manager.
Output: SELECT T1.staff_id ,  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  =  "Department Manager"
find the total percentage share of all channels owned by CCTV.
Output: SELECT sum(Share_in_percent) FROM channel WHERE OWNER  =  'CCTV'
What are the names of all colleges that have two or more players?
Output: SELECT College FROM match_season GROUP BY College HAVING count(*)  >=  2
Show all the distinct districts for elections.
Output: SELECT DISTINCT District FROM election
What are the names of the aircraft that the least people are certified to fly?
Output: SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid  =  T1.aid GROUP BY T1.aid ORDER BY count(*) DESC LIMIT 1
When did the first payment happen?
Output: SELECT payment_date FROM payment ORDER BY payment_date ASC LIMIT 1
What are the times of elimination for wrestlers with over 50 days held?
Output: SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID  =  T2.Wrestler_ID WHERE T2.Days_held  >  50
What are the distinct creation years of the departments managed by a secretary born in state 'Alabama'?
Output: SELECT DISTINCT T1.creation FROM department AS T1 JOIN management AS T2 ON T1.department_id  =  T2.department_id JOIN head AS T3 ON T2.head_id  =  T3.head_id WHERE T3.born_state  =  'Alabama'
What are the names of the cameras that have taken picture of the most mountains?
Output: SELECT T2.name FROM photos AS T1 JOIN camera_lens AS T2 ON T1.camera_lens_id  =  T2.id GROUP BY T2.id ORDER BY count(*) DESC LIMIT 1
Which language does the film AIRPORT POLLOCK use? List the language name.
Output: SELECT T2.name FROM film AS T1 JOIN LANGUAGE AS T2 ON T1.language_id  =  T2.language_id WHERE T1.title  =  'AIRPORT POLLOCK'
What is the average rating for right-footed players and left-footed players?
Output: SELECT preferred_foot ,  avg(overall_rating) FROM Player_Attributes GROUP BY preferred_foot
What is the flight number, origin, and destination for all flights in alphabetical order by departure cities?
Output: SELECT flno ,  origin ,  destination FROM Flight ORDER BY origin
List all of the player ids with a height of at least 180cm and an overall rating higher than 85.
Output: SELECT player_api_id FROM Player WHERE height  >=  180 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE overall_rating  >  85
How many donors have endowment for school named "Glenn"?
Output: SELECT count(DISTINCT T1.donator_name) FROM endowment AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T2.school_name  =  "Glenn"
What are the names of the heads who are born outside the California state?
Output: SELECT name FROM head WHERE born_state != 'California'
Show each school name, its budgeted amount, and invested amount in year 2002 or after.
Output: SELECT T2.school_name ,  T1.budgeted ,  T1.invested FROM budget AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T1.year  >=  2002
Which customer, who has made at least one payment, has spent the least money? List his or her first name, last name, and the id.
Output: SELECT T1.first_name ,  T1.last_name ,  T1.customer_id FROM customer AS T1 JOIN payment AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY sum(amount) ASC LIMIT 1
Among the procedures that cost more than 1000, which were not specialized in by physician John Wen?
Output: SELECT name FROM procedures WHERE cost  >  1000 EXCEPT SELECT T3.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 T1.name  =  "John Wen"
What are the names of wrestlers and the elimination moves?
Output: SELECT T2.Name ,  T1.Elimination_Move FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID  =  T2.Wrestler_ID
Return the maximum and minimum customer codes.
Output: SELECT max(customer_code) ,  min(customer_code) FROM Customers
Which channels are broadcast in the morning? Give me the channel names.
Output: SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id  =  t2.channel_id WHERE t2.time_of_day  =  'Morning'
List the names and birthdays of the top five players in terms of potential.
Output: SELECT DISTINCT T1.player_name ,  T1.birthday FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id  =  T2.player_api_id ORDER BY potential DESC LIMIT 5
What are the names of players who have the best dribbling?
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.dribbling  =  ( SELECT max(overall_rating) FROM Player_Attributes)
Find the names of all patients who have an undergoing treatment and are staying in room 111.
Output: SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN patient AS T2 ON T1.patient = T2.SSN JOIN stay AS T3 ON T1.Stay  =  T3.StayID WHERE T3.room  =  111
How many acting statuses are there?
Output: SELECT count(DISTINCT temporary_acting) FROM management
What are the first names of customers who have not rented any films after '2005-08-23 02:06:01'?
Output: SELECT first_name FROM customer WHERE customer_id NOT IN( SELECT customer_id FROM rental WHERE rental_date  >  '2005-08-23 02:06:01' )
Show the name of aircrafts with top three lowest distances.
Output: SELECT name FROM Aircraft ORDER BY distance LIMIT 3
List the names of all players who have a crossing score higher than 90 and prefer their right foot.
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.crossing  >  90 AND T2.preferred_foot  =  "right"
What are the distinct ages of the heads who are acting?
Output: SELECT DISTINCT T1.age FROM management AS T2 JOIN head AS T1 ON T1.head_id  =  T2.head_id WHERE T2.temporary_acting  =  'Yes'
In which distinct years was the governor "Eliot Spitzer"?
Output: SELECT DISTINCT YEAR FROM party WHERE Governor  =  "Eliot Spitzer"
List the names of editors that are not on any journal committee.
Output: SELECT Name FROM editor WHERE editor_id NOT IN (SELECT editor_id FROM journal_committee)
Return the names and ids of customers who have TN in their address.
Output: SELECT customer_name ,  customer_id FROM customers WHERE customer_address LIKE "%TN%"
What are the full names of actors who had roles in more than 30 films?
Output: SELECT T2.first_name ,  T2.last_name FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id  =  T2.actor_id GROUP BY T2.actor_id HAVING count(*)  >  30
What are the title, id, and description of the movie with the greatest number of actors?
Output: SELECT T2.title ,  T2.film_id ,  T2.description FROM film_actor AS T1 JOIN film AS T2 ON T1.film_id  =  T2.film_id GROUP BY T2.film_id ORDER BY count(*) DESC LIMIT 1
List all program origins in the alphabetical order.
Output: SELECT origin FROM program ORDER BY origin
How many editors are there?
Output: SELECT count(*) FROM editor
What is the name of the patient who made the most recent appointment?
Output: SELECT T1.name FROM patient AS T1 JOIN appointment AS T2 ON T1.ssn = T2.patient ORDER BY T2.start DESC LIMIT 1
Find the names of users who have more than one tweet.
Output: SELECT T1.name FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid  =  T2.uid GROUP BY T2.uid HAVING count(*)  >  1
How many employees do we have?
Output: SELECT count(*) FROM Employee
How many distinct kinds of camera lenses are used to take photos of mountains in the country 'Ethiopia'?
Output: SELECT count(DISTINCT T2.camera_lens_id) FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id WHERE T1.country  =  'Ethiopia'
How many farms are there?
Output: SELECT count(*) FROM farm
Show the names and heights of buildings with at least two institutions founded after 1880.
Output: SELECT T1.name ,  T1.height_feet FROM building AS T1 JOIN institution AS T2 ON T1.building_id  =  T2.building_id WHERE T2.founded  >  1880 GROUP BY T1.building_id HAVING count(*)  >=  2
What are the statuses and average populations of each city?
Output: SELECT Status ,  avg(Population) FROM city GROUP BY Status
What place has the most flights coming from there?
Output: SELECT origin FROM Flight GROUP BY origin ORDER BY count(*) DESC LIMIT 1
What is the alphabetically ordered list of all distinct medications?
Output: SELECT DISTINCT name FROM medication ORDER BY name
What is the total number of clubs that have less than 10 medals in total?
Output: SELECT count(*) FROM club_rank WHERE Total  <  10
Find the name and email for the users who have more than one follower.
Output: SELECT T1.name ,  T1.email FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid  =  T2.f1 GROUP BY T2.f1 HAVING count(*)  >  1
List the amount and donor name for the largest amount of donation.
Output: SELECT amount ,  donator_name FROM endowment ORDER BY amount DESC LIMIT 1
What are all the movies rated as R? List the titles.
Output: SELECT title FROM film WHERE rating  =  'R'
For each player, what are their name, season, and country that they belong to?
Output: SELECT T2.Season ,  T2.Player ,  T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country
How many camera lenses have a focal length longer than 15 mm?
Output: SELECT count(*) FROM camera_lens WHERE focal_length_mm  >  15
Find the name of the program that is broadcast most frequently.
Output: SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id  =  t2.program_id GROUP BY t2.program_id ORDER BY count(*) DESC LIMIT 1
List all the product names with the color description "white".
Output: SELECT t1.product_name FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code  =  t2.color_code WHERE t2.color_description  =  "white"
What is the name of the customer that made the order with the largest quantity?
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 WHERE t3.order_quantity  =  ( SELECT max(order_quantity) FROM order_items)
Find the name of companies that do not make DVD drive.
Output: SELECT name FROM manufacturers EXCEPT SELECT T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T1.name  =  'DVD drive'
Show the names and main services for train stations that have the top three total number of passengers.
Output: SELECT name ,  main_services FROM station ORDER BY total_passengers DESC LIMIT 3
Find the distinct names of all wines that have prices higher than some wines from John Anthony winery.
Output: SELECT DISTINCT Name FROM WINE WHERE Price  >  (SELECT min(Price) FROM wine WHERE Winery  =  "John Anthony")
Return the number of customers who have at least one order with "Cancelled" status.
Output: SELECT count(DISTINCT customer_id) FROM customer_orders WHERE order_status  =  "Cancelled"
What is the most common amenity in the dorms?
Output: SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T1.amenid  =  T2.amenid GROUP BY T2.amenid ORDER BY count(*) DESC LIMIT 1
How many students participated in tryouts for each college by descennding count?
Output: SELECT count(*) ,  cName FROM tryout GROUP BY cName ORDER BY count(*) DESC
What are the names and revenues of the companies with the highest revenues in each headquarter city?
Output: SELECT name ,  max(revenue) ,  Headquarter FROM manufacturers GROUP BY Headquarter
Show the statuses of roller coasters longer than 3300 or higher than 100.
Output: SELECT Status FROM roller_coaster WHERE LENGTH  >  3300 OR Height  >  100
Find the name of customers who are living in Colorado?
Output: SELECT t1.customer_name 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.state_province_county  =  "Colorado"
Find the name of dorms that do not have amenity TV Lounge.
Output: SELECT dorm_name FROM dorm 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  =  'TV Lounge'
What are the names and enrollment numbers for colleges that have more than 10000 enrolled and are located in Louisiana?
Output: SELECT cName ,  enr FROM College WHERE enr  >  10000 AND state = "LA"
Show the station name with at least two trains.
Output: SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id  =  T2.station_id GROUP BY T1.station_id HAVING count(*)  >=  2
What are the appelations for wines produced after 2008 but not in the Central Coast area?
Output: SELECT Appelation FROM WINE WHERE YEAR  >  2008 EXCEPT SELECT Appelation FROM APPELLATIONS WHERE Area  =  "Central Coast"
What are the descriptions of the categories that products with product descriptions that contain the letter t are in?
Output: SELECT T1.product_category_description FROM ref_product_categories AS T1 JOIN products AS T2 ON T1.product_category_code  =  T2.product_category_code WHERE T2.product_description LIKE '%t%'
Find the name of companies whose revenue is greater than the average revenue of all companies.
Output: SELECT name FROM manufacturers WHERE revenue  >  (SELECT avg(revenue) FROM manufacturers)
What are the average prices of products for each manufacturer?
Output: SELECT avg(T1.price) ,  T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.name
Find the name of the tryout players who are from the college with largest size.
Output: SELECT T2.pName FROM  tryout AS T1 JOIN player AS T2 ON T1.pID  =  T2.pID WHERE T1.cName  =  (SELECT cName FROM college ORDER BY enr DESC LIMIT 1)
How many students whose are playing the role of goalie?
Output: SELECT count(*) FROM tryout WHERE pPos  =  'goalie'
Show the names of countries and the average speed of roller coasters from each country.
Output: SELECT T1.Name ,  avg(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID GROUP BY T1.Name
Find the captain rank that has no captain in Third-rate ship of the line class.
Output: SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS  =  'Third-rate ship of the line'
What are the names of the clients who do not have any booking?
Output: SELECT Customer_Name FROM Clients EXCEPT SELECT T2.Customer_Name FROM Bookings AS T1 JOIN Clients AS T2 ON T1.Customer_ID  =  T2.Client_ID
List the names of roller coasters by ascending order of length.
Output: SELECT Name FROM roller_coaster ORDER BY LENGTH ASC
How many students got accepted after the tryout?
Output: SELECT count(*) FROM tryout WHERE decision  =  'yes'
What is all the product data, as well as  each product's manufacturer?
Output: SELECT * FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer  =  T2.code
What is the payment method of the customer that has purchased the least quantity of items?
Output: SELECT t1.payment_method FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id  =  t2.customer_id JOIN order_items AS t3 ON t2.order_id  =  t3.order_id GROUP BY t1.customer_name ORDER BY sum(t3.order_quantity) LIMIT 1
List the branch name and city without any registered members.
Output: SELECT name ,  city FROM branch WHERE branch_id NOT IN (SELECT branch_id FROM membership_register_branch)
Return the title and director of the movie released in the year 2000 or earlier that had the highest worldwide gross.
Output: SELECT title ,  director FROM movie WHERE YEAR  <=  2000 ORDER BY gross_worldwide DESC LIMIT 1
Find the name and training hours of players whose hours are below 1500.
Output: SELECT pName ,  HS FROM Player WHERE HS  <  1500
Find the names of states that have some college students playing in goalie and mid positions.
Output: SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName  =  T2.cName WHERE T2.pPos  =  'goalie' INTERSECT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName  =  T2.cName WHERE T2.pPos  =  'mid'
Find the number of distinct products Rodrick Heaney has bought so far.
Output: SELECT count(DISTINCT t3.product_id) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id  =  t2.customer_id JOIN order_items AS t3 ON t2.order_id  =  t3.order_id WHERE t1.customer_name  =  "Rodrick Heaney"
Find the average hours for the students whose tryout decision is no.
Output: SELECT avg(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID  =  T2.pID WHERE T2.decision  =  'no'
What are the actual delivery dates of orders with quantity 1?
Output: SELECT T1.Actual_Delivery_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID  =  T2.Order_ID WHERE T2.Order_Quantity  =  1
What is the name and opening year for the branch that registered the most members in 2016?
Output: SELECT T2.name ,  T2.open_year FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id  =  T2.branch_id WHERE T1.register_year  =  2016 GROUP BY T2.branch_id ORDER BY count(*) DESC LIMIT 1
Find the name and hours of the students whose tryout decision is yes.
Output: SELECT T1.pName ,  T1.HS FROM player AS T1 JOIN tryout AS T2 ON T1.pID  =  T2.pID WHERE T2.decision  =  'yes'
What are the average prices of products, grouped by manufacturer name?
Output: SELECT avg(T1.Price) ,  T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer  =  T2.code GROUP BY T2.name
Find the states of the colleges that have students in the tryout who played in striker position.
Output: SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName  =  T2.cName WHERE T2.pPos  =  'striker'
Where is the headquarter of the company founded by James?
Output: SELECT headquarter FROM manufacturers WHERE founder  =  'James'
What are the store names of drama workshop groups?
Output: SELECT Store_Name FROM Drama_Workshop_Groups
What is the total number of products that are in orders with status "Cancelled"?
Output: SELECT sum(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id  =  t2.order_id WHERE t1.order_status  =  "Cancelled"
What are names of customers who never ordered product Latte.
Output: SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id  =  t2.customer_id 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'
Find the average and maximum hours for the students whose tryout decision is yes.
Output: SELECT avg(T1.HS) ,  max(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID  =  T2.pID WHERE T2.decision  =  'yes'
What are the email addresses of the drama workshop groups with address in Alaska state?
Output: SELECT T2.Store_Email_Address FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID  =  T2.Address_ID WHERE T1.State_County  =  "Alaska"
Count the number of colors.
Output: SELECT count(*) FROM ref_colors
Find the captain rank that has some captains in both Cutter and Armed schooner classes.
Output: SELECT rank FROM captain WHERE CLASS  =  'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS  =  'Armed schooner'
What is the average price of wines produced in appelations in Sonoma County?
Output: SELECT AVG(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation  =  T2.Appelation WHERE T1.County  =  "Sonoma"
For each position, what is the maximum number of  hours for students who spent more than 1000 hours training?
Output: SELECT max(T1.HS) ,  pPos FROM player AS T1 JOIN tryout AS T2 ON T1.pID  =  T2.pID WHERE T1.HS  >  1000 GROUP BY T2.pPos
List the object number of railways that do not have any trains.
Output: SELECT ObjectNumber FROM railway WHERE Railway_ID NOT IN (SELECT Railway_ID FROM train)
Show the customer name, customer address city, date from, and date to for each customer address history.
Output: SELECT T2.customer_name ,  T3.city ,  T1.date_from ,  T1.date_to FROM customer_address_history AS T1 JOIN customers AS T2 ON T1.customer_id  =  T2.customer_id JOIN addresses AS T3 ON T1.address_id  =  T3.address_id
What are the names of the members and branches at which they are registered sorted by year of registration?
Output: SELECT T3.name ,  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 ORDER BY T1.register_year
Find the names of the students who are in the position of striker and got a yes tryout decision.
Output: SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID  =  T2.pID WHERE T2.decision  =  'yes' AND T2.pPos  =  'striker'
What are the years, titles, and publishers for all books, ordered by year descending?
Output: SELECT YEAR ,  book_title ,  publisher FROM book_club ORDER BY YEAR DESC
Return the the names of the drama workshop groups that are located in Feliciaberg city.
Output: SELECT T2.Store_Name FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID  =  T2.Address_ID WHERE T1.City_Town  =  "Feliciaberg"
Find the states where have the colleges whose enrollments are less than the largest size.
Output: SELECT DISTINCT state FROM college WHERE enr  <  (SELECT max(enr) FROM college)
What are the member names and hometowns of those who registered at a branch in 2016?
Output: SELECT T2.name ,  T2.hometown FROM membership_register_branch AS T1 JOIN member AS T2 ON T1.member_id  =  T2.member_id WHERE T1.register_year  =  2016
What are the average prices and cases of wines produced in the year of 2009 and made of Zinfandel grape?
Output: SELECT AVG(Price) ,  AVG(Cases) FROM WINE WHERE YEAR  =  2009 AND Grape  =  "Zinfandel"
Show the product name and total order quantity for each product.
Output: SELECT T1.product_name ,  sum(T2.order_quantity) FROM products AS T1 JOIN order_items AS T2 ON T1.product_id  =  T2.product_id GROUP BY T1.product_id
Find the name of different colleges involved in the tryout in alphabetical order.
Output: SELECT DISTINCT cName FROM tryout ORDER BY cName
What is the name of the product with the color description 'yellow'?
Output: SELECT T1.product_name FROM products AS T1 JOIN ref_colors AS T2 ON T1.color_code  =  T2.color_code WHERE T2.color_description  =  'yellow'
List the names of all distinct wines that are made of red color grape.
Output: SELECT DISTINCT T2.Name FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape  =  T2.Grape WHERE T1.Color  =  "Red"
Find the city where the most customers live.
Output: SELECT 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 GROUP BY t3.city ORDER BY count(*) DESC LIMIT 1
List the description of all the colors.
Output: SELECT color_description FROM ref_colors
What are the card numbers, names, and hometowns of every member ordered by descending level?
Output: SELECT card_number ,  name ,  hometown FROM member ORDER BY LEVEL DESC
Find the number and average age of students living in each city.
Output: SELECT count(*) ,  avg(age) ,  city_code FROM student GROUP BY city_code
What are the dates when customers with ids between 10 and 20 became customers?
Output: SELECT date_became_customer FROM customers WHERE customer_id BETWEEN 10 AND 20
Find the white grape used to produce wines with scores above 90.
Output: SELECT DISTINCT T1.Grape FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape  =  T2.Grape WHERE T1.Color  =  "White" AND T2.score  >  90
Find the name of the swimmer who has at least 2 records.
Output: SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id  =  t2.swimmer_id GROUP BY t2.swimmer_id HAVING count(*)  >=  2
Return the address content for the customer whose name is "Maudie Kertzmann".
Output: SELECT t3.address_content 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 t1.customer_name  =  "Maudie Kertzmann"
Find the names of schools that have some players in the mid position but not in the goalie position.
Output: SELECT cName FROM  tryout WHERE pPos  =  'mid' EXCEPT SELECT cName FROM  tryout WHERE pPos  =  'goalie'
Show different builders of railways, along with the corresponding number of railways using each builder.
Output: SELECT Builder ,  COUNT(*) FROM railway GROUP BY Builder
How many drama workshop groups are there in each city? Return both the city and the count.
Output: SELECT T1.City_Town ,  count(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID  =  T2.Address_ID GROUP BY T1.City_Town
Show the name, location, and number of platforms for all stations.
Output: SELECT name ,  LOCATION ,  number_of_platforms FROM station
What are the total purchases for members rated at level 6?
Output: SELECT count(*) FROM purchase AS T1 JOIN member AS T2 ON T1.member_id  =  T2.member_id WHERE T2.level  =  6
What is the "active to date" of the latest contact channel used by "Tillman Ernser"?
Output: SELECT max(t2.active_to_date) FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id  =  t2.customer_id WHERE t1.customer_name  =  "Tillman Ernser"
Find the number of products with category "Spices" and typically sold above 1000.
Output: SELECT count(*) FROM products WHERE product_category_code  =  "Spices" AND typical_buying_price  >  1000
Count the number of characteristics of the product named 'laurel'.
Output: SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id  =  t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id  =  t3.characteristic_id WHERE t1.product_name  =  "laurel"
Which 3 wineries produce the most wines made from white grapes?
Output: SELECT T2.Winery FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.GRAPE  =  T2.GRAPE WHERE T1.Color  =  "White" GROUP BY T2.Winery ORDER BY count(*) DESC LIMIT 3
Return the average, maximum, and total revenues across all manufacturers.
Output: SELECT avg(revenue) ,  max(revenue) ,  sum(revenue) FROM manufacturers
What are the order details of the products with price higher than 2000?
Output: SELECT T1.Other_Item_Details FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID  =  T2.Product_ID WHERE T2.Product_price  >  2000
Find the name and active date of the customer that use email as the contact channel.
Output: SELECT t1.customer_name ,  t2.active_from_date FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id  =  t2.customer_id WHERE t2.channel_code  =  'Email'
Find the product names that are colored 'white' but do not have unit of measurement "Handful".
Output: SELECT t1.product_name FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code  =  t2.product_category_code JOIN ref_colors AS t3 ON t1.color_code  =  t3.color_code WHERE t3.color_description  =  "white" AND t2.unit_of_measure != "Handful"
What is the total number of enrollment of schools that do not have any goalie player?
Output: SELECT sum(enr) FROM college WHERE cName NOT IN (SELECT cName FROM tryout WHERE pPos  =  "goalie")
Compute the total order quantities of the product "photo".
Output: SELECT sum(T1.Order_Quantity) FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID  =  T2.Product_ID WHERE T2.Product_Name  =  "photo"
What are the names, details and data types of the characteristics which are never used by any product?
Output: SELECT characteristic_name ,  other_characteristic_details ,  characteristic_data_type FROM CHARACTERISTICS EXCEPT SELECT t1.characteristic_name ,  t1.other_characteristic_details ,  t1.characteristic_data_type FROM CHARACTERISTICS AS t1 JOIN product_characteristics AS t2 ON t1.characteristic_id  =  t2.characteristic_id
Count the number of colors that are not used in any products.
Output: SELECT count(*) FROM Ref_colors WHERE color_code NOT IN ( SELECT color_code FROM products )
What are the cities that do not have any branches with more than 100 members?
Output: SELECT city FROM branch EXCEPT SELECT city FROM branch WHERE membership_amount  >  100
What are the names of the colleges that are larger than at least one college in Florida?
Output: SELECT DISTINCT cName FROM college WHERE enr  >  (SELECT min(enr) FROM college WHERE state  =  'FL')
What is the name of the event that happened in the most recent year?
Output: SELECT name FROM event ORDER BY YEAR DESC LIMIT 1
Show the station name with greatest number of trains.
Output: SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id  =  T2.station_id GROUP BY T1.station_id ORDER BY count(*) DESC LIMIT 1
Show the number of trains
Output: SELECT count(*) FROM train
Which marketing region has the most drama workshop groups? Give me the region code.
Output: SELECT Marketing_Region_Code FROM Drama_Workshop_Groups GROUP BY Marketing_Region_Code ORDER BY count(*) DESC LIMIT 1
What are the resident details containing the substring 'Miss'?
Output: SELECT other_details FROM Residents WHERE other_details LIKE '%Miss%'
How many customers do we have?
Output: SELECT count(*) FROM CUSTOMERS
Compute the average active time span of contact channels.
Output: SELECT avg(active_to_date - active_from_date) FROM customer_contact_channels
Find the number of different products that are produced by companies at different headquarter cities.
Output: SELECT count(DISTINCT T1.name) ,  T2.Headquarter FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.Headquarter
Find the name and nationality of the swimmer who has won (i.e., has a result of "win") more than 1 time.
Output: SELECT t1.name ,  t1.nationality FROM swimmer AS t1 JOIN record AS t2 ON t1.id  =  t2.swimmer_id WHERE RESULT  =  'Win' GROUP BY t2.swimmer_id HAVING count(*)  >  1
Find the total revenue of companies whose revenue is larger than the revenue of some companies based in Austin.
Output: SELECT sum(revenue) FROM manufacturers WHERE revenue  >  (SELECT min(revenue) FROM manufacturers WHERE headquarter  =  'Austin')
Find the number of female students (with F sex) living in Smith Hall
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.dorm_name  =  'Smith Hall' AND T1.sex  =  'F'
What is the last name of every student who is either female or living in a city with the code BAL or male and under 20?
Output: SELECT lname FROM student WHERE sex  =  'F' AND city_code  =  'BAL' UNION SELECT lname FROM student WHERE sex  =  'M' AND age  <  20
What is the total revenue of companies started by founder?
Output: SELECT sum(revenue) ,  founder FROM manufacturers GROUP BY founder
What are all the addresses in East Julianaside, Texas or in Gleasonmouth, Arizona.
Output: SELECT address_content FROM addresses WHERE city  =  "East Julianaside" AND state_province_county  =  "Texas" UNION SELECT address_content FROM addresses WHERE city  =  "Gleasonmouth" AND state_province_county  =  "Arizona"
Give me the name of the customer who ordered the most items in total.
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 GROUP BY t1.customer_name ORDER BY sum(t3.order_quantity) DESC LIMIT 1
Show the id and builder of the railway that are associated with the most trains.
Output: SELECT T2.Railway_ID ,  T1.Builder FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID  =  T2.Railway_ID GROUP BY T2.Railway_ID ORDER BY COUNT(*) DESC LIMIT 1
Show all cities where at least one customer lives in but no performer lives in.
Output: SELECT T1.City_Town FROM Addresses AS T1 JOIN Customers AS T2 ON T1.Address_ID  =  T2.Address_ID EXCEPT SELECT T1.City_Town FROM Addresses AS T1 JOIN Performers AS T2 ON T1.Address_ID  =  T2.Address_ID
Find the average price of all product clothes.
Output: SELECT avg(product_price) FROM products WHERE product_type_code  =  'Clothes'
How many states that have some college students playing in the mid position but not in the goalie position.
Output: SELECT COUNT(*) FROM (SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName  =  T2.cName WHERE T2.pPos  =  'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName  =  T2.cName WHERE T2.pPos  =  'goalie')
What are the names of products produced by both Creative Labs and Sony?
Output: SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Creative Labs' INTERSECT SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Sony'
Give the names of characteristics that are in two or more 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 HAVING count(*)  >= 2
Count the total number of bookings made.
Output: SELECT count(*) FROM BOOKINGS
What are the planned delivery date and actual delivery date for each booking?
Output: SELECT Planned_Delivery_Date ,  Actual_Delivery_Date FROM BOOKINGS
Show id and location of railways that are associated with more than one train.
Output: SELECT T2.Railway_ID ,  T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID  =  T2.Railway_ID GROUP BY T2.Railway_ID HAVING COUNT(*)  >  1
What are the name of the players who received a card in descending order of the hours of training?
Output: SELECT pName FROM Player WHERE yCard  =  'yes' ORDER BY HS DESC
How many products are there?
Output: SELECT count(*) FROM products
What are the speeds of the longest roller coaster?
Output: SELECT Speed FROM roller_coaster ORDER BY LENGTH DESC LIMIT 1
List the distinct payment method codes with the number of orders made
Output: SELECT payment_method_code ,  count(*) FROM INVOICES GROUP BY payment_method_code
Find the name of amenities of the dorm where the student with last name Smith is living in.
Output: SELECT T3.amenity_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 JOIN lives_in AS T4 ON T4.dormid  =  T1.dormid JOIN student AS T5 ON T5.stuid  =  T4.stuid WHERE T5.lname  =  'Smith'
Find the distinct names of wines produced before the year of 2000 or after the year of 2010.
Output: SELECT DISTINCT Name FROM WINE WHERE YEAR  <  2000 OR YEAR  >  2010
Find the states where have some college students in tryout and their decisions are yes.
Output: SELECT DISTINCT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName  =  T2.cName WHERE T2.decision  =  'yes'
What is the unit of measuerment of the product category code "Herbs"?
Output: SELECT unit_of_measure FROM ref_product_categories WHERE product_category_code  =  "Herbs"
How many appelations are in Napa Country?
Output: SELECT count(*) FROM APPELLATIONS WHERE County  =  "Napa"
What are the titles of movies and books corresponding to companies incorporated in China?
Output: SELECT T1.title ,  T3.book_title FROM movie AS T1 JOIN culture_company AS T2 ON T1.movie_id  =  T2.movie_id JOIN book_club AS T3 ON T3.book_club_id  =  T2.book_club_id WHERE T2.incorporated_in  =  'China'
What are names for top three branches with most number of membership?
Output: SELECT name FROM branch ORDER BY membership_amount DESC LIMIT 3
How many stadiums are there?
Output: SELECT count(*) FROM stadium
What is the product ID of the most frequently ordered item on invoices?
Output: SELECT Product_ID FROM INVOICES GROUP BY Product_ID ORDER BY COUNT(*) DESC LIMIT 1
Compute the number of products with a price larger than or equal to $180.
Output: SELECT count(*) FROM products WHERE price >= 180
Show the station name and number of trains in each station.
Output: SELECT T2.name ,  count(*) FROM train_station AS T1 JOIN station AS T2 ON T1.station_id  =  T2.station_id GROUP BY T1.station_id
Show the names of customers who use Credit Card payment method and have more than 2 orders.
Output: SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id WHERE T1.payment_method_code  =  'Credit Card' GROUP BY T1.customer_id HAVING count(*)  >  2
How many students are enrolled in college?
Output: SELECT sum(enr) FROM College
What are the titles and authors or editors that correspond to books made after 1989?
Output: SELECT book_title ,  author_or_editor FROM book_club WHERE YEAR  >  1989
In which state is the college that Charles attends?
Output: SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName  =  T2.cName JOIN player AS T3 ON T2.pID  =  T3.pID WHERE T3.pName  =  'Charles'
What are the names of all schools that have students trying out for the position of goal and 'mid'-field.
Output: SELECT cName FROM  tryout WHERE pPos  =  'goalie' INTERSECT SELECT cName FROM  tryout WHERE pPos  =  'mid'
Find the name of the most expensive hardware product.
Output: SELECT product_name FROM products WHERE product_type_code  =  'Hardware' ORDER BY product_price DESC LIMIT 1
Find the names of stadiums that the most swimmers have been to.
Output: SELECT t3.name FROM record AS t1 JOIN event AS t2 ON t1.event_id  =  t2.id JOIN stadium AS t3 ON t3.id  =  t2.stadium_id GROUP BY t2.stadium_id ORDER BY count(*) DESC LIMIT 1
What are the names of the schools with the top 3 largest class sizes?
Output: SELECT cName FROM college ORDER BY enr DESC LIMIT 3
What is the area for the appelation which produced the most wines prior to 2010?
Output: SELECT T1.Area FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation  =  T2.Appelation GROUP BY T2.Appelation HAVING T2.year  <  2010 ORDER BY count(*) DESC LIMIT 1
Find all details for each swimmer.
Output: SELECT * FROM swimmer
Find the states or counties where the stores with marketing region code "CA" are located.
Output: SELECT T1.State_County FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID  =  T2.Address_ID WHERE T2.Marketing_Region_Code  =  "CA"
How many dorms are in the database?
Output: SELECT count(*) FROM dorm
How many characteristics does the product named "sesame" have?
Output: SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id  =  t2.product_id WHERE t1.product_name  =  "sesame"
For which countries are there more than four distinct addresses listed?
Output: SELECT country FROM addresses GROUP BY country HAVING count(address_id)  >  4
What are the names of wines produced before any wine from the Brander winery?
Output: SELECT Name FROM WINE WHERE YEAR  <  (SELECT min(YEAR) FROM WINE WHERE Winery  =  "Brander")
Find the name and capacity of the dorm with least number of amenities.
Output: SELECT T1.dorm_name ,  T1.student_capacity FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid GROUP BY T2.dormid ORDER BY count(*) LIMIT 1
Find the customer name and date of the orders that have the status "Delivered".
Output: SELECT t1.customer_name ,  t2.order_date FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id  =  t2.customer_id WHERE order_status  =  "Delivered"
How many different levels do members have?
Output: SELECT count(DISTINCT LEVEL) FROM member
Find the number of students whose age is older than the average age for each gender.
Output: SELECT count(*) ,  sex FROM student WHERE age  >  (SELECT avg(age) FROM student) GROUP BY sex
Show all train names and times in stations in London in descending order by train time.
Output: SELECT T3.name ,  T3.time FROM train_station AS T1 JOIN station AS T2 ON T1.station_id  =  T2.station_id JOIN train AS T3 ON T3.train_id  =  T1.train_id WHERE T2.location  =  'London' ORDER BY T3.time DESC
What are all the company names that have a book published by Alyson?
Output: SELECT T1.company_name FROM culture_company AS T1 JOIN book_club AS T2 ON T1.book_club_id  =  T2.book_club_id WHERE T2.publisher  =  'Alyson'
How many schools have some students playing in goalie and mid positions.
Output: SELECT COUNT(*) FROM (SELECT cName FROM  tryout WHERE pPos  =  'goalie' INTERSECT SELECT cName FROM  tryout WHERE pPos  =  'mid')
What are the id and details of the customers who have at least 3 events?
Output: SELECT T1.customer_id ,  T1.customer_details FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id HAVING count(*)  >=  3
List the customer event id and the corresponding move in date and property id.
Output: SELECT customer_event_id ,  date_moved_in ,  property_id FROM customer_events
What are the different product names for products that have the 'warm' characteristic:?
Output: SELECT DISTINCT t1.product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id  =  t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id  =  t3.characteristic_id WHERE t3.characteristic_name  =  "warm"
When is the last day any resident moved in?
Output: SELECT max(date_moved_in) FROM Residents
Show all locations which don't have a train station with at least 15 platforms.
Output: SELECT LOCATION FROM station EXCEPT SELECT LOCATION FROM station WHERE number_of_platforms  >=  15
What are the grapes and appelations of each wine?
Output: SELECT Grape ,  Appelation FROM WINE
Find the id and name of customers whose address contains WY state and do not use credit card for payment.
Output: SELECT customer_id ,  customer_name FROM customers WHERE customer_address LIKE "%WY%" AND payment_method_code != "Credit Card"
List name of all amenities which Anonymous Donor Hall has, and sort the results in alphabetic order.
Output: SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T2.amenid  =  T1.amenid JOIN dorm AS T3 ON T2.dormid  =  T3.dormid WHERE T3.dorm_name  =  'Anonymous Donor Hall' ORDER BY T1.amenity_name
Show the names of trains and locations of railways they are in.
Output: SELECT T2.Name ,  T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID  =  T2.Railway_ID
What is the name of every college in alphabetical order that has more than 18000 students enrolled?
Output: SELECT cName FROM College WHERE enr  >  18000 ORDER BY cName
Sort all captain names by their ages from old to young.
Output: SELECT name FROM captain ORDER BY age DESC
Give the names and scores of wines made from white grapes.
Output: SELECT T2.Name ,   T2.Score FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape  =  T2.Grape WHERE T1.Color  =  "White"
Which contact channel has been used by the customer with name "Tillman Ernser"?
Output: SELECT DISTINCT channel_code FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id  =  t2.customer_id WHERE t1.customer_name  =  "Tillman Ernser"
What is the name of the school with smallest enrollment size per state?
Output: SELECT cName ,  state ,  min(enr) FROM college GROUP BY state