question stringlengths 43 589 | query stringlengths 19 598 |
|---|---|
What is the id of the trip that has the shortest duration?
Schema:
- trip(COUNT, bike_id, duration, end_station_name, id, start_date, start_station_id, start_station_name, zip_code) | SELECT id FROM trip ORDER BY duration ASC NULLS LAST LIMIT 1; |
journal papers for instance segmentation?
Schema:
- paperKeyphrase(...)
- keyphrase(...)
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) | 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 WHERE T1.keyphraseName = 'instance segmentation' AND T3.journalId >= 0; |
Return the investors who have invested in two or more entrepreneurs.?
Schema:
- entrepreneur(COUNT, Company, Investor, Money_Requested) | SELECT Investor FROM entrepreneur WHERE Investor IS NOT NULL GROUP BY Investor HAVING COUNT(*) >= 2; |
What are the distinct positions of the players from a country whose capital is Dublin?
Schema:
- country(Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, M, Name, Official_native_language, ... (4 more))
- match_season(COUNT, College, Draft_Class, Draft_Pick_Number, JO, Player, Position, T1, Team) | SELECT DISTINCT T2."Position" FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Capital = 'Dublin'; |
Please show the results of music festivals and the number of music festivals that have had each, ordered by this count.?
Schema:
- music_festival(COUNT, Category, Date_of_ceremony, Result) | SELECT "Result", COUNT(*) AS num_festivals FROM music_festival GROUP BY "Result" ORDER BY num_festivals DESC NULLS LAST; |
most cited EMNLP 2010 papers?
Schema:
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
- cite(...)
- venue(venueId, venueName) | SELECT DISTINCT T3.citedPaperId, COUNT(T3.citedPaperId) AS num_citations FROM paper AS T1 JOIN cite AS T3 ON T1.paperId = T3.citedPaperId JOIN venue AS T2 ON T2.venueId = T1.venueId WHERE T1."year" = 2010 AND T2.venueName = 'EMNLP' GROUP BY T3.citedPaperId ORDER BY num_citations DESC NULLS LAST; |
How many reviewers listed?
Schema:
- Reviewer(Lew, name, rID) | SELECT COUNT(*) AS num_reviewers FROM Reviewer; |
List the first and last name for players who participated in all star game in 1998.?
Schema:
- player(Age, COUNT, Gender, Occupation, Player, Player_name, Po, Points, Position, Residence, Sponsor_name, T1, ... (12 more))
- all_star(...) | SELECT name_first, name_last FROM player AS T1 JOIN all_star AS T2 ON T1.player_id = T2.player_id WHERE "year" = 1998; |
what is the maximum elevation of 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'; |
How many coaches does each club has? List the club id, name and the number of coaches.?
Schema:
- club(Region, Start_year, name)
- coach(...) | SELECT T1.Club_ID, T1.Club_name, COUNT(*) AS num_coaches FROM club AS T1 JOIN coach AS T2 ON T1.Club_ID = T2.Club_ID GROUP BY T1.Club_ID, T1.Club_name; |
What is the name and date of the most recent race?
Schema:
- races(date, name) | SELECT name, "date" FROM races ORDER BY "date" DESC NULLS LAST LIMIT 1; |
What are the full names of employees who with in department 70 or 90?
Schema:
- employees(COMMISSION_PCT, DEPARTMENT_ID, EMAIL, EMPLOYEE_ID, FIRST_NAME, HIRE_DATE, JOB_ID, LAST_NAME, M, MANAGER_ID, PHONE_NUMBER, SALARY, ... (12 more)) | SELECT FIRST_NAME, LAST_NAME FROM employees WHERE DEPARTMENT_ID = 70 OR DEPARTMENT_ID = 90; |
Show the names for all females from Canada having a wedding in year 2016.?
Schema:
- wedding(...)
- people(Age, Birth_Date, Birth_Place, COUNT, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more)) | SELECT T2."name" FROM wedding AS T1 JOIN people AS T2 ON T1.Female_ID = T2.People_ID WHERE T1."Year" = 2016 AND T2.Is_Male = 'F' AND T2.Country = 'Canada'; |
Show the name of each county along with the corresponding number of delegates from that county.?
Schema:
- county(County_name, Population, Zip_code)
- election(Committee, Date, Delegate, District, Vote_Percent, Votes) | SELECT T1.County_name, COUNT(*) AS num_delegates FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District GROUP BY T1.County_Id, T1.County_name; |
Find the first names and degree of all professors who are teaching some class in Computer Info. Systems department.?
Schema:
- CLASS(CLASS_CODE, CLASS_ROOM, CLASS_SECTION, CRS_CODE, PROF_NUM)
- EMPLOYEE(EMP_DOB, EMP_FNAME, EMP_JOBCODE, EMP_LNAME)
- PROFESSOR(DEPT_CODE, PROF_HIGH_DEGREE)
- DEPARTMENT(Account, DEPT_ADDRESS, DEPT_NAME, H, SCHOOL_CODE) | SELECT DISTINCT T2.EMP_FNAME, T3.PROF_HIGH_DEGREE FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN PROFESSOR AS T3 ON T2.EMP_NUM = T3.EMP_NUM JOIN DEPARTMENT AS T4 ON T4.DEPT_CODE = T3.DEPT_CODE WHERE T4.DEPT_NAME = 'Computer Info. Systems'; |
What are the distinct names of wines that have appellations in the North Coast area?
Schema:
- appellations(Area, County)
- wine(Appelation, Cases, Grape, M, Name, Price, Score, Winery, Year, Z, w) | SELECT DISTINCT T2.Name FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = 'North Coast'; |
Keyphrases used by Christof Dallermassl in 2000?
Schema:
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
- paperKeyphrase(...)
- writes(...)
- author(...) | SELECT DISTINCT T2.keyphraseId FROM paper AS T3 JOIN paperKeyphrase AS T2 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 = 'Christof Dallermassl' AND T3."year" = 2000; |
Find the name and hours of project that has the most number of scientists.?
Schema:
- Projects(COUNT, Hours, Name, Project_Details, Project_ID, organ, organisation_id, project_details)
- AssignedTo(Scientist) | SELECT T1.Name, T1.Hours FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project GROUP BY T2.Project, T1.Name, T1.Hours ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
where can we find some restaurants in alameda ?
Schema:
- restaurant(...)
- location(...) | SELECT T2.house_number, T1.name FROM restaurant AS T1 JOIN location AS T2 ON T1.id = T2.restaurant_id WHERE T2.city_name = 'alameda'; |
Give the distinct headquarters of manufacturers.?
Schema:
- Manufacturers(Aust, Beij, Founder, Headquarter, I, M, Name, Revenue) | SELECT DISTINCT Headquarter FROM Manufacturers; |
How many different levels do members have?
Schema:
- member_(Address, Age, COUNT, Card_Number, Country, Hometown, Level, Member_ID, Member_Name, Membership_card, Name, Party_ID, ... (1 more)) | SELECT COUNT(DISTINCT Level) AS num_levels FROM member_; |
What are the names of all the video games and their types in alphabetical order?
Schema:
- Video_Games(COUNT, Dest, GName, GType, onl) | SELECT GName, GType FROM Video_Games ORDER BY GName ASC NULLS LAST; |
What are the names of the courses in alphabetical order?
Schema:
- Courses(course_description, course_name) | SELECT course_name FROM Courses ORDER BY course_name ASC NULLS LAST; |
What are the medicine and trade names that cannot interact with the enzyme with the product 'Heme'?
Schema:
- medicine(FDA_approved, Trade_Name, name)
- medicine_enzyme_interaction(interaction_type)
- enzyme(Chromosome, Location, OMIM, Porphyria, Product, name) | SELECT T1.name, T1.Trade_Name FROM medicine AS T1 LEFT JOIN (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') AS T2 ON T1.name = T2.name AND T1.Trade_Name = T2.Trade_Name WHERE T2.name IS NULL; |
How many models do not have the wifi function?
Schema:
- chip_model(Launch_year, Model_name, RAM_MiB, WiFi) | SELECT COUNT(*) AS num_models FROM chip_model WHERE WiFi = 'No'; |
Which room has the highest base price?
Schema:
- Rooms(K, RoomId, basePrice, bedType, beds, decor, maxOccupancy, roomName) | SELECT RoomId, roomName FROM Rooms ORDER BY basePrice DESC NULLS LAST LIMIT 1; |
What are the unique names of all race held between 2014 and 2017?
Schema:
- races(date, name) | SELECT DISTINCT name FROM races WHERE "year" BETWEEN 2014 AND 2017; |
List the software platform shared by the greatest number of devices.?
Schema:
- device(COUNT, Carrier, Software_Platform) | SELECT Software_Platform FROM device WHERE Software_Platform IS NOT NULL GROUP BY Software_Platform ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
return me the papers of " H. V. Jagadish " containing keyword " User Study " .?
Schema:
- publication_keyword(...)
- keyword(keyword)
- publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year)
- writes(...)
- author(...) | SELECT T5.title FROM publication_keyword AS T3 JOIN keyword AS T1 ON T3.kid = T1.kid JOIN publication AS T5 ON T5.pid = T3.pid JOIN writes AS T4 ON T4.pid = T5.pid JOIN author AS T2 ON T4.aid = T2.aid WHERE T2.name = 'H. V. Jagadish' AND T1.keyword = 'User Study'; |
Return the poll resource associated with the most candidates.?
Schema:
- candidate(COUNT, Candidate_ID, Consider_rate, Oppose_rate, Poll_Source, Support_rate, Unsure_rate) | SELECT Poll_Source FROM candidate WHERE Poll_Source IS NOT NULL GROUP BY Poll_Source ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
How many papers did David M. Blei publish at AISTATS ?
Schema:
- venue(venueId, venueName)
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
- writes(...)
- author(...) | SELECT DISTINCT COUNT(T3.paperId) AS num_papers FROM venue AS T4 JOIN paper AS T3 ON T4.venueId = T3.venueId JOIN writes AS T2 ON T2.paperId = T3.paperId JOIN author AS T1 ON T2.authorId = T1.authorId WHERE T1.authorName = 'David M. Blei' AND T4.venueName = 'AISTATS'; |
What are the ids, names, and FDA approval status for medicines ordered by descending number of possible enzyme interactions?
Schema:
- medicine(FDA_approved, Trade_Name, name)
- medicine_enzyme_interaction(interaction_type) | 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, T1.name, T1.FDA_approved ORDER BY COUNT(*) DESC NULLS LAST; |
What is the average number of points for players from the "AIB" club?
Schema:
- club(Region, Start_year, name)
- player(Age, COUNT, Gender, Occupation, Player, Player_name, Po, Points, Position, Residence, Sponsor_name, T1, ... (12 more)) | SELECT AVG(T2.Points) AS avg_points FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T1.name = 'AIB'; |
For each document, list the number of employees who have showed up in the circulation history of that document. List the document ids and number of employees.?
Schema:
- Circulation_History(copy_number, document_id, draft_number, employee_id) | SELECT document_id, COUNT(DISTINCT employee_id) AS num_employees FROM Circulation_History GROUP BY document_id; |
What are the names of the ships that are from either the US or the UK?
Schema:
- ship(COUNT, DIST, JO, K, Name, Nationality, T1, Tonnage, Type, disposition_of_ship, name, tonnage) | SELECT Name FROM ship WHERE Nationality = 'United States' OR Nationality = 'United Kingdom'; |
List ids and details for all projects.?
Schema:
- Projects(COUNT, Hours, Name, Project_Details, Project_ID, organ, organisation_id, project_details) | SELECT Project_ID, Project_Details FROM Projects; |
What are all the fault descriptions and the fault status of all the faults recoreded in the logs?
Schema:
- Fault_Log(...)
- Fault_Log_Parts(fault_status) | SELECT T1.fault_description, T2.fault_status FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id; |
What are the first names of all Accounting professors who teach and what are the classrooms of the courses they teach?
Schema:
- CLASS(CLASS_CODE, CLASS_ROOM, CLASS_SECTION, CRS_CODE, PROF_NUM)
- EMPLOYEE(EMP_DOB, EMP_FNAME, EMP_JOBCODE, EMP_LNAME)
- PROFESSOR(DEPT_CODE, PROF_HIGH_DEGREE)
- DEPARTMENT(Account, DEPT_ADDRESS, DEPT_NAME, H, SCHOOL_CODE) | SELECT T2.EMP_FNAME, T1.CLASS_ROOM FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN PROFESSOR AS T3 ON T2.EMP_NUM = T3.EMP_NUM JOIN DEPARTMENT AS T4 ON T4.DEPT_CODE = T3.DEPT_CODE WHERE T4.DEPT_NAME = 'Accounting'; |
What are the job ids and dates of hire for employees hired after November 5th, 2007 and before July 5th, 2009?
Schema:
- employees(COMMISSION_PCT, DEPARTMENT_ID, EMAIL, EMPLOYEE_ID, FIRST_NAME, HIRE_DATE, JOB_ID, LAST_NAME, M, MANAGER_ID, PHONE_NUMBER, SALARY, ... (12 more)) | SELECT JOB_ID, HIRE_DATE FROM employees WHERE HIRE_DATE BETWEEN '2007-11-05' AND '2009-07-05'; |
return me the papers in VLDB conference containing keyword " Information Retrieval " .?
Schema:
- publication_keyword(...)
- keyword(keyword)
- publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year)
- conference(homepage, name) | SELECT T4.title FROM publication_keyword AS T3 JOIN keyword AS T1 ON T3.kid = T1.kid JOIN publication AS T4 ON T4.pid = T3.pid JOIN conference AS T2 ON T4.cid = CAST(T2.cid AS TEXT) WHERE T2.name = 'VLDB' AND T1.keyword = 'Information Retrieval'; |
Which job titles correspond to jobs with salaries over 9000?
Schema:
- jobs(JOB_TITLE, diff) | SELECT JOB_TITLE FROM jobs WHERE MIN_SALARY > 9000; |
What are the names and salaries for instructors who earn less than the average salary of instructors in the Physics department?
Schema:
- instructor(AVG, M, So, Stat, dept_name, name, salary) | SELECT name, salary FROM instructor WHERE salary < (SELECT AVG(salary) FROM instructor WHERE dept_name = 'Physics'); |
List all department names ordered by their starting date.?
Schema:
- department(Budget_in_Billions, COUNT, Creation, Dname, F, Market, Mgr_start_date, budget, building, dept_name, name) | SELECT Dname FROM department ORDER BY Mgr_start_date ASC NULLS LAST; |
Show the number of audience in year 2008 or 2010.?
Schema:
- festival_detail(Chair_Name, Festival_Name, Location, T1, Year) | SELECT Num_of_Audience FROM festival_detail WHERE "Year" = 2008 OR "Year" = 2010; |
return me the paper in VLDB conference with more than 200 citations .?
Schema:
- publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year)
- conference(homepage, name) | SELECT T2.title FROM publication AS T2 JOIN conference AS T1 ON T2.cid = CAST(T1.cid AS TEXT) WHERE T1.name = 'VLDB' AND T2.citation_num > 200; |
How many songs, on average, are sung by a female artist?
Schema:
- artist(Age, Artist, Country, Famous_Release_date, Famous_Title, Year_Join, artist_name, country, gender)
- song(COUNT, M, art, artist_name, engl, f_id, genre_is, languages, rat, rating, releasedate, resolution, ... (1 more)) | SELECT AVG(T2.rating) AS avg_rating FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = 'Female'; |
Which state has the greatest total number of bank customers?
Schema:
- bank(SUM, bname, city, morn, no_of_customers, state) | SELECT state FROM bank WHERE state IS NOT NULL GROUP BY state ORDER BY SUM(no_of_customers) DESC NULLS LAST LIMIT 1; |
Find the id of students who do not have a cat pet.?
Schema:
- Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
- Has_Pet(...)
- Pets(PetID, PetType, pet_age, weight) | SELECT StuID FROM Student WHERE StuID NOT IN (SELECT T1.StuID FROM Student AS T1 JOIN Has_Pet AS T2 ON T1.StuID = T2.StuID JOIN Pets AS T3 ON T3.PetID = T2.PetID WHERE T3.PetType = 'cat'); |
Find the name, age, and job title of persons who are friends with Alice for the longest years.?
Schema:
- Person(M, age, city, eng, gender, job, name)
- PersonFriend(M, friend, name) | 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'); |
Show the names of players coached by the rank 1 coach.?
Schema:
- player_coach(...)
- coach(...)
- player(Age, COUNT, Gender, Occupation, Player, Player_name, Po, Points, Position, Residence, Sponsor_name, T1, ... (12 more)) | SELECT T3.Player_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID WHERE T2."Rank" = 1; |
Find the number of courses provided in each semester and year.?
Schema:
- section(COUNT, JO, Spr, T1, course_id, semester, year) | SELECT COUNT(*) AS num_courses, semester, "year" FROM section GROUP BY semester, "year"; |
How many papers has Christopher D. Manning written ?
Schema:
- writes(...)
- author(...) | SELECT DISTINCT COUNT(DISTINCT T2.paperId) AS num_papers FROM writes AS T2 JOIN author AS T1 ON T2.authorId = T1.authorId WHERE T1.authorName = 'Christopher D. Manning'; |
Which city does staff with first name as Janessa and last name as Sawayn live?
Schema:
- Addresses(address_content, city, country, line_1, line_1_number_building, line_2, state_province_county, town_city, zip_postcode)
- Staff(COUNT, Name, Other_Details, date_joined_staff, date_left_staff, date_of_birth, email_address, first_name, gender, last_name, middle_name, nickname) | 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'; |
How many products have the characteristic named "hot"?
Schema:
- Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more))
- Product_Characteristics(...)
- Characteristics(characteristic_name) | SELECT COUNT(*) AS num_products FROM Products AS T1 JOIN Product_Characteristics AS T2 ON T1.product_id = T2.product_id JOIN Characteristics AS T3 ON T2.characteristic_id = T3.characteristic_id WHERE T3.characteristic_name = 'hot'; |
What is the average total number of passengers for all airports that the aircraft "Robinson R-22" visits?
Schema:
- aircraft(Description, aid, d, distance, name)
- airport_aircraft(...)
- airport(Airport_Name, City, Country, Domestic_Passengers, International_Passengers, Transit_Passengers, id, name) | SELECT AVG(T3.Total_Passengers) AS avg_total_passengers FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T1.Aircraft = 'Robinson R-22'; |
Which students not enrolled in any course? Find their personal names.?
Schema:
- Students(cell_mobile_number, current_address_id, date_first_registered, date_left, date_of_latest_logon, email_address, family_name, first_name, last_name, login_name, middle_name, other_student_details, ... (1 more))
- Student_Course_Enrolment(course_id, date_of_completion, date_of_enrolment, student_id) | SELECT DISTINCT personal_name FROM Students WHERE personal_name NOT IN (SELECT T1.personal_name FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id); |
What are the countries that have both mountains that are higher than 5600 and lower than 5200?
Schema:
- mountain(AVG, COUNT, Country, Height, JO, Name, Prominence, Range, T1, mck, mounta, mountain_altitude, ... (3 more)) | SELECT DISTINCT T1.Country FROM (SELECT Country FROM mountain WHERE Height > 5600) AS T1 JOIN (SELECT Country FROM mountain WHERE Height < 5200) AS T2 ON T1.Country = T2.Country; |
What are the maximum and minimum budget of the departments?
Schema:
- department(Budget_in_Billions, COUNT, Creation, Dname, F, Market, Mgr_start_date, budget, building, dept_name, name) | SELECT MAX(Budget_in_Billions) AS max_budget, MIN(Budget_in_Billions) AS min_budget FROM department; |
Count the number of different colleges that players who play for Columbus Crew are from.?
Schema:
- match_season(COUNT, College, Draft_Class, Draft_Pick_Number, JO, Player, Position, T1, Team)
- team(Name) | SELECT COUNT(DISTINCT T1.College) AS num_colleges FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = 'Columbus Crew'; |
Which membership card has more than 5 members?
Schema:
- member_(Address, Age, COUNT, Card_Number, Country, Hometown, Level, Member_ID, Member_Name, Membership_card, Name, Party_ID, ... (1 more)) | SELECT Membership_card FROM member_ WHERE Membership_card IS NOT NULL GROUP BY Membership_card HAVING COUNT(*) > 5; |
What are the names of the contestants whose names are not 'Jessie Alloway'?
Schema:
- CONTESTANTS(contestant_name) | SELECT contestant_name FROM CONTESTANTS WHERE contestant_name != 'Jessie Alloway'; |
Show the student id of the oldest student.?
Schema:
- Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age) | SELECT StuID FROM Student WHERE Age = (SELECT MAX(Age) FROM Student); |
Find the papers which have "Olin Shivers" as an author.?
Schema:
- Authors(fname, lname)
- Authorship(...)
- Papers(title) | SELECT T3.title 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 = 'Olin' AND T1.lname = 'Shivers'; |
Return names of songs in volumes that are by artists that are at least 32 years old.?
Schema:
- artist(Age, Artist, Country, Famous_Release_date, Famous_Title, Year_Join, artist_name, country, gender)
- volume(Artist_ID, Issue_Date, Song, Weeks_on_Top) | SELECT T2.Song FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.Age >= 32; |
Which nurses are in charge of patients undergoing treatments?
Schema:
- Undergoes(DateUndergoes, Patient)
- Nurse(Name) | SELECT DISTINCT T2.Name FROM Undergoes AS T1 JOIN Nurse AS T2 ON T1.AssistingNurse = T2.EmployeeID; |
What are the names and scores of all wines?
Schema:
- wine(Appelation, Cases, Grape, M, Name, Price, Score, Winery, Year, Z, w) | SELECT Name, Score FROM wine; |
What are the names of instructors who earn more than at least one instructor from the Biology department?
Schema:
- instructor(AVG, M, So, Stat, dept_name, name, salary) | SELECT name FROM instructor WHERE salary > (SELECT MIN(salary) FROM instructor WHERE dept_name = 'Biology'); |
How many students received a yes from tryouts?
Schema:
- Tryout(COUNT, EX, T1, cName, decision, pPos) | SELECT COUNT(*) AS num_students FROM Tryout WHERE decision = 'yes'; |
What are the names of projects that require more than 300 hours, and how many scientists are assigned to each?
Schema:
- Projects(COUNT, Hours, Name, Project_Details, Project_ID, organ, organisation_id, project_details)
- AssignedTo(Scientist) | SELECT COUNT(*) AS num_scientists, T1.Name FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project WHERE T1.Hours > 300 GROUP BY T1.Name; |
Which actors were born in Tehran?
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 = 'Tehran'; |
Who published the most papers in 2007 at CVPR ?
Schema:
- venue(venueId, venueName)
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
- writes(...) | SELECT DISTINCT COUNT(T2.paperId) AS num_papers, T1.authorId FROM venue AS T3 JOIN paper AS T2 ON T3.venueId = T2.venueId JOIN writes AS T1 ON T1.paperId = T2.paperId WHERE T2."year" = 2007 AND T3.venueName = 'CVPR' GROUP BY T1.authorId ORDER BY num_papers DESC NULLS LAST; |
What are the names of all the states with college students playing in the mid position but no goalies?
Schema:
- College(M, cName, enr, state)
- Tryout(COUNT, EX, T1, cName, decision, pPos) | SELECT DISTINCT T1.state FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' AND T1.state NOT IN (SELECT T1.state FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie'); |
When is the first transcript released? List the date and details.?
Schema:
- Transcripts(other_details, transcript_date) | SELECT transcript_date, other_details FROM Transcripts ORDER BY transcript_date ASC NULLS LAST LIMIT 1; |
What is the most common role for the staff?
Schema:
- Project_Staff(COUNT, date_from, date_to, role_code) | SELECT role_code FROM Project_Staff WHERE role_code IS NOT NULL GROUP BY role_code ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
Are the customers holding coupons with amount 500 bad or good?
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))
- Discount_Coupons(...) | SELECT T1.good_or_bad_customer FROM Customers AS T1 JOIN Discount_Coupons AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.coupon_amount = 500; |
What are the three products that have the most problems?s?
Schema:
- Problems(date_problem_reported, problem_id)
- Product(product_id, product_name) | SELECT T2.product_name FROM Problems AS T1 JOIN Product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name ORDER BY COUNT(*) DESC NULLS LAST LIMIT 3; |
What are the names and types of the dorms that have a capacity greater than 300 or less than 100?
Schema:
- Dorm(dorm_name, gender, student_capacity) | SELECT dorm_name, gender FROM Dorm WHERE student_capacity > 300 OR student_capacity < 100; |
who wrote the most papers on syntactic parsing ?
Schema:
- paperKeyphrase(...)
- keyphrase(...)
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
- writes(...) | SELECT DISTINCT COUNT(T4.paperId) AS num_papers, T3.authorId FROM paperKeyphrase AS T1 JOIN keyphrase AS T2 ON T1.keyphraseId = T2.keyphraseId JOIN paper AS T4 ON T4.paperId = T1.paperId JOIN writes AS T3 ON T3.paperId = T4.paperId WHERE T2.keyphraseName = 'syntactic parsing' GROUP BY T3.authorId ORDER BY num_papers DESC NULLS LAST; |
Count the number of countries in Asia.?
Schema:
- country(Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, M, Name, Official_native_language, ... (4 more)) | SELECT COUNT(*) AS num_countries FROM country WHERE Continent = 'Asia'; |
What are the names of all directors whose movies have been reviewed by Sarah Martinez?
Schema:
- Rating(Rat, mID, rID, stars)
- Movie(T1, director, title, year)
- Reviewer(Lew, name, rID) | SELECT DISTINCT T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Sarah Martinez'; |
what states have no bordering state?
Schema:
- state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom)
- border_info(T1, border, state_name) | SELECT state_name FROM state WHERE state_name NOT IN (SELECT state_name FROM border_info); |
What are the names of the all-female dorms?
Schema:
- Dorm(dorm_name, gender, student_capacity) | SELECT dorm_name FROM Dorm WHERE gender = 'F'; |
What are the category of music festivals with result "Awarded"?
Schema:
- music_festival(COUNT, Category, Date_of_ceremony, Result) | SELECT Category FROM music_festival WHERE "Result" = 'Awarded'; |
How many lessons were in cancelled state?
Schema:
- Lessons(lesson_status_code) | SELECT COUNT(*) AS num_lessons FROM Lessons WHERE lesson_status_code = 'Cancelled'; |
Which cities have lower temperature in March than in July and have been once host cities?
Schema:
- city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more))
- temperature(...)
- hosting_city(Host_City, Year) | SELECT DISTINCT T1.City FROM city AS T1 JOIN temperature AS T2 ON T1.City_ID = T2.City_ID JOIN hosting_city AS T4 ON T1.City_ID = T4.Host_City WHERE T2.Mar < T2.Jul; |
How many members of "Bootup Baltimore" are older than 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 names and distances for all airplanes?
Schema:
- aircraft(Description, aid, d, distance, name) | SELECT name, distance FROM aircraft; |
Please list the years of film market estimations when the market is in country "Japan" in descending order.?
Schema:
- film_market_estimation(High_Estimate, Low_Estimate, Type)
- market(Country, Number_cities) | SELECT T1."Year" FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = 'Japan' ORDER BY T1."Year" DESC NULLS LAST; |
What are the names of the teachers whose courses have not been arranged?
Schema:
- teacher(Age, COUNT, D, Hometown, Name)
- course_arrange(...) | SELECT Name FROM teacher WHERE Teacher_ID NOT IN (SELECT Teacher_ID FROM course_arrange); |
Return the cell phone number and email address for all students.?
Schema:
- Students(cell_mobile_number, current_address_id, date_first_registered, date_left, date_of_latest_logon, email_address, family_name, first_name, last_name, login_name, middle_name, other_student_details, ... (1 more)) | SELECT cell_mobile_number, email_address FROM Students; |
Find the first name of students living in city PHL whose age is between 20 and 25.?
Schema:
- Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age) | SELECT Fname FROM Student WHERE city_code = 'PHL' AND Age BETWEEN 20 AND 25; |
What is the customer id with most number of cards, and how many does he have?
Schema:
- Customers_Cards(COUNT, card_id, card_number, card_type_code, customer_id, date_valid_from, date_valid_to) | SELECT customer_id, COUNT(*) AS num_cards FROM Customers_Cards WHERE customer_id IS NOT NULL GROUP BY customer_id ORDER BY num_cards DESC NULLS LAST LIMIT 1; |
What are the names of all pilots 30 years old or young in descending alphabetical order?
Schema:
- pilot(Age, COUNT, Join_Year, Name, Nationality, Pilot_name, Position, Rank, Team) | SELECT Name FROM pilot WHERE Age <= 30 ORDER BY Name DESC NULLS LAST; |
Which store owns most items?
Schema:
- inventory(COUNT, store_id) | SELECT store_id FROM inventory WHERE store_id IS NOT NULL GROUP BY store_id ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
What are the codes and names for all regions, sorted by codes?
Schema:
- region(Label, Region_code, Region_name) | SELECT Region_code, Region_name FROM region ORDER BY Region_code ASC NULLS LAST; |
What are the ids of documents with letter 's' in the name with any expense budgets.?
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))
- Documents_with_Expenses(Budget_Type_Code, COUNT, Document_ID) | SELECT T1.Document_ID FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.Document_ID = T2.Document_ID WHERE T1.Document_Name LIKE '%s%'; |
What are the first names for all faculty professors, ordered by first name?
Schema:
- Faculty(Building, COUNT, FacID, Fname, LName, Lname, Phone, Pr, Rank, Room, Sex) | SELECT Fname FROM Faculty WHERE "Rank" = 'Professor' ORDER BY Fname ASC NULLS LAST; |
What buildings have faculty offices?
Schema:
- Faculty(Building, COUNT, FacID, Fname, LName, Lname, Phone, Pr, Rank, Room, Sex) | SELECT DISTINCT Building FROM Faculty; |
Find number of tracks in each genre?
Schema:
- genres(name)
- tracks(composer, milliseconds, name, unit_price) | SELECT COUNT(*) AS num_tracks, T1.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id GROUP BY T1.name; |
What is the first and last name of all the German drivers?
Schema:
- drivers(forename, nationality, surname) | SELECT forename, surname FROM drivers WHERE nationality = 'German'; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.