question stringlengths 43 589 | query stringlengths 19 598 |
|---|---|
Show me the departure date and arrival date for all flights from Los Angeles to Honolulu.?
Schema:
- flight(Altitude, COUNT, Date, Pilot, Vehicle_Flight_number, Velocity, arrival_date, departure_date, destination, distance, flno, origin, ... (1 more)) | SELECT departure_date, arrival_date FROM flight WHERE origin = 'Los Angeles' AND destination = 'Honolulu'; |
when is the hire date for those employees whose first name does not containing the letter M?
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 HIRE_DATE FROM employees WHERE FIRST_NAME NOT LIKE '%M%'; |
What are the ids for courses in the Fall of 2009 or the Spring of 2010?
Schema:
- section(COUNT, JO, Spr, T1, course_id, semester, year) | SELECT course_id FROM section WHERE (semester = 'Fall' AND "year" = 2009) OR (semester = 'Spring' AND "year" = 2010); |
What is the starting year for the oldest technician?
Schema:
- technician(Age, COUNT, JO, Start, Starting_Year, T1, Team, name) | SELECT Starting_Year FROM technician ORDER BY Age DESC NULLS LAST LIMIT 1; |
What is the campus fee in the year 2000 for San Jose State University?
Schema:
- csu_fees(CampusFee)
- Campuses(Campus, County, Franc, Location) | SELECT T1.CampusFee FROM csu_fees AS T1 JOIN Campuses AS T2 ON T1.Campus = T2.Id WHERE T2.Campus = 'San Jose State University' AND T1."Year" = 2000; |
Give the city and country for the Alton airport.?
Schema:
- airports(AirportCode, AirportName, Argent, COUNT, City, Country, city, country, elevation, name) | SELECT City, Country FROM airports WHERE AirportName = 'Alton'; |
Return the name of the team and the acc during the regular season for the school that was founded the earliest.?
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; |
Find the average and maximum hours for the students whose tryout decision is yes.?
Schema:
- Player(HS, pName, weight, yCard)
- Tryout(COUNT, EX, T1, cName, decision, pPos) | SELECT AVG(T1.HS) AS avg_hours, MAX(T1.HS) AS max_hours FROM Player AS T1 JOIN Tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'; |
Find the number of rooms located on each block floor.?
Schema:
- Block(...)
- Room(BlockCode, RoomType, Unavailable) | SELECT COUNT(*) AS num_rooms, T1.BlockFloor FROM Block AS T1 JOIN Room AS T2 ON T1.BlockFloor = T2.BlockFloor AND T1.BlockCode = T2.BlockCode GROUP BY T1.BlockFloor; |
How many stores are there?
Schema:
- store(Type) | SELECT COUNT(*) AS num_stores FROM store; |
Find the names of furnitures whose prices are lower than the highest price.?
Schema:
- furniture(Furniture_ID, Market_Rate, Name)
- furniture_manufacte(...) | SELECT T1.Name FROM furniture AS T1 JOIN furniture_manufacte AS T2 ON T1.Furniture_ID = T2.Furniture_ID WHERE T2.Price_in_Dollar < (SELECT MAX(Price_in_Dollar) FROM furniture_manufacte); |
what is the longest river in the states that border tennessee?
Schema:
- river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse)
- border_info(T1, border, state_name) | SELECT river_name FROM river WHERE LENGTH = (SELECT MAX(LENGTH) FROM river WHERE traverse IN (SELECT border FROM border_info WHERE state_name = 'tennessee')) AND traverse IN (SELECT border FROM border_info WHERE state_name = 'tennessee'); |
What are the names of any scientists who worked on projects named 'Matter of Time' and 'A Puzzling Parallax'?
Schema:
- AssignedTo(Scientist)
- Projects(COUNT, Hours, Name, Project_Details, Project_ID, organ, organisation_id, project_details)
- Scientists(Name) | SELECT T3.Name FROM AssignedTo AS T1 JOIN Projects AS T2 ON T1.Project = T2.Code JOIN Scientists AS T3 ON T1.Scientist = T3.SSN WHERE T2.Name = 'Matter of Time' AND T3.Name IN (SELECT T3.Name FROM AssignedTo AS T1 JOIN Projects AS T2 ON T1.Project = T2.Code JOIN Scientists AS T3 ON T1.Scientist = T3.SSN WHERE T2.Name = 'A Puzzling Parallax'); |
Give the maximum and minimum product prices for each product type, grouped and ordered by product type.?
Schema:
- Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more)) | SELECT MAX(product_price) AS max_product_price, MIN(product_price) AS min_product_price, product_type_code FROM Products WHERE product_type_code IS NOT NULL GROUP BY product_type_code ORDER BY product_type_code ASC NULLS LAST; |
List all country and league names.?
Schema:
- Country(...)
- League(...) | SELECT T1.name, T2.name FROM Country AS T1 JOIN League AS T2 ON T1.id = T2.country_id; |
List the name of browsers in descending order by market share.?
Schema:
- browser(id, market_share, name) | SELECT name FROM browser ORDER BY market_share DESC NULLS LAST; |
What are the first and last name of the author who published the paper titled "Nameless, Painless"?
Schema:
- Authors(fname, lname)
- Authorship(...)
- Papers(title) | SELECT T1.fname, 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 = 'Nameless, Painless'; |
What are all the location codes and location names?
Schema:
- Ref_Locations(Location_Code, Location_Description, Location_Name) | SELECT Location_Code, Location_Name FROM Ref_Locations; |
What are the crime rates of counties sorted by number of offices ascending?
Schema:
- county_public_safety(COUNT, Case_burden, Crime_rate, Location, Name, Police_force, Police_officers, Population, T1) | SELECT Crime_rate FROM county_public_safety ORDER BY Police_officers ASC NULLS LAST; |
How many flights do we have?
Schema:
- flights(DestAirport, FlightNo, SourceAirport) | SELECT COUNT(*) AS num_flights FROM flights; |
How many buildings are there?
Schema:
- building(Floors, Height_feet, Name, build) | SELECT COUNT(*) AS num_buildings FROM building; |
datasets mentioned at ACL?
Schema:
- paperDataset(...)
- dataset(...)
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
- venue(venueId, venueName) | SELECT DISTINCT T1.datasetId FROM paperDataset AS T2 JOIN dataset AS T1 ON T2.datasetId = T1.datasetId JOIN paper AS T3 ON T3.paperId = T2.paperId JOIN venue AS T4 ON T4.venueId = T3.venueId WHERE T4.venueName = 'ACL'; |
Which student has enrolled for the most times in any program? List the id, first name, middle name, last name, the number of enrollments and student id.?
Schema:
- Students(cell_mobile_number, current_address_id, date_first_registered, date_left, date_of_latest_logon, email_address, family_name, first_name, last_name, login_name, middle_name, other_student_details, ... (1 more))
- Student_Enrolment(...) | SELECT T1.student_id, T1.first_name, T1.middle_name, T1.last_name, COUNT(*) AS num_enrollments FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id, T1.first_name, T1.middle_name, T1.last_name ORDER BY num_enrollments DESC NULLS LAST LIMIT 1; |
What is the number of employees that have a salary between 100000 and 200000?
Schema:
- employee(Address, Age, Bdate, City, Fname, Lname, Name, Salary, Sex, eid, name, salary) | SELECT COUNT(*) AS num_employees FROM employee WHERE salary BETWEEN 100000 AND 200000; |
List the total scores of body builders in ascending order.?
Schema:
- body_builder(Clean_Jerk, Snatch, Total) | SELECT Total FROM body_builder ORDER BY Total ASC NULLS LAST; |
How many countries are listed?
Schema:
- countries(...) | SELECT COUNT(*) AS num_countries FROM countries; |
What are the details of the markets that can be accessed by walk or bus?
Schema:
- Street_Markets(...)
- 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 T1.Market_Details FROM Street_Markets AS T1 JOIN Tourist_Attractions AS T2 ON T1.Market_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = 'walk' OR T2.How_to_Get_There = 'bus'; |
Show all train names and times in stations in London in descending order by train time.?
Schema:
- train_station(...)
- station(Annual_entry_exit, Annual_interchanges, COUNT, Location, MAX, Main_Services, Mounta, Name, Number_of_Platforms, city, id, lat, ... (4 more))
- train(Name, Service, Time, destination, name, origin, time, train_number) | SELECT T3.Name, T3."Time" FROM train_station AS T1 JOIN station AS T2 ON T1.Station_ID = T2.Station_ID JOIN train AS T3 ON T3.Train_ID = T1.Train_ID WHERE T2.Location = 'London' ORDER BY T3."Time" DESC NULLS LAST; |
where is the best restaurant in bay area for american food ?
Schema:
- restaurant(...)
- geographic(...)
- location(...) | SELECT T3.house_number, T1.name FROM restaurant AS T1 JOIN geographic AS T2 ON T1.city_name = T2.city_name JOIN location AS T3 ON T1.id = T3.restaurant_id WHERE T2.region = 'bay area' AND T1.food_type = 'american' AND T1.rating = (SELECT MAX(T1.rating) FROM restaurant AS T1 JOIN geographic AS T2 ON T1.city_name = T2.city_name WHERE T2.region = 'bay area' AND T1.food_type = 'american'); |
what is the most populous city in wyoming?
Schema:
- city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) | SELECT city_name FROM city WHERE population = (SELECT MAX(population) FROM city WHERE state_name = 'wyoming') AND state_name = 'wyoming'; |
What is the document type code for document type "Paper"?
Schema:
- Ref_Document_Types(Document_Type_Code, Document_Type_Description, Document_Type_Name, document_type_code, document_type_description) | SELECT Document_Type_Code FROM Ref_Document_Types WHERE Document_Type_Name = 'Paper'; |
Count the number of different positions in the club "Bootup Baltimore".?
Schema:
- Club(ClubDesc, ClubLocation, ClubName, Enterpr, Gam, Hopk, Tenn)
- Member_of_club(...) | SELECT COUNT(DISTINCT T2."Position") AS num_positions FROM Club AS T1 JOIN Member_of_club AS T2 ON T1.ClubID = T2.ClubID WHERE T1.ClubName = 'Bootup Baltimore'; |
Show name, country, age for all singers ordered by age from the oldest to the youngest.?
Schema:
- singer(Age, Birth_Year, COUNT, Citizenship, Country, Name, Net_Worth_Millions, Song_Name, Song_release_year, T1, s) | SELECT Name, Country, Age FROM singer ORDER BY Age DESC NULLS LAST; |
What is the name of the ship that is commanded by the youngest captain?
Schema:
- Ship(Built_Year, COUNT, Class, Flag, Name, Type)
- captain(COUNT, Class, INT, Name, Rank, TRY_CAST, age, capta, l) | SELECT T1.Name FROM Ship AS T1 JOIN captain AS T2 ON T1.Ship_ID = T2.Ship_ID ORDER BY T2.age ASC NULLS LAST LIMIT 1; |
What is the name, latitude, and city of the station that is located the furthest South?
Schema:
- station(Annual_entry_exit, Annual_interchanges, COUNT, Location, MAX, Main_Services, Mounta, Name, Number_of_Platforms, city, id, lat, ... (4 more)) | SELECT name, lat, city FROM station ORDER BY lat ASC NULLS LAST LIMIT 1; |
Show the names of schools with a total budget amount greater than 100 or a total endowment greater than 10.?
Schema:
- budget(Budgeted)
- School(County, Enrollment, Location, Mascot, School_name)
- endowment(School_id, amount, donator_name) | SELECT T2.School_name FROM budget AS T1 JOIN School AS T2 ON CAST(T1.School_id AS TEXT) = T2.School_id JOIN endowment AS T3 ON T2.School_id = CAST(T3.School_id AS TEXT) GROUP BY T2.School_name HAVING SUM(T1.Budgeted) > 100 OR SUM(T3.amount) > 10; |
What are the three colleges from which the most players are from?
Schema:
- match_season(COUNT, College, Draft_Class, Draft_Pick_Number, JO, Player, Position, T1, Team) | SELECT College FROM match_season WHERE College IS NOT NULL GROUP BY College ORDER BY COUNT(*) DESC NULLS LAST LIMIT 3; |
what is the biggest american city in a state with a river?
Schema:
- city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more))
- river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse) | SELECT DISTINCT T1.city_name FROM city AS T1 JOIN river AS T2 ON T2.traverse = T1.state_name WHERE T1.population = (SELECT MAX(T1.population) FROM river AS T2 JOIN city AS T1 ON T2.traverse = T1.state_name); |
On what dates were employees without the letter M in their first names hired?
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 HIRE_DATE FROM employees WHERE FIRST_NAME NOT LIKE '%M%'; |
Find the name of the customer that has been involved in the most policies.?
Schema:
- Policies(COUNT, Policy_Type_Code)
- Customers(BIGINT, COUNT, Customer_Details, Customer_ID, Customer_name, Mar, Rat, TRY_CAST, V, address_line_1, address_line_2, amount_outstanding, ... (25 more)) | SELECT T2.Customer_Details FROM Policies AS T1 JOIN Customers AS T2 ON T1.Customer_ID = T2.Customer_ID GROUP BY T2.Customer_Details ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
What are the names of people who are not entrepreneurs?
Schema:
- people(Age, Birth_Date, Birth_Place, COUNT, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more))
- entrepreneur(COUNT, Company, Investor, Money_Requested) | SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM entrepreneur); |
What are the template ids with template type description "Presentation".?
Schema:
- Ref_Template_Types(Template_Type_Code, Template_Type_Description)
- Templates(COUNT, M, Template_ID, Template_Type_Code, Version_Number) | SELECT T2.Template_ID FROM Ref_Template_Types AS T1 JOIN Templates AS T2 ON T1.Template_Type_Code = T2.Template_Type_Code WHERE T1.Template_Type_Description = 'Presentation'; |
What is the title of a course that is listed in both the Statistics and Psychology departments?
Schema:
- course(COUNT, JO, SUM, Stat, T1, course_id, credits, dept_name, title) | SELECT DISTINCT T1.title FROM (SELECT title FROM course WHERE dept_name = 'Statistics') AS T1 JOIN (SELECT title FROM course WHERE dept_name = 'Psychology') AS T2 ON T1.title = T2.title; |
How many scientists do not have any projects assigned to them?
Schema:
- Scientists(Name)
- AssignedTo(Scientist) | SELECT COUNT(*) AS num_scientists FROM Scientists WHERE SSN NOT IN (SELECT Scientist FROM AssignedTo); |
What is the most common result of the music festival?
Schema:
- music_festival(COUNT, Category, Date_of_ceremony, Result) | SELECT "Result" FROM music_festival GROUP BY "Result" ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
Where is the headquarter of the company founded by James?
Schema:
- Manufacturers(Aust, Beij, Founder, Headquarter, I, M, Name, Revenue) | SELECT Headquarter FROM Manufacturers WHERE Founder = 'James'; |
Show the party with drivers from Hartford and drivers older than 40.?
Schema:
- driver(Age, Home_city, Name, Party) | SELECT Party FROM driver WHERE Home_city = 'Hartford' AND Age > 40; |
Find the wineries that have at least four wines.?
Schema:
- wine(Appelation, Cases, Grape, M, Name, Price, Score, Winery, Year, Z, w) | SELECT Winery FROM wine WHERE Winery IS NOT NULL GROUP BY Winery HAVING COUNT(*) >= 4; |
What is the customer id of the customer with the most accounts, and how many accounts does this person have?
Schema:
- Accounts(Account_Details, Account_ID, Statement_ID, account_id, account_name, customer_id, date_account_opened, other_account_details) | SELECT customer_id, COUNT(*) AS num_accounts FROM Accounts WHERE customer_id IS NOT NULL GROUP BY customer_id ORDER BY num_accounts DESC NULLS LAST LIMIT 1; |
What are the ids and names of each document, as well as the number of paragraphs in each?
Schema:
- Paragraphs(COUNT, Document_ID, Other_Details, Paragraph_Text, T1)
- 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.Document_ID, T2.Document_Name, COUNT(*) AS num_paragraphs FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.Document_ID = T2.Document_ID GROUP BY T1.Document_ID, T2.Document_Name; |
Return the average attendance across all shows.?
Schema:
- show_(Attendance) | SELECT AVG(Attendance) AS avg_attendance FROM show_; |
How many times in total did the team Boston Red Stockings participate in postseason games?
Schema:
- postseason(ties)
- team(Name) | SELECT COUNT(*) AS num_games FROM (SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' UNION ALL SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings'); |
How many exhibition are there in year 2005 or after?
Schema:
- exhibition(Theme, Ticket_Price, Year) | SELECT COUNT(*) AS num_exhibitions FROM exhibition WHERE "Year" >= 2005; |
Which students are unaffected by allergies?
Schema:
- Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
- Has_Allergy(Allergy, COUNT, StuID) | SELECT StuID FROM Student WHERE StuID NOT IN (SELECT StuID FROM Has_Allergy); |
How many trips did not end in San Francisco?
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'; |
How many papers on nature communications in 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'; |
What are the schools that were either founded before 1850 or are public?
Schema:
- university(Affiliation, Enrollment, Founded, Location, Nickname, Primary_conference, School) | SELECT School FROM university WHERE Founded < 1850 OR Affiliation = 'Public'; |
most published author at CVPR 2007?
Schema:
- venue(venueId, venueName)
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
- writes(...) | SELECT DISTINCT COUNT(T2.paperId) AS num_papers, T1.authorId FROM venue AS T3 JOIN paper AS T2 ON T3.venueId = T2.venueId JOIN writes AS T1 ON T1.paperId = T2.paperId WHERE T2."year" = 2007 AND T3.venueName = 'CVPR' GROUP BY T1.authorId ORDER BY num_papers DESC NULLS LAST; |
Who are enrolled in 2 degree programs in one semester? List the first name, middle name and last name and the id.?
Schema:
- Students(cell_mobile_number, current_address_id, date_first_registered, date_left, date_of_latest_logon, email_address, family_name, first_name, last_name, login_name, middle_name, other_student_details, ... (1 more))
- Student_Enrolment(...) | SELECT T1.first_name, T1.middle_name, T1.last_name, T1.student_id FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id, T1.first_name, T1.middle_name, T1.last_name HAVING COUNT(*) = 2; |
What are the ids and full names for employees who work in a department that has someone with a first name that contains the letter T?
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 EMPLOYEE_ID, FIRST_NAME, LAST_NAME FROM employees WHERE DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%T%'); |
What region does Angola belong to and what is its population?
Schema:
- country(Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, M, Name, Official_native_language, ... (4 more)) | SELECT Population, Region FROM country WHERE Name = 'Angola'; |
What are the names of countries that speak more than 2 languages, as well as how many languages they speak?
Schema:
- country(Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, M, Name, Official_native_language, ... (4 more))
- countrylanguage(COUNT, CountryCode, Engl, Language) | SELECT COUNT(T2."Language") AS num_languages, T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode GROUP BY T1.Name HAVING COUNT(*) > 2; |
Show the hometowns shared by at least two teachers.?
Schema:
- teacher(Age, COUNT, D, Hometown, Name) | SELECT Hometown FROM teacher WHERE Hometown IS NOT NULL GROUP BY Hometown HAVING COUNT(*) >= 2; |
What are the names and hours spent practicing of every student who received a yes at tryouts?
Schema:
- Player(HS, pName, weight, yCard)
- Tryout(COUNT, EX, T1, cName, decision, pPos) | SELECT T1.pName, T1.HS FROM Player AS T1 JOIN Tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'; |
What are the names of cities in ascending alphabetical order?
Schema:
- city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) | SELECT Name FROM city ORDER BY Name ASC NULLS LAST; |
What are the names of teams that do no have match season record?
Schema:
- team(Name)
- match_season(COUNT, College, Draft_Class, Draft_Pick_Number, JO, Player, Position, T1, Team) | SELECT Name FROM team WHERE Team_id NOT IN (SELECT Team FROM match_season); |
Return the distinct customer details.?
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 DISTINCT Customer_Details FROM Customers; |
ACL papers in 2016 with neural attention in the title?
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.title LIKE 'neural attention' AND T1."year" = 2016 AND T2.venueName = 'ACL'; |
Return the total points of the gymnast with the lowest age.?
Schema:
- gymnast(Floor_Exercise_Points, Horizontal_Bar_Points)
- people(Age, Birth_Date, Birth_Place, COUNT, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more)) | SELECT T1.Total_Points FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Age ASC NULLS LAST LIMIT 1; |
Select the names and the prices of all the products in the store.?
Schema:
- Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more)) | SELECT Name, Price FROM Products; |
What is the year of publication of " A Switching Architecture For ISDN " ?
Schema:
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) | SELECT "year" FROM paper WHERE title = 'A Switching Architecture For ISDN'; |
How many different last names do the actors and actresses have?
Schema:
- actor(Afghan, Aust, COUNT, Character, Chr, Duration, Kev, Name, age, birth_city, birth_year, first_name, ... (4 more)) | SELECT COUNT(DISTINCT last_name) AS num_last_names FROM actor; |
which rivers run through the state with the lowest elevation in the usa?
Schema:
- river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse)
- highlow(M, highest_elevation, highest_point, lowest_elevation, lowest_point, state_name) | SELECT river_name FROM river WHERE traverse IN (SELECT state_name FROM highlow WHERE lowest_elevation = (SELECT MIN(lowest_elevation) FROM highlow)); |
What is the mean longitude for all stations that have never had more than 10 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 AVG(long) AS mean_longitude FROM station WHERE id NOT IN (SELECT station_id FROM status WHERE station_id IS NOT NULL GROUP BY station_id HAVING MAX(bikes_available) > 10); |
Find all actors from Canada who acted in " James Bond " movies?
Schema:
- cast_(...)
- actor(Afghan, Aust, COUNT, Character, Chr, Duration, Kev, Name, age, birth_city, birth_year, first_name, ... (4 more))
- movie(Budget_million, Director, Find, Gross_worldwide, T1, Title, Year, budget, release_year, title) | SELECT T1.name FROM cast_ AS T2 JOIN actor AS T1 ON T2.aid = T1.aid JOIN movie AS T3 ON T3.mid = T2.msid WHERE T1.nationality = 'Canada' AND T3.title = 'James Bond'; |
Find the name of the patient who made the appointment with the most recent start date.?
Schema:
- Patient(...)
- Appointment(AppointmentID, Start) | SELECT T1.Name FROM Patient AS T1 JOIN Appointment AS T2 ON T1.SSN = T2.Patient ORDER BY T2."Start" DESC NULLS LAST LIMIT 1; |
Give the airline with abbreviation 'UAL'.?
Schema:
- airlines(Abbreviation, Airline, COUNT, Country, active, country, name) | SELECT Airline FROM airlines WHERE Abbreviation = 'UAL'; |
Show the crime rate of counties with a city having white percentage more than 90.?
Schema:
- city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more))
- county_public_safety(COUNT, Case_burden, Crime_rate, Location, Name, Police_force, Police_officers, Population, T1) | SELECT T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID WHERE T1.White > 90; |
Sort the names of all counties in descending alphabetical order.?
Schema:
- county(County_name, Population, Zip_code) | SELECT County_name FROM county ORDER BY County_name DESC NULLS LAST; |
What is the total student capacity of all dorms?
Schema:
- Dorm(dorm_name, gender, student_capacity) | SELECT SUM(student_capacity) AS total_student_capacity FROM Dorm; |
What is the number of artists for each gender?
Schema:
- artist(Age, Artist, Country, Famous_Release_date, Famous_Title, Year_Join, artist_name, country, gender) | SELECT COUNT(*) AS num_artists, gender FROM artist GROUP BY gender; |
What is the owner of the channel that has the highest rating ratio?
Schema:
- channel(Name, Owner, Rating_in_percent, Share_in_percent) | SELECT Owner FROM channel ORDER BY Rating_in_percent DESC NULLS LAST LIMIT 1; |
Return the issue date of the volume that has spent the fewest weeks on top.?
Schema:
- volume(Artist_ID, Issue_Date, Song, Weeks_on_Top) | SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top ASC NULLS LAST LIMIT 1; |
What are the last names and ages of the students who are allergic to milk and cat?
Schema:
- Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
- Has_Allergy(Allergy, COUNT, StuID) | SELECT LName, Age FROM Student WHERE StuID IN (SELECT DISTINCT T1.StuID FROM (SELECT StuID FROM Has_Allergy WHERE Allergy = 'Milk') T1, (SELECT StuID FROM Has_Allergy WHERE Allergy = 'Cat') AS T2 WHERE T1.StuID = T2.StuID); |
how many major cities are in texas?
Schema:
- city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) | SELECT COUNT(city_name) AS num_cities FROM city WHERE population > 150000 AND state_name = 'texas'; |
What are the average profits of companies?
Schema:
- Companies(Assets_billion, Bank, COUNT, Ch, Headquarters, Industry, Market_Value_billion, Profits_billion, Sales_billion, T1, name) | SELECT AVG(Profits_billion) AS avg_profit_billion FROM Companies; |
which is the density of the state that the largest river in the united states runs through?
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 density FROM state WHERE state_name IN (SELECT traverse FROM river WHERE LENGTH = (SELECT MAX(LENGTH) FROM river)); |
What are names and savings balances of the three accounts with the highest savings balances?
Schema:
- ACCOUNTS(name)
- SAVINGS(SAV, balance) | SELECT T1.name, T2.balance FROM ACCOUNTS AS T1 JOIN SAVINGS AS T2 ON T1.custid = T2.custid ORDER BY T2.balance DESC NULLS LAST LIMIT 3; |
How many companies are headquartered in the US?
Schema:
- company(Bank, COUNT, Company, Headquarters, Industry, JO, Main_Industry, Market_Value, Name, Profits_in_Billion, Rank, Retail, ... (4 more)) | SELECT COUNT(*) AS num_companies FROM company WHERE Headquarters = 'USA'; |
Find the average age and number of male students (with sex M) from each city.?
Schema:
- Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age) | SELECT COUNT(*) AS num_students, AVG(Age) AS avg_age, city_code FROM Student WHERE Sex = 'M' GROUP BY city_code; |
Which movies did " Alfred Hitchcock " direct ?
Schema:
- director(Afghan, name, nationality)
- directed_by(...)
- movie(Budget_million, Director, Find, Gross_worldwide, T1, Title, Year, budget, release_year, title) | SELECT T3.title FROM director AS T2 JOIN directed_by AS T1 ON T2.did = T1.did JOIN movie AS T3 ON T3.mid = T1.msid WHERE T2.name = 'Alfred Hitchcock'; |
How many routes end in a Canadian airport?
Schema:
- airports(AirportCode, AirportName, Argent, COUNT, City, Country, city, country, elevation, name)
- routes(...) | SELECT COUNT(*) AS num_routes FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE country = 'Canada'; |
Find the first name and country code of the oldest player.?
Schema:
- players(COUNT, birth_date, country_code, first_name, hand, last_name) | SELECT first_name, country_code FROM players ORDER BY birth_date ASC NULLS LAST LIMIT 1; |
Find all the catalog publishers whose name contains "Murray"?
Schema:
- Catalogs(COUNT, catalog_publisher, date_of_latest_revision) | SELECT DISTINCT catalog_publisher FROM Catalogs WHERE catalog_publisher LIKE '%Murray%'; |
which state has the lowest population density?
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 MIN(density) FROM state); |
Show the first and last name of all the faculty members who participated in some activity, together with the number of activities they participated in.?
Schema:
- Faculty(Building, COUNT, FacID, Fname, LName, Lname, Phone, Pr, Rank, Room, Sex)
- Faculty_Participates_in(FacID) | SELECT T1.Fname, T1.Lname, COUNT(*) AS num_activities, T1.FacID FROM Faculty AS T1 JOIN Faculty_Participates_in AS T2 ON T1.FacID = T2.FacID GROUP BY T1.FacID, T1.Fname, T1.Lname; |
Find the country of the airlines whose name starts with 'Orbit'.?
Schema:
- airlines(Abbreviation, Airline, COUNT, Country, active, country, name) | SELECT country FROM airlines WHERE name LIKE 'Orbit%'; |
Find the names and number of works of the three artists who have produced the most songs.?
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 T1.artist_name, COUNT(*) AS num_songs FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name, T1.artist_name ORDER BY num_songs DESC NULLS LAST LIMIT 3; |
Compute the average salary of the players in the team called 'Boston Red Stockings'.?
Schema:
- salary(salary)
- team(Name) | SELECT AVG(T1.salary) AS avg_salary FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings'; |
Find all 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'; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.