Question:
What is the largest and smallest customer codes?
Additional table information: table: department_store

Answer: SELECT MAX(customer_code), MIN(customer_code) FROM Customers


Question:
How many students enrolled in class ACCT-211?
Additional table information: table: college_1

Answer: SELECT COUNT(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code WHERE T1.crs_code = 'ACCT-211'


Question:
What is the product description of the product booked with an amount of 102.76?
Additional table information: table: products_for_hire

Answer: SELECT T2.product_description FROM products_booked AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.booked_amount = 102.76


Question:
Which room has cheapest base price? List the room's name and the base price.
Additional table information: table: inn_1

Answer: SELECT roomName, basePrice FROM Rooms ORDER BY basePrice ASC NULLS FIRST LIMIT 1


Question:
What are the last names for all scholarship students?
Additional table information: table: game_1

Answer: SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.onscholarship = 'Y'


Question:
List official names of cities in descending order of population.
Additional table information: table: farm

Answer: SELECT Official_Name FROM city ORDER BY Population DESC


Question:
What are the titles of all the albums?
Additional table information: table: store_1

Answer: SELECT title FROM albums


Question:
List the builders of railways in ascending alphabetical order.
Additional table information: table: railway

Answer: SELECT Builder FROM railway ORDER BY Builder ASC NULLS FIRST


Question:
What is the address of each course author or tutor?
Additional table information: table: e_learning

Answer: SELECT address_line_1 FROM Course_Authors_and_Tutors


Question:
Find the market shares and names of furnitures which no any company is producing in our records.
Additional table information: table: manufacturer

Answer: SELECT Market_Rate, name FROM furniture WHERE NOT Furniture_ID IN (SELECT Furniture_ID FROM furniture_manufacte)


Question:
What is the name of the institution the author 'Katsuhiro Ueno' belongs to?
Additional table information: table: icfp_1

Answer: SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = 'Katsuhiro' AND t1.lname = 'Ueno'


Question:
Which course is enrolled in by the most students? Give me the course name.
Additional table information: table: e_learning

Answer: SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1


Question:
What are the names of the states where at least 3 heads were born?
Additional table information: table: department_management

Answer: SELECT born_state FROM head GROUP BY born_state HAVING COUNT(*) >= 3


Question:
Find the name of the train whose route runs through greatest number of stations.
Additional table information: table: station_weather

Answer: SELECT t1.name FROM train AS t1 JOIN route AS t2 ON t1.id = t2.train_id GROUP BY t2.train_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the id, forename and number of races of all drivers who have at least participated in two races?
Additional table information: table: formula_1

Answer: SELECT T1.driverid, T1.forename, COUNT(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING COUNT(*) >= 2


Question:
Find the number of the products that have their color described as 'red' and have a characteristic named 'slow'.
Additional table information: table: products_gen_characteristics

Answer: 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'


Question:
What are all the songs in albums under label 'Universal Music Group'?
Additional table information: table: music_2

Answer: SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE t1.label = 'Universal Music Group'


Question:
Find the name of the company that produces both furnitures with less than 6 components and furnitures with more than 10 components.
Additional table information: table: manufacturer

Answer: SELECT t3.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID JOIN manufacturer AS t3 ON t2.manufacturer_id = t3.manufacturer_id WHERE t1.num_of_component < 6 INTERSECT SELECT t3.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID JOIN manufacturer AS t3 ON t2.manufacturer_id = t3.manufacturer_id WHERE t1.num_of_component > 10


Question:
Show the transaction type code that occurs the fewest times.
Additional table information: table: tracking_share_transactions

Answer: SELECT transaction_type_code FROM TRANSACTIONS GROUP BY transaction_type_code ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1


Question:
Which contact channel has been used by the customer with name 'Tillman Ernser'?
Additional table information: table: customers_and_addresses

Answer: 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'


Question:
List the name of albums that are released by aritist whose name has 'Led'
Additional table information: table: store_1

Answer: SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id = T2.artist_id WHERE T1.name LIKE '%Led%'


Question:
what is the fuel propulsion where the fleet series (quantity) is 310-329 (20)?
Additional table information: table: "vehicles"."cars"
columns: order_year, manufacturer, model, fleet_series_quantity, powertrain, fuel_propulsion

Answer: SELECT fuel_propulsion FROM "vehicles"."cars" WHERE fleet_series_quantity = '310-329 (20)'


Question:
What are the names of wrestlers who have never been eliminated?
Additional table information: table: wrestler

Answer: SELECT Name FROM wrestler WHERE NOT Wrestler_ID IN (SELECT Wrestler_ID FROM elimination)


Question:
Give all information regarding instructors, in order of salary from least to greatest.
Additional table information: table: college_2

Answer: SELECT * FROM instructor ORDER BY salary NULLS FIRST


Question:
What are the distinct names of wines that have appellations in the North Coast area?
Additional table information: table: wine_1

Answer: SELECT DISTINCT T2.Name FROM APPELLATIONs AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = 'North Coast'


Question:
Show the name of each county along with the corresponding number of delegates from that county.
Additional table information: table: election

Answer: SELECT T1.County_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id


Question:
Which college has the most authors with submissions?
Additional table information: table: workshop_paper

Answer: SELECT College FROM submission GROUP BY College ORDER BY COUNT(*) DESC LIMIT 1


Question:
How many patients do each physician take care of? List their names and number of patients they take care of.
Additional table information: table: hospital_1

Answer: SELECT T1.name, COUNT(*) FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid


Question:
Give the names of mountains in alphabetical order.
Additional table information: table: climbing

Answer: SELECT Name FROM mountain ORDER BY Name ASC NULLS FIRST


Question:
How many customers in total?
Additional table information: table: driving_school

Answer: SELECT COUNT(*) FROM Customers


Question:
What is the product, chromosome, and porphyria of the enzymes located at 'Cytosol'?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT product, chromosome, porphyria FROM enzyme WHERE LOCATION = 'Cytosol'


Question:
Show the names of phones and the districts of markets they are on.
Additional table information: table: phone_market

Answer: SELECT T3.Name, T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID


Question:
Show the facility codes of apartments with more than 4 bedrooms.
Additional table information: table: apartment_rentals

Answer: SELECT T1.facility_code FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4


Question:
Show the names of buildings except for those having an institution founded in 2003.
Additional table information: table: protein_institute

Answer: SELECT name FROM building EXCEPT SELECT T1.name FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded = 2003


Question:
Which film is rented at a fee of 0.99 and has less than 3 in the inventory? List the film title and id.
Additional table information: table: sakila_1

Answer: SELECT title, film_id FROM film WHERE rental_rate = 0.99 INTERSECT 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 HAVING COUNT(*) < 3


Question:
which gender got the highest average uncertain ratio.
Additional table information: table: candidate_poll

Answer: SELECT t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex ORDER BY AVG(t2.unsure_rate) DESC LIMIT 1


Question:
What is the category and typical buying price  of the product with name 'cumin'?
Additional table information: table: products_gen_characteristics

Answer: SELECT product_category_code, typical_buying_price FROM products WHERE product_name = 'cumin'


Question:
What is the first and last name of the faculty members who participated in at least one activity? For each of them, also show the number of activities they participated in.
Additional table information: table: activity_1

Answer: SELECT T1.fname, T1.lname, COUNT(*), T1.FacID FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID GROUP BY T1.FacID


Question:
What are the types of vocals that the musician with the last name 'Heilo' played in 'Der Kapitan'?
Additional table information: table: music_2

Answer: SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T3.lastname = 'Heilo' AND T2.title = 'Der Kapitan'


Question:
What are the details of the student who registered for the most number of courses?
Additional table information: table: student_assessment

Answer: SELECT T1.student_details FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the first name of the staff who did not give any lesson?
Additional table information: table: driving_school

Answer: SELECT first_name FROM Staff EXCEPT SELECT T2.first_name FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id


Question:
What are the years, titles, and publishers for all books, ordered by year descending?
Additional table information: table: culture_company

Answer: SELECT YEAR, book_title, publisher FROM book_club ORDER BY YEAR DESC


Question:
What is the name of the district with the smallest area?
Additional table information: table: store_product

Answer: SELECT district_name FROM district ORDER BY city_area ASC NULLS FIRST LIMIT 1


Question:
What are the titles of all movies that James Cameron directed after 2000?
Additional table information: table: movie_1

Answer: SELECT title FROM Movie WHERE director = 'James Cameron' AND YEAR > 2000


Question:
Find the number of projects which each scientist is working on and scientist's name.
Additional table information: table: scientist_1

Answer: SELECT COUNT(*), T1.name FROM scientists AS T1 JOIN assignedto AS T2 ON T1.ssn = T2.scientist GROUP BY T1.name


Question:
What are the name, latitude, and city of the station with the lowest latitude?
Additional table information: table: bike_1

Answer: SELECT name, lat, city FROM station ORDER BY lat NULLS FIRST LIMIT 1


Question:
Which service id and type has the least number of participants?
Additional table information: table: local_govt_in_alabama

Answer: SELECT T3.service_id, T4.Service_Type_Code FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID JOIN EVENTS AS T3 ON T2.Event_ID = T3.Event_ID JOIN services AS T4 ON T3.service_id = T4.service_id GROUP BY T3.service_id ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1


Question:
What is the payment method that were used the least often?
Additional table information: table: insurance_policies

Answer: SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1


Question:
What are each document's location code, and starting date and ending data in that location?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT location_code, date_in_location_from, date_in_locaton_to FROM Document_locations


Question:
Find the name, enrollment of the colleges whose size is bigger than 10000 and location is in state LA.
Additional table information: table: soccer_2

Answer: SELECT cName, enr FROM College WHERE enr > 10000 AND state = 'LA'


Question:
What are the names of products that are not 'white' in color and are not measured by the unit 'Handful'?
Additional table information: table: products_gen_characteristics

Answer: 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'


Question:
Count the number of different statuses.
Additional table information: table: farm

Answer: SELECT COUNT(DISTINCT Status) FROM city


Question:
What is the maximum, minimum and average market share of the listed browsers?
Additional table information: table: browser_web

Answer: SELECT MAX(market_share), MIN(market_share), AVG(market_share) FROM browser


Question:
In zip code 94107, on which day neither Fog nor Rain was not observed?
Additional table information: table: bike_1

Answer: SELECT date FROM weather WHERE zip_code = 94107 AND EVENTS <> 'Fog' AND EVENTS <> 'Rain'


Question:
What is the name of the body builder with the greatest body weight?
Additional table information: table: body_builder

Answer: SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMIT 1


Question:
What are the names of the states that have 2 to 4 employees living there?
Additional table information: table: driving_school

Answer: SELECT T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.state_province_county HAVING COUNT(*) BETWEEN 2 AND 4


Question:
Find all students taught by MARROTTE KIRK. Output first and last names of students.
Additional table information: table: student_1

Answer: SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'MARROTTE' AND T2.lastname = 'KIRK'


Question:
What is the total number of enrollment of schools that do not have any goalie player?
Additional table information: table: soccer_2

Answer: SELECT SUM(enr) FROM college WHERE NOT cName IN (SELECT cName FROM tryout WHERE pPos = 'goalie')


Question:
What are the department name and room for the course INTRODUCTION TO COMPUTER SCIENCE?
Additional table information: table: college_3

Answer: SELECT T2.Dname, T2.Room FROM COURSE AS T1 JOIN DEPARTMENT AS T2 ON T1.DNO = T2.DNO WHERE T1.CName = 'INTRODUCTION TO COMPUTER SCIENCE'


Question:
What are the store names of drama workshop groups?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Store_Name FROM Drama_Workshop_Groups


Question:
Find the name, type, and flag of the ship that is built in the most recent year.
Additional table information: table: ship_1

Answer: SELECT name, TYPE, flag FROM ship ORDER BY built_year DESC LIMIT 1


Question:
Find the name of the customer who made the most orders.
Additional table information: table: tracking_orders

Answer: SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
Please show the police forces and the number of counties with each police force.
Additional table information: table: county_public_safety

Answer: SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force


Question:
Which authors with submissions are from college 'Florida' or 'Temple'?
Additional table information: table: workshop_paper

Answer: SELECT Author FROM submission WHERE College = 'Florida' OR College = 'Temple'


Question:
Which catalog content has the smallest capacity? Return the catalog entry name.
Additional table information: table: product_catalog

Answer: SELECT catalog_entry_name FROM catalog_contents ORDER BY capacity ASC NULLS FIRST LIMIT 1


Question:
What are the allergy types and how many allergies correspond to each one?
Additional table information: table: allergy_1

Answer: SELECT allergytype, COUNT(*) FROM Allergy_type GROUP BY allergytype


Question:
What is the role name and role description for employee called Ebba?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT T2.role_name, T2.role_description FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T1.employee_name = 'Ebba'


Question:
How many trips started from Mountain View city and ended at Palo Alto city?
Additional table information: table: bike_1

Answer: SELECT COUNT(*) FROM station AS T1, trip AS T2, station AS T3 JOIN trip AS T4 ON T1.id = T2.start_station_id AND T2.id = T4.id AND T3.id = T4.end_station_id WHERE T1.city = 'Mountain View' AND T3.city = 'Palo Alto'


Question:
Find the names of states that have some college students playing in the mid position but not in the goalie position.
Additional table information: table: soccer_2

Answer: 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'


Question:
Provide the last name of the youngest student.
Additional table information: table: allergy_1

Answer: SELECT LName FROM Student WHERE age = (SELECT MIN(age) FROM Student)


Question:
Give me the average and minimum price (in Euro) of the products.
Additional table information: table: product_catalog

Answer: SELECT AVG(price_in_euros), MIN(price_in_euros) FROM catalog_contents


Question:
Where is the club 'Hopkins Student Enterprises' located?
Additional table information: table: club_1

Answer: SELECT clublocation FROM club WHERE clubname = 'Hopkins Student Enterprises'


Question:
What campuses are located in the county of Los Angeles?
Additional table information: table: csu_1

Answer: SELECT campus FROM campuses WHERE county = 'Los Angeles'


Question:
What are the id of all the files in mp3 format?
Additional table information: table: music_1

Answer: SELECT f_id FROM files WHERE formats = 'mp3'


Question:
List the creation year, name and budget of each department.
Additional table information: table: department_management

Answer: SELECT creation, name, budget_in_billions FROM department


Question:
Which tourist attraction is associated with the photo 'game1'? Return its name.
Additional table information: table: cre_Theme_park

Answer: SELECT T2.Name FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T1.Name = 'game1'


Question:
Which classrooms are used by grade 5?
Additional table information: table: student_1

Answer: SELECT DISTINCT classroom FROM list WHERE grade = 5


Question:
Which authors did not submit to any workshop?
Additional table information: table: workshop_paper

Answer: SELECT Author FROM submission WHERE NOT Submission_ID IN (SELECT Submission_ID FROM acceptance)


Question:
What is the id of the event with the most participants?
Additional table information: table: local_govt_in_alabama

Answer: SELECT Event_ID FROM Participants_in_Events GROUP BY Event_ID ORDER BY COUNT(*) DESC LIMIT 1


Question:
Return complaint status codes have more than 3 corresponding complaints?
Additional table information: table: customer_complaints

Answer: SELECT complaint_status_code FROM complaints GROUP BY complaint_status_code HAVING COUNT(*) > 3


Question:
Return all players sorted by college in ascending alphabetical order.
Additional table information: table: match_season

Answer: SELECT player FROM match_season ORDER BY College ASC NULLS FIRST


Question:
What are the names of the dorm that does not have a TV Lounge?
Additional table information: table: dorm_1

Answer: 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'


Question:
What is the title of the course that is a prerequisite for Mobile Computing?
Additional table information: table: college_2

Answer: SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.title = 'Mobile Computing')


Question:
Find the name of the customers who have at most two orders.
Additional table information: table: tracking_orders

Answer: SELECT T2.customer_name FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING COUNT(*) <= 2


Question:
List all region names in alphabetical order.
Additional table information: table: storm_record

Answer: SELECT region_name FROM region ORDER BY region_name NULLS FIRST


Question:
What are the names of people who are not entrepreneurs?
Additional table information: table: entrepreneur

Answer: SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM entrepreneur)


