question stringlengths 43 589 | query stringlengths 19 598 |
|---|---|
return me the paper in PVLDB with the most 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' ORDER BY T2.citation_num DESC NULLS LAST LIMIT 1; |
What are the distinct template type descriptions for the templates ever used by any 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; |
List the area codes in which voters voted both for the contestant 'Tabatha Gehling' and the contestant 'Kelly Clauss'.?
Schema:
- CONTESTANTS(contestant_name)
- VOTES(created, phone_number, state, vote_id)
- AREA_CODE_STATE(area_code, state) | SELECT T3.area_code FROM CONTESTANTS AS T1 JOIN VOTES AS T2 ON T1.contestant_number = T2.contestant_number JOIN AREA_CODE_STATE AS T3 ON T2.state = T3.state WHERE T1.contestant_name IN ('Tabatha Gehling', 'Kelly Clauss') GROUP BY T3.area_code HAVING COUNT(DISTINCT T1.contestant_name) = 2; |
What is the average price across all products?
Schema:
- Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more)) | SELECT AVG(Price) AS avg_price FROM Products; |
how many people in boulder?
Schema:
- city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) | SELECT population FROM city WHERE city_name = 'boulder'; |
Show all video games and their types in the order of their names.?
Schema:
- Video_Games(COUNT, Dest, GName, GType, onl) | SELECT GName, GType FROM Video_Games ORDER BY GName ASC NULLS LAST; |
Count the 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 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 = 'Tennis Club'; |
Find the first name and gpa of the students whose gpa is lower than the average gpa of all students.?
Schema:
- STUDENT(DEPT_CODE, STU_DOB, STU_FNAME, STU_GPA, STU_HRS, STU_LNAME, STU_PHONE) | SELECT STU_FNAME, STU_GPA FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT); |
Which classrooms are used by grade 5?
Schema:
- list(COUNT, Classroom, FirstName, Grade, LastName) | SELECT DISTINCT Classroom FROM list WHERE Grade = 5; |
which state is the largest city in montana in?
Schema:
- city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) | SELECT state_name FROM city WHERE population = (SELECT MAX(population) FROM city WHERE state_name = 'montana') AND state_name = 'montana'; |
How many members of club "Bootup Baltimore" are younger 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 is the total amount of grants given by each organisations? Also list the organisation id.?
Schema:
- Grants(grant_amount, organisation_id) | SELECT SUM(grant_amount) AS total_grant_amount, organisation_id FROM Grants GROUP BY organisation_id; |
Which orders have shipment after 2000-01-01? Give me the order ids.?
Schema:
- Shipments(order_id, shipment_date, shipment_tracking_number) | SELECT order_id FROM Shipments WHERE shipment_date > '2000-01-01 00:00:00'; |
Find the policy type the most customers choose.?
Schema:
- Customer_Policies(COUNT, Policy_Type_Code) | SELECT Policy_Type_Code FROM Customer_Policies WHERE Policy_Type_Code IS NOT NULL GROUP BY Policy_Type_Code ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
Give the average quantity of stocks.?
Schema:
- stock(Quantity) | SELECT AVG(Quantity) AS avg_quantity FROM stock; |
Return the phone numbers for all customers and suppliers.?
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))
- Suppliers(...) | SELECT DISTINCT customer_phone FROM (SELECT customer_phone FROM Customers UNION ALL SELECT supplier_phone FROM Suppliers); |
What are the denomination more than one school have?
Schema:
- school(Denom, Denomination, EX, Enrollment, Founded, Location, School_Colors, T1, Type) | SELECT Denomination FROM school WHERE Denomination IS NOT NULL GROUP BY Denomination HAVING COUNT(*) > 1; |
Find all the customer last names that do not have invoice totals larger than 20.?
Schema:
- Customer(Email, FirstName, LastName, State, lu)
- Invoice(BillingCountry) | SELECT LastName FROM Customer WHERE LastName NOT IN (SELECT T1.LastName FROM Customer AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T2.Total > 20); |
Show all director names who have a movie in both year 1999 and 2000.?
Schema:
- movie(Budget_million, Director, Find, Gross_worldwide, T1, Title, Year, budget, release_year, title) | SELECT DISTINCT T1.Director FROM movie AS T1 JOIN movie AS T2 ON T1.Director = T2.Director WHERE T1."Year" = 2000 AND T2."Year" = 1999; |
number of papers in sigir conference?
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 T2.venueName = 'sigir'; |
Which police forces operate in both counties that are located in the East and in the West?
Schema:
- county_public_safety(COUNT, Case_burden, Crime_rate, Location, Name, Police_force, Police_officers, Population, T1) | SELECT T1.Police_force FROM county_public_safety AS T1 JOIN county_public_safety AS T2 ON T1.Police_force = T2.Police_force WHERE T1.Location = 'East' AND T2.Location = 'West' GROUP BY T1.Police_force; |
What are the names of the courses taught by the tutor whose personal name is "Julio"?
Schema:
- Course_Authors_and_Tutors(address_line_1, family_name, login_name, personal_name)
- Courses(course_description, course_name) | SELECT T2.course_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T1.personal_name = 'Julio'; |
what are the details of the cmi masters that have the cross reference code 'Tax'?
Schema:
- Customer_Master_Index(cmi_details)
- CMI_Cross_References(source_system_code) | SELECT T1.cmi_details FROM Customer_Master_Index AS T1 JOIN CMI_Cross_References AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T2.source_system_code = 'Tax'; |
What papers have been written by Peter Mertens and Dina Barbian ?
Schema:
- writes(...)
- author(...) | SELECT DISTINCT T3.paperId 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 = 'Peter Mertens' AND T1.authorName = 'Dina Barbian'; |
Find the types of documents with more than 4 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(*) > 4; |
Find the average fee on a CSU campus in 1996?
Schema:
- csu_fees(CampusFee) | SELECT AVG(CampusFee) AS avg_fee FROM csu_fees WHERE "Year" = 1996; |
List the popular publications on dependent types?
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 = 'dependent types'; |
Which party has two or more records?
Schema:
- party(COUNT, Comptroller, First_year, Governor, Last_year, Left_office, Location, Minister, Number_of_hosts, Party, Party_Theme, Party_name, ... (3 more)) | SELECT Party FROM party WHERE Party IS NOT NULL GROUP BY Party HAVING COUNT(*) >= 2; |
how many papers on convolutional neural networks have been published in the past year ?
Schema:
- paperKeyphrase(...)
- keyphrase(...)
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) | SELECT DISTINCT COUNT(T3.paperId) AS num_papers 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 = 'convolutional neural networks' AND T3."year" = 2016; |
return me the papers on PVLDB .?
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'; |
return me the paper by " H. V. Jagadish " with the most citations .?
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' ORDER BY T3.citation_num DESC NULLS LAST LIMIT 1; |
List the name of all playlist.?
Schema:
- playlists(name) | SELECT name FROM playlists; |
List all the businesses with more than 4.5 stars?
Schema:
- business(business_id, city, full_address, name, rating, review_count, state) | SELECT name FROM business WHERE rating > 4.5; |
Find the number of times ROY SWEAZY has reserved a room.?
Schema:
- Reservations(Adults, CheckIn, FirstName, Kids, LastName) | SELECT COUNT(*) AS num_reservations FROM Reservations WHERE FirstName = 'ROY' AND LastName = 'SWEAZY'; |
What are the official names of cities that have population over 1500 or less than 500?
Schema:
- city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) | SELECT Official_Name FROM city WHERE Population > 1500 OR Population < 500; |
What are the maximum and minimum number of silver medals for all the clubs?
Schema:
- club_rank(Gold, Silver, Total) | SELECT MAX(Silver) AS max_silver, MIN(Silver) AS min_silver FROM club_rank; |
List the names of all distinct wines ordered by price.?
Schema:
- wine(Appelation, Cases, Grape, M, Name, Price, Score, Winery, Year, Z, w) | SELECT Name FROM wine WHERE Name IS NOT NULL AND Price IS NOT NULL GROUP BY Name, Price ORDER BY Price ASC NULLS LAST; |
Find the name and id of the item with the highest average rating.?
Schema:
- item(title)
- review(i_id, rank, rating, text) | SELECT T1.title, T1.i_id FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id, T1.title, T1.i_id ORDER BY AVG(T2.rating) DESC NULLS LAST LIMIT 1; |
When was deep learning proposed ?
Schema:
- paperKeyphrase(...)
- keyphrase(...)
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) | SELECT DISTINCT T3."year" 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 = 'deep learning' GROUP BY T3."year" ORDER BY T3."year" ASC NULLS LAST; |
Find all users who have written tips about businesses in Dallas?
Schema:
- tip(month, text)
- business(business_id, city, full_address, name, rating, review_count, state)
- user_(name) | SELECT T3.name FROM tip AS T2 JOIN business AS T1 ON T2.business_id = T1.business_id JOIN user_ AS T3 ON T3.user_id = T2.user_id WHERE T1.city = 'Dallas'; |
What are the date and venue of each debate?
Schema:
- debate(Date, Venue) | SELECT "Date", Venue FROM debate; |
Find the distinct breed type and size type combinations for dogs.?
Schema:
- Dogs(abandoned_yn, age, breed_code, date_arrived, date_departed, name, size_code, weight) | SELECT DISTINCT breed_code, size_code FROM Dogs; |
return me the author in the " University of Michigan " whose papers have the most total citations .?
Schema:
- organization(continent, homepage, name)
- author(...)
- writes(...)
- publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year) | SELECT T1.name FROM organization AS T2 JOIN author AS T1 ON T2.oid = T1.oid JOIN writes AS T3 ON T3.aid = T1.aid JOIN publication AS T4 ON T3.pid = T4.pid WHERE T2.name = 'University of Michigan' GROUP BY T1.name ORDER BY SUM(T4.citation_num) DESC NULLS LAST LIMIT 1; |
What are the id and address of the shops which have a happy hour in May?
Schema:
- shop(Address, District, INT, Location, Manager_name, Name, Number_products, Open_Year, Score, Shop_ID, Shop_Name, T1, ... (1 more))
- happy_hour(COUNT, Month) | SELECT T1.Address, T1.Shop_ID FROM shop AS T1 JOIN happy_hour AS T2 ON T1.Shop_ID = T2.Shop_ID WHERE "Month" = 'May'; |
Find the max, average and min training hours of all players.?
Schema:
- Player(HS, pName, weight, yCard) | SELECT AVG(HS) AS avg_training_hours, MAX(HS) AS max_training_hours, MIN(HS) AS min_training_hours FROM Player; |
Give the dates of creation for documents that have both budget type codes 'GV' and 'SF'.?
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_Date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.Document_ID = T2.Document_ID WHERE T2.Budget_Type_Code = 'GV' AND T1.Document_Date IN (SELECT T1.Document_Date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.Document_ID = T2.Document_ID WHERE T2.Budget_Type_Code = 'SF'); |
What are the ids of all vehicles?
Schema:
- Vehicles(vehicle_details, vehicle_id) | SELECT vehicle_id FROM Vehicles; |
Return the primary conference of the school with the lowest acc percentage score.?
Schema:
- university(Affiliation, Enrollment, Founded, Location, Nickname, Primary_conference, School)
- basketball_match(ACC_Percent, All_Home, School_ID, Team_Name) | SELECT T1.Primary_conference FROM university AS T1 JOIN basketball_match AS T2 ON T1.School_ID = T2.School_ID ORDER BY T2.ACC_Percent ASC NULLS LAST LIMIT 1; |
How many papers does David M. Blei have in 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'; |
Which of the mill names contains the french word 'Moulin'?
Schema:
- mill(Moul, location, name, type) | SELECT name FROM mill WHERE name LIKE '%Moulin%'; |
Which game type has most number of games?
Schema:
- Video_Games(COUNT, Dest, GName, GType, onl) | SELECT GType FROM Video_Games WHERE GType IS NOT NULL GROUP BY GType ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
display the full name (first and last name ) of employee with ID and name of the country presently where (s)he is working.?
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))
- departments(DEPARTMENT_NAME, Market)
- locations(COUNTRY_ID)
- countries(...) | SELECT T1.FIRST_NAME, T1.LAST_NAME, T1.EMPLOYEE_ID, T4.COUNTRY_NAME FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID JOIN locations AS T3 ON T2.LOCATION_ID = T3.LOCATION_ID JOIN countries AS T4 ON T3.COUNTRY_ID = T4.COUNTRY_ID; |
What are the names of captains, sorted by age descending?
Schema:
- captain(COUNT, Class, INT, Name, Rank, TRY_CAST, age, capta, l) | SELECT Name FROM captain ORDER BY age DESC NULLS LAST; |
List the journals related to Temporal Data?
Schema:
- paperKeyphrase(...)
- keyphrase(...)
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) | SELECT DISTINCT T3.journalId 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 = 'Temporal Data' GROUP BY T3.journalId; |
What are the distinct publishers of publications with price higher than 5000000?
Schema:
- publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year) | SELECT DISTINCT Publisher FROM publication WHERE Price > 5000000; |
What are the names of the clients who do not have any booking?
Schema:
- Clients(...)
- Bookings(Actual_Delivery_Date, COUNT, Order_Date, Planned_Delivery_Date, Status_Code) | SELECT Customer_Name FROM Clients WHERE Customer_Name NOT IN (SELECT T2.Customer_Name FROM Bookings AS T1 JOIN Clients AS T2 ON T1.Customer_ID = T2.Client_ID); |
List the name of the stadium where both the player 'Walter Samuel' and the player 'Thiago Motta' got injured.?
Schema:
- game(Date, Home_team, Season)
- stadium(Average, Average_Attendance, Capacity, Capacity_Percentage, City, Country, Home_Games, Location, Name, Opening_year, T1)
- injury_accident(Source) | SELECT DISTINCT T4.name FROM (SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.Player = 'Walter Samuel') AS T4 JOIN (SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.Player = 'Thiago Motta') AS T5 ON T4.name = T5.name; |
show the lowest low temperature and highest wind speed in miles per hour.?
Schema:
- weekly_weather(low_temperature, wind_speed_mph) | SELECT MIN(low_temperature) AS min_low_temperature, MAX(wind_speed_mph) AS max_wind_speed_mph FROM weekly_weather; |
Find the distinct student first names of all students that have grade point at least 3.8 in one course.?
Schema:
- Enrolled_in(Fname, Grade, LName, StuID, T2, T3, gradepoint) | SELECT DISTINCT T3.Fname FROM Enrolled_in AS T1, Gradeconversion AS T2, Student AS T3 WHERE T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID AND T2.gradepoint >= 3.8; |
Find the number of rooms with price higher than 120 for different decor.?
Schema:
- Rooms(K, RoomId, basePrice, bedType, beds, decor, maxOccupancy, roomName) | SELECT decor, COUNT(*) AS num_rooms FROM Rooms WHERE basePrice > 120 GROUP BY decor; |
What is the id, genre, and name of the artist for every English song ordered by ascending rating?
Schema:
- song(COUNT, M, art, artist_name, engl, f_id, genre_is, languages, rat, rating, releasedate, resolution, ... (1 more)) | SELECT f_id, genre_is, artist_name FROM song WHERE languages = 'english' ORDER BY rating ASC NULLS LAST; |
What are the statuses and average populations of each city?
Schema:
- city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) | SELECT Status, AVG(Population) AS avg_population FROM city GROUP BY Status; |
Find the city where the most customers live.?
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 T3.city 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 GROUP BY T3.city ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
Find the login name of the course author that teaches the course with name "advanced database".?
Schema:
- Course_Authors_and_Tutors(address_line_1, family_name, login_name, personal_name)
- Courses(course_description, course_name) | SELECT T1.login_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = 'advanced database'; |
What are the ids of songs that are available in either mp4 format or have resolution above 720?
Schema:
- files(COUNT, duration, f_id, formats)
- song(COUNT, M, art, artist_name, engl, f_id, genre_is, languages, rat, rating, releasedate, resolution, ... (1 more)) | SELECT DISTINCT f_id FROM (SELECT f_id FROM files WHERE formats = 'mp4' UNION ALL SELECT f_id FROM song WHERE resolution > 720); |
Please show the most common citizenship of singers.?
Schema:
- singer(Age, Birth_Year, COUNT, Citizenship, Country, Name, Net_Worth_Millions, Song_Name, Song_release_year, T1, s) | SELECT Citizenship FROM singer WHERE Citizenship IS NOT NULL GROUP BY Citizenship ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
Show the names of people and the number of times they have been on the affirmative side of debates.?
Schema:
- debate_people(...)
- people(Age, Birth_Date, Birth_Place, COUNT, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more)) | SELECT T2.Name, COUNT(*) AS num_debates FROM debate_people AS T1 JOIN people AS T2 ON T1.Affirmative = T2.People_ID GROUP BY T2.Name; |
Find all the stage positions of the musicians with first name "Solveig"?
Schema:
- Performance(...)
- Band(...) | SELECT DISTINCT T1.StagePosition FROM Performance AS T1 JOIN Band AS T2 ON T1.Bandmate = T2.Id WHERE Firstname = 'Solveig'; |
What are the names of all high schoolers in grade 10?
Schema:
- Highschooler(COUNT, ID, grade, name) | SELECT name FROM Highschooler WHERE grade = 10; |
display the employee ID for each employee and the date on which he ended his previous job.?
Schema:
- job_history(EMPLOYEE_ID, END_DATE, JOB_ID) | SELECT EMPLOYEE_ID, MAX(END_DATE) AS max_end_date FROM job_history GROUP BY EMPLOYEE_ID; |
List the names of the schools without any endowment.?
Schema:
- School(County, Enrollment, Location, Mascot, School_name)
- endowment(School_id, amount, donator_name) | SELECT School_name FROM School WHERE School_id NOT IN (SELECT CAST(School_id AS TEXT) FROM endowment); |
Give the ids of documents that have between one and two paragraphs.?
Schema:
- Paragraphs(COUNT, Document_ID, Other_Details, Paragraph_Text, T1) | SELECT Document_ID FROM Paragraphs WHERE Document_ID IS NOT NULL GROUP BY Document_ID HAVING COUNT(*) BETWEEN 1 AND 2; |
How many films have the word 'Dummy' in their titles?
Schema:
- film(COUNT, Directed_by, Director, Gross_in_dollar, JO, LENGTH, Studio, T1, Title, language_id, rating, rental_rate, ... (3 more)) | SELECT COUNT(*) AS num_films FROM film WHERE Title LIKE '%Dummy%'; |
List names of all pilot in descending order of age.?
Schema:
- pilot(Age, COUNT, Join_Year, Name, Nationality, Pilot_name, Position, Rank, Team) | SELECT Name FROM pilot ORDER BY Age DESC NULLS LAST; |
Show the authors who have submissions to more than one workshop.?
Schema:
- Acceptance(...)
- submission(Author, COUNT, College, Scores) | SELECT T2.Author FROM Acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author HAVING COUNT(DISTINCT T1.Workshop_ID) > 1; |
List the names of people that have not been on the affirmative side of debates.?
Schema:
- people(Age, Birth_Date, Birth_Place, COUNT, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more))
- debate_people(...) | SELECT Name FROM people WHERE People_ID NOT IN (SELECT Affirmative FROM debate_people); |
What are the account ids, customer ids, and account names for all the accounts?
Schema:
- Accounts(Account_Details, Account_ID, Statement_ID, account_id, account_name, customer_id, date_account_opened, other_account_details) | SELECT account_id, customer_id, account_name FROM Accounts; |
give me a good arabic 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; |
What are the average price and score of wines for each appelation?
Schema:
- wine(Appelation, Cases, Grape, M, Name, Price, Score, Winery, Year, Z, w) | SELECT AVG(Price) AS avg_price, AVG(Score) AS avg_score, Appelation FROM wine GROUP BY Appelation; |
What are all the customer phone numbers under the most popular policy type?
Schema:
- Available_Policies(COUNT, Customer_Phone, Life, policy_type_code) | SELECT Customer_Phone FROM Available_Policies WHERE policy_type_code = (SELECT policy_type_code FROM Available_Policies WHERE policy_type_code IS NOT NULL GROUP BY policy_type_code ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1); |
Find the name of amenity that is most common in all dorms.?
Schema:
- Dorm_amenity(amenity_name)
- Has_amenity(dormid) | SELECT T1.amenity_name FROM Dorm_amenity AS T1 JOIN Has_amenity AS T2 ON T1.amenid = T2.amenid GROUP BY T2.amenid, T1.amenity_name ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
Show different nationalities along with the number of hosts of each nationality.?
Schema:
- host(Age, COUNT, Name, Nationality) | SELECT Nationality, COUNT(*) AS num_hosts FROM host GROUP BY Nationality; |
What is the total credit does each department offer?
Schema:
- COURSE(C, CRS_CODE, CRS_CREDIT, CRS_DESCRIPTION, DEPT_CODE) | SELECT SUM(CRS_CREDIT) AS total_credit, DEPT_CODE FROM COURSE GROUP BY DEPT_CODE; |
What is the last name of the author that has published the most papers?
Schema:
- Authors(fname, lname)
- Authorship(...)
- Papers(title) | SELECT T1.lname FROM Authors AS T1 JOIN Authorship AS T2 ON T1.authID = T2.authID JOIN Papers AS T3 ON T2.paperID = T3.paperID GROUP BY T1.fname, T1.lname ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
Find the name of companies whose revenue is smaller than the revenue of all companies based in Austin.?
Schema:
- Manufacturers(Aust, Beij, Founder, Headquarter, I, M, Name, Revenue) | SELECT Name FROM Manufacturers WHERE Revenue < (SELECT MIN(Revenue) FROM Manufacturers WHERE Headquarter = 'Austin'); |
What is the average base price of rooms, for each bed type?
Schema:
- Rooms(K, RoomId, basePrice, bedType, beds, decor, maxOccupancy, roomName) | SELECT bedType, AVG(basePrice) AS avg_base_price FROM Rooms GROUP BY bedType; |
Give the names of characteristics that are in two or more products?
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 T3.characteristic_name 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 GROUP BY T3.characteristic_name HAVING COUNT(*) >= 2; |
What is the id and detail of the vehicle used in lessons for most of the times?
Schema:
- Vehicles(vehicle_details, vehicle_id)
- Lessons(lesson_status_code) | SELECT T1.vehicle_id, T1.vehicle_details FROM Vehicles AS T1 JOIN Lessons AS T2 ON T1.vehicle_id = T2.vehicle_id GROUP BY T1.vehicle_id, T1.vehicle_details ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
List the creation year, name and budget of each department.?
Schema:
- department(Budget_in_Billions, COUNT, Creation, Dname, F, Market, Mgr_start_date, budget, building, dept_name, name) | SELECT Creation, name, Budget_in_Billions FROM department; |
What is the number of faculty at Long Beach State University in 2002?
Schema:
- faculty(Faculty)
- Campuses(Campus, County, Franc, Location) | SELECT Faculty FROM faculty AS T1 JOIN Campuses AS T2 ON T1.Campus = T2.Id WHERE T1."Year" = 2002 AND T2.Campus = 'Long Beach State University'; |
what is the population of the largest city in the state with the largest area?
Schema:
- city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more))
- state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom) | SELECT population FROM city WHERE population = (SELECT MAX(population) FROM city WHERE state_name IN (SELECT state_name FROM state WHERE area = (SELECT MAX(area) FROM state))) AND state_name IN (SELECT state_name FROM state WHERE area = (SELECT MAX(area) FROM state)); |
How many distinct hometowns did these people have?
Schema:
- people(Age, Birth_Date, Birth_Place, COUNT, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more)) | SELECT COUNT(DISTINCT Hometown) AS num_hometowns FROM people; |
How many Egyptian restaurant are there in Edinburgh ?
Schema:
- category(...)
- business(business_id, city, full_address, name, rating, review_count, state) | SELECT COUNT(DISTINCT T1.name) AS num_restaurants FROM category AS T2 JOIN business AS T1 ON T2.business_id = T1.business_id JOIN category AS T3 ON T3.business_id = T1.business_id WHERE T1.city = 'Edinburgh' AND T2.category_name = 'restaurant' AND T3.category_name = 'Egyptian'; |
How many papers are related to deep learning ?
Schema:
- paperKeyphrase(...)
- keyphrase(...)
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) | SELECT DISTINCT COUNT(DISTINCT T3.paperId) AS num_papers 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 = 'deep learning'; |
Find the different first names and cities of the students who have allergy to milk or cat.?
Schema:
- Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
- Has_Allergy(Allergy, COUNT, StuID) | SELECT DISTINCT T1.Fname, T1.city_code FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.StuID = T2.StuID WHERE T2.Allergy = 'Milk' OR T2.Allergy = 'Cat'; |
What are all the breweries in " Los Angeles " ?
Schema:
- category(...)
- business(business_id, city, full_address, name, rating, review_count, state) | SELECT T1.name FROM category AS T2 JOIN business AS T1 ON T2.business_id = T1.business_id WHERE T1.city = 'Los Angeles' AND T2.category_name = 'breweries'; |
return me the 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 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'; |
What are the dates of ceremony at music festivals corresponding to volumes that lasted more than 2 weeks on top?
Schema:
- music_festival(COUNT, Category, Date_of_ceremony, Result)
- volume(Artist_ID, Issue_Date, Song, Weeks_on_Top) | SELECT T1.Date_of_ceremony FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T2.Weeks_on_Top > 2; |
Whose permanent address is different from his or her current address? List his or her first name.?
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 first_name FROM Students WHERE current_address_id != permanent_address_id; |
How many assets does each third party company supply? List the count and the company id.?
Schema:
- Third_Party_Companies(...)
- Assets(asset_acquired_date, asset_details, asset_disposed_date, asset_id, asset_make, asset_model) | SELECT COUNT(*) AS num_assets, T1.company_id FROM Third_Party_Companies AS T1 JOIN Assets AS T2 ON T1.company_id = T2.supplier_company_id GROUP BY T1.company_id; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.