question stringlengths 43 589 | query stringlengths 19 598 |
|---|---|
What are the names of wrestlers who have never been eliminated?
Schema:
- wrestler(COUNT, Days_held, Location, Name, Reign)
- Elimination(Benjam, Eliminated_By, Elimination_Move, T1, Team, Time) | SELECT Name FROM wrestler WHERE CAST(Wrestler_ID AS TEXT) NOT IN (SELECT Wrestler_ID FROM Elimination); |
return me the homepage of the VLDB conference .?
Schema:
- conference(homepage, name) | SELECT homepage FROM conference WHERE name = 'VLDB'; |
who published the most 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; |
Retrieve the title of the paper that has the largest number of authors.?
Schema:
- Authorship(...)
- Papers(title) | SELECT T2.title FROM Authorship AS T1 JOIN Papers AS T2 ON T1.paperID = T2.paperID WHERE T1.authOrder = (SELECT MAX(authOrder) FROM Authorship); |
What are the titles of all the Aerosmith albums?
Schema:
- albums(I, title)
- artists(...) | SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = 'Aerosmith'; |
How many instructors are in the department with the highest budget, and what is their average salary?
Schema:
- instructor(AVG, M, So, Stat, dept_name, name, salary)
- department(Budget_in_Billions, COUNT, Creation, Dname, F, Market, Mgr_start_date, budget, building, dept_name, name) | SELECT AVG(T1.salary) AS avg_salary, COUNT(*) AS num_instructors FROM instructor AS T1 JOIN department AS T2 ON T1.dept_name = T2.dept_name GROUP BY T2.budget ORDER BY T2.budget DESC NULLS LAST LIMIT 1; |
List all the characteristic names and data types of product "cumin".?
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, T3.characteristic_data_type FROM Products AS T1 JOIN Product_Characteristics AS T2 ON T1.product_id = T2.product_id JOIN Characteristics AS T3 ON T2.characteristic_id = T3.characteristic_id WHERE T1.product_name = 'cumin'; |
List the authors of submissions in ascending order of scores.?
Schema:
- submission(Author, COUNT, College, Scores) | SELECT Author FROM submission ORDER BY Scores ASC NULLS LAST; |
What is the name of the tourist attraction that is associated with the photo "game1"?
Schema:
- Photos(Name)
- Tourist_Attractions(Al, COUNT, How_to_Get_There, Name, Opening_Hours, Rosal, T1, T3, Tour, Tourist_Attraction_ID, Tourist_Details, Tourist_ID, ... (2 more)) | SELECT T2.Name FROM Photos AS T1 JOIN Tourist_Attractions AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T1.Name = 'game1'; |
List the names of the customers who have once bought product "food".?
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))
- Orders(customer_id, date_order_placed, order_id)
- Order_Items(COUNT, DOUBLE, INT, TRY_CAST, order_id, order_item_id, order_quantity, product_id, product_quantity)
- Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more)) | SELECT T1.customer_name FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id = T2.customer_id JOIN Order_Items AS T3 ON T2.order_id = T3.order_id JOIN Products AS T4 ON T3.product_id = T4.product_id WHERE T4.product_name = 'food' GROUP BY T1.customer_id, T1.customer_name HAVING COUNT(*) >= 1; |
Retrieve the list of all cities.?
Schema:
- Addresses(address_content, city, country, line_1, line_1_number_building, line_2, state_province_county, town_city, zip_postcode) | SELECT DISTINCT city FROM Addresses; |
How many courses does the department of Computer Information Systmes offer?
Schema:
- DEPARTMENT(Account, DEPT_ADDRESS, DEPT_NAME, H, SCHOOL_CODE)
- COURSE(C, CRS_CODE, CRS_CREDIT, CRS_DESCRIPTION, DEPT_CODE) | SELECT COUNT(*) AS num_courses FROM DEPARTMENT AS T1 JOIN COURSE AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE WHERE DEPT_NAME = 'Computer Info. Systems'; |
Return the different names of cities that are in Asia and for which Chinese is the official language.?
Schema:
- country(Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, M, Name, Official_native_language, ... (4 more))
- countrylanguage(COUNT, CountryCode, Engl, Language)
- city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) | SELECT DISTINCT T3.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode JOIN city AS T3 ON T1.Code = T3.CountryCode WHERE T2.IsOfficial = 'T' AND T2."Language" = 'Chinese' AND T1.Continent = 'Asia'; |
Find the name of physicians who are affiliated with Surgery or Psychiatry department.?
Schema:
- Physician(I, Name)
- Affiliated_With(Department, Physician, PrimaryAffiliation)
- Department(Building, COUNT, DNO, DName, DPhone, DepartmentID, Division, FacID, Head, LName, Room, T2) | SELECT T1.Name FROM Physician AS T1 JOIN Affiliated_With AS T2 ON T1.EmployeeID = T2.Physician JOIN Department AS T3 ON T2.Department = T3.DepartmentID WHERE T3.Name = 'Surgery' OR T3.Name = 'Psychiatry'; |
List the description of the outcomes for all projects.?
Schema:
- Research_Outcomes(...)
- Project_Outcomes(outcome_code) | SELECT T1.outcome_description FROM Research_Outcomes AS T1 JOIN Project_Outcomes AS T2 ON T1.outcome_code = T2.outcome_code; |
what states have towns named springfield?
Schema:
- city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) | SELECT state_name FROM city WHERE city_name = 'springfield'; |
What is the average rating of songs produced by female artists?
Schema:
- artist(Age, Artist, Country, Famous_Release_date, Famous_Title, Year_Join, artist_name, country, gender)
- song(COUNT, M, art, artist_name, engl, f_id, genre_is, languages, rat, rating, releasedate, resolution, ... (1 more)) | SELECT AVG(T2.rating) AS avg_rating FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = 'Female'; |
What is the total revenue of all companies whose main office is at Tokyo or Taiwan?
Schema:
- Manufacturers(Aust, Beij, Founder, Headquarter, I, M, Name, Revenue) | SELECT SUM(Revenue) AS total_revenue FROM Manufacturers WHERE Headquarter = 'Tokyo' OR Headquarter = 'Taiwan'; |
List all female students age is older than 18 who is not majoring in 600. List students' first name and last name.?
Schema:
- Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age) | SELECT Fname, LName FROM Student WHERE Age > 18 AND Major != 600 AND Sex = 'F'; |
What is the city with the smallest GDP? Return the city and its GDP.?
Schema:
- city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) | SELECT City, GDP FROM city ORDER BY GDP ASC NULLS LAST LIMIT 1; |
How many departments offer courses?
Schema:
- course(COUNT, JO, SUM, Stat, T1, course_id, credits, dept_name, title) | SELECT COUNT(DISTINCT dept_name) AS num_departments FROM course; |
What is the name of the department with the fewest professors?
Schema:
- PROFESSOR(DEPT_CODE, PROF_HIGH_DEGREE)
- DEPARTMENT(Account, DEPT_ADDRESS, DEPT_NAME, H, SCHOOL_CODE) | SELECT T2.DEPT_NAME FROM PROFESSOR AS T1 JOIN DEPARTMENT AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.DEPT_CODE, T2.DEPT_NAME ORDER BY COUNT(*) ASC NULLS LAST LIMIT 1; |
Which tourist attractions are visited at least twice? Give me their names and ids.?
Schema:
- Tourist_Attractions(Al, COUNT, How_to_Get_There, Name, Opening_Hours, Rosal, T1, T3, Tour, Tourist_Attraction_ID, Tourist_Details, Tourist_ID, ... (2 more))
- Visits(Visit_Date) | SELECT T1.Name, T2.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID, T1.Name HAVING COUNT(*) >= 2; |
List the names of editors in ascending order of age.?
Schema:
- editor(Age, COUNT, Name) | SELECT Name FROM editor ORDER BY Age ASC NULLS LAST; |
Find the last names of all the authors that have written a paper with title containing the word "Monadic".?
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 WHERE T3.title LIKE '%Monadic%'; |
What are the starting years shared by the technicians from the team "CLE" or "CWS"?
Schema:
- technician(Age, COUNT, JO, Start, Starting_Year, T1, Team, name) | SELECT DISTINCT T1.Starting_Year FROM (SELECT Starting_Year FROM technician WHERE Team = 'CLE') AS T1 JOIN (SELECT Starting_Year FROM technician WHERE Team = 'CWS') AS T2 ON T1.Starting_Year = T2.Starting_Year; |
what is the largest state bordering california?
Schema:
- state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom)
- border_info(T1, border, state_name) | SELECT state_name FROM state WHERE area = (SELECT MAX(area) FROM state WHERE state_name IN (SELECT border FROM border_info WHERE state_name = 'california')) AND state_name IN (SELECT border FROM border_info WHERE state_name = 'california'); |
What is the id of the longest song?
Schema:
- files(COUNT, duration, f_id, formats) | SELECT f_id FROM files ORDER BY duration DESC NULLS LAST LIMIT 1; |
Show the average population of all counties.?
Schema:
- county(County_name, Population, Zip_code) | SELECT AVG(Population) AS avg_population FROM county; |
How many movies were produced in the year 2013 ?
Schema:
- movie(Budget_million, Director, Find, Gross_worldwide, T1, Title, Year, budget, release_year, title) | SELECT COUNT(DISTINCT title) AS num_movies FROM movie WHERE release_year = 2013; |
Show the leader names and locations of colleges.?
Schema:
- college(College_Location, Leader_Name) | SELECT Leader_Name, College_Location FROM college; |
What are the different product colors?
Schema:
- Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more)) | SELECT DISTINCT product_color FROM Products; |
Which 3 wineries produce the most wines made from white grapes?
Schema:
- grapes(...)
- wine(Appelation, Cases, Grape, M, Name, Price, Score, Winery, Year, Z, w) | SELECT T2.Winery FROM grapes AS T1 JOIN wine AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'White' GROUP BY T2.Winery ORDER BY COUNT(*) DESC NULLS LAST LIMIT 3; |
List the names and decor of rooms that have a king bed. Sort the list by their price.?
Schema:
- Rooms(K, RoomId, basePrice, bedType, beds, decor, maxOccupancy, roomName) | SELECT roomName, decor FROM Rooms WHERE bedType = 'King' ORDER BY basePrice ASC NULLS LAST; |
What are the titles of movies and books corresponding to companies incorporated in China?
Schema:
- movie(Budget_million, Director, Find, Gross_worldwide, T1, Title, Year, budget, release_year, title)
- culture_company(...)
- book_club(Author_or_Editor, Book_Title, COUNT, Category, Publ, Publisher, T1) | SELECT T1.Title, T3.Book_Title FROM movie AS T1 JOIN culture_company AS T2 ON CAST(T1.movie_id AS TEXT) = T2.movie_id JOIN book_club AS T3 ON CAST(T3.book_club_id AS TEXT) = T2.book_club_id WHERE T2.Incorporated_in = 'China'; |
For each classroom with at least 2 classes, how many classes are offered?
Schema:
- CLASS(CLASS_CODE, CLASS_ROOM, CLASS_SECTION, CRS_CODE, PROF_NUM) | SELECT COUNT(*) AS num_classes, CLASS_ROOM FROM CLASS WHERE CLASS_ROOM IS NOT NULL GROUP BY CLASS_ROOM HAVING COUNT(*) >= 2; |
What is the average age for all managers?
Schema:
- manager(Age, Country, Level, Name, Working_year_starts, m1) | SELECT AVG(Age) AS avg_age FROM manager; |
what is the highest elevation in delaware?
Schema:
- highlow(M, highest_elevation, highest_point, lowest_elevation, lowest_point, state_name) | SELECT highest_elevation FROM highlow WHERE state_name = 'delaware'; |
In which state is the college that Charles attends?
Schema:
- College(M, cName, enr, state)
- Tryout(COUNT, EX, T1, cName, decision, pPos)
- Player(HS, pName, weight, yCard) | SELECT T1.state FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName JOIN Player AS T3 ON T2.pID = T3.pID WHERE T3.pName = 'Charles'; |
Show the apartment type code that has the largest number of total rooms, together with the number of bathrooms and number of bedrooms.?
Schema:
- Apartments(AVG, COUNT, INT, SUM, TRY_CAST, apt_number, apt_type_code, bathroom_count, bedroom_count, room_count) | SELECT apt_type_code, bathroom_count, bedroom_count FROM Apartments WHERE apt_type_code IS NOT NULL AND bathroom_count IS NOT NULL AND bedroom_count IS NOT NULL GROUP BY apt_type_code, bathroom_count, bedroom_count ORDER BY SUM(TRY_CAST(room_count AS INT)) DESC NULLS LAST LIMIT 1; |
For each type of store, how many of them are there?
Schema:
- store(Type) | SELECT Type, COUNT(*) AS num_stores FROM store GROUP BY Type; |
What is the team name and acc regular season score of the school that was founded for the longest time?
Schema:
- university(Affiliation, Enrollment, Founded, Location, Nickname, Primary_conference, School)
- basketball_match(ACC_Percent, All_Home, School_ID, Team_Name) | SELECT T2.Team_Name, T2.ACC_Regular_Season FROM university AS T1 JOIN basketball_match AS T2 ON T1.School_ID = T2.School_ID ORDER BY T1.Founded ASC NULLS LAST LIMIT 1; |
What is all the information about employees who have never had a job in the past?
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))
- job_history(EMPLOYEE_ID, END_DATE, JOB_ID) | SELECT * FROM employees WHERE EMPLOYEE_ID NOT IN (SELECT EMPLOYEE_ID FROM job_history); |
For each city, return the highest latitude among its stations.?
Schema:
- station(Annual_entry_exit, Annual_interchanges, COUNT, Location, MAX, Main_Services, Mounta, Name, Number_of_Platforms, city, id, lat, ... (4 more)) | SELECT city, MAX(lat) AS max_lat FROM station GROUP BY city; |
Find the names of users who do not have a first notification of loss record.?
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))
- First_Notification_of_Loss(...) | SELECT Customer_name FROM Customers WHERE Customer_name NOT IN (SELECT T1.Customer_name FROM Customers AS T1 JOIN First_Notification_of_Loss AS T2 ON T1.Customer_ID = T2.Customer_ID); |
What is the average rating for each movie that has never been reviewed by Brittany Harris?
Schema:
- Rating(Rat, mID, rID, stars)
- Reviewer(Lew, name, rID) | SELECT mID, AVG(stars) AS avg_rating FROM Rating WHERE mID NOT IN (SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = 'Brittany Harris') GROUP BY mID; |
What are the full names of all left handed players, in order of birth date?
Schema:
- players(COUNT, birth_date, country_code, first_name, hand, last_name) | SELECT first_name, last_name FROM players WHERE hand = 'L' ORDER BY birth_date ASC NULLS LAST; |
Count the number of trips that did not end in San Francisco city.?
Schema:
- trip(COUNT, bike_id, duration, end_station_name, id, start_date, start_station_id, start_station_name, zip_code)
- station(Annual_entry_exit, Annual_interchanges, COUNT, Location, MAX, Main_Services, Mounta, Name, Number_of_Platforms, city, id, lat, ... (4 more)) | SELECT COUNT(*) AS num_trips FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id = T2.id WHERE T2.city != 'San Francisco'; |
Show all locations and the total number of platforms and passengers for all train stations in each location.?
Schema:
- station(Annual_entry_exit, Annual_interchanges, COUNT, Location, MAX, Main_Services, Mounta, Name, Number_of_Platforms, city, id, lat, ... (4 more)) | SELECT Location, SUM(Number_of_Platforms) AS num_platforms, SUM(Total_Passengers) AS total_passengers FROM station GROUP BY Location; |
List the name of artworks that are not nominated.?
Schema:
- artwork(COUNT, Name, Type)
- nomination(...) | SELECT Name FROM artwork WHERE Artwork_ID NOT IN (SELECT Artwork_ID FROM nomination); |
What are the ids and names of the medicine that can interact with two or more enzymes?
Schema:
- medicine(FDA_approved, Trade_Name, name)
- medicine_enzyme_interaction(interaction_type) | SELECT T1.id, T1.name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id, T1.name HAVING COUNT(*) >= 2; |
For each nomination, show the name of the artwork and name of the festival where it is nominated.?
Schema:
- nomination(...)
- artwork(COUNT, Name, Type)
- festival_detail(Chair_Name, Festival_Name, Location, T1, Year) | SELECT T2.Name, T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID; |
List the first name and birth date of all players from the country with code USA.?
Schema:
- players(COUNT, birth_date, country_code, first_name, hand, last_name) | SELECT first_name, birth_date FROM players WHERE country_code = 'USA'; |
How many distinct students are enrolled in courses?
Schema:
- Student_Course_Enrolment(course_id, date_of_completion, date_of_enrolment, student_id) | SELECT COUNT(DISTINCT student_id) AS num_students FROM Student_Course_Enrolment; |
Find the names of reviewers who had given higher than 3 star ratings.?
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 > 3; |
How many authors are there?
Schema:
- Authors(fname, lname) | SELECT COUNT(*) AS num_authors FROM Authors; |
Show all game names played by at least 1000 hours.?
Schema:
- Plays_Games(GameID, Hours_Played, StuID)
- Video_Games(COUNT, Dest, GName, GType, onl) | SELECT GName FROM Plays_Games AS T1 JOIN Video_Games AS T2 ON T1.GameID = T2.GameID GROUP BY T1.GameID, GName HAVING SUM(Hours_Played) >= 1000; |
Find the states where have some college students in tryout and their decisions are yes.?
Schema:
- College(M, cName, enr, state)
- Tryout(COUNT, EX, T1, cName, decision, pPos) | SELECT DISTINCT T1.state FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'; |
What is the maximum and minimum share for the TV series?
Schema:
- TV_series(Air_Date, Episode, Rating, Share, Weekly_Rank) | SELECT MAX(Share) AS max_share, MIN(Share) AS min_share FROM TV_series; |
What are all the friends of Alice who are female?
Schema:
- Person(M, age, city, eng, gender, job, name)
- PersonFriend(M, friend, name) | SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female'; |
What are the names of all people who are friends with Alice for the shortest amount of time?
Schema:
- PersonFriend(M, friend, name) | SELECT name FROM PersonFriend WHERE friend = 'Alice' AND "year" = (SELECT MIN("year") FROM PersonFriend WHERE friend = 'Alice'); |
Return the name of the organization which has the most contact individuals.?
Schema:
- Organizations(date_formed, organization_name)
- Organization_Contact_Individuals(...) | SELECT T1.organization_name FROM Organizations AS T1 JOIN Organization_Contact_Individuals AS T2 ON T1.organization_id = T2.organization_id GROUP BY T1.organization_name ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
What are the titles of all movies that have between 3 and 5 stars?
Schema:
- Rating(Rat, mID, rID, stars)
- Movie(T1, director, title, year) | SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5; |
List the names of climbers whose country is not Switzerland.?
Schema:
- climber(Country, K, Name, Points) | SELECT Name FROM climber WHERE Country != 'Switzerland'; |
What papers were written on question answering in 2016 ?
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' AND T3."year" = 2016; |
Find the average number of followers for the users who do not have any tweet.?
Schema:
- user_profiles(email, followers, name, partitionid)
- tweets(I, tweet_text, uid) | SELECT AVG(followers) AS avg_followers FROM user_profiles WHERE uid NOT IN (SELECT uid FROM tweets); |
Show theme and year for all exhibitions in an descending order of ticket price.?
Schema:
- exhibition(Theme, Ticket_Price, Year) | SELECT Theme, "Year" FROM exhibition ORDER BY Ticket_Price DESC NULLS LAST; |
Please show the names and the players of clubs.?
Schema:
- club(Region, Start_year, name)
- player(Age, COUNT, Gender, Occupation, Player, Player_name, Po, Points, Position, Residence, Sponsor_name, T1, ... (12 more)) | SELECT T1.name, T2.Player_ID FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID; |
What are the distinct districts for elections?
Schema:
- election(Committee, Date, Delegate, District, Vote_Percent, Votes) | SELECT DISTINCT District FROM election; |
what are the populations of states through which the mississippi river 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'); |
What are the distinct battle names which are between bulgarian commander 'Kaloyan' and latin commander 'Baldwin I'?
Schema:
- battle(Baldw, bulgarian_commander, date, latin_commander, name, result) | SELECT name FROM battle WHERE bulgarian_commander = 'Kaloyan' AND latin_commander = 'Baldwin I'; |
What are flight numbers of Airline "United Airlines"?
Schema:
- flights(DestAirport, FlightNo, SourceAirport)
- airlines(Abbreviation, Airline, COUNT, Country, active, country, name) | SELECT T1.FlightNo FROM flights AS T1 JOIN airlines AS T2 ON T2.uid = T1.Airline WHERE T2.Airline = 'United Airlines'; |
What is the response received date for the document described as Regular that was granted more than 100 dollars?
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))
- Document_Types(document_description, document_type_code)
- Grants(grant_amount, organisation_id) | SELECT T1.response_received_date FROM Documents AS T1 JOIN Document_Types AS T2 ON T1.document_type_code = T2.document_type_code JOIN Grants AS T3 ON T1.grant_id = T3.grant_id WHERE T2.document_description = 'Regular' OR T3.grant_amount > 100; |
Give the details of the project with the document name 'King Book'.?
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_Details FROM Projects AS T1 JOIN Documents AS T2 ON T1.Project_ID = T2.Project_ID WHERE T2.Document_Name = 'King Book'; |
papers by Liwen Xiong from 2015?
Schema:
- writes(...)
- author(...)
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) | SELECT DISTINCT T3.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 = 'Liwen Xiong' AND T3."year" = 2015; |
Show the names of the buildings that have more than one company offices.?
Schema:
- Office_locations(...)
- buildings(Height, Status, Stories, name)
- Companies(Assets_billion, Bank, COUNT, Ch, Headquarters, Industry, Market_Value_billion, Profits_billion, Sales_billion, T1, name) | SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id, T2.name HAVING COUNT(*) > 1; |
Find the names of the tourist attractions that is either accessible by walk or at address 660 Shea Crescent.?
Schema:
- Locations(Address, Location_Name, Other_Details)
- Tourist_Attractions(Al, COUNT, How_to_Get_There, Name, Opening_Hours, Rosal, T1, T3, Tour, Tourist_Attraction_ID, Tourist_Details, Tourist_ID, ... (2 more)) | SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = '660 Shea Crescent' OR T2.How_to_Get_There = 'walk'; |
what capital is the largest in the us?
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 city_name FROM city WHERE population = (SELECT MAX(T1.population) FROM state AS T2 JOIN city AS T1 ON T2.capital = T1.city_name); |
How many employees do we have?
Schema:
- Employees(COUNT, Date_of_Birth, Employee_ID, Employee_Name, Role_Code, employee_id, employee_name, role_code) | SELECT COUNT(*) AS num_employees FROM Employees; |
What are the minimum and maximum membership amounts for all branches that either opened in 2011 or are located in London?
Schema:
- branch(Address_road, City, Name, Open_year, membership_amount) | SELECT MIN(membership_amount) AS min_membership_amount, MAX(membership_amount) AS max_membership_amount FROM branch WHERE Open_year = 2011 OR City = 'London'; |
How many flights does airline 'JetBlue Airways' have?
Schema:
- flights(DestAirport, FlightNo, SourceAirport)
- airlines(Abbreviation, Airline, COUNT, Country, active, country, name) | SELECT COUNT(*) AS num_flights FROM flights AS T1 JOIN airlines AS T2 ON T1.Airline = T2.uid WHERE T2.Airline = 'JetBlue Airways'; |
What are the names of the customers who have made two or less orders?
Schema:
- Orders(customer_id, date_order_placed, order_id)
- Customers(BIGINT, COUNT, Customer_Details, Customer_ID, Customer_name, Mar, Rat, TRY_CAST, V, address_line_1, address_line_2, amount_outstanding, ... (25 more)) | SELECT T2.customer_name FROM Orders AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id, T2.customer_name HAVING COUNT(*) <= 2; |
Show the accelerator names and supporting operating systems that are not compatible with the browser named 'Opera'.?
Schema:
- Web_client_accelerator(Client, Operating_system)
- accelerator_compatible_browser(...)
- browser(id, market_share, name) | SELECT wca.name, wca.Operating_system FROM Web_client_accelerator wca LEFT JOIN (SELECT acb.accelerator_id FROM accelerator_compatible_browser acb JOIN browser b ON acb.browser_id = b.id WHERE b.name = 'Opera') opera_compatible ON wca.id = opera_compatible.accelerator_id WHERE opera_compatible.accelerator_id IS NULL; |
what is the most dense state in the usa?
Schema:
- state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom) | SELECT state_name FROM state WHERE density = (SELECT MAX(density) FROM state); |
What is the most recent paper of deep learning ?
Schema:
- paperKeyphrase(...)
- keyphrase(...)
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) | SELECT DISTINCT T3.paperId, 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' ORDER BY T3."year" DESC NULLS LAST; |
Papers about chi?
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 T2.venueName = 'chi'; |
How many orders does Lucas Mancini has?
Schema:
- customers(Mart, city, company, country, email, first_name, last_name, phone, state)
- invoices(billing_city, billing_country, billing_state, total) | SELECT COUNT(*) AS num_orders FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = 'Lucas' AND T1.last_name = 'Mancini'; |
what are the capital city in texas?
Schema:
- state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom) | SELECT capital FROM state WHERE state_name = 'texas'; |
How many players are from each country?
Schema:
- country(Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, M, Name, Official_native_language, ... (4 more))
- match_season(COUNT, College, Draft_Class, Draft_Pick_Number, JO, Player, Position, T1, Team) | SELECT Country_name, COUNT(*) AS num_players FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name; |
Find the first and last name of the staff members who reported problems from the product "rem" but not "aut"?
Schema:
- Problems(date_problem_reported, problem_id)
- Product(product_id, product_name)
- Staff(COUNT, Name, Other_Details, date_joined_staff, date_left_staff, date_of_birth, email_address, first_name, gender, last_name, middle_name, nickname) | SELECT T3.staff_first_name, T3.staff_last_name FROM Problems AS T1 JOIN Product AS T2 ON T1.product_id = T2.product_id JOIN Staff AS T3 ON T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = 'rem' AND NOT EXISTS (SELECT 1 FROM Problems AS T4 JOIN Product AS T5 ON T4.product_id = T5.product_id JOIN Staff AS T6 ON T4.reported_by_staff_id = T6.staff_id WHERE T5.product_name = 'aut' AND T3.staff_id = T6.staff_id); |
Which year has most number of concerts?
Schema:
- concert(COUNT, Year) | SELECT "Year" FROM concert GROUP BY "Year" ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
What are the names of all the documents, as well as the access counts of each, ordered alphabetically?
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 document_name ASC NULLS LAST; |
Which days had a minimum dew point smaller than any day in zip code 94107, and in which zip codes were those measurements taken?
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", zip_code FROM weather WHERE min_dew_point_f < (SELECT MIN(min_dew_point_f) FROM weather WHERE zip_code = 94107); |
What are the id and name of the stations that have ever had more than 12 bikes available?
Schema:
- station(Annual_entry_exit, Annual_interchanges, COUNT, Location, MAX, Main_Services, Mounta, Name, Number_of_Platforms, city, id, lat, ... (4 more))
- status(...) | SELECT DISTINCT T1.id, T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available > 12; |
who published the most in semantic parsing after 2005 ?
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 = 'semantic parsing' AND T4."year" > 2005 GROUP BY T3.authorId ORDER BY num_papers DESC NULLS LAST; |
What is the velocity of the pilot named 'Thompson'?
Schema:
- flight(Altitude, COUNT, Date, Pilot, Vehicle_Flight_number, Velocity, arrival_date, departure_date, destination, distance, flno, origin, ... (1 more)) | SELECT AVG(Velocity) AS avg_velocity FROM flight WHERE Pilot = 'Thompson'; |
Which countries have at least 3 cities?
Schema:
- city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more))
- country(Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, M, Name, Official_native_language, ... (4 more)) | SELECT T2.country FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id GROUP BY T2.country_id, T2.country HAVING COUNT(*) >= 3; |
How many airports' names have the word Interanation in them?
Schema:
- airports(AirportCode, AirportName, Argent, COUNT, City, Country, city, country, elevation, name) | SELECT COUNT(*) AS num_airports FROM airports WHERE name LIKE '%International%'; |
Who directed Avatar?
Schema:
- Movie(T1, director, title, year) | SELECT director FROM Movie WHERE title = 'Avatar'; |
Show the average room count of the apartments that have booking status code "Provisional".?
Schema:
- Apartment_Bookings(booking_end_date, booking_start_date, booking_status_code)
- Apartments(AVG, COUNT, INT, SUM, TRY_CAST, apt_number, apt_type_code, bathroom_count, bedroom_count, room_count) | SELECT AVG(TRY_CAST(room_count AS INT)) AS avg_room_count FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = 'Provisional'; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.