Question:
How many gas station are opened between 2000 and 2005?
Additional table information: table: gas_company

Answer: SELECT COUNT(*) FROM gas_station WHERE open_year BETWEEN 2000 AND 2005


Question:
How many clubs have total medals less than 10?
Additional table information: table: sports_competition

Answer: SELECT COUNT(*) FROM club_rank WHERE Total < 10


Question:
Count the number of players who enter hall of fame for each year.
Additional table information: table: baseball_1

Answer: SELECT yearid, COUNT(*) FROM hall_of_fame GROUP BY yearid


Question:
Find the name and id of the top 3 expensive rooms.
Additional table information: table: inn_1

Answer: SELECT RoomId, roomName FROM Rooms ORDER BY basePrice DESC LIMIT 3


Question:
What are the distinct positions of the players from a country whose capital is Dublin?
Additional table information: table: match_season

Answer: SELECT DISTINCT T2.Position FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Capital = 'Dublin'


Question:
How many customers have no payment histories?
Additional table information: table: driving_school

Answer: SELECT COUNT(*) FROM Customers WHERE NOT customer_id IN (SELECT customer_id FROM Customer_Payments)


Question:
How many parks does Atlanta city have?
Additional table information: table: baseball_1

Answer: SELECT COUNT(*) FROM park WHERE city = 'Atlanta'


Question:
How many papers are 'Atsushi Ohori' the author of?
Additional table information: table: icfp_1

Answer: SELECT COUNT(*) FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = 'Atsushi' AND t1.lname = 'Ohori'


Question:
For each year, return the year and the average number of attendance at home games.
Additional table information: table: baseball_1

Answer: SELECT YEAR, AVG(attendance) FROM home_game GROUP BY YEAR


Question:
What are the addresses of the course authors or tutors with personal name 'Cathrine'
Additional table information: table: e_learning

Answer: SELECT address_line_1 FROM Course_Authors_and_Tutors WHERE personal_name = 'Cathrine'


Question:
Compute the total order quantities of the product 'photo'.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: 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'


