question
stringlengths
43
589
query
stringlengths
19
598
What is the name of the song that was released most recently? Schema: - song(COUNT, M, art, artist_name, engl, f_id, genre_is, languages, rat, rating, releasedate, resolution, ... (1 more))
SELECT song_name, releasedate FROM song ORDER BY releasedate DESC NULLS LAST LIMIT 1;
return me the keywords in PVLDB .? Schema: - publication_keyword(...) - keyword(keyword) - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year) - journal(Theme, homepage, name)
SELECT T1.keyword FROM publication_keyword AS T4 JOIN keyword AS T1 ON T4.kid = T1.kid JOIN publication AS T2 ON T2.pid = T4.pid JOIN journal AS T3 ON T2.jid = T3.jid WHERE T3.name = 'PVLDB';
Return the number of likes that the high schooler named Kyle has.? Schema: - Likes(student_id) - Highschooler(COUNT, ID, grade, name)
SELECT COUNT(*) AS num_likes FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.ID WHERE T2.name = 'Kyle';
What are the number of concerts that occurred in the stadium with the largest capacity ? Schema: - concert(COUNT, Year) - stadium(Average, Average_Attendance, Capacity, Capacity_Percentage, City, Country, Home_Games, Location, Name, Opening_year, T1)
SELECT COUNT(*) AS num_concerts FROM concert WHERE Stadium_ID = (SELECT Stadium_ID FROM stadium ORDER BY Capacity DESC NULLS LAST LIMIT 1);
What are the the songs in volumes, listed in ascending order? Schema: - volume(Artist_ID, Issue_Date, Song, Weeks_on_Top)
SELECT Song FROM volume ORDER BY Song ASC NULLS LAST;
What are the advisors who have at least two 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 HAVING COUNT(*) >= 2;
For each continent, list its id, name, and how many countries it has? Schema: - continents(...) - countries(...)
SELECT T1.ContId, T1.Continent, COUNT(*) AS num_countries FROM continents AS T1 JOIN countries AS T2 ON T1.ContId = T2.Continent GROUP BY T1.ContId, T1.Continent;
Show the description for role name "Proof Reader".? Schema: - Roles(Role_Code, Role_Description, Role_Name, role_code, role_description)
SELECT Role_Description FROM Roles WHERE Role_Name = 'Proof Reader';
Return the distinct name of customers whose order status is Pending, in the order of customer id.? 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)) - Customer_Orders(customer_id, order_date, order_id, order_shipping_charges)
SELECT T1.customer_name FROM Customers AS T1 JOIN Customer_Orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'Pending' GROUP BY T1.customer_name, T2.customer_id ORDER BY T2.customer_id ASC NULLS LAST;
Which students have professors as their advisors? Find their student ids.? Schema: - Faculty(Building, COUNT, FacID, Fname, LName, Lname, Phone, Pr, Rank, Room, Sex) - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT T2.StuID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.Advisor WHERE T1."Rank" = 'Professor';
Find the name of the tryout players who are from the college with largest size.? Schema: - Tryout(COUNT, EX, T1, cName, decision, pPos) - Player(HS, pName, weight, yCard) - College(M, cName, enr, state)
SELECT T2.pName FROM Tryout AS T1 JOIN Player AS T2 ON T1.pID = T2.pID WHERE T1.cName = (SELECT cName FROM College ORDER BY enr DESC NULLS LAST LIMIT 1);
Find the names of schools that have some students playing in goalie and mid positions.? Schema: - Tryout(COUNT, EX, T1, cName, decision, pPos)
SELECT DISTINCT T1.cName FROM Tryout AS T1 WHERE EXISTS (SELECT 1 FROM Tryout AS T2 WHERE T1.cName = T2.cName AND T2.pPos = 'goalie') AND EXISTS (SELECT 1 FROM Tryout AS T3 WHERE T1.cName = T3.cName AND T3.pPos = 'mid');
Display all the information about the department Marketing.? Schema: - departments(DEPARTMENT_NAME, Market)
SELECT * FROM departments WHERE DEPARTMENT_NAME = 'Marketing';
What is the team with at least 2 technicians? Schema: - technician(Age, COUNT, JO, Start, Starting_Year, T1, Team, name)
SELECT Team FROM technician WHERE Team IS NOT NULL GROUP BY Team HAVING COUNT(*) >= 2;
What is the name of the most common genre in all tracks? Schema: - Genre(Name) - Track(Milliseconds, Name, UnitPrice)
SELECT T1.Name FROM Genre AS T1 JOIN Track AS T2 ON T1.GenreId = T2.GenreId GROUP BY T2.GenreId, T1.Name ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
what were some Parsing based papers in acl 2012 ? 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';
What are the dates of the assessment notes? Schema: - Assessment_Notes(date_of_notes)
SELECT date_of_notes FROM Assessment_Notes;
What are the maximum and average height of the mountains? Schema: - mountain(AVG, COUNT, Country, Height, JO, Name, Prominence, Range, T1, mck, mounta, mountain_altitude, ... (3 more))
SELECT MAX(Height) AS max_height, AVG(Height) AS avg_height FROM mountain;
Show name of all students who have some friends and also are liked by someone else.? Schema: - Highschooler(COUNT, ID, grade, name) - Friend(student_id) - Likes(student_id)
SELECT name FROM Highschooler WHERE ID IN (SELECT student_id FROM Friend) AND ID IN (SELECT liked_id FROM Likes);
For each state, find the total account balance of customers whose credit score is above 100.? Schema: - customer(COUNT, T1, acc_bal, acc_type, active, check, credit_score, cust_name, no_of_loans, sav, state, store_id)
SELECT SUM(acc_bal) AS total_account_balance, state FROM customer WHERE credit_score > 100 GROUP BY state;
What is the name of the document which has been accessed the most times, as well as the number of times it has been accessed? 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))
SELECT document_name, access_count FROM Documents ORDER BY access_count DESC NULLS LAST LIMIT 1;
What are the name and id of the three highest priced rooms? Schema: - Rooms(K, RoomId, basePrice, bedType, beds, decor, maxOccupancy, roomName)
SELECT RoomId, roomName FROM Rooms ORDER BY basePrice DESC NULLS LAST LIMIT 3;
What are the first names and last names of the students who are 18 years old and have vice president votes.? Schema: - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age) - Voting_record(Election_Cycle, President_Vote, Registration_Date, Secretary_Vote, Vice_President_Vote)
SELECT DISTINCT T1.Fname, T1.LName FROM Student AS T1 JOIN Voting_record AS T2 ON T1.StuID = T2.Vice_President_Vote WHERE T1.Age = 18;
How many distinct parties are there for representatives? Schema: - representative(JO, Lifespan, Name, Party, State, T1)
SELECT COUNT(DISTINCT Party) AS num_parties FROM representative;
return me the number of 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 COUNT(DISTINCT T5.title) AS num_papers 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';
How many workshops did each author submit to? Return the author name and the number of workshops.? Schema: - Acceptance(...) - submission(Author, COUNT, College, Scores)
SELECT T2.Author, COUNT(DISTINCT T1.Workshop_ID) AS num_workshops FROM Acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author;
What is the location of the party with the most hosts? Schema: - party(COUNT, Comptroller, First_year, Governor, Last_year, Left_office, Location, Minister, Number_of_hosts, Party, Party_Theme, Party_name, ... (3 more))
SELECT Location FROM party ORDER BY Number_of_hosts DESC NULLS LAST LIMIT 1;
Return the id of the store with the most customers.? Schema: - customer(COUNT, T1, acc_bal, acc_type, active, check, credit_score, cust_name, no_of_loans, sav, state, store_id)
SELECT store_id FROM customer WHERE store_id IS NOT NULL GROUP BY store_id ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Show the name and distance of the aircrafts with more than 5000 distance and which at least 5 people have its certificate.? Schema: - certificate(eid) - aircraft(Description, aid, d, distance, name)
SELECT T2.name FROM certificate AS T1 JOIN aircraft AS T2 ON T2.aid = T1.aid WHERE T2.distance > 5000 GROUP BY T1.aid, T2.name HAVING COUNT(*) >= 5;
What are the names of all video games that are collectible cards? Schema: - Video_Games(COUNT, Dest, GName, GType, onl)
SELECT GName FROM Video_Games WHERE GType = 'Collectible card game';
return me the citations of each paper in the VLDB conference .? Schema: - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year) - conference(homepage, name)
SELECT T2.citation_num FROM publication AS T2 JOIN conference AS T1 ON T2.cid = CAST(T1.cid AS TEXT) WHERE T1.name = 'VLDB';
What are the different models created by either the car maker General Motors or weighed more than 3500? Schema: - car_names(COUNT, Model) - model_list(Maker, Model) - car_makers(...) - cars_data(Accelerate, Cylinders, Horsepower, MPG, T1, Weight, Year)
SELECT DISTINCT T2.Model FROM car_names AS T1 JOIN model_list AS T2 ON T1.Model = T2.Model JOIN car_makers AS T3 ON T2.Maker = T3.Id JOIN cars_data AS T4 ON T1.MakeId = T4.Id WHERE T3.FullName = 'General Motors' OR T4.Weight > 3500;
What are all details of the students who registered but did not attend any course? Schema: - Student_Course_Registrations(COUNT, student_id) - Student_Course_Attendance(course_id, date_of_attendance, student_id)
SELECT * FROM Student_Course_Registrations WHERE student_id NOT IN (SELECT student_id FROM Student_Course_Attendance);
what is the biggest city in wyoming? Schema: - city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more))
SELECT city_name FROM city WHERE population = (SELECT MAX(population) FROM city WHERE state_name = 'wyoming') AND state_name = 'wyoming';
Count the number of artists who are older than 46 and joined after 1990.? Schema: - artist(Age, Artist, Country, Famous_Release_date, Famous_Title, Year_Join, artist_name, country, gender)
SELECT COUNT(*) AS num_artists FROM artist WHERE Age > 46 AND Year_Join > 1990;
Which customers have an insurance policy with the type code "Deputy" or "Uniform"? Return 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 DISTINCT T2.Customer_Details FROM Policies AS T1 JOIN Customers AS T2 ON T1.Customer_ID = T2.Customer_ID WHERE T1.Policy_Type_Code = 'Deputy' OR T1.Policy_Type_Code = 'Uniform';
Find the major that is studied by the most female students.? Schema: - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT Major FROM Student WHERE Sex = 'F' AND Major IS NOT NULL GROUP BY Major ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Find the building that has the largest number of faculty members.? Schema: - Faculty(Building, COUNT, FacID, Fname, LName, Lname, Phone, Pr, Rank, Room, Sex)
SELECT Building FROM Faculty WHERE Building IS NOT NULL GROUP BY Building ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Find the first names of owners living in Virginia and the names of dogs they own.? Schema: - Owners(email_address, first_name, last_name, state) - Dogs(abandoned_yn, age, breed_code, date_arrived, date_departed, name, size_code, weight)
SELECT T1.first_name, T2.name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id WHERE T1.state = 'Virginia';
Find all the papers published by "Aaron Turon".? 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 = 'Aaron' AND T1.lname = 'Turon';
Find the names of instructors who didn't each any courses in any Spring semester.? Schema: - instructor(AVG, M, So, Stat, dept_name, name, salary) - teaches(ID, Spr, semester)
SELECT name FROM instructor WHERE ID NOT IN (SELECT ID FROM teaches WHERE semester = 'Spring');
List the writers of the books in ascending alphabetical order.? Schema: - book(Ela, Issues, Title, Writer)
SELECT Writer FROM book ORDER BY Writer ASC NULLS LAST;
What are the names of schools with the top 3 largest size? Schema: - College(M, cName, enr, state)
SELECT cName FROM College ORDER BY enr DESC NULLS LAST LIMIT 3;
Find the first names that are used for professionals or owners but are not used as dog names.? Schema: - Professionals(Wiscons, cell_number, city, email_address, home_phone, role_code, state, street) - Owners(email_address, first_name, last_name, state) - Dogs(abandoned_yn, age, breed_code, date_arrived, date_departed, name, size_code, weight)
SELECT DISTINCT first_name FROM (SELECT first_name FROM Professionals UNION ALL SELECT first_name FROM Owners WHERE first_name NOT IN (SELECT name FROM Dogs));
return me the paper after 2000 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 AND T2."year" > 2000;
what is the area of the state with the smallest population density? Schema: - state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom)
SELECT area FROM state WHERE density = (SELECT MIN(density) FROM state);
Find the dates of the tests taken with result "Pass".? Schema: - Student_Tests_Taken(date_test_taken, test_result)
SELECT date_test_taken FROM Student_Tests_Taken WHERE test_result = 'Pass';
How many Bars in Dallas have a rating above 3.5 ? Schema: - category(...) - business(business_id, city, full_address, name, rating, review_count, state)
SELECT COUNT(DISTINCT T1.name) AS num_bars FROM category AS T2 JOIN business AS T1 ON T2.business_id = T1.business_id WHERE T1.city = 'Dallas' AND T1.rating > 3.5 AND T2.category_name = 'Bars';
Find the zip code in which the average mean visibility is lower than 10.? Schema: - weather(AVG, COUNT, M, Ra, cloud_cover, date, diff, events, mean_humidity, mean_sea_level_pressure_inches, mean_temperature_f, mean_visibility_miles, ... (1 more))
SELECT zip_code FROM weather WHERE zip_code IS NOT NULL GROUP BY zip_code HAVING AVG(mean_visibility_miles) < 10;
display the full name (first and last), hire date, salary, and department number for those employees whose first name does not containing the letter M and make the result set in ascending order by department number.? 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, HIRE_DATE, SALARY, DEPARTMENT_ID FROM employees WHERE FIRST_NAME NOT LIKE '%M%' ORDER BY DEPARTMENT_ID ASC NULLS LAST;
Find all movies produced in 2015? Schema: - movie(Budget_million, Director, Find, Gross_worldwide, T1, Title, Year, budget, release_year, title)
SELECT title FROM movie WHERE release_year = 2015;
Find all years that have a movie that received a rating of 4 or 5, and sort them in increasing order of year.? Schema: - Movie(T1, director, title, year) - Rating(Rat, mID, rID, stars)
SELECT DISTINCT "year" FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars >= 4 ORDER BY T1."year" ASC NULLS LAST;
What are the names of reviewers who had rated 3 star and 4 star? Schema: - Rating(Rat, mID, rID, stars) - Reviewer(Lew, name, rID)
SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars IN (3, 4) GROUP BY T2.name HAVING COUNT(DISTINCT T1.stars) = 2;
top author in 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;
How many addresses have zip code 197? Schema: - Addresses(address_content, city, country, line_1, line_1_number_building, line_2, state_province_county, town_city, zip_postcode)
SELECT COUNT(*) AS num_addresses FROM Addresses WHERE zip_postcode = '197';
List the name of film studio that have the most number of films.? Schema: - film(COUNT, Directed_by, Director, Gross_in_dollar, JO, LENGTH, Studio, T1, Title, language_id, rating, rental_rate, ... (3 more))
SELECT Studio FROM film WHERE Studio IS NOT NULL GROUP BY Studio ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
which rivers do not run through usa? Schema: - river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse)
SELECT river_name FROM river WHERE country_name != 'usa';
How many papers did michael i. jordan publish in 2016 ? Schema: - writes(...) - author(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT COUNT(T2.paperId) AS num_papers 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 = 'michael i. jordan' AND T3."year" = 2016;
How many students are attending English courses? Schema: - Courses(course_description, course_name) - Student_Course_Attendance(course_id, date_of_attendance, student_id)
SELECT COUNT(*) AS num_students FROM Courses AS T1 JOIN Student_Course_Attendance AS T2 ON T1.course_id = CAST(T2.course_id AS TEXT) WHERE T1.course_name = 'English';
What are the first and last names of the 5 customers who purchased something most recently? Schema: - customers(Mart, city, company, country, email, first_name, last_name, phone, state) - invoices(billing_city, billing_country, billing_state, total)
SELECT T1.first_name, T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY T2.invoice_date DESC NULLS LAST LIMIT 5;
What are the building full names that contain the word "court"? Schema: - Apartment_Buildings(building_address, building_description, building_full_name, building_manager, building_phone, building_short_name)
SELECT building_full_name FROM Apartment_Buildings WHERE building_full_name LIKE '%court%';
List name, dates active, and number of deaths for all storms with at least 1 death.? Schema: - storm(Damage_millions_USD, Dates_active, Name, Number_Deaths)
SELECT Name, Dates_active, Number_Deaths FROM storm WHERE Number_Deaths >= 1;
What document types have more than 2 corresponding documents? 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))
SELECT document_type_code FROM Documents WHERE document_type_code IS NOT NULL GROUP BY document_type_code HAVING COUNT(*) > 2;
What is the total surface area of the continents Asia and Europe? 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 Continent = 'Asia' OR Continent = 'Europe';
Find the names of customers who are not living in the state of California.? 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)) - Customer_Addresses(address_type_code) - Addresses(address_content, city, country, line_1, line_1_number_building, line_2, state_province_county, town_city, zip_postcode)
SELECT DISTINCT customer_name FROM Customers WHERE customer_name NOT IN (SELECT T1.customer_name FROM Customers AS T1 JOIN Customer_Addresses AS T2 ON T1.customer_id = T2.customer_id JOIN Addresses AS T3 ON T2.address_id = T3.address_id WHERE T3.state_province_county = 'California');
citations for Daniel Jurafsky? Schema: - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - cite(...) - writes(...) - author(...)
SELECT DISTINCT T3.paperId FROM paper AS T3 JOIN cite AS T4 ON T3.paperId = T4.citingPaperId JOIN writes AS T2 ON T2.paperId = T4.citedPaperId JOIN author AS T1 ON T2.authorId = T1.authorId WHERE T1.authorName = 'Daniel Jurafsky';
What is oren etzioni 's latest paper ? Schema: - writes(...) - author(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT T2.paperId 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 = 'oren etzioni' GROUP BY T2.paperId, T3."year" ORDER BY T3."year" DESC NULLS LAST;
Find the names of artists that do not have any albums.? Schema: - Artist(Name) - Album(Title)
SELECT Name FROM Artist WHERE Name NOT IN (SELECT T2.Name FROM Album AS T1 JOIN Artist AS T2 ON T1.ArtistId = T2.ArtistId);
What are all the different zip codes that have a maximum dew point that was always below 70? Schema: - weather(AVG, COUNT, M, Ra, cloud_cover, date, diff, events, mean_humidity, mean_sea_level_pressure_inches, mean_temperature_f, mean_visibility_miles, ... (1 more))
SELECT zip_code FROM weather WHERE zip_code IS NOT NULL GROUP BY zip_code HAVING MAX(max_dew_point_f) < 70;
Give the name, year of independence, and surface area of the country that has the lowest population.? Schema: - country(Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, M, Name, Official_native_language, ... (4 more))
SELECT Name, SurfaceArea, IndepYear FROM country ORDER BY Population ASC NULLS LAST LIMIT 1;
What are the papers published under the institution "Indiana University"? Schema: - Papers(title) - Authorship(...) - Inst(...)
SELECT DISTINCT T1.title FROM Papers AS T1 JOIN Authorship AS T2 ON T1.paperID = T2.paperID JOIN Inst AS T3 ON T2.instID = T3.instID WHERE T3.name = 'Indiana University';
What are the first names of the professors who do not teach a class.? Schema: - EMPLOYEE(EMP_DOB, EMP_FNAME, EMP_JOBCODE, EMP_LNAME) - CLASS(CLASS_CODE, CLASS_ROOM, CLASS_SECTION, CRS_CODE, PROF_NUM)
SELECT EMP_FNAME FROM EMPLOYEE WHERE EMP_JOBCODE = 'PROF' AND EMP_FNAME NOT IN (SELECT T1.EMP_FNAME FROM EMPLOYEE AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM);
How many male and female assistant professors do we have? Schema: - Faculty(Building, COUNT, FacID, Fname, LName, Lname, Phone, Pr, Rank, Room, Sex)
SELECT Sex, COUNT(*) AS num_faculty FROM Faculty WHERE "Rank" = 'AsstProf' GROUP BY Sex;
return me the number of authors who have papers in the VLDB conference .? Schema: - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year) - conference(homepage, name) - writes(...) - author(...)
SELECT COUNT(DISTINCT T1.name) AS num_authors FROM publication AS T4 JOIN conference AS T2 ON T4.cid = CAST(T2.cid AS TEXT) JOIN writes AS T3 ON T3.pid = T4.pid JOIN author AS T1 ON T3.aid = T1.aid WHERE T2.name = 'VLDB';
Find the name and age of the visitor who bought the most tickets at once.? Schema: - visitor(Age, Level_of_membership, Name) - visit(...)
SELECT T1.Name, T1.Age FROM visitor AS T1 JOIN visit AS T2 ON T1.ID = T2.visitor_ID ORDER BY T2.Num_of_Ticket DESC NULLS LAST LIMIT 1;
What is the average age for each dorm and what are the names of each dorm? Schema: - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age) - Lives_in(...) - Dorm(dorm_name, gender, student_capacity)
SELECT AVG(T1.Age) AS avg_age, T3.dorm_name FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name;
keyphrases by Luke Zettlemoyer? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...) - author(...)
SELECT DISTINCT T1.keyphraseId FROM paperKeyphrase AS T2 JOIN keyphrase AS T1 ON T2.keyphraseId = T1.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId JOIN writes AS T4 ON T4.paperId = T3.paperId JOIN author AS T5 ON T4.authorId = T5.authorId WHERE T5.authorName = 'Luke Zettlemoyer';
Return the result that is most frequent at music festivals.? Schema: - music_festival(COUNT, Category, Date_of_ceremony, Result)
SELECT "Result" FROM music_festival GROUP BY "Result" ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
How many girl students who are younger than 25? Schema: - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT COUNT(*) AS num_girl_students FROM Student WHERE Sex = 'F' AND Age < 25;
return me the number of authors who have cooperated with " H. V. Jagadish " .? Schema: - writes(...) - author(...) - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year)
SELECT COUNT(DISTINCT T2.name) AS num_authors FROM writes AS T3 JOIN author AS T2 ON T3.aid = T2.aid JOIN publication AS T5 ON T3.pid = T5.pid JOIN writes AS T4 ON T4.pid = T5.pid JOIN author AS T1 ON T4.aid = T1.aid WHERE T1.name = 'H. V. Jagadish';
Return the issue dates of volumes by artists who are at most 23 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 Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.Age <= 23;
What is the name of the customer that made the order with the largest quantity? 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)) - Customer_Orders(customer_id, order_date, order_id, order_shipping_charges) - Order_Items(COUNT, DOUBLE, INT, TRY_CAST, order_id, order_item_id, order_quantity, product_id, product_quantity)
SELECT T1.customer_name FROM Customers AS T1 JOIN Customer_Orders AS T2 ON T1.customer_id = T2.customer_id JOIN Order_Items AS T3 ON T2.order_id = T3.order_id WHERE TRY_CAST(T3.order_quantity AS DOUBLE) = (SELECT MAX(TRY_CAST(order_quantity AS DOUBLE)) FROM Order_Items);
Find the ids of reviewers who didn't only give 4 star.? Schema: - Rating(Rat, mID, rID, stars)
SELECT rID FROM Rating WHERE stars != 4;
What are the names of customers who have taken out more than one loan? Schema: - customer(COUNT, T1, acc_bal, acc_type, active, check, credit_score, cust_name, no_of_loans, sav, state, store_id) - loan(...)
SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID GROUP BY T1.cust_name HAVING COUNT(*) > 1;
Retrieve the average age of members of the club "Tennis Club".? 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 AVG(T3.Age) AS avg_age 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 = 'Tennis Club';
List the names of the employees who authorized the destruction of documents and the employees who destroyed the corresponding documents.? Schema: - Documents_to_be_Destroyed(Destroyed_by_Employee_ID, Destruction_Authorised_by_Employee_ID) - Employees(COUNT, Date_of_Birth, Employee_ID, Employee_Name, Role_Code, employee_id, employee_name, role_code)
SELECT T2.Employee_Name, T3.Employee_Name FROM Documents_to_be_Destroyed AS T1 JOIN Employees AS T2 ON T1.Destruction_Authorised_by_Employee_ID = T2.Employee_ID JOIN Employees AS T3 ON T1.Destroyed_by_Employee_ID = T3.Employee_ID;
Compute the average profits companies make.? Schema: - Companies(Assets_billion, Bank, COUNT, Ch, Headquarters, Industry, Market_Value_billion, Profits_billion, Sales_billion, T1, name)
SELECT AVG(Profits_billion) AS avg_profits_billion FROM Companies;
Return the ids and details corresponding to projects for which there are more than two documents.? Schema: - Projects(COUNT, Hours, Name, Project_Details, Project_ID, organ, organisation_id, project_details) - 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.Project_ID, T1.Project_Details FROM Projects AS T1 JOIN Documents AS T2 ON T1.Project_ID = T2.Project_ID GROUP BY T1.Project_ID, T1.Project_Details HAVING COUNT(*) > 2;
What are the dates of publications in descending order of price? Schema: - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year)
SELECT Publication_Date FROM publication ORDER BY Price DESC NULLS LAST;
List the names of poker players ordered by the final tables made in ascending order.? Schema: - people(Age, Birth_Date, Birth_Place, COUNT, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more)) - poker_player(Best_Finish, Earnings, Final_Table_Made, Money_Rank)
SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Final_Table_Made ASC NULLS LAST;
Find number of pets owned by students who are older than 20.? Schema: - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age) - Has_Pet(...)
SELECT COUNT(*) AS num_pets FROM Student AS T1 JOIN Has_Pet AS T2 ON T1.StuID = T2.StuID WHERE T1.Age > 20;
datasets used for semantic parsing? Schema: - paperDataset(...) - dataset(...) - paperKeyphrase(...) - keyphrase(...)
SELECT DISTINCT T2.datasetId FROM paperDataset AS T3 JOIN dataset AS T2 ON T3.datasetId = T2.datasetId JOIN paperKeyphrase AS T1 ON T1.paperId = T3.paperId JOIN keyphrase AS T4 ON T1.keyphraseId = T4.keyphraseId WHERE T4.keyphraseName = 'semantic parsing';
What are the details of the three most expensive hotels? Schema: - Hotels(hotel_id, other_hotel_details, pets_allowed_yn, price_range, star_rating_code)
SELECT other_hotel_details FROM Hotels ORDER BY price_range DESC NULLS LAST LIMIT 3;
Show the addresses of the buildings that have apartments with more than 2 bathrooms.? Schema: - Apartment_Buildings(building_address, building_description, building_full_name, building_manager, building_phone, building_short_name) - Apartments(AVG, COUNT, INT, SUM, TRY_CAST, apt_number, apt_type_code, bathroom_count, bedroom_count, room_count)
SELECT T1.building_address FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T2.bathroom_count > 2;
how many people live in the smallest state bordering wyoming? 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 population FROM state WHERE population = (SELECT MAX(population) FROM state WHERE state_name IN (SELECT border FROM border_info WHERE state_name = 'wyoming')) AND state_name IN (SELECT border FROM border_info WHERE state_name = 'wyoming');
find the minimum and maximum number of products of all stores.? Schema: - shop(Address, District, INT, Location, Manager_name, Name, Number_products, Open_Year, Score, Shop_ID, Shop_Name, T1, ... (1 more))
SELECT MIN(Number_products) AS min_number_products, MAX(Number_products) AS max_number_products FROM shop;
Show all party names and their region names.? Schema: - party(COUNT, Comptroller, First_year, Governor, Last_year, Left_office, Location, Minister, Number_of_hosts, Party, Party_Theme, Party_name, ... (3 more)) - region(Label, Region_code, Region_name)
SELECT T1.Party_name, T2.Region_name FROM party AS T1 JOIN region AS T2 ON T1.Region_ID = T2.Region_ID;
Find the total checkins in " Brighton Heights " neighbourhood? Schema: - checkin(...) - business(business_id, city, full_address, name, rating, review_count, state) - neighbourhood(...)
SELECT SUM(T3."count") AS total_checkins FROM checkin AS T3 JOIN business AS T1 ON T3.business_id = T1.business_id JOIN neighbourhood AS T2 ON T2.business_id = T1.business_id WHERE T2.neighbourhood_name = 'Brighton Heights';
Select the name and price of the cheapest product.? Schema: - Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more))
SELECT Name, Price FROM Products ORDER BY Price ASC NULLS LAST LIMIT 1;
List the height and weight of people in descending order of height.? Schema: - people(Age, Birth_Date, Birth_Place, COUNT, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more))
SELECT Height, Weight FROM people ORDER BY Height DESC NULLS LAST;