question
stringlengths
43
589
query
stringlengths
19
598
What papers were published during the conference pldi 2015 ? Schema: - venue(venueId, venueName) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT T1.paperId FROM venue AS T2 JOIN paper AS T1 ON T2.venueId = T1.venueId WHERE T1."year" = 2015 AND T2.venueName = 'pldi';
What are the party emails associated with parties that used the party form that is the most common? Schema: - Parties(party_email, party_phone, payment_method_code) - Party_Forms(...)
SELECT T1.party_email FROM Parties AS T1 JOIN Party_Forms AS T2 ON T1.party_id = T2.party_id WHERE T2.form_id = (SELECT form_id FROM Party_Forms WHERE form_id IS NOT NULL GROUP BY form_id ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1);
What is the average ticket sales gross in dollars of films? Schema: - film(COUNT, Directed_by, Director, Gross_in_dollar, JO, LENGTH, Studio, T1, Title, language_id, rating, rental_rate, ... (3 more))
SELECT AVG(Gross_in_dollar) AS avg_ticket_sales_gross FROM film;
Please list the countries and years of film market estimations.? Schema: - film_market_estimation(High_Estimate, Low_Estimate, Type) - market(Country, Number_cities)
SELECT T2.Country, T1."Year" FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID;
give me some good restaurants on buchanan in san francisco for arabic food ? 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 = 'san francisco' AND T2.street_name = 'buchanan' AND T1.food_type = 'arabic' AND T1.rating > 2.5;
What is the average cost of procedures that physician John Wen was trained in? Schema: - Physician(I, Name) - Trained_In(...) - Procedures(Cost, Name)
SELECT AVG(T3.Cost) AS avg_cost FROM Physician AS T1 JOIN Trained_In AS T2 ON T1.EmployeeID = T2.Physician JOIN Procedures AS T3 ON T3.Code = T2.Treatment WHERE T1.Name = 'John Wen';
Show the times of elimination by "Punk" or "Orton".? Schema: - Elimination(Benjam, Eliminated_By, Elimination_Move, T1, Team, Time)
SELECT "Time" FROM Elimination WHERE Eliminated_By = 'Punk' OR Eliminated_By = 'Orton';
How many neighbourhoods have a business with rating 5 in Madison ? Schema: - neighbourhood(...) - business(business_id, city, full_address, name, rating, review_count, state)
SELECT COUNT(DISTINCT T1.neighbourhood_name) AS num_neighbourhoods FROM neighbourhood AS T1 JOIN business AS T2 ON T1.business_id = T2.business_id WHERE T2.city = 'Madison' AND T2.rating = 5;
Return the different descriptions for templates that have been used in a document.? Schema: - Ref_Template_Types(Template_Type_Code, Template_Type_Description) - Templates(COUNT, M, Template_ID, Template_Type_Code, Version_Number) - 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 DISTINCT T1.Template_Type_Description FROM Ref_Template_Types AS T1 JOIN Templates AS T2 ON T1.Template_Type_Code = T2.Template_Type_Code JOIN Documents AS T3 ON T2.Template_ID = T3.Template_ID;
most cited papers for 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 are the average rating and resolution of songs that are in Bangla? Schema: - song(COUNT, M, art, artist_name, engl, f_id, genre_is, languages, rat, rating, releasedate, resolution, ... (1 more))
SELECT AVG(rating) AS avg_rating, AVG(resolution) AS avg_resolution FROM song WHERE languages = 'bangla';
What is the total number of routes for each country and airline in that country? Schema: - airlines(Abbreviation, Airline, COUNT, Country, active, country, name) - routes(...)
SELECT T1.country, T1.name, COUNT(*) AS num_routes FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.country, T1.name;
author who wrote papers with Noah A Smith? Schema: - writes(...) - author(...)
SELECT DISTINCT T1.authorId FROM writes AS T3 JOIN author AS T2 ON T3.authorId = T2.authorId JOIN writes AS T4 ON T4.paperId = T3.paperId JOIN author AS T1 ON T4.authorId = T1.authorId WHERE T2.authorName = 'Noah A Smith';
what is the tallest mountain in america? Schema: - mountain(AVG, COUNT, Country, Height, JO, Name, Prominence, Range, T1, mck, mounta, mountain_altitude, ... (3 more))
SELECT mountain_name FROM mountain WHERE mountain_altitude = (SELECT MAX(mountain_altitude) FROM mountain);
what topics does Luke Zettlemoyer publish in? 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';
List the name of the phone model launched in year 2002 and with the highest RAM size.? Schema: - chip_model(Launch_year, Model_name, RAM_MiB, WiFi) - phone(Accreditation_level, Accreditation_type, COUNT, Carrier, Company_name, Hardware_Model_name, Memory_in_G, Name, Spr, chip_model, p1, screen_mode)
SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002 ORDER BY T1.RAM_MiB DESC NULLS LAST LIMIT 1;
What are the names of all tracks that are on playlists titled Movies? Schema: - tracks(composer, milliseconds, name, unit_price) - playlist_tracks(...) - playlists(name)
SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T3.id = T2.playlist_id WHERE T3.name = 'Movies';
Find the names of the workshop groups where services with product name "film" are performed.? Schema: - Drama_Workshop_Groups(COUNT, Currency_Code, Marketing_Region_Code, Store_Name) - Services(Service_Type_Code, Service_name)
SELECT T1.Store_Phone, T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T2.Product_Name = 'film';
List the names of studios that have at least two 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 HAVING COUNT(*) >= 2;
Who are the players that have names containing the letter a? Schema: - Player(HS, pName, weight, yCard)
SELECT DISTINCT pName FROM Player WHERE pName LIKE '%a%';
Who are the different players, what season do they play in, and what is the name of the team they are on? Schema: - match_season(COUNT, College, Draft_Class, Draft_Pick_Number, JO, Player, Position, T1, Team) - team(Name)
SELECT T1.Season, T1.Player, T2.Name FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id;
Find the address of all customers that live in Germany and have invoice.? Schema: - Customer(Email, FirstName, LastName, State, lu) - Invoice(BillingCountry)
SELECT DISTINCT T1.Address FROM Customer AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.Country = 'Germany';
Find the name of services that have been used for more than 2 times in first notification of loss.? Schema: - First_Notification_of_Loss(...) - Services(Service_Type_Code, Service_name)
SELECT T2.Service_name FROM First_Notification_of_Loss AS T1 JOIN Services AS T2 ON T1.Service_ID = T2.Service_ID GROUP BY T1.Service_ID, T2.Service_name HAVING COUNT(*) > 2;
For each station, find its latitude and the minimum duration of trips that ended at the station.? Schema: - station(Annual_entry_exit, Annual_interchanges, COUNT, Location, MAX, Main_Services, Mounta, Name, Number_of_Platforms, city, id, lat, ... (4 more)) - trip(COUNT, bike_id, duration, end_station_name, id, start_date, start_station_id, start_station_name, zip_code)
SELECT T1.name, T1.lat, MIN(T2.duration) AS min_duration FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.end_station_id GROUP BY T2.end_station_id, T1.name, T1.lat;
Give me the dates when the max temperature was higher than 85.? 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 "date" FROM weather WHERE max_temperature_f > 85;
Who is the friend of Zach with longest year relationship? Schema: - PersonFriend(M, friend, name)
SELECT friend FROM PersonFriend WHERE name = 'Zach' AND "year" = (SELECT MAX("year") FROM PersonFriend WHERE name = 'Zach');
Show the title and director for all films.? Schema: - film(COUNT, Directed_by, Director, Gross_in_dollar, JO, LENGTH, Studio, T1, Title, language_id, rating, rental_rate, ... (3 more))
SELECT Title, Directed_by FROM film;
What are the country codes for countries that do not speak English? Schema: - countrylanguage(COUNT, CountryCode, Engl, Language)
SELECT CountryCode FROM countrylanguage WHERE CountryCode NOT IN (SELECT CountryCode FROM countrylanguage WHERE "Language" = 'English');
When did researchers start and stop working? Schema: - Project_Staff(COUNT, date_from, date_to, role_code)
SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'researcher';
return me the papers by " H. V. Jagadish " .? Schema: - writes(...) - author(...) - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year)
SELECT T3.title FROM writes AS T2 JOIN author AS T1 ON T2.aid = T1.aid JOIN publication AS T3 ON T2.pid = T3.pid WHERE T1.name = 'H. V. Jagadish';
authors working on ImageNet? Schema: - paperDataset(...) - dataset(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...)
SELECT DISTINCT T2.paperId FROM paperDataset AS T3 JOIN dataset AS T1 ON T3.datasetId = T1.datasetId JOIN paper AS T4 ON T4.paperId = T3.paperId JOIN writes AS T2 ON T2.paperId = T4.paperId WHERE T1.datasetName = 'ImageNet' GROUP BY T2.paperId;
papers published in the area of Question Answering? 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 = 'Question Answering';
Count the number of statements.? Schema: - Statements(Statement_Details, Statement_ID)
SELECT COUNT(*) AS num_statements FROM Statements;
What is the name of the department with the most students minoring in it? Schema: - Department(Building, COUNT, DNO, DName, DPhone, DepartmentID, Division, FacID, Head, LName, Room, T2) - Minor_in(...)
SELECT T1.DName FROM Department AS T1 JOIN Minor_in AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO, T1.DName ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Which county has the largest population? Give me the name of the county.? Schema: - county(County_name, Population, Zip_code)
SELECT County_name FROM county ORDER BY Population DESC NULLS LAST LIMIT 1;
list papers published by balakrishnan prabhakaran? Schema: - writes(...) - author(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT T3.paperId, T3."year" 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 = 'balakrishnan prabhakaran';
What campuses are located in Chico? Schema: - Campuses(Campus, County, Franc, Location)
SELECT Campus FROM Campuses WHERE Location = 'Chico';
Count the number of races.? Schema: - race(Class, Date, Name)
SELECT COUNT(*) AS num_races FROM race;
Sort all the rooms according to the price. Just report the room names.? Schema: - Rooms(K, RoomId, basePrice, bedType, beds, decor, maxOccupancy, roomName)
SELECT roomName FROM Rooms ORDER BY basePrice ASC NULLS LAST;
how many papers published in nature communications 2015 ? Schema: - venue(venueId, venueName) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT COUNT(T1.paperId) AS num_papers FROM venue AS T2 JOIN paper AS T1 ON T2.venueId = T1.venueId WHERE T1."year" = 2015 AND T2.venueName = 'nature communications';
Return all players sorted by college in ascending alphabetical order.? Schema: - match_season(COUNT, College, Draft_Class, Draft_Pick_Number, JO, Player, Position, T1, Team)
SELECT Player FROM match_season ORDER BY College ASC NULLS LAST;
How many continents are there? Schema: - continents(...)
SELECT COUNT(*) AS num_continents FROM continents;
what year had the most number of NIPS papers ? Schema: - venue(venueId, venueName) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT COUNT(T1.paperId) AS num_papers, T1."year" FROM venue AS T2 JOIN paper AS T1 ON T2.venueId = T1.venueId WHERE T2.venueName = 'NIPS' GROUP BY T1."year" ORDER BY num_papers DESC NULLS LAST;
What instrument is used the most? Schema: - Instruments(COUNT, Instrument)
SELECT Instrument FROM Instruments WHERE Instrument IS NOT NULL GROUP BY Instrument ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Which part fault requires the most number of skills to fix? List part id and name.? Schema: - Parts(chargeable_amount, part_id) - Part_Faults(...) - Skills_Required_To_Fix(...)
SELECT T1.part_id, T1.part_name FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id JOIN Skills_Required_To_Fix AS T3 ON T2.part_fault_id = T3.part_fault_id GROUP BY T1.part_id, T1.part_name ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Find the name, headquarter and founder of the manufacturer that has the highest revenue.? Schema: - Manufacturers(Aust, Beij, Founder, Headquarter, I, M, Name, Revenue)
SELECT Name, Headquarter, Founder FROM Manufacturers ORDER BY Revenue DESC NULLS LAST LIMIT 1;
What are the subject ID, subject name, and the number of available courses for each subject? Schema: - Courses(course_description, course_name) - Subjects(subject_name)
SELECT T1.subject_id, T2.subject_name, COUNT(*) AS num_courses FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id, T2.subject_name;
Find the birth dates corresponding to employees who live in the city of Edmonton.? Schema: - Employee(BirthDate, City, FirstName, LastName, Phone)
SELECT BirthDate FROM Employee WHERE City = 'Edmonton';
How many parties are there? Schema: - party(COUNT, Comptroller, First_year, Governor, Last_year, Left_office, Location, Minister, Number_of_hosts, Party, Party_Theme, Party_name, ... (3 more))
SELECT COUNT(*) AS num_parties FROM party;
keyphrases used by dan klein in his emnlp papers? Schema: - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - paperKeyphrase(...) - venue(venueId, venueName) - writes(...) - author(...)
SELECT DISTINCT T2.keyphraseId FROM paper AS T3 JOIN paperKeyphrase AS T2 ON T3.paperId = T2.paperId JOIN venue AS T4 ON T4.venueId = T3.venueId JOIN writes AS T5 ON T5.paperId = T3.paperId JOIN author AS T1 ON T5.authorId = T1.authorId WHERE T1.authorName = 'dan klein' AND T4.venueName = 'emnlp';
What are the ids of the students who are not involved in any activity? Schema: - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age) - Participates_in(...)
SELECT StuID FROM Student WHERE StuID NOT IN (SELECT StuID FROM Participates_in);
which river goes through the most states? Schema: - river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse)
SELECT river_name FROM river GROUP BY (river_name) ORDER BY COUNT(DISTINCT traverse) DESC NULLS LAST LIMIT 1;
what is the length of the longest river that runs through texas? Schema: - river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse)
SELECT LENGTH FROM river WHERE LENGTH = (SELECT MAX(LENGTH) FROM river WHERE traverse = 'texas') AND traverse = 'texas';
what rivers are there in illinois? Schema: - river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse)
SELECT river_name FROM river WHERE traverse = 'illinois';
How many students play sports? Schema: - SportsInfo(COUNT, GamesPlayed, OnScholarship, SportName, StuID)
SELECT COUNT(DISTINCT StuID) AS num_students FROM SportsInfo;
what are the populations of the states through which the mississippi run? Schema: - state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom) - river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse)
SELECT population FROM state WHERE state_name IN (SELECT traverse FROM river WHERE river_name = 'mississippi');
How many unique languages are spoken in the world? Schema: - countrylanguage(COUNT, CountryCode, Engl, Language)
SELECT COUNT(DISTINCT "Language") AS num_languages FROM countrylanguage;
What are the names of races held after 12:00:00 or before 09:00:00? Schema: - races(date, name)
SELECT name FROM races WHERE "time" > '12:00:00' OR "time" < '09:00:00';
What are the names of the mills which are not located in 'Donceel'? Schema: - mill(Moul, location, name, type)
SELECT name FROM mill WHERE location != 'Donceel';
Show the most common apartment type code among apartments with more than 1 bathroom.? Schema: - Apartments(AVG, COUNT, INT, SUM, TRY_CAST, apt_number, apt_type_code, bathroom_count, bedroom_count, room_count)
SELECT apt_type_code FROM Apartments WHERE bathroom_count > 1 AND apt_type_code IS NOT NULL GROUP BY apt_type_code ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Find all Bars reviewed by Patrick with at least 3 stars? Schema: - category(...) - business(business_id, city, full_address, name, rating, review_count, state) - review(i_id, rank, rating, text) - user_(name)
SELECT T1."name" FROM category AS T2 JOIN business AS T1 ON T2.business_id = T1.business_id JOIN review AS T3 ON T3.business_id = T1.business_id JOIN user_ AS T4 ON T4.user_id = T3.user_id WHERE T1.rating >= 3 AND T2.category_name = 'Bars' AND T4."name" = 'Patrick';
find the number of medicines offered by each trade.? Schema: - medicine(FDA_approved, Trade_Name, name)
SELECT Trade_Name, COUNT(*) AS num_medicines FROM medicine GROUP BY Trade_Name;
where are some good arabics on buchanan in san francisco ? 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 = 'san francisco' AND T2.street_name = 'buchanan' AND T1.food_type = 'arabic' AND T1.rating > 2.5;
What is the product, chromosome and porphyria related to the enzymes which take effect at the location 'Cytosol'? Schema: - enzyme(Chromosome, Location, OMIM, Porphyria, Product, name)
SELECT Product, Chromosome, Porphyria FROM enzyme WHERE Location = 'Cytosol';
What are the names and addressed of customers who have both New and Pending orders? 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 DISTINCT T1.customer_name, T1.customer_address FROM Customers AS T1 JOIN Customer_Orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code IN ('New', 'Pending');
How many CSU campuses are there? Schema: - Campuses(Campus, County, Franc, Location)
SELECT COUNT(*) AS num_campuses FROM Campuses;
Which countries have greater area than that of any country in Europe? Schema: - country(Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, M, Name, Official_native_language, ... (4 more))
SELECT Name FROM country WHERE SurfaceArea > (SELECT MIN(SurfaceArea) FROM country WHERE Continent = 'Europe');
How many different cities are they from? Schema: - Person(M, age, city, eng, gender, job, name)
SELECT COUNT(DISTINCT city) AS num_cities FROM Person;
How many courses are offered? Schema: - CLASS(CLASS_CODE, CLASS_ROOM, CLASS_SECTION, CRS_CODE, PROF_NUM)
SELECT COUNT(DISTINCT CRS_CODE) AS num_courses FROM CLASS;
List the details of the customers who do not have any policies.? 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_Policies(COUNT, Policy_Type_Code)
SELECT DISTINCT Customer_Details FROM Customers WHERE Customer_Details NOT IN (SELECT T1.Customer_Details FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_ID = T2.Customer_ID);
How many ships ended up being 'Captured'? Schema: - ship(COUNT, DIST, JO, K, Name, Nationality, T1, Tonnage, Type, disposition_of_ship, name, tonnage)
SELECT COUNT(*) AS num_ships FROM ship WHERE disposition_of_ship = 'Captured';
Return the famous release date for the oldest artist.? Schema: - artist(Age, Artist, Country, Famous_Release_date, Famous_Title, Year_Join, artist_name, country, gender)
SELECT Famous_Release_date FROM artist ORDER BY Age DESC NULLS LAST LIMIT 1;
Which advisors are advising more than 2 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;
Which parties did not have any delegates in elections? Schema: - party(COUNT, Comptroller, First_year, Governor, Last_year, Left_office, Location, Minister, Number_of_hosts, Party, Party_Theme, Party_name, ... (3 more)) - election(Committee, Date, Delegate, District, Vote_Percent, Votes)
SELECT Party FROM party WHERE Party_ID NOT IN (SELECT Party FROM election);
What are the names of enzymes whose product is not 'Heme'? Schema: - enzyme(Chromosome, Location, OMIM, Porphyria, Product, name)
SELECT name FROM enzyme WHERE Product != 'Heme';
give me a good arabic restaurant in mountain view ? 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 = 'mountain view' AND T1.food_type = 'arabic' AND T1.rating > 2.5;
List the time of elimination of the wrestlers with largest days held.? Schema: - Elimination(Benjam, Eliminated_By, Elimination_Move, T1, Team, Time) - wrestler(COUNT, Days_held, Location, Name, Reign)
SELECT T1."Time" FROM Elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = CAST(T2.Wrestler_ID AS TEXT) ORDER BY T2.Days_held DESC NULLS LAST LIMIT 1;
return me the conferences, which have more than 10 papers by " H. V. Jagadish " .? Schema: - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year) - conference(homepage, name) - writes(...) - author(...)
SELECT T2.name 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 T1.name = 'H. V. Jagadish' GROUP BY T2.name HAVING COUNT(DISTINCT T4.title) > 10;
What are the low and high estimates of film markets? Schema: - film_market_estimation(High_Estimate, Low_Estimate, Type)
SELECT Low_Estimate, High_Estimate FROM film_market_estimation;
return me the year of " Making database systems usable "? Schema: - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year)
SELECT "year" FROM publication WHERE title = 'Making database systems usable';
What is the first and last name of the oldest employee? Schema: - EMPLOYEE(EMP_DOB, EMP_FNAME, EMP_JOBCODE, EMP_LNAME)
SELECT EMP_FNAME, EMP_LNAME FROM EMPLOYEE ORDER BY EMP_DOB ASC NULLS LAST LIMIT 1;
How many storms had death records? Schema: - storm(Damage_millions_USD, Dates_active, Name, Number_Deaths)
SELECT COUNT(*) AS num_storms FROM storm WHERE Number_Deaths > 0;
How many cities are there that have more than 3 airports? Schema: - airports(AirportCode, AirportName, Argent, COUNT, City, Country, city, country, elevation, name)
SELECT COUNT(*) AS num_cities FROM (SELECT city FROM airports WHERE city IS NOT NULL GROUP BY city HAVING COUNT(*) > 3);
Find the name of organizations whose names contain "Party".? Schema: - Organizations(date_formed, organization_name)
SELECT organization_name FROM Organizations WHERE organization_name LIKE '%Party%';
Show the dates of performances with attending members whose roles are "Violin".? Schema: - member_attendance(...) - member_(Address, Age, COUNT, Card_Number, Country, Hometown, Level, Member_ID, Member_Name, Membership_card, Name, Party_ID, ... (1 more)) - performance(Attendance, COUNT, Date, Location, T1)
SELECT T3."Date" FROM member_attendance AS T1 JOIN member_ AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID WHERE T2.Role = 'Violin';
Which states have both owners and professionals living there? Schema: - Owners(email_address, first_name, last_name, state) - Professionals(Wiscons, cell_number, city, email_address, home_phone, role_code, state, street)
SELECT DISTINCT T1.state FROM Owners AS T1 JOIN Professionals AS T2 ON T1.state = T2.state;
Find the cities which have exactly two airports.? Schema: - airports(AirportCode, AirportName, Argent, COUNT, City, Country, city, country, elevation, name)
SELECT city FROM airports WHERE city IS NOT NULL GROUP BY city HAVING COUNT(*) = 2;
Count the number of cities in the state of Colorado.? 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_cities FROM Addresses WHERE state_province_county = 'Colorado';
How many characteristics does the product named "sesame" have? Schema: - Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more)) - Product_Characteristics(...)
SELECT COUNT(*) AS num_characteristics FROM Products AS T1 JOIN Product_Characteristics AS T2 ON T1.product_id = T2.product_id WHERE T1.product_name = 'sesame';
Which state has the most customers? 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))
SELECT state FROM Customers WHERE state IS NOT NULL GROUP BY state ORDER BY COUNT(*) ASC NULLS LAST LIMIT 1;
display all the information about the department Marketing.? Schema: - departments(DEPARTMENT_NAME, Market)
SELECT * FROM departments WHERE DEPARTMENT_NAME = 'Marketing';
display the department ID, full name (first and last name), salary for those employees who is highest salary in every department.? 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, SALARY, DEPARTMENT_ID, MAX(SALARY) AS max_salary FROM employees GROUP BY DEPARTMENT_ID, FIRST_NAME, LAST_NAME, SALARY;
What are the names of staff who have been assigned multiple jobs? Schema: - Staff(COUNT, Name, Other_Details, date_joined_staff, date_left_staff, date_of_birth, email_address, first_name, gender, last_name, middle_name, nickname) - Staff_Department_Assignments(COUNT, date_assigned_to, department_id, job_title_code, staff_id)
SELECT T1.staff_name FROM Staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id GROUP BY T2.staff_id, T1.staff_name HAVING COUNT(*) > 1;
What are the names of all the reviewers and movie names? 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 ranks of captains that have no captain that are in the Third-rate ship of the line class? Schema: - captain(COUNT, Class, INT, Name, Rank, TRY_CAST, age, capta, l)
SELECT DISTINCT "Rank" FROM captain WHERE "Rank" NOT IN (SELECT "Rank" FROM captain WHERE Class = 'Third-rate Ship of the line');
return me the authors who have cooperated with " H. V. Jagadish " after 2000 .? Schema: - writes(...) - author(...) - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year)
SELECT T2.name 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' AND T5."year" > 2000;
Which countries has the most number of airlines? Schema: - airlines(Abbreviation, Airline, COUNT, Country, active, country, name)
SELECT country FROM airlines WHERE country IS NOT NULL GROUP BY country ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Show all template type codes that are not used by any document.? Schema: - Templates(COUNT, M, Template_ID, Template_Type_Code, Version_Number) - 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 DISTINCT Template_Type_Code FROM Templates WHERE Template_Type_Code NOT IN (SELECT Template_Type_Code FROM Templates AS T1 JOIN Documents AS T2 ON T1.Template_ID = T2.Template_ID);
List the name of the colleges whose enrollment is greater 18000 sorted by the college's name.? Schema: - College(M, cName, enr, state)
SELECT cName FROM College WHERE enr > 18000 ORDER BY cName ASC NULLS LAST;
What are the names of high schoolers who both have friends and are liked? 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);