question
stringlengths
43
589
query
stringlengths
19
598
What is the minimum, maximum, and average seating for all tracks.? Schema: - track(Location, Name, Seat, Seating, T1, Year_Opened)
SELECT MIN(Seating) AS min_seating, MAX(Seating) AS max_seating, AVG(Seating) AS avg_seating FROM track;
syntactic parsing papers not written by chris dyer? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...) - author(...)
SELECT DISTINCT T1.authorName, T3.paperId FROM paperKeyphrase AS T2 JOIN keyphrase AS T5 ON T2.keyphraseId = T5.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId JOIN writes AS T4 ON T4.paperId = T3.paperId JOIN author AS T1 ON T4.authorId = T1.authorId WHERE T1.authorName != 'chris dyer' AND T5.keyphraseName = 'syntactic parsing';
Find the state and country of all cities with post code starting with 4.? Schema: - Addresses(address_content, city, country, line_1, line_1_number_building, line_2, state_province_county, town_city, zip_postcode)
SELECT state_province_county, country FROM Addresses WHERE zip_postcode LIKE '4%';
List the school color of the school that has the largest enrollment.? Schema: - school(Denom, Denomination, EX, Enrollment, Founded, Location, School_Colors, T1, Type)
SELECT School_Colors FROM school ORDER BY Enrollment DESC NULLS LAST LIMIT 1;
rivers in illinois? Schema: - river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse)
SELECT river_name FROM river WHERE traverse = 'illinois';
Find the name of the user who has the largest number of followers.? Schema: - user_profiles(email, followers, name, partitionid)
SELECT name FROM user_profiles ORDER BY followers DESC NULLS LAST LIMIT 1;
What is the name of the technician whose team is not 'NYY'? Schema: - technician(Age, COUNT, JO, Start, Starting_Year, T1, Team, name)
SELECT name FROM technician WHERE Team != 'NYY';
what is the shortest river in the united states? Schema: - river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse)
SELECT river_name FROM river WHERE LENGTH = (SELECT MIN(LENGTH) FROM river);
What are the names of the schools with the top 3 largest class sizes? Schema: - College(M, cName, enr, state)
SELECT cName FROM College ORDER BY enr DESC NULLS LAST LIMIT 3;
papers on Parsing appeared at acl last year? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - venue(venueId, venueName)
SELECT DISTINCT T3.paperId FROM paperKeyphrase AS T2 JOIN keyphrase AS T1 ON T2.keyphraseId = T1.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId JOIN venue AS T4 ON T4.venueId = T3.venueId WHERE T1.keyphraseName = 'Parsing' AND T3."year" = 2012 AND T4.venueName = 'acl';
List the document ids of documents with the status done and type Paper, which not shipped by the shipping agent named USPS.? Schema: - Documents(COUNT, Document_Description, Document_ID, Document_Name, Document_Type_Code, I, K, Project_ID, Robb, Template_ID, access_count, document_id, ... (7 more)) - Ref_Shipping_Agents(shipping_agent_code, shipping_agent_name)
SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON CAST(Documents.shipping_agent_code AS TEXT) = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = 'USPS';
List the first and last name of all players who are left / L hand in the order of birth date.? Schema: - players(COUNT, birth_date, country_code, first_name, hand, last_name)
SELECT first_name, last_name FROM players WHERE hand = 'L' ORDER BY birth_date ASC NULLS LAST;
Find the first and last name of students who are not in the largest major.? Schema: - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT Fname, LName FROM Student WHERE Major != (SELECT Major FROM Student WHERE Major IS NOT NULL GROUP BY Major ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1);
Find the number of scientists who are not assigned to any project.? Schema: - Scientists(Name) - AssignedTo(Scientist)
SELECT COUNT(*) AS num_scientists FROM Scientists WHERE SSN NOT IN (SELECT Scientist FROM AssignedTo);
Which advisor has most number of students? Schema: - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT Advisor FROM Student WHERE Advisor IS NOT NULL GROUP BY Advisor ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Find the physician who was trained in the most expensive procedure? Schema: - Physician(I, Name) - Trained_In(...) - Procedures(Cost, Name)
SELECT T1.Name FROM Physician AS T1 JOIN Trained_In AS T2 ON T1.EmployeeID = T2.Physician JOIN Procedures AS T3 ON T3.Code = T2.Treatment ORDER BY T3.Cost DESC NULLS LAST LIMIT 1;
For each submission, find its author and acceptance result.? Schema: - Acceptance(...) - submission(Author, COUNT, College, Scores)
SELECT T2.Author, T1."Result" FROM Acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID;
What are the distinct address type codes for all customer addresses? Schema: - Customer_Addresses(address_type_code)
SELECT DISTINCT address_type_code FROM Customer_Addresses;
Which customer have the most policies? Give me the customer details.? Schema: - Policies(COUNT, Policy_Type_Code) - Customers(BIGINT, COUNT, Customer_Details, Customer_ID, Customer_name, Mar, Rat, TRY_CAST, V, address_line_1, address_line_2, amount_outstanding, ... (25 more))
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 NULLS LAST LIMIT 1;
Find the average and oldest age for students with different sex.? Schema: - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT AVG(Age) AS avg_age, MAX(Age) AS oldest_age, Sex FROM Student GROUP BY Sex;
What are the apartment number and the room count of each apartment? Schema: - Apartments(AVG, COUNT, INT, SUM, TRY_CAST, apt_number, apt_type_code, bathroom_count, bedroom_count, room_count)
SELECT apt_number, room_count FROM Apartments;
What are the first names of customers who have not rented any films after '2005-08-23 02:06:01'? Schema: - customer(COUNT, T1, acc_bal, acc_type, active, check, credit_score, cust_name, no_of_loans, sav, state, store_id) - rental(...)
SELECT first_name FROM customer WHERE customer_id NOT IN(SELECT customer_id FROM rental WHERE rental_date > '2005-08-23 02:06:01');
Find all movies about nuclear weapons? Schema: - tags(...) - keyword(keyword) - movie(Budget_million, Director, Find, Gross_worldwide, T1, Title, Year, budget, release_year, title)
SELECT T3.title FROM tags AS T2 JOIN keyword AS T1 ON T2.kid = T1.id JOIN movie AS T3 ON T2.msid = T3.mid WHERE T1.keyword = 'nuclear weapons';
What country is Jetblue Airways affiliated with? Schema: - airlines(Abbreviation, Airline, COUNT, Country, active, country, name)
SELECT Country FROM airlines WHERE Airline = 'JetBlue Airways';
What are the other account details for the account with the name 338? Schema: - Accounts(Account_Details, Account_ID, Statement_ID, account_id, account_name, customer_id, date_account_opened, other_account_details)
SELECT other_account_details FROM Accounts WHERE account_name = '338';
what state has highest elevation? Schema: - highlow(M, highest_elevation, highest_point, lowest_elevation, lowest_point, state_name)
SELECT state_name FROM highlow WHERE highest_elevation = (SELECT MAX(highest_elevation) FROM highlow);
most cited papers on parsing? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - cite(...)
SELECT DISTINCT T4.citedPaperId, COUNT(T4.citedPaperId) AS num_cited_papers FROM paperKeyphrase AS T2 JOIN keyphrase AS T1 ON T2.keyphraseId = T1.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId JOIN cite AS T4 ON T3.paperId = T4.citedPaperId WHERE T1.keyphraseName = 'parsing' GROUP BY T4.citedPaperId ORDER BY num_cited_papers DESC NULLS LAST;
what is the population of boulder? Schema: - city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more))
SELECT population FROM city WHERE city_name = 'boulder';
which countries did participated in both Friendly and Tournament type competitions.? Schema: - competition(COUNT, Competition_type, Country, T1, Year)
SELECT DISTINCT T1.Country FROM competition AS T1 JOIN competition AS T2 ON T1.Country = T2.Country WHERE T1.Competition_type = 'Friendly' AND T2.Competition_type = 'Tournament';
Show the game name that has most number of hours played.? Schema: - Plays_Games(GameID, Hours_Played, StuID) - Video_Games(COUNT, Dest, GName, GType, onl)
SELECT GName FROM Plays_Games AS T1 JOIN Video_Games AS T2 ON T1.GameID = T2.GameID GROUP BY T1.GameID, GName ORDER BY SUM(Hours_Played) DESC NULLS LAST LIMIT 1;
Show different ways to get to attractions and the number of attractions that can be accessed in the corresponding way.? Schema: - Tourist_Attractions(Al, COUNT, How_to_Get_There, Name, Opening_Hours, Rosal, T1, T3, Tour, Tourist_Attraction_ID, Tourist_Details, Tourist_ID, ... (2 more))
SELECT How_to_Get_There, COUNT(*) AS num_attractions FROM Tourist_Attractions GROUP BY How_to_Get_There;
How many actors were born in " Los Angeles " after 2000 ? Schema: - actor(Afghan, Aust, COUNT, Character, Chr, Duration, Kev, Name, age, birth_city, birth_year, first_name, ... (4 more))
SELECT COUNT(DISTINCT name) AS num_actors FROM actor WHERE birth_city = 'Los Angeles' AND birth_year > 2000;
What are the names of all instructors in the Comp. Sci. department? Schema: - instructor(AVG, M, So, Stat, dept_name, name, salary)
SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.';
Papers by sharon goldwater? Schema: - writes(...) - author(...)
SELECT DISTINCT T2.paperId FROM writes AS T2 JOIN author AS T1 ON T2.authorId = T1.authorId WHERE T1.authorName = 'sharon goldwater';
how many buttercup kitchen are there in san francisco ? Schema: - restaurant(...) - location(...)
SELECT COUNT(*) AS num_buttercup_kitchens FROM restaurant AS T1 JOIN location AS T2 ON T1.id = T2.restaurant_id WHERE T2.city_name = 'san francisco' AND T1.name = 'buttercup kitchen';
Show the parties that have both representatives in New York state and representatives in Pennsylvania state.? Schema: - representative(JO, Lifespan, Name, Party, State, T1)
SELECT DISTINCT T1.Party FROM (SELECT Party FROM representative WHERE State = 'New York') AS T1 JOIN (SELECT Party FROM representative WHERE State = 'Pennsylvania') AS T2 ON T1.Party = T2.Party;
return me the paper in PVLDB with more than 200 citations .? Schema: - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year) - journal(Theme, homepage, name)
SELECT T2.title FROM publication AS T2 JOIN journal AS T1 ON T2.jid = T1.jid WHERE T1.name = 'PVLDB' AND T2.citation_num > 200;
List all the scientists' names, their projects' names, and the hours worked by that scientist on each project, in alphabetical order of project name, and then scientist name.? Schema: - Scientists(Name) - AssignedTo(Scientist) - Projects(COUNT, Hours, Name, Project_Details, Project_ID, organ, organisation_id, project_details)
SELECT T1.Name, T3.Name, T3.Hours FROM Scientists AS T1 JOIN AssignedTo AS T2 ON T1.SSN = T2.Scientist JOIN Projects AS T3 ON T2.Project = T3.Code ORDER BY T3.Name, T1.Name ASC NULLS LAST;
Count the number of documents with expenses.? Schema: - Documents_with_Expenses(Budget_Type_Code, COUNT, Document_ID)
SELECT COUNT(*) AS num_documents FROM Documents_with_Expenses;
Show the names of clubs that have players with position "Right Wing".? Schema: - club(Region, Start_year, name) - player(Age, COUNT, Gender, Occupation, Player, Player_name, Po, Points, Position, Residence, Sponsor_name, T1, ... (12 more))
SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T2."Position" = 'Right Wing';
What is the maximum and minimum resolution of all songs that are approximately 3 minutes long? Schema: - files(COUNT, duration, f_id, formats) - song(COUNT, M, art, artist_name, engl, f_id, genre_is, languages, rat, rating, releasedate, resolution, ... (1 more))
SELECT MAX(T2.resolution) AS max_resolution, MIN(T2.resolution) AS min_resolution FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE '3:%';
Count the number of members in club "Bootup Baltimore" whose age is below 18.? Schema: - Club(ClubDesc, ClubLocation, ClubName, Enterpr, Gam, Hopk, Tenn) - Member_of_club(...) - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT COUNT(*) AS num_members FROM Club AS T1 JOIN Member_of_club AS T2 ON T1.ClubID = T2.ClubID JOIN Student AS T3 ON T2.StuID = T3.StuID WHERE T1.ClubName = 'Bootup Baltimore' AND T3.Age < 18;
What are the companies and investors that correspond to each entrepreneur? Schema: - entrepreneur(COUNT, Company, Investor, Money_Requested)
SELECT Company, Investor FROM entrepreneur;
Which cities served as a host city after 2010? Schema: - city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) - hosting_city(Host_City, Year)
SELECT T1.City FROM city AS T1 JOIN hosting_city AS T2 ON T1.City_ID = T2.Host_City WHERE T2."Year" > 2010;
What are the ids and names of all countries that either have more than 3 car makers or produce fiat model ? Schema: - countries(...) - car_makers(...) - model_list(Maker, Model)
SELECT DISTINCT CountryId, CountryName FROM (SELECT T1.CountryId, T1.CountryName FROM countries AS T1 JOIN car_makers AS T2 ON T1.CountryId = T2.CountryId GROUP BY T1.CountryId, T1.CountryName HAVING COUNT(*) > 3 UNION ALL SELECT T1.CountryId, T1.CountryName FROM countries AS T1 JOIN car_makers AS T2 ON T1.CountryId = T2.CountryId JOIN model_list AS T3 ON T2.Id = T3.Maker WHERE T3.Model = 'fiat');
Show ids for all employees who don't have a certificate.? Schema: - employee(Address, Age, Bdate, City, Fname, Lname, Name, Salary, Sex, eid, name, salary) - certificate(eid)
SELECT eid FROM employee WHERE eid NOT IN (SELECT eid FROM certificate);
Show all student IDs who have at least two allergies.? Schema: - Has_Allergy(Allergy, COUNT, StuID)
SELECT StuID FROM Has_Allergy WHERE StuID IS NOT NULL GROUP BY StuID HAVING COUNT(*) >= 2;
what is the capital of the state with the highest elevation? Schema: - highlow(M, highest_elevation, highest_point, lowest_elevation, lowest_point, state_name) - state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom)
SELECT T1.capital FROM highlow AS T2 JOIN state AS T1 ON T1.state_name = T2.state_name WHERE T2.highest_elevation = (SELECT MAX(highest_elevation) FROM highlow);
What is the last name of the student who got a grade A in the class with code 10018.? Schema: - STUDENT(DEPT_CODE, STU_DOB, STU_FNAME, STU_GPA, STU_HRS, STU_LNAME, STU_PHONE) - ENROLL(...)
SELECT T1.STU_LNAME FROM STUDENT AS T1 JOIN ENROLL AS T2 ON T1.STU_NUM = T2.STU_NUM WHERE T2.ENROLL_GRADE = 'A' AND T2.CLASS_CODE = '10018';
What are the names of rooms that have either king or queen bed? Schema: - Rooms(K, RoomId, basePrice, bedType, beds, decor, maxOccupancy, roomName)
SELECT roomName FROM Rooms WHERE bedType = 'King' OR bedType = 'Queen';
Show the stadium name and capacity with most number of concerts in year 2014 or after.? Schema: - concert(COUNT, Year) - stadium(Average, Average_Attendance, Capacity, Capacity_Percentage, City, Country, Home_Games, Location, Name, Opening_year, T1)
SELECT T2.Name, T2.Capacity FROM concert AS T1 JOIN stadium AS T2 ON T1.Stadium_ID = T2.Stadium_ID WHERE T1."Year" >= 2014 GROUP BY T2.Stadium_ID, T2.Name, T2.Capacity ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Return the average, minimum, maximum, and total transaction amounts.? Schema: - Financial_Transactions(COUNT, F, SUM, account_id, invoice_number, transaction_amount, transaction_id, transaction_type)
SELECT AVG(transaction_amount) AS avg_transaction_amount, MIN(transaction_amount) AS min_transaction_amount, MAX(transaction_amount) AS max_transaction_amount, SUM(transaction_amount) AS total_transaction_amount FROM Financial_Transactions;
What are the students ids of students who have more than one allergy? Schema: - Has_Allergy(Allergy, COUNT, StuID)
SELECT StuID FROM Has_Allergy WHERE StuID IS NOT NULL GROUP BY StuID HAVING COUNT(*) >= 2;
show me papers by sharon goldwater .? Schema: - writes(...) - author(...)
SELECT DISTINCT T2.paperId FROM writes AS T2 JOIN author AS T1 ON T2.authorId = T1.authorId WHERE T1.authorName = 'sharon goldwater';
find the names of people who are taller than 200 or lower than 190.? Schema: - people(Age, Birth_Date, Birth_Place, COUNT, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more))
SELECT Name FROM people WHERE Height > 200 OR Height < 190;
List the names of employees and sort in ascending order of age.? Schema: - employee(Address, Age, Bdate, City, Fname, Lname, Name, Salary, Sex, eid, name, salary)
SELECT Name FROM employee ORDER BY Age ASC NULLS LAST;
What is the average GPA of students taking ACCT-211? Schema: - ENROLL(...) - STUDENT(DEPT_CODE, STU_DOB, STU_FNAME, STU_GPA, STU_HRS, STU_LNAME, STU_PHONE) - CLASS(CLASS_CODE, CLASS_ROOM, CLASS_SECTION, CRS_CODE, PROF_NUM)
SELECT AVG(T2.STU_GPA) AS avg_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';
What are the different region names, ordered by labels? Schema: - region(Label, Region_code, Region_name)
SELECT Region_name FROM region WHERE Region_name IS NOT NULL AND Label IS NOT NULL GROUP BY Region_name, Label ORDER BY Label ASC NULLS LAST;
What is the name of tracks whose genre is Rock? Schema: - genres(name) - tracks(composer, milliseconds, name, unit_price)
SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = 'Rock';
Which employee has showed up in most circulation history documents. List the employee's name and the number of drafts and copies.? Schema: - Employees(COUNT, Date_of_Birth, Employee_ID, Employee_Name, Role_Code, employee_id, employee_name, role_code) - Circulation_History(copy_number, document_id, draft_number, employee_id)
SELECT Employees.employee_name, COUNT(*) AS num_drafts_copies FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id GROUP BY Circulation_History.document_id, Circulation_History.draft_number, Circulation_History.copy_number, Employees.employee_name ORDER BY num_drafts_copies DESC NULLS LAST LIMIT 1;
How many customers do not have an account? Schema: - Customers(BIGINT, COUNT, Customer_Details, Customer_ID, Customer_name, Mar, Rat, TRY_CAST, V, address_line_1, address_line_2, amount_outstanding, ... (25 more)) - Accounts(Account_Details, Account_ID, Statement_ID, account_id, account_name, customer_id, date_account_opened, other_account_details)
SELECT COUNT(*) AS num_customers FROM Customers WHERE customer_id NOT IN (SELECT customer_id FROM Accounts);
For each project id, how many staff does it have? List them in increasing order.? Schema: - Project_Staff(COUNT, date_from, date_to, role_code) - Projects(COUNT, Hours, Name, Project_Details, Project_ID, organ, organisation_id, project_details)
SELECT T1.project_id, COUNT(*) AS num_staff FROM Project_Staff AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY num_staff ASC NULLS LAST;
What is the name of the department in the Building Mergenthaler? Schema: - Department(Building, COUNT, DNO, DName, DPhone, DepartmentID, Division, FacID, Head, LName, Room, T2)
SELECT DName FROM Department WHERE Building = 'Mergenthaler';
Fetch me the most cited publications for Artificial Intelligence? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - cite(...)
SELECT DISTINCT T4.citedPaperId, COUNT(T4.citingPaperId) AS num_citations FROM paperKeyphrase AS T2 JOIN keyphrase AS T1 ON T2.keyphraseId = T1.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId JOIN cite AS T4 ON T3.paperId = T4.citedPaperId WHERE T1.keyphraseName = 'Artificial Intelligence' GROUP BY T4.citedPaperId ORDER BY num_citations DESC NULLS LAST;
Find the total savings balance of all accounts except the account with name ‘Brown’.? Schema: - ACCOUNTS(name) - SAVINGS(SAV, balance)
SELECT SUM(T2.balance) AS total_savings_balance FROM ACCOUNTS AS T1 JOIN SAVINGS AS T2 ON T1.custid = T2.custid WHERE T1.name != 'Brown';
List the names of all the physicians who prescribe Thesisin as medication.? Schema: - Physician(I, Name) - Prescribes(...) - Medication(Name)
SELECT DISTINCT T1.Name FROM Physician AS T1 JOIN Prescribes AS T2 ON T1.EmployeeID = T2.Physician JOIN Medication AS T3 ON T3.Code = T2.Medication WHERE T3.Name = 'Thesisin';
Return the founder of Sony.? Schema: - Manufacturers(Aust, Beij, Founder, Headquarter, I, M, Name, Revenue)
SELECT Founder FROM Manufacturers WHERE Name = 'Sony';
Please show each industry and the corresponding number of companies in that industry.? Schema: - Companies(Assets_billion, Bank, COUNT, Ch, Headquarters, Industry, Market_Value_billion, Profits_billion, Sales_billion, T1, name)
SELECT Industry, COUNT(*) AS num_companies FROM Companies GROUP BY Industry;
Show ids for all aircrafts with more than 1000 distance.? Schema: - aircraft(Description, aid, d, distance, name)
SELECT aid FROM aircraft WHERE distance > 1000;
How many members are not living in Hartford? Schema: - member_(Address, Age, COUNT, Card_Number, Country, Hometown, Level, Member_ID, Member_Name, Membership_card, Name, Party_ID, ... (1 more))
SELECT COUNT(*) AS num_members FROM member_ WHERE Address != 'Hartford';
Which language is spoken by the largest number of countries? Schema: - countrylanguage(COUNT, CountryCode, Engl, Language)
SELECT "Language" FROM countrylanguage GROUP BY "Language" ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
What are the grapes, appelations, and wines with scores above 93, sorted by Name? Schema: - wine(Appelation, Cases, Grape, M, Name, Price, Score, Winery, Year, Z, w)
SELECT Grape, Appelation, Name FROM wine WHERE Score > 93 ORDER BY Name ASC NULLS LAST;
How long does student Linda Smith spend on the restaurant in total? Schema: - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age) - Visits_Restaurant(ResID, StuID)
SELECT SUM(Spent) AS total_spent FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID WHERE Student.Fname = 'Linda' AND Student.LName = 'Smith';
What is the first name of each student enrolled in class ACCT-211? Schema: - CLASS(CLASS_CODE, CLASS_ROOM, CLASS_SECTION, CRS_CODE, PROF_NUM) - ENROLL(...) - STUDENT(DEPT_CODE, STU_DOB, STU_FNAME, STU_GPA, STU_HRS, STU_LNAME, STU_PHONE)
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';
What is the last name of the artist who sang the most songs? Schema: - Performance(...) - Band(...) - Songs(Title)
SELECT T2.Lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.Bandmate = T2.Id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE Lastname IS NOT NULL GROUP BY Lastname ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
What are the names of all instructors with a higher salary than any of the instructors in the Biology department? Schema: - instructor(AVG, M, So, Stat, dept_name, name, salary)
SELECT name FROM instructor WHERE salary > (SELECT MAX(salary) FROM instructor WHERE dept_name = 'Biology');
how high is guadalupe peak? Schema: - highlow(M, highest_elevation, highest_point, lowest_elevation, lowest_point, state_name)
SELECT highest_elevation FROM highlow WHERE highest_point = 'guadalupe peak';
Return the id and name of the document with the most paragraphs.? Schema: - Paragraphs(COUNT, Document_ID, Other_Details, Paragraph_Text, T1) - Documents(COUNT, Document_Description, Document_ID, Document_Name, Document_Type_Code, I, K, Project_ID, Robb, Template_ID, access_count, document_id, ... (7 more))
SELECT T1.Document_ID, T2.Document_Name FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.Document_ID = T2.Document_ID GROUP BY T1.Document_ID, T2.Document_Name ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Find all actors from Austin born after 1980? Schema: - actor(Afghan, Aust, COUNT, Character, Chr, Duration, Kev, Name, age, birth_city, birth_year, first_name, ... (4 more))
SELECT name FROM actor WHERE birth_city = 'Austin' AND birth_year > 1980;
What is the total surface area of the countries in the Caribbean region? Schema: - country(Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, M, Name, Official_native_language, ... (4 more))
SELECT SUM(SurfaceArea) AS total_surface_area FROM country WHERE Region = 'Caribbean';
Find the catalog publisher that has the most catalogs.? Schema: - Catalogs(COUNT, catalog_publisher, date_of_latest_revision)
SELECT catalog_publisher FROM Catalogs WHERE catalog_publisher IS NOT NULL GROUP BY catalog_publisher ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Find all the directors who are from Afghanistan? Schema: - director(Afghan, name, nationality)
SELECT name FROM director WHERE nationality = 'Afghanistan';
What are the different account ids that have made financial transactions, as well as how many transactions correspond to each? Schema: - Financial_Transactions(COUNT, F, SUM, account_id, invoice_number, transaction_amount, transaction_id, transaction_type)
SELECT account_id, COUNT(*) AS num_transactions FROM Financial_Transactions GROUP BY account_id;
List the name and phone number of all suppliers in the alphabetical order of their addresses.? Schema: - Suppliers(...) - Supplier_Addresses(...) - Addresses(address_content, city, country, line_1, line_1_number_building, line_2, state_province_county, town_city, zip_postcode)
SELECT T1.supplier_name, T1.supplier_phone FROM Suppliers AS T1 JOIN Supplier_Addresses AS T2 ON T1.supplier_id = T2.supplier_id JOIN Addresses AS T3 ON T2.address_id = T3.address_id ORDER BY T3.address_details ASC NULLS LAST;
Give me a list of the names of all songs ordered by their resolution.? Schema: - song(COUNT, M, art, artist_name, engl, f_id, genre_is, languages, rat, rating, releasedate, resolution, ... (1 more))
SELECT song_name FROM song ORDER BY resolution ASC NULLS LAST;
Find the number of members living in each address.? Schema: - member_(Address, Age, COUNT, Card_Number, Country, Hometown, Level, Member_ID, Member_Name, Membership_card, Name, Party_ID, ... (1 more))
SELECT COUNT(*) AS num_members, Address FROM member_ GROUP BY Address;
Return all reviewer names and movie names together in a single list.? Schema: - Reviewer(Lew, name, rID) - Movie(T1, director, title, year)
SELECT DISTINCT name FROM (SELECT name FROM Reviewer UNION ALL SELECT title FROM Movie);
What are the first names of all students taking accoutning and Computer Information Systems classes? Schema: - STUDENT(DEPT_CODE, STU_DOB, STU_FNAME, STU_GPA, STU_HRS, STU_LNAME, STU_PHONE) - ENROLL(...) - CLASS(CLASS_CODE, CLASS_ROOM, CLASS_SECTION, CRS_CODE, PROF_NUM) - COURSE(C, CRS_CODE, CRS_CREDIT, CRS_DESCRIPTION, DEPT_CODE) - DEPARTMENT(Account, DEPT_ADDRESS, DEPT_NAME, H, SCHOOL_CODE)
SELECT T1.STU_FNAME FROM STUDENT AS T1 JOIN ENROLL AS T2 ON T1.STU_NUM = T2.STU_NUM JOIN CLASS AS T3 ON T2.CLASS_CODE = T3.CLASS_CODE JOIN COURSE AS T4 ON T3.CRS_CODE = T4.CRS_CODE JOIN DEPARTMENT AS T5 ON T5.DEPT_CODE = T4.DEPT_CODE WHERE T5.DEPT_NAME = 'Accounting' AND EXISTS (SELECT 1 FROM ENROLL AS T2_sub JOIN CLASS AS T3_sub ON T2_sub.CLASS_CODE = T3_sub.CLASS_CODE JOIN COURSE AS T4_sub ON T3_sub.CRS_CODE = T4_sub.CRS_CODE JOIN DEPARTMENT AS T5_sub ON T5_sub.DEPT_CODE = T4_sub.DEPT_CODE WHERE T5_sub.DEPT_NAME = 'Computer Info. Systems' AND T1.STU_NUM = T2_sub.STU_NUM);
Show the manager name for gas stations belonging to the ExxonMobil company.? Schema: - station_company(...) - company(Bank, COUNT, Company, Headquarters, Industry, JO, Main_Industry, Market_Value, Name, Profits_in_Billion, Rank, Retail, ... (4 more)) - gas_station(COUNT, Location, Manager_Name, Open_Year, Station_ID)
SELECT T3.Manager_Name FROM station_company AS T1 JOIN company AS T2 ON T1.Company_ID = T2.Company_ID JOIN gas_station AS T3 ON T1.Station_ID = T3.Station_ID WHERE T2.Company = 'ExxonMobil';
How many diffrent dorm amenities are there? Schema: - Dorm_amenity(amenity_name)
SELECT COUNT(*) AS num_dorm_amenities FROM Dorm_amenity;
What are the ids of documents that contain the paragraph text 'Brazil' and 'Ireland'? Schema: - Paragraphs(COUNT, Document_ID, Other_Details, Paragraph_Text, T1)
SELECT DISTINCT T1.Document_ID FROM Paragraphs AS T1 JOIN Paragraphs AS T2 ON T1.Document_ID = T2.Document_ID WHERE T1.Paragraph_Text = 'Brazil' AND T2.Paragraph_Text = 'Ireland';
Find the most popular room in the hotel. The most popular room is the room that had seen the largest number of reservations.? Schema: - Reservations(Adults, CheckIn, FirstName, Kids, LastName) - Rooms(K, RoomId, basePrice, bedType, beds, decor, maxOccupancy, roomName)
SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room, T2.roomName ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
When did the first staff for the projects started working? Schema: - FROM(Country, Name, Year_Join) - ASC(...)
SELECT date_from FROM Project_Staff ORDER BY date_from ASC NULLS LAST LIMIT 1;
Find the name of the winner who has the highest rank points and participated in the Australian Open tourney.? Schema: - matches_(COUNT, T1, loser_age, loser_name, minutes, tourney_name, winner_age, winner_hand, winner_name, winner_rank, winner_rank_points, year)
SELECT winner_name FROM matches_ WHERE tourney_name = 'Australian Open' ORDER BY winner_rank_points DESC NULLS LAST LIMIT 1;
Show all party names and the number of members in each party.? Schema: - member_(Address, Age, COUNT, Card_Number, Country, Hometown, Level, Member_ID, Member_Name, Membership_card, Name, Party_ID, ... (1 more)) - party(COUNT, Comptroller, First_year, Governor, Last_year, Left_office, Location, Minister, Number_of_hosts, Party, Party_Theme, Party_name, ... (3 more))
SELECT T2.Party_name, COUNT(*) AS num_members FROM member_ AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID, T2.Party_name;
Show the years in which orchestras that have given more than one performance are founded.? Schema: - orchestra(COUNT, Major_Record_Format, Record_Company, Year_of_Founded) - performance(Attendance, COUNT, Date, Location, T1)
SELECT T1.Year_of_Founded FROM orchestra AS T1 JOIN performance AS T2 ON T1.Orchestra_ID = T2.Orchestra_ID GROUP BY T2.Orchestra_ID, T1.Year_of_Founded HAVING COUNT(*) > 1;
Where did li dong publish in 2016? Schema: - writes(...) - author(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT T3.venueId FROM writes AS T2 JOIN author AS T1 ON T2.authorId = T1.authorId JOIN paper AS T3 ON T2.paperId = T3.paperId WHERE T1.authorName = 'li dong' AND T3."year" = 2016;
What are the resident details containing the substring 'Miss'? Schema: - Residents(M, date_moved_in, last_day_moved_in, other_details)
SELECT other_details FROM Residents WHERE other_details LIKE '%Miss%';
What are the names of musicals who have at 3 or more actors? Schema: - actor(Afghan, Aust, COUNT, Character, Chr, Duration, Kev, Name, age, birth_city, birth_year, first_name, ... (4 more)) - musical(Award, COUNT, Name, Nom, Nominee, Result, T1)
SELECT T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID, T2.Name HAVING COUNT(*) >= 3;
TAIL papers in NIPS? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - venue(venueId, venueName)
SELECT DISTINCT T3.paperId FROM paperKeyphrase AS T2 JOIN keyphrase AS T1 ON T2.keyphraseId = T1.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId JOIN venue AS T4 ON T4.venueId = T3.venueId WHERE T1.keyphraseName = 'TAIL' AND T4.venueName = 'NIPS';