Question:
Which clubs are located at 'AKW'? Return the club names.
Additional table information: table: club_1

Answer: SELECT clubname FROM club WHERE clublocation = 'AKW'


Question:
Who are the advisors for students that live in a city with city code 'BAL'?
Additional table information: table: voter_2

Answer: SELECT Advisor FROM STUDENT WHERE city_code = 'BAL'


Question:
Count the number of players who were born in USA and have bats information 'R'.
Additional table information: table: baseball_1

Answer: SELECT COUNT(*) FROM player WHERE birth_country = 'USA' AND bats = 'R'


Question:
Return the total and minimum enrollments across all schools.
Additional table information: table: university_basketball

Answer: SELECT SUM(enrollment), MIN(enrollment) FROM university


Question:
How many problems does the product with the most problems have? List the number of the problems and product name.
Additional table information: table: tracking_software_problems

Answer: SELECT COUNT(*), T1.product_name FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name ORDER BY COUNT(*) DESC LIMIT 1


Question:
Compute the mean price of procedures physician John Wen was trained in.
Additional table information: table: hospital_1

Answer: SELECT AVG(T3.cost) 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'


Question:
What are the names, headquarters and founders of the company with the highest revenue?
Additional table information: table: manufactory_1

Answer: SELECT name, headquarter, founder FROM manufacturers ORDER BY revenue DESC LIMIT 1


Question:
What are the district names and city populations for all districts that between 200,000 and 2,000,000 residents?
Additional table information: table: store_product

Answer: SELECT District_name, City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000


Question:
Sort the names of all counties in descending alphabetical order.
Additional table information: table: election

Answer: SELECT County_name FROM county ORDER BY County_name DESC


Question:
What is the average number of gold medals for clubs?
Additional table information: table: sports_competition

Answer: SELECT AVG(Gold) FROM club_rank


Question:
List venues of all matches in the order of their dates starting from the most recent one.
Additional table information: table: city_record

Answer: SELECT venue FROM MATCH ORDER BY date DESC


Question:
List top 10 employee work longest in the company. List employee's first and last name.
Additional table information: table: store_1

Answer: SELECT first_name, last_name FROM employees ORDER BY hire_date ASC NULLS FIRST LIMIT 10


Question:
Show the theme for exhibitions with both records of an attendance below 100 and above 500.
Additional table information: table: theme_gallery

Answer: SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance < 100 INTERSECT SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance > 500


Question:
Find the number of different cities which banks are located at.
Additional table information: table: loan_1

Answer: SELECT COUNT(DISTINCT city) FROM bank


Question:
Give the building that the instructor who teaches the greatest number of courses lives in.
Additional table information: table: college_3

Answer: SELECT T2.Building FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY COUNT(*) DESC LIMIT 1


Question:
How many phone hardware models are produced by the company named 'Nokia Corporation'?
Additional table information: table: phone_1

Answer: SELECT COUNT(*) FROM phone WHERE Company_name = 'Nokia Corporation'


Question:
What are the names of the technicians that have not been assigned to repair machines?
Additional table information: table: machine_repair

Answer: SELECT Name FROM technician WHERE NOT technician_id IN (SELECT technician_id FROM repair_assignment)


Question:
Find the number of dorms that have some amenity.
Additional table information: table: dorm_1

Answer: SELECT COUNT(DISTINCT dormid) FROM has_amenity


Question:
Which customer have the most policies? Give me the customer details.
Additional table information: table: insurance_and_eClaims

Answer: SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id GROUP BY t2.customer_details ORDER BY COUNT(*) DESC LIMIT 1


Question:
List the official name and status of the city with the largest population.
Additional table information: table: farm

Answer: SELECT Official_Name, Status FROM city ORDER BY Population DESC LIMIT 1


Question:
Show the name of buildings that do not have any institution.
Additional table information: table: protein_institute

Answer: SELECT name FROM building WHERE NOT building_id IN (SELECT building_id FROM institution)


Question:
How many faculty members are at the university that gave the least number of degrees in 2001?
Additional table information: table: csu_1

Answer: SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2001 ORDER BY t3.degrees NULLS FIRST LIMIT 1


Question:
Find the emails and phone numbers of all the customers, ordered by email address and phone number.
Additional table information: table: customer_complaints

Answer: SELECT email_address, phone_number FROM customers ORDER BY email_address NULLS FIRST, phone_number NULLS FIRST


Question:
What are the names of the members that have never registered at any branch?
Additional table information: table: shop_membership

Answer: SELECT name FROM member WHERE NOT member_id IN (SELECT member_id FROM membership_register_branch)


Question:
What is the company where Eduardo Martins is a customer?
Additional table information: table: store_1

Answer: SELECT company FROM customers WHERE first_name = 'Eduardo' AND last_name = 'Martins'


Question:
List the top 10 customers by total gross sales. List customers' first and last name and total gross sales.
Additional table information: table: store_1

Answer: SELECT T1.first_name, T1.last_name, SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY SUM(T2.total) DESC LIMIT 10


Question:
List the names of products that are not in any event.
Additional table information: table: solvency_ii

Answer: SELECT Product_Name FROM Products WHERE NOT Product_ID IN (SELECT Product_ID FROM Products_in_Events)


Question:
Show the number of transactions with transaction type code 'SALE' for different investors if it is larger than 0.
Additional table information: table: tracking_share_transactions

Answer: SELECT investor_id, COUNT(*) FROM TRANSACTIONS WHERE transaction_type_code = 'SALE' GROUP BY investor_id


Question:
Which cities have lower temperature in March than in July and have been once host cities?
Additional table information: table: city_record

Answer: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Jul INTERSECT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city


Question:
What are the ids for courses in the Fall of 2009 or the Spring of 2010?
Additional table information: table: college_2

Answer: SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 UNION SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010


Question:
What are the maximum and minimum settlement amount on record?
Additional table information: table: insurance_fnol

Answer: SELECT MAX(settlement_amount), MIN(settlement_amount) FROM settlements


Question:
What are the names of companies that do not make DVD drives?
Additional table information: table: manufactory_1

Answer: 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'


Question:
Show the minimum amount of transactions whose type code is 'PUR' and whose share count is bigger than 50.
Additional table information: table: tracking_share_transactions

Answer: SELECT MIN(amount_of_transaction) FROM TRANSACTIONS WHERE transaction_type_code = 'PUR' AND share_count > 50


Question:
What is the order id and order details for the order more than two invoices.
Additional table information: table: customers_and_invoices

Answer: SELECT T2.order_id, T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id = T2.order_id GROUP BY T2.order_id HAVING COUNT(*) > 2


Question:
What is the shipping agent code of shipping agent UPS?
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT shipping_agent_code FROM Ref_Shipping_Agents WHERE shipping_agent_name = 'UPS'


Question:
What are the dates of ceremony at music festivals corresponding to volumes that lasted more than 2 weeks on top?
Additional table information: table: music_4

Answer: SELECT T1.Date_of_ceremony FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T2.Weeks_on_Top > 2


Question:
What are the names of actors and the musicals that they are in?
Additional table information: table: musical

Answer: SELECT T1.Name, T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID


Question:
What are the names of members and their corresponding parties?
Additional table information: table: party_people

Answer: SELECT T1.member_name, T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id


Question:
What are the different transaction types, and how many transactions of each have taken place?
Additional table information: table: customers_card_transactions

Answer: SELECT transaction_type, COUNT(*) FROM Financial_transactions GROUP BY transaction_type


Question:
Count the number of all the calendar items.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT COUNT(*) FROM Ref_calendar


Question:
What are the ids, names, and FDA approval status for medicines ordered by descending number of possible enzyme interactions?
Additional table information: table: medicine_enzyme_interaction

Answer: 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


Question:
How many branches where have more than average number of memberships are there?
Additional table information: table: shop_membership

Answer: SELECT COUNT(*) FROM branch WHERE membership_amount > (SELECT AVG(membership_amount) FROM branch)


Question:
Find the names of all wines produced in 2008.
Additional table information: table: wine_1

Answer: SELECT Name FROM WINE WHERE YEAR = '2008'


Question:
Find the title and star rating of the movie that got the least rating star for each reviewer.
Additional table information: table: movie_1

Answer: SELECT T2.title, T1.rID, T1.stars, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.rID


Question:
Find the name and gender type of the dorms whose capacity is greater than 300 or less than 100.
Additional table information: table: dorm_1

Answer: SELECT dorm_name, gender FROM dorm WHERE student_capacity > 300 OR student_capacity < 100


Question:
Find the name of amenities Smith Hall dorm have.
Additional table information: table: dorm_1

Answer: 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 WHERE T1.dorm_name = 'Smith Hall'


Question:
What are the distinct wineries which produce wines costing between 50 and 100?
Additional table information: table: wine_1

Answer: SELECT DISTINCT Winery FROM WINE WHERE Price BETWEEN 50 AND 100


Question:
Count the number of regions.
Additional table information: table: storm_record

Answer: SELECT COUNT(*) FROM region


Question:
What is the city with the most number of flagship stores?
Additional table information: table: store_product

Answer: SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city ORDER BY COUNT(*) DESC LIMIT 1


Question:
List the name of musicals that do not have actors.
Additional table information: table: musical

Answer: SELECT Name FROM musical WHERE NOT Musical_ID IN (SELECT Musical_ID FROM actor)


Question:
Count the number of addressed in the California district.
Additional table information: table: sakila_1

Answer: SELECT COUNT(*) FROM address WHERE district = 'California'


Question:
which country did participated in the most number of Tournament competitions?
Additional table information: table: sports_competition

Answer: SELECT country FROM competition WHERE competition_type = 'Tournament' GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the id of the candidate whose email is stanley.monahan@example.org?
Additional table information: table: student_assessment

Answer: SELECT T2.candidate_id FROM people AS T1 JOIN candidates AS T2 ON T1.person_id = T2.candidate_id WHERE T1.email_address = 'stanley.monahan@example.org'


Question:
What are the characters and duration of actors?
Additional table information: table: musical

Answer: SELECT Character, Duration FROM actor


Question:
Find name of the project that needs the least amount of time to finish and the name of scientists who worked on it.
Additional table information: table: scientist_1

Answer: SELECT T2.name, T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MIN(hours) FROM projects)


Question:
What are the countries that participated in both friendly and tournament type competitions?
Additional table information: table: sports_competition

Answer: SELECT country FROM competition WHERE competition_type = 'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type = 'Tournament'


Question:
Count the number of documents with the type code BK that correspond to each product id.
Additional table information: table: cre_Docs_and_Epenses

Answer: SELECT COUNT(*), project_id FROM Documents WHERE document_type_code = 'BK' GROUP BY project_id


Question:
Find the names of all procedures which cost more than 1000 but which physician John Wen was not trained in?
Additional table information: table: hospital_1

Answer: 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'


Question:
Show the number of document types.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT COUNT(*) FROM Ref_document_types


Question:
What is the id of the product that was ordered the most often?
Additional table information: table: department_store

Answer: SELECT product_id FROM order_items GROUP BY product_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
How many films have the word 'Dummy' in their titles?
Additional table information: table: cinema

Answer: SELECT COUNT(*) FROM film WHERE title LIKE '%Dummy%'


Question:
Find all the distinct district names ordered by city area in descending.
Additional table information: table: store_product

Answer: SELECT DISTINCT District_name FROM district ORDER BY city_area DESC


Question:
For each grade, report the grade, the number of classrooms in which it is taught and the total number of students in the grade.
Additional table information: table: student_1

Answer: SELECT grade, COUNT(DISTINCT classroom), COUNT(*) FROM list GROUP BY grade


Question:
What is the software platform that is most common amongst all devices?
Additional table information: table: device

Answer: SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the name of customers who do not have a loan with a type of Mortgages.
Additional table information: table: loan_1

Answer: SELECT cust_name FROM customer EXCEPT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE T2.loan_type = 'Mortgages'


Question:
How many weddings are there in year 2016?
Additional table information: table: wedding

Answer: SELECT COUNT(*) FROM wedding WHERE YEAR = 2016


Question:
List all channel names ordered by their rating in percent from big to small.
Additional table information: table: program_share

Answer: SELECT name FROM channel ORDER BY rating_in_percent DESC


Question:
Find the name and account balance of the customer whose name includes the letter ‘a’.
Additional table information: table: loan_1

Answer: SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%'


Question:
Find the first and last name of students who are living in the dorms that have amenity TV Lounge.
Additional table information: table: dorm_1

Answer: SELECT T1.fname, T1.lname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge')


Question:
What are the names of all the clubs starting with the oldest?
Additional table information: table: sports_competition

Answer: SELECT name FROM club ORDER BY Start_year ASC NULLS FIRST


Question:
Find the types and details for all premises and order by the premise type.
Additional table information: table: customers_campaigns_ecommerce

Answer: SELECT premises_type, premise_details FROM premises ORDER BY premises_type NULLS FIRST


Question:
What is the location code for the country 'Canada'?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT location_code FROM Ref_locations WHERE location_name = 'Canada'


Question:
What is the name of all tracks in the Rock genre?
Additional table information: table: store_1

Answer: SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = 'Rock'


Question:
How many phones are there?
Additional table information: table: phone_market

Answer: SELECT COUNT(*) FROM phone


Question:
Return the name, phone number and email address for the customer with the most orders.
Additional table information: table: department_store

Answer: SELECT T1.customer_name, T1.customer_phone, T1.customer_email FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
Please show the most common publication date.
Additional table information: table: book_2

Answer: SELECT Publication_Date FROM publication GROUP BY Publication_Date ORDER BY COUNT(*) DESC LIMIT 1


Question:
What are the average prices of wines for different years?
Additional table information: table: wine_1

Answer: SELECT AVG(Price), YEAR FROM WINE GROUP BY YEAR


Question:
give me names of all compatible browsers and accelerators in the descending order of compatible year
Additional table information: table: browser_web

Answer: SELECT T2.name, T3.name FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id = T2.id JOIN web_client_accelerator AS T3 ON T1.accelerator_id = T3.id ORDER BY T1.compatible_since_year DESC


Question:
What are the names of procedures physician John Wen was trained in?
Additional table information: table: hospital_1

Answer: 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'


Question:
What is the name of the aircraft that was on flight number 99?
Additional table information: table: flight_1

Answer: SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99


Question:
Find the name of the ship that is steered by the youngest captain.
Additional table information: table: ship_1

Answer: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id ORDER BY t2.age NULLS FIRST LIMIT 1


Question:
Find the total quantity of products associated with the orders in the 'Cancelled' status.
Additional table information: table: customers_and_addresses

Answer: 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'


Question:
What are the different majors?
Additional table information: table: allergy_1

Answer: SELECT DISTINCT Major FROM Student


Question:
Show the average price of hotels for each star rating code.
Additional table information: table: cre_Theme_park

Answer: SELECT star_rating_code, AVG(price_range) FROM HOTELS GROUP BY star_rating_code


Question:
List the name of products in ascending order of price.
Additional table information: table: solvency_ii

Answer: SELECT Product_Name FROM Products ORDER BY Product_Price ASC NULLS FIRST


Question:
What are the full names of customers who have accounts?
Additional table information: table: customers_card_transactions

Answer: SELECT DISTINCT T1.customer_first_name, T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id


Question:
What is all the information about courses, ordered by credits ascending?
Additional table information: table: college_3

Answer: SELECT * FROM COURSE ORDER BY Credits NULLS FIRST


Question:
What is the average number of hosts for parties?
Additional table information: table: party_host

Answer: SELECT AVG(Number_of_hosts) FROM party


Question:
List lesson id of all lessons taught by staff with first name as Janessa, last name as Sawayn and nickname containing letter 's'.
Additional table information: table: driving_school

Answer: SELECT T1.lesson_id FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Janessa' AND T2.last_name = 'Sawayn' AND nickname LIKE '%s%'


Question:
List all country and league names.
Additional table information: table: soccer_1

Answer: SELECT T1.name, T2.name FROM Country AS T1 JOIN League AS T2 ON T1.id = T2.country_id


Question:
What is the county that produces the most wines scoring higher than 90?
Additional table information: table: wine_1

Answer: 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


Question:
Show all the Store_Name of drama workshop groups.
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT Store_Name FROM Drama_Workshop_Groups


Question:
List ids and details for all projects.
Additional table information: table: cre_Docs_and_Epenses

Answer: SELECT project_id, project_details FROM Projects


Question:
List all countries of markets in descending order of number of cities.
Additional table information: table: film_rank

Answer: SELECT Country FROM market ORDER BY Number_cities DESC


Question:
Show writers who have published a book with price more than 4000000.
Additional table information: table: book_2

Answer: SELECT T1.Writer FROM book AS T1 JOIN publication AS T2 ON T1.Book_ID = T2.Book_ID WHERE T2.Price > 4000000


Question:
What are the ranks of captains that have no captain that are in the Third-rate ship of the line class?
Additional table information: table: ship_1

Answer: SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS = 'Third-rate ship of the line'


Question:
Find the total rating ratio for each channel owner.
Additional table information: table: program_share

Answer: SELECT SUM(Rating_in_percent), OWNER FROM channel GROUP BY OWNER


Question:
Count the number of bank branches.
Additional table information: table: loan_1

Answer: SELECT COUNT(*) FROM bank


Question:
How many different advisors are listed?
Additional table information: table: allergy_1

Answer: SELECT COUNT(DISTINCT advisor) FROM Student


Question:
List the document type code, document name, and document description for the document with name 'Noel CV' or name 'King Book'.
Additional table information: table: cre_Docs_and_Epenses

Answer: SELECT document_type_code, document_name, document_description FROM Documents WHERE document_name = 'Noel CV' OR document_name = 'King Book'


Question:
How many different colleges are there?
Additional table information: table: soccer_2

Answer: SELECT COUNT(*) FROM College


Question:
What is the year in which most ships were built?
Additional table information: table: ship_1

Answer: SELECT built_year FROM ship GROUP BY built_year ORDER BY COUNT(*) DESC LIMIT 1


Question:
How many documents were shipped by USPS?
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT COUNT(*) FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = 'USPS'


Question:
How many universities have a location that contains NY?
Additional table information: table: university_basketball

Answer: SELECT COUNT(*) FROM university WHERE LOCATION LIKE '%NY%'


Question:
What are the ids and details of all accounts?
Additional table information: table: cre_Docs_and_Epenses

Answer: SELECT account_id, account_details FROM Accounts


Question:
Find the names of all instructors whose salary is greater than the salary of all instructors in the Biology department.
Additional table information: table: college_2

Answer: SELECT name FROM instructor WHERE salary > (SELECT MAX(salary) FROM instructor WHERE dept_name = 'Biology')


Question:
What are the distinct names and phone numbers for suppliers who have red jeans?
Additional table information: table: department_store

Answer: SELECT DISTINCT T1.supplier_name, T1.supplier_phone FROM suppliers AS T1 JOIN product_suppliers AS T2 ON T1.supplier_id = T2.supplier_id JOIN products AS T3 ON T2.product_id = T3.product_id WHERE T3.product_name = 'red jeans'


Question:
What are the names of customers who do not have saving accounts?
Additional table information: table: loan_1

Answer: SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type = 'saving'


Question:
Find the names of the tourist attractions that is either accessible by walk or at address 660 Shea Crescent.
Additional table information: table: cre_Theme_park

Answer: SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = '660 Shea Crescent' OR T2.How_to_Get_There = 'walk'


Question:
Return the sum and average of all settlement amounts.
Additional table information: table: insurance_fnol

Answer: SELECT SUM(settlement_amount), AVG(settlement_amount) FROM settlements


Question:
Count the number of countries.
Additional table information: table: match_season

Answer: SELECT COUNT(*) FROM country


Question:
What are the type come, name, and description of the document that has either the name 'Noel CV' or 'King Book'?
Additional table information: table: cre_Docs_and_Epenses

Answer: SELECT document_type_code, document_name, document_description FROM Documents WHERE document_name = 'Noel CV' OR document_name = 'King Book'


Question:
What are the first names of all students in course ACCT-211?
Additional table information: table: college_1

Answer: SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T2.stu_num = T3.stu_num WHERE T1.crs_code = 'ACCT-211'


Question:
How much money did Lucas Mancini spend?
Additional table information: table: store_1

Answer: SELECT SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = 'Lucas' AND T1.last_name = 'Mancini'


Question:
Give me the claim date, settlement date for all the claims whose claimed amount is larger than the average.
Additional table information: table: insurance_policies

Answer: SELECT Date_Claim_Made, Date_Claim_Settled FROM Claims WHERE Amount_Claimed > (SELECT AVG(Amount_Claimed) FROM Claims)


Question:
Show the names and genders of players with a coach starting after 2011.
Additional table information: table: riding_club

Answer: SELECT T3.Player_name, T3.gender 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 WHERE T1.Starting_year > 2011


Question:
List all the distinct stations from which a trip of duration below 100 started.
Additional table information: table: bike_1

Answer: SELECT DISTINCT start_station_name FROM trip WHERE duration < 100


Question:
Show the statuses of roller coasters longer than 3300 or higher than 100.
Additional table information: table: roller_coaster

Answer: SELECT Status FROM roller_coaster WHERE LENGTH > 3300 OR Height > 100


Question:
How many different professors are there for the different schools?
Additional table information: table: college_1

Answer: SELECT COUNT(*), T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code


Question:
How many professors are teaching class with code ACCT-211?
Additional table information: table: college_1

Answer: SELECT COUNT(DISTINCT PROF_NUM) FROM CLASS WHERE CRS_CODE = 'ACCT-211'


Question:
Find all students taught by OTHA MOYER. Output the first and last names of the students.
Additional table information: table: student_1

Answer: SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'OTHA' AND T2.lastname = 'MOYER'


Question:
Find the department name of the instructor whose name contains 'Soisalon'.
Additional table information: table: college_2

Answer: SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%'


Question:
How many invoices were billed from Chicago, IL?
Additional table information: table: store_1

Answer: SELECT COUNT(*) FROM invoices WHERE billing_city = 'Chicago' AND billing_state = 'IL'


Question:
What are the first name and last name of all the instructors?
Additional table information: table: activity_1

Answer: SELECT fname, lname FROM Faculty WHERE Rank = 'Instructor'


Question:
List the name of the company that produced more than one phone model.
Additional table information: table: phone_1

Answer: SELECT Company_name FROM phone GROUP BY Company_name HAVING COUNT(*) > 1


Question:
Which apartment type has the largest number of total rooms? Return the apartment type code, its number of bathrooms and number of bedrooms.
Additional table information: table: apartment_rentals

Answer: SELECT apt_type_code, bathroom_count, bedroom_count FROM Apartments GROUP BY apt_type_code ORDER BY SUM(room_count) DESC LIMIT 1


Question:
Which building has the largest number of company offices? Give me the building name.
Additional table information: table: company_office

Answer: SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
What are the first names of customers who have not rented any films after '2005-08-23 02:06:01'?
Additional table information: table: sakila_1

Answer: SELECT first_name FROM customer WHERE NOT customer_id IN (SELECT customer_id FROM rental WHERE rental_date > '2005-08-23 02:06:01')


Question:
What is the average GPA of students taking ACCT-211?
Additional table information: table: college_1

Answer: SELECT AVG(T2.stu_gpa) FROM enroll AS T1 JOIN student AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T1.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211'


Question:
Return the average gross sales in dollars across all films.
Additional table information: table: film_rank

Answer: SELECT AVG(Gross_in_dollar) FROM film


Question:
For each id of a driver who participated in at most 30 races, how many races did they participate in?
Additional table information: table: formula_1

Answer: SELECT T1.driverid, COUNT(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING COUNT(*) <= 30


Question:
What is the oldest log id and its corresponding problem id?
Additional table information: table: tracking_software_problems

Answer: SELECT problem_log_id, problem_id FROM problem_log ORDER BY log_entry_date NULLS FIRST LIMIT 1


Question:
Give me the names of customers who have placed orders between 2009-01-01 and 2010-01-01.
Additional table information: table: tracking_orders

Answer: SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.date_order_placed >= '2009-01-01' AND T2.date_order_placed <= '2010-01-01'


Question:
What are the low and high estimates of film markets?
Additional table information: table: film_rank

Answer: SELECT Low_Estimate, High_Estimate FROM film_market_estimation


Question:
Count the number of times the team 'Boston Red Stockings' lost in 2009 postseason.
Additional table information: table: baseball_1

Answer: SELECT COUNT(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2009


Question:
List all department names ordered by their starting date.
Additional table information: table: company_1

Answer: SELECT dname FROM department ORDER BY mgr_start_date NULLS FIRST


Question:
What is average and maximum salary of all employees.
Additional table information: table: flight_1

Answer: SELECT AVG(salary), MAX(salary) FROM Employee


Question:
Find the first name and gender of the student who has allergy to milk but not cat.
Additional table information: table: allergy_1

Answer: 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')


Question:
Find the id and name of the stadium where the largest number of injury accidents occurred.
Additional table information: table: game_injury

Answer: 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


Question:
How many students attend course English?
Additional table information: table: student_assessment

Answer: SELECT COUNT(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = 'English'


Question:
What are the names of the different bank branches, and what are their total loan amounts?
Additional table information: table: loan_1

Answer: SELECT SUM(amount), T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname


Question:
What are the different ids and names of the stations that have had more than 12 bikes available?
Additional table information: table: bike_1

Answer: SELECT DISTINCT T1.id, T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available > 12


Question:
What is the name of the department with the student that has the lowest GPA?
Additional table information: table: college_1

Answer: SELECT T2.dept_name FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code ORDER BY stu_gpa NULLS FIRST LIMIT 1


Question:
How many students live in each city and what are their average ages?
Additional table information: table: dorm_1

Answer: SELECT COUNT(*), AVG(age), city_code FROM student GROUP BY city_code


Question:
How many employees have a first name of Ludie?
Additional table information: table: driving_school

Answer: SELECT COUNT(*) FROM Staff WHERE first_name = 'Ludie'


Question:
What is the name of the most recent movie?
Additional table information: table: movie_1

Answer: SELECT title FROM Movie WHERE YEAR = (SELECT MAX(YEAR) FROM Movie)


Question:
List email address and birthday of customer whose first name as Carole.
Additional table information: table: driving_school

Answer: SELECT email_address, date_of_birth FROM Customers WHERE first_name = 'Carole'


Question:
What are the names of storms that did not affect two or more regions?
Additional table information: table: storm_record

Answer: SELECT name FROM storm EXCEPT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2


Question:
What are the faculty id and the number of students each faculty has?
Additional table information: table: activity_1

Answer: SELECT T1.FacID, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID


Question:
What are the different cities that have more than 100 memberships?
Additional table information: table: shop_membership

Answer: SELECT DISTINCT city FROM branch WHERE membership_amount >= 100


Question:
Show the booking status code and the corresponding number of bookings.
Additional table information: table: apartment_rentals

Answer: SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code


Question:
What are the first names of students studying in room 107?
Additional table information: table: student_1

Answer: SELECT DISTINCT firstname FROM list WHERE classroom = 107


Question:
Show the themes of parties and the names of the party hosts.
Additional table information: table: party_host

Answer: SELECT T3.Party_Theme, T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID


Question:
List the name of all tracks in the playlists of Movies.
Additional table information: table: store_1

Answer: SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T3.id = T2.playlist_id WHERE T3.name = 'Movies'


Question:
How many staff live in state Georgia?
Additional table information: table: driving_school

Answer: SELECT COUNT(*) FROM Addresses WHERE state_province_county = 'Georgia'


Question:
List the titles of the books in ascending order of issues.
Additional table information: table: book_2

Answer: SELECT Title FROM book ORDER BY Issues ASC NULLS FIRST


Question:
Which product has been ordered most number of times?
Additional table information: table: customers_and_addresses

Answer: SELECT t2.product_details FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
Return the title and director of the movie released in the year 2000 or earlier that had the highest worldwide gross.
Additional table information: table: culture_company

Answer: SELECT title, director FROM movie WHERE YEAR <= 2000 ORDER BY gross_worldwide DESC LIMIT 1


Question:
Show the company name with the number of gas station.
Additional table information: table: gas_company

Answer: 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


Question:
What are the names of enzymes who does not produce 'Heme'?
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT name FROM enzyme WHERE product <> 'Heme'


Question:
Show ids, customer ids, names for all accounts.
Additional table information: table: customers_card_transactions

Answer: SELECT account_id, customer_id, account_name FROM Accounts


Question:
Give the ids for documents that have the budget description 'Government'.
Additional table information: table: cre_Docs_and_Epenses

Answer: SELECT T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_code = T2.Budget_Type_code WHERE T2.budget_type_Description = 'Government'


Question:
Show the names of customers having an order with shipping method FedEx and order status Paid.
Additional table information: table: customers_campaigns_ecommerce

Answer: SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE shipping_method_code = 'FedEx' AND order_status_code = 'Paid'


Question:
List the number of invoices from the US, grouped by state.
Additional table information: table: store_1

Answer: SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = 'USA' GROUP BY billing_state


Question:
What is the average age of students who are living in the dorm with the largest capacity?
Additional table information: table: dorm_1

Answer: SELECT AVG(T1.age) 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.student_capacity = (SELECT MAX(student_capacity) FROM dorm)


Question:
Who are the customers that had more than 1 policy? List the customer details and id.
Additional table information: table: insurance_policies

Answer: SELECT T1.customer_details, T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.Customer_id GROUP BY T1.customer_id HAVING COUNT(*) > 1


Question:
Who are the lieutenant governor and comptroller from the democratic party?
Additional table information: table: election

Answer: SELECT Lieutenant_Governor, Comptroller FROM party WHERE Party = 'Democratic'


Question:
Find the name of amenities of the dorm where the student with last name Smith is living in.
Additional table information: table: dorm_1

Answer: 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'


Question:
Show all origins and the number of flights from each origin.
Additional table information: table: flight_1

Answer: SELECT origin, COUNT(*) FROM Flight GROUP BY origin


Question:
Find the grade taught in classroom 103.
Additional table information: table: student_1

Answer: SELECT DISTINCT grade FROM list WHERE classroom = 103


Question:
How many male and female assistant professors do we have?
Additional table information: table: activity_1

Answer: SELECT sex, COUNT(*) FROM Faculty WHERE rank = 'AsstProf' GROUP BY sex


Question:
Show the faculty id of each faculty member, along with the number of students he or she advises.
Additional table information: table: activity_1

Answer: SELECT T1.FacID, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID


Question:
For each player, show the team and the location of school they belong to.
Additional table information: table: school_player

Answer: SELECT T1.Team, T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID


Question:
Who are the different directors of films which had market estimation in 1995?
Additional table information: table: film_rank

Answer: SELECT DISTINCT T1.Director FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID WHERE T2.Year = 1995


Question:
Return all the apartment numbers sorted by the room count in ascending order.
Additional table information: table: apartment_rentals

Answer: SELECT apt_number FROM Apartments ORDER BY room_count ASC NULLS FIRST


Question:
What are the different names of the colleges involved in the tryout in alphabetical order?
Additional table information: table: soccer_2

Answer: SELECT DISTINCT cName FROM tryout ORDER BY cName NULLS FIRST


Question:
What is the last name of the first individual contacted from the organization with the maximum UK Vat number across all organizations?
Additional table information: table: e_government

Answer: SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.uk_vat_number = (SELECT MAX(uk_vat_number) FROM organizations) ORDER BY t2.date_contact_to ASC NULLS FIRST LIMIT 1


Question:
Find the average age of female (sex is F) students who have secretary votes in the spring election cycle.
Additional table information: table: voter_2

Answer: SELECT AVG(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = SECRETARY_Vote WHERE T1.Sex = 'F' AND T2.Election_Cycle = 'Spring'


Question:
List the names of counties that do not have any cities.
Additional table information: table: county_public_safety

Answer: SELECT Name FROM county_public_safety WHERE NOT County_ID IN (SELECT County_ID FROM city)


Question:
Find the branch name of the bank that has the most number of customers.
Additional table information: table: loan_1

Answer: SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1


Question:
What are the different budget type codes, and how many documents are there for each?
Additional table information: table: cre_Docs_and_Epenses

Answer: SELECT budget_type_code, COUNT(*) FROM Documents_with_expenses GROUP BY budget_type_code


Question:
How many countries are there in total?
Additional table information: table: match_season

Answer: SELECT COUNT(*) FROM country


Question:
What is the sum of total pounds of purchase in year 2018 for all branches in London?
Additional table information: table: shop_membership

Answer: SELECT SUM(total_pounds) FROM purchase AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T2.city = 'London' AND T1.year = 2018


Question:
What are the ids and full names for employees who work in a department that has someone with a first name that contains the letter T?
Additional table information: table: hr_1

Answer: SELECT employee_id, first_name, last_name FROM employees WHERE department_id IN (SELECT department_id FROM employees WHERE first_name LIKE '%T%')


Question:
Display the first name and department name for each employee.
Additional table information: table: hr_1

Answer: SELECT T1.first_name, T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id


Question:
Find the names and average salaries of all departments whose average salary is greater than 42000.
Additional table information: table: college_2

Answer: SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name HAVING AVG(salary) > 42000


Question:
What is the total number of postseason games that team Boston Red Stockings participated in?
Additional table information: table: baseball_1

Answer: SELECT COUNT(*) FROM (SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' UNION SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings')


Question:
What is the origin and destination for all flights whose price is higher than 300?
Additional table information: table: flight_1

Answer: SELECT origin, destination FROM Flight WHERE price > 300


Question:
Return the names and typical buying prices for all products.
Additional table information: table: products_gen_characteristics

Answer: SELECT product_name, typical_buying_price FROM products


Question:
How many phones belongs to each accreditation type?
Additional table information: table: phone_1

Answer: SELECT Accreditation_type, COUNT(*) FROM phone GROUP BY Accreditation_type


Question:
List the age of all music artists.
Additional table information: table: music_4

Answer: SELECT Age FROM artist


Question:
How many games were played in park 'Columbia Park' in 1907?
Additional table information: table: baseball_1

Answer: SELECT COUNT(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 1907 AND T2.park_name = 'Columbia Park'


Question:
What is the name of the tallest building?
Additional table information: table: protein_institute

Answer: SELECT name FROM building ORDER BY height_feet DESC LIMIT 1


Question:
Tell me the ages of the oldest and youngest students studying major 600.
Additional table information: table: voter_2

Answer: SELECT MAX(Age), MIN(Age) FROM STUDENT WHERE Major = 600


Question:
Find the name and email of the user followed by the least number of people.
Additional table information: table: twitter_1

Answer: SELECT name, email FROM user_profiles ORDER BY followers NULLS FIRST LIMIT 1


Question:
Which countries have more than two members?
Additional table information: table: decoration_competition

Answer: SELECT Country FROM member GROUP BY Country HAVING COUNT(*) > 2


Question:
What are the name, height and prominence of mountains which do not belong to the range 'Aberdare Range'?
Additional table information: table: mountain_photos

Answer: SELECT name, height, prominence FROM mountain WHERE range <> 'Aberdare Range'


Question:
What is the receipt date of the document with id 3?
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT receipt_date FROM Documents WHERE document_id = 3


Question:
Report the total number of students for each fourth-grade classroom.
Additional table information: table: student_1

Answer: SELECT classroom, COUNT(*) FROM list WHERE grade = '4' GROUP BY classroom


Question:
Give the years and official names of the cities of each competition.
Additional table information: table: farm

Answer: SELECT T2.Year, T1.Official_Name FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID


Question:
Find the distinct first names of the students who have class senator votes.
Additional table information: table: voter_2

Answer: SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_Senator_VOTE


Question:
What are the names of the aircraft that the least people are certified to fly?
Additional table information: table: flight_1

Answer: 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


Question:
What is the number of ships?
Additional table information: table: ship_mission

Answer: SELECT COUNT(*) FROM ship


Question:
What are the name and typical buying and selling prices of the products that have color described as 'yellow'?
Additional table information: table: products_gen_characteristics

Answer: SELECT t1.product_name, t1.typical_buying_price, t1.typical_selling_price FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = 'yellow'


Question:
Find the pixels of the screen modes that are used by both phones with full accreditation types and phones with Provisional accreditation types.
Additional table information: table: phone_1

Answer: SELECT t1.pixels FROM screen_mode AS t1 JOIN phone AS t2 ON t1.Graphics_mode = t2.screen_mode WHERE t2.Accreditation_type = 'Provisional' INTERSECT SELECT t1.pixels FROM screen_mode AS t1 JOIN phone AS t2 ON t1.Graphics_mode = t2.screen_mode WHERE t2.Accreditation_type = 'Full'


Question:
Count the number of documents.
Additional table information: table: cre_Docs_and_Epenses

Answer: SELECT COUNT(*) FROM Documents


Question:
Show names for all employees who have certificate of Boeing 737-800.
Additional table information: table: flight_1

Answer: SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = 'Boeing 737-800'


Question:
Find the names and total checking and savings balances of accounts whose savings balance is higher than the average savings balance.
Additional table information: table: small_bank_1

Answer: SELECT T1.name, T2.balance + T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T3.balance > (SELECT AVG(balance) FROM savings)


Question:
Show the document name and the document date for all documents on project with details 'Graph Database project'.
Additional table information: table: cre_Docs_and_Epenses

Answer: SELECT document_name, document_date FROM Documents AS T1 JOIN projects AS T2 ON T1.project_id = T2.project_id WHERE T2.project_details = 'Graph Database project'


Question:
What are the names of the workshop groups that have bookings with status code 'stop'?
Additional table information: table: cre_Drama_Workshop_Groups

Answer: SELECT T2.Store_Name FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = 'stop'


Question:
What are the theme and year for all exhibitions that have a ticket price under 15?
Additional table information: table: theme_gallery

Answer: SELECT theme, YEAR FROM exhibition WHERE ticket_price < 15


Question:
find the highest support percentage, lowest consider rate and oppose rate of all candidates.
Additional table information: table: candidate_poll

Answer: SELECT MAX(support_rate), MIN(consider_rate), MIN(oppose_rate) FROM candidate


Question:
Which course authors teach two or more courses? Give me their addresses and author IDs.
Additional table information: table: e_learning

Answer: SELECT T1.address_line_1, T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id HAVING COUNT(*) >= 2


Question:
What are the full names of customers with the account name 900?
Additional table information: table: customers_and_invoices

Answer: SELECT T2.customer_first_name, T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.account_name = '900'


Question:
How many students exist?
Additional table information: table: dorm_1

Answer: SELECT COUNT(*) FROM student


Question:
Find the name of the club that has the most female students.
Additional table information: table: club_1

Answer: SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.sex = 'F' GROUP BY t1.clubname ORDER BY COUNT(*) DESC LIMIT 1


Question:
How many trips stated from  a station in Mountain View and ended at one in Palo Alto?
Additional table information: table: bike_1

Answer: SELECT COUNT(*) FROM station AS T1, trip AS T2, station AS T3 JOIN trip AS T4 ON T1.id = T2.start_station_id AND T2.id = T4.id AND T3.id = T4.end_station_id WHERE T1.city = 'Mountain View' AND T3.city = 'Palo Alto'


Question:
Which city does staff with first name as Janessa and last name as Sawayn live?
Additional table information: table: driving_school

Answer: SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = 'Janessa' AND T2.last_name = 'Sawayn'


Question:
Count the number of different last names actors have.
Additional table information: table: sakila_1

Answer: SELECT COUNT(DISTINCT last_name) FROM actor


Question:
List the distinct names of the instructors, ordered by name.
Additional table information: table: college_2

Answer: SELECT DISTINCT name FROM instructor ORDER BY name NULLS FIRST


Question:
What are the employee ids for employees who make more than the average?
Additional table information: table: hr_1

Answer: SELECT employee_id FROM employees WHERE salary > (SELECT AVG(salary) FROM employees)


Question:
Show the names of companies and of employees.
Additional table information: table: company_employee

Answer: SELECT T3.Name, T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID


Question:
What are the type and nationality of ships?
Additional table information: table: ship_mission

Answer: SELECT TYPE, Nationality FROM ship


Question:
What are the start and end dates for incidents with incident type code 'NOISE'?
Additional table information: table: behavior_monitoring

Answer: SELECT date_incident_start, date_incident_end FROM Behavior_Incident WHERE incident_type_code = 'NOISE'


Question:
Find the names of all artists that have 'a' in their names.
Additional table information: table: chinook_1

Answer: SELECT Name FROM ARTIST WHERE Name LIKE '%a%'


Question:
Find the ids of the employees who does not work in those departments where some employees works whose manager id within the range 100 and 200.
Additional table information: table: hr_1

Answer: SELECT * FROM employees WHERE NOT department_id IN (SELECT department_id FROM departments WHERE manager_id BETWEEN 100 AND 200)


Question:
Return the name of the artist who has the latest join year.
Additional table information: table: theme_gallery

Answer: SELECT name FROM artist ORDER BY year_join DESC LIMIT 1


Question:
What are the names of the artists who released a song that has the word love in its title, and where are the artists from?
Additional table information: table: music_1

Answer: SELECT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.song_name LIKE '%love%'


Question:
For each user, find their name and the number of reviews written by them.
Additional table information: table: epinions_1

Answer: SELECT T1.name, COUNT(*) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id


Question:
What are the state and country of all the cities that have post codes starting with 4.\
Additional table information: table: customers_and_addresses

Answer: SELECT state_province_county, country FROM addresses WHERE zip_postcode LIKE '4%'


Question:
Show the ids of the investors who have at least two transactions.
Additional table information: table: tracking_share_transactions

Answer: SELECT T2.investor_id FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id HAVING COUNT(*) >= 2


Question:
List the hosts of performances in ascending order of attendance.
Additional table information: table: performance_attendance

Answer: SELECT HOST FROM performance ORDER BY Attendance ASC NULLS FIRST


Question:
Which committees have delegates from the Democratic party?
Additional table information: table: election

Answer: SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = 'Democratic'


Question:
Return the average, minimum, maximum, and total transaction amounts.
Additional table information: table: customers_and_invoices

Answer: SELECT AVG(transaction_amount), MIN(transaction_amount), MAX(transaction_amount), SUM(transaction_amount) FROM Financial_transactions


Question:
How many entrepreneurs are there?
Additional table information: table: entrepreneur

Answer: SELECT COUNT(*) FROM entrepreneur


Question:
For each year, return the year and the number of times the team Boston Red Stockings won in the postseasons.
Additional table information: table: baseball_1

Answer: SELECT COUNT(*), T1.year FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' GROUP BY T1.year


Question:
How many accounts does the customer with first name Art and last name Turcotte have?
Additional table information: table: customers_card_transactions

Answer: 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'


Question:
Show the name, role code, and date of birth for the employee with name 'Armani'.
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT employee_name, role_code, date_of_birth FROM Employees WHERE employee_Name = 'Armani'


Question:
What are the names of students who have taken Statistics courses?
Additional table information: table: college_2

Answer: SELECT T3.name FROM course AS T1 JOIN takes AS T2 ON T1.course_id = T2.course_id JOIN student AS T3 ON T2.id = T3.id WHERE T1.dept_name = 'Statistics'


Question:
How many students received a yes from tryouts?
Additional table information: table: soccer_2

Answer: SELECT COUNT(*) FROM tryout WHERE decision = 'yes'


Question:
list the card number of all members whose hometown address includes word 'Kentucky'.
Additional table information: table: shop_membership

Answer: SELECT card_number FROM member WHERE Hometown LIKE '%Kentucky%'


Question:
What are the first and last names of people who payed more than the rooms' base prices?
Additional table information: table: inn_1

Answer: SELECT T1.firstname, T1.lastname FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T1.Rate - T2.basePrice > 0


Question:
List the status shared by more than two roller coaster.
Additional table information: table: roller_coaster

Answer: SELECT Status FROM roller_coaster GROUP BY Status HAVING COUNT(*) > 2


Question:
What is the id of the bike that traveled the most in 94002?
Additional table information: table: bike_1

Answer: SELECT bike_id FROM trip WHERE zip_code = 94002 GROUP BY bike_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
What are the name of the players who received a card in descending order of the hours of training?
Additional table information: table: soccer_2

Answer: SELECT pName FROM Player WHERE yCard = 'yes' ORDER BY HS DESC


Question:
How many customers did not have any event?
Additional table information: table: local_govt_and_lot

Answer: SELECT COUNT(*) FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM customer_events)


Question:
Show different publishers together with the number of publications they have.
Additional table information: table: book_2

Answer: SELECT Publisher, COUNT(*) FROM publication GROUP BY Publisher


Question:
What is department name and office for the professor whose last name is Heffington?
Additional table information: table: college_1

Answer: SELECT T3.dept_name, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T1.emp_lname = 'Heffington'


Question:
What is the maximum number that a certain service is provided? List the service id, details and number.
Additional table information: table: local_govt_and_lot

Answer: SELECT T1.service_id, T1.service_details, COUNT(*) FROM Services AS T1 JOIN Residents_Services AS T2 ON T1.service_id = T2.service_id GROUP BY T1.service_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
When was the order placed whose shipment tracking number is 3452? Give me the date.
Additional table information: table: tracking_orders

Answer: SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.shipment_tracking_number = 3452


Question:
Please give me a list of cities whose regional population is over 10000000.
Additional table information: table: city_record

Answer: SELECT city FROM city WHERE regional_population > 10000000


Question:
Which catalog contents have length below 3 or above 5? Find the catalog entry names.
Additional table information: table: product_catalog

Answer: SELECT catalog_entry_name FROM catalog_contents WHERE LENGTH < 3 OR width > 5


Question:
List the names and buildings of all departments sorted by the budget from large to small.
Additional table information: table: college_2

Answer: SELECT dept_name, building FROM department ORDER BY budget DESC


Question:
Find the building that has the largest number of faculty members.
Additional table information: table: activity_1

Answer: SELECT building FROM Faculty GROUP BY building ORDER BY COUNT(*) DESC LIMIT 1


Question:
What are the names of all airports in Cuba or Argentina?
Additional table information: table: flight_4

Answer: SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina'


Question:
What are the first names and ids for customers who have two or more accounts?
Additional table information: table: customers_and_invoices

Answer: SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 2


Question:
What are the names of students and their respective departments, ordered by number of credits from least to greatest?
Additional table information: table: college_2

Answer: SELECT name, dept_name FROM student ORDER BY tot_cred NULLS FIRST


Question:
what is the full name and id of the college with the largest number of baseball players?
Additional table information: table: baseball_1

Answer: SELECT T1.name_full, T1.college_id FROM college AS T1 JOIN player_college AS T2 ON T1.college_id = T2.college_id GROUP BY T1.college_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show the rank, first name, and last name for all the faculty.
Additional table information: table: activity_1

Answer: SELECT rank, Fname, Lname FROM Faculty


Question:
What are the numbers of wines for different grapes?
Additional table information: table: wine_1

Answer: SELECT COUNT(*), Grape FROM WINE GROUP BY Grape


Question:
What are the names and players of all the clubs?
Additional table information: table: sports_competition

Answer: SELECT T1.name, T2.Player_id FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID


Question:
How many professors who has a either Ph.D. or MA degree?
Additional table information: table: college_1

Answer: SELECT COUNT(*) FROM professor WHERE prof_high_degree = 'Ph.D.' OR prof_high_degree = 'MA'


Question:
What is the name of the project with the most hours?
Additional table information: table: scientist_1

Answer: SELECT name FROM projects ORDER BY hours DESC LIMIT 1


Question:
Find out the top 10 customers by total number of orders. List customers' first and last name and the number of total orders.
Additional table information: table: store_1

Answer: SELECT T1.first_name, T1.last_name, COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 10


Question:
For each grade 0 classroom, report the total number of students.
Additional table information: table: student_1

Answer: SELECT classroom, COUNT(*) FROM list WHERE grade = '0' GROUP BY classroom


Question:
What are the names of all the songs whose album is under the label of 'Universal Music Group'?
Additional table information: table: music_2

Answer: SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE t1.label = 'Universal Music Group'


Question:
Which authors have written a paper with title containing the word 'Monadic'? Return their last names.
Additional table information: table: icfp_1

Answer: SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title LIKE '%Monadic%'


Question:
Find the captain rank that has some captains in both Cutter and Armed schooner classes.
Additional table information: table: ship_1

Answer: SELECT rank FROM captain WHERE CLASS = 'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS = 'Armed schooner'


Question:
What are the denominations used by both schools founded before 1890 and schools founded  after 1900?
Additional table information: table: school_player

Answer: SELECT Denomination FROM school WHERE Founded < 1890 INTERSECT SELECT Denomination FROM school WHERE Founded > 1900


Question:
Show the name and country for all people whose age is smaller than the average.
Additional table information: table: wedding

Answer: SELECT name, country FROM people WHERE age < (SELECT AVG(age) FROM people)


Question:
Show the product type and name for the products with price higher than 1000 or lower than 500.
Additional table information: table: customers_and_products_contacts

Answer: SELECT product_type_code, product_name FROM products WHERE product_price > 1000 OR product_price < 500


Question:
What is the first name and last name employee helps the customer with first name Leonie?
Additional table information: table: chinook_1

Answer: SELECT T2.FirstName, T2.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId WHERE T1.FirstName = 'Leonie'


Question:
Show the medicine names and trade names that cannot interact with the enzyme with product 'Heme'.
Additional table information: table: medicine_enzyme_interaction

Answer: SELECT name, trade_name FROM medicine EXCEPT SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id JOIN enzyme AS T3 ON T3.id = T2.enzyme_id WHERE T3.product = 'Protoporphyrinogen IX'


Question:
How many degrees were conferred at San Jose State University in 2000?
Additional table information: table: csu_1

Answer: SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = 'San Jose State University' AND t2.year = 2000


Question:
What are all the calendar dates and day Numbers?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT calendar_date, day_Number FROM Ref_calendar


Question:
Give the name of the wine with the highest score.
Additional table information: table: wine_1

Answer: SELECT Name FROM WINE ORDER BY Score NULLS FIRST LIMIT 1


Question:
Find the names of the buildings in 'on-hold' status, and sort them in ascending order of building stories.
Additional table information: table: company_office

Answer: SELECT name FROM buildings WHERE Status = 'on-hold' ORDER BY Stories ASC NULLS FIRST


Question:
What is the maximum total amount paid by a customer? List the customer id and amount.
Additional table information: table: products_for_hire

Answer: SELECT customer_id, SUM(amount_paid) FROM Payments GROUP BY customer_id ORDER BY SUM(amount_paid) DESC LIMIT 1


Question:
Find the name of branches where have some members whose hometown is in Louisville, Kentucky and some in Hiram, Georgia.
Additional table information: table: shop_membership

Answer: 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'


Question:
How many different positions of players are there?
Additional table information: table: school_player

Answer: SELECT COUNT(DISTINCT POSITION) FROM player


Question:
What are the first names of all the students?
Additional table information: table: club_1

Answer: SELECT DISTINCT fname FROM student


Question:
Find the description and credit for the course QM-261?
Additional table information: table: college_1

Answer: SELECT crs_credit, crs_description FROM course WHERE crs_code = 'QM-261'


Question:
Which students in third grade are not taught by teacher COVIN JEROME? Give me the last names of the students.
Additional table information: table: student_1

Answer: SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 3 AND T2.firstname <> 'COVIN' AND T2.lastname <> 'JEROME'


Question:
What is the id and salary of the employee named Mark Young?
Additional table information: table: flight_1

Answer: SELECT eid, salary FROM Employee WHERE name = 'Mark Young'


Question:
What is the joined year of the pilot of the highest rank?
Additional table information: table: pilot_record

Answer: SELECT Join_Year FROM pilot ORDER BY Rank ASC NULLS FIRST LIMIT 1


Question:
What is the id of the most recent order?
Additional table information: table: tracking_orders

Answer: SELECT order_id FROM orders ORDER BY date_order_placed DESC LIMIT 1


Question:
List name of all amenities which Anonymous Donor Hall has, and sort the results in alphabetic order.
Additional table information: table: dorm_1

Answer: 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 NULLS FIRST


Question:
What is the name of the customer who has the largest number of orders?
Additional table information: table: tracking_orders

Answer: SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
display the department id and the total salary for those departments which contains at least two employees.
Additional table information: table: hr_1

Answer: SELECT department_id, SUM(salary) FROM employees GROUP BY department_id HAVING COUNT(*) >= 2


Question:
What document type codes do we have?
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT document_type_code FROM Ref_Document_Types


Question:
How many team franchises are active, with active value 'Y'?
Additional table information: table: baseball_1

Answer: SELECT COUNT(*) FROM team_franchise WHERE active = 'Y'


Question:
Which programs are never broadcasted in the morning? Give me the names of the programs.
Additional table information: table: program_share

Answer: 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'


Question:
How many drivers are there?
Additional table information: table: school_bus

Answer: SELECT COUNT(*) FROM driver


Question:
What is the maximum fastest lap speed in race named 'Monaco Grand Prix' in 2008 ?
Additional table information: table: formula_1

Answer: SELECT MAX(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = 'Monaco Grand Prix'


Question:
What are the name, role code, and date of birth of the employee named 'Armani'?
Additional table information: table: cre_Doc_Tracking_DB

Answer: SELECT employee_name, role_code, date_of_birth FROM Employees WHERE employee_Name = 'Armani'


Question:
List the names of all distinct wines that have scores higher than 90.
Additional table information: table: wine_1

Answer: SELECT Name FROM WINE WHERE score > 90


Question:
What are the names, ages, and jobs of all people who are friends with Alice for the longest amount of time?
Additional table information: table: network_2

Answer: SELECT T1.name, T1.age, T1.job FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' AND T2.year = (SELECT MAX(YEAR) FROM PersonFriend WHERE friend = 'Alice')


Question:
Give me a list of all the last names of authors sorted in alphabetical order
Additional table information: table: icfp_1

Answer: SELECT lname FROM authors ORDER BY lname NULLS FIRST