question stringlengths 43 589 | query stringlengths 19 598 |
|---|---|
Show the height of the mountain climbed by the climber with the maximum points.?
Schema:
- climber(Country, K, Name, Points)
- mountain(AVG, COUNT, Country, Height, JO, Name, Prominence, Range, T1, mck, mounta, mountain_altitude, ... (3 more)) | SELECT T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T1.Points DESC NULLS LAST LIMIT 1; |
Which grade has the most high schoolers?
Schema:
- Highschooler(COUNT, ID, grade, name) | SELECT grade FROM Highschooler WHERE grade IS NOT NULL GROUP BY grade ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
What are the names of documents that have both one of the three most common types and one of three most common structures?
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 FROM Documents WHERE document_type_code IN (SELECT document_type_code FROM Documents WHERE document_type_code IS NOT NULL GROUP BY document_type_code ORDER BY COUNT(*) DESC NULLS LAST LIMIT 3) AND document_structure_code IN (SELECT document_structure_code FROM Documents WHERE document_structure_code IS NOT NULL GROUP BY document_structure_code ORDER BY COUNT(*) DESC NULLS LAST LIMIT 3); |
What are the different pilot names who had piloted a flight in the country 'United States' or in the airport named 'Billund Airport'?
Schema:
- airport(Airport_Name, City, Country, Domestic_Passengers, International_Passengers, Transit_Passengers, id, name)
- flight(Altitude, COUNT, Date, Pilot, Vehicle_Flight_number, Velocity, arrival_date, departure_date, destination, distance, flno, origin, ... (1 more)) | SELECT DISTINCT T2.Pilot FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id WHERE T1.Country = 'United States' OR T1.name = 'Billund Airport'; |
What are the names of the teachers whose hometown is not `` Little Lever Urban District '' ?
Schema:
- teacher(Age, COUNT, D, Hometown, Name) | SELECT Name FROM teacher WHERE Hometown != 'Little Lever Urban District'; |
Give me the name and year of opening of the manufacturers that have either less than 10 factories or more than 10 shops.?
Schema:
- manufacturer(Manufacturer_ID, Name, Open_Year) | SELECT Name, Open_Year FROM manufacturer WHERE Num_of_Shops > 10 OR Num_of_Factories < 10; |
Find all reviews for businesses rated 2.5?
Schema:
- review(i_id, rank, rating, text)
- business(business_id, city, full_address, name, rating, review_count, state) | SELECT T2."text" FROM review AS T2 JOIN business AS T1 ON T2.business_id = T1.business_id WHERE T1.rating = 2.5; |
How many languages are in these films?
Schema:
- film(COUNT, Directed_by, Director, Gross_in_dollar, JO, LENGTH, Studio, T1, Title, language_id, rating, rental_rate, ... (3 more)) | SELECT COUNT(DISTINCT language_id) AS num_languages FROM film; |
How many document types are there?
Schema:
- Ref_Document_Types(Document_Type_Code, Document_Type_Description, Document_Type_Name, document_type_code, document_type_description) | SELECT COUNT(*) AS num_document_types FROM Ref_Document_Types; |
What is the first name of students who got grade C in any class?
Schema:
- STUDENT(DEPT_CODE, STU_DOB, STU_FNAME, STU_GPA, STU_HRS, STU_LNAME, STU_PHONE)
- ENROLL(...) | SELECT DISTINCT STU_FNAME FROM STUDENT AS T1 JOIN ENROLL AS T2 ON T1.STU_NUM = T2.STU_NUM WHERE ENROLL_GRADE = 'C'; |
papers about TAIL published at NIPS?
Schema:
- paperKeyphrase(...)
- keyphrase(...)
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
- venue(venueId, venueName) | SELECT DISTINCT T3.paperId FROM paperKeyphrase AS T2 JOIN keyphrase AS T1 ON T2.keyphraseId = T1.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId JOIN venue AS T4 ON T4.venueId = T3.venueId WHERE T1.keyphraseName = 'TAIL' AND T4.venueName = 'NIPS'; |
What are the first names and ages of all students who are playing both Football and Lacrosse?
Schema:
- Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
- SportsInfo(COUNT, GamesPlayed, OnScholarship, SportName, StuID) | SELECT Fname, Age FROM Student AS T1 WHERE EXISTS (SELECT 1 FROM SportsInfo AS T2 WHERE T2.StuID = T1.StuID AND T2.SportName = 'Football') AND EXISTS (SELECT 1 FROM SportsInfo AS T3 WHERE T3.StuID = T1.StuID AND T3.SportName = 'Lacrosse'); |
how many people live in the state with the largest population density?
Schema:
- state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom) | SELECT population FROM state WHERE density = (SELECT MAX(density) FROM state); |
Which owners live in the state whose name contains the substring 'North'? List his first name, last name and email.?
Schema:
- Owners(email_address, first_name, last_name, state) | SELECT first_name, last_name, email_address FROM Owners WHERE state LIKE '%North%'; |
Find the total number of king beds available.?
Schema:
- Rooms(K, RoomId, basePrice, bedType, beds, decor, maxOccupancy, roomName) | SELECT SUM(beds) AS total_beds FROM Rooms WHERE bedType = 'King'; |
What is the address of the restaurant Subway?
Schema:
- Restaurant(Address, Rating, ResID, ResName) | SELECT Address FROM Restaurant WHERE ResName = 'Subway'; |
Sort the list of names and costs of all procedures in the descending order of cost.?
Schema:
- Procedures(Cost, Name) | SELECT Name, Cost FROM Procedures ORDER BY Cost DESC NULLS LAST; |
What are the full names of actors who had roles in more than 30 films?
Schema:
- film_actor(...)
- actor(Afghan, Aust, COUNT, Character, Chr, Duration, Kev, Name, age, birth_city, birth_year, first_name, ... (4 more)) | SELECT T2.first_name, T2.last_name FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id, T2.first_name, T2.last_name HAVING COUNT(*) > 30; |
What is the date of birth of every customer whose status code is 'Good Customer'?
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 date_of_birth FROM Customers WHERE customer_status_code = 'Good Customer'; |
Who performed the song named "Badlands"? Show the first name and the last name.?
Schema:
- Performance(...)
- Band(...)
- Songs(Title) | SELECT T2.Firstname, T2.Lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.Bandmate = T2.Id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = 'Badlands'; |
What are the cities with exactly two airports?
Schema:
- airports(AirportCode, AirportName, Argent, COUNT, City, Country, city, country, elevation, name) | SELECT city FROM airports WHERE city IS NOT NULL GROUP BY city HAVING COUNT(*) = 2; |
How many papers were at nature communications 2015 ?
Schema:
- venue(venueId, venueName)
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) | SELECT DISTINCT COUNT(T1.paperId) AS num_papers FROM venue AS T2 JOIN paper AS T1 ON T2.venueId = T1.venueId WHERE T1."year" = 2015 AND T2.venueName = 'nature communications'; |
What are the names of all singers that are from the UK and released a song in English?
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 DISTINCT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.country = 'UK' AND T2.languages = 'english'; |
What is the name of the shop that is hiring the largest number of employees?
Schema:
- hiring(...)
- shop(Address, District, INT, Location, Manager_name, Name, Number_products, Open_Year, Score, Shop_ID, Shop_Name, T1, ... (1 more)) | SELECT T2.Name FROM hiring AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID, T2.Name ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
what is the state with the highest elevation in the united states?
Schema:
- highlow(M, highest_elevation, highest_point, lowest_elevation, lowest_point, state_name) | SELECT state_name FROM highlow WHERE highest_elevation = (SELECT MAX(highest_elevation) FROM highlow); |
What are the names of cities that are in counties that have a crime rate below 100?
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 Name FROM city WHERE County_ID IN (SELECT County_ID FROM county_public_safety WHERE Crime_rate < 100); |
Find the number of rooms that do not have any reservation.?
Schema:
- Rooms(K, RoomId, basePrice, bedType, beds, decor, maxOccupancy, roomName)
- Reservations(Adults, CheckIn, FirstName, Kids, LastName) | SELECT COUNT(*) AS num_rooms FROM Rooms WHERE RoomId NOT IN (SELECT DISTINCT Room FROM Reservations); |
How many different departments are there in each school that has less than 5 apartments?
Schema:
- DEPARTMENT(Account, DEPT_ADDRESS, DEPT_NAME, H, SCHOOL_CODE) | SELECT COUNT(DISTINCT DEPT_NAME) AS num_departments, SCHOOL_CODE FROM DEPARTMENT WHERE SCHOOL_CODE IS NOT NULL GROUP BY SCHOOL_CODE HAVING COUNT(DISTINCT DEPT_NAME) < 5; |
how many states are in the united states?
Schema:
- state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom) | SELECT COUNT(state_name) AS num_states FROM state WHERE country_name = 'United States'; |
How many states have smaller colleges than average?
Schema:
- College(M, cName, enr, state) | SELECT COUNT(DISTINCT state) AS num_states FROM College WHERE enr < (SELECT AVG(enr) FROM College); |
How many distinct official languages are there among countries of players whose positions are defenders.?
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 COUNT(DISTINCT T1.Official_native_language) AS num_languages FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2."Position" = 'Defender'; |
Who is the president of the club "Bootup Baltimore"? Give me the first and last name.?
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 T3.Fname, T3.LName 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 T2."Position" = 'President'; |
which state is mount whitney in?
Schema:
- mountain(AVG, COUNT, Country, Height, JO, Name, Prominence, Range, T1, mck, mounta, mountain_altitude, ... (3 more)) | SELECT state_name FROM mountain WHERE mountain_name = 'whitney'; |
What is the joined year of the pilot of the highest rank?
Schema:
- pilot(Age, COUNT, Join_Year, Name, Nationality, Pilot_name, Position, Rank, Team) | SELECT Join_Year FROM pilot ORDER BY "Rank" ASC NULLS LAST LIMIT 1; |
List the vehicle flight number, date and pilot of all the flights, ordered by altitude.?
Schema:
- flight(Altitude, COUNT, Date, Pilot, Vehicle_Flight_number, Velocity, arrival_date, departure_date, destination, distance, flno, origin, ... (1 more)) | SELECT Vehicle_Flight_number, "Date", Pilot FROM flight ORDER BY Altitude ASC NULLS LAST; |
Find the titles of all movies that have no ratings.?
Schema:
- Movie(T1, director, title, year)
- Rating(Rat, mID, rID, stars) | SELECT title FROM Movie WHERE mID NOT IN (SELECT mID FROM Rating); |
What is the name of every college in alphabetical order that has more than 18000 students enrolled?
Schema:
- College(M, cName, enr, state) | SELECT cName FROM College WHERE enr > 18000 ORDER BY cName ASC NULLS LAST; |
What are the main industries of the companies without gas stations and what are the companies?
Schema:
- company(Bank, COUNT, Company, Headquarters, Industry, JO, Main_Industry, Market_Value, Name, Profits_in_Billion, Rank, Retail, ... (4 more))
- station_company(...) | SELECT Company, Main_Industry FROM company WHERE Company_ID NOT IN (SELECT Company_ID FROM station_company); |
how many 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 state_name = 'texas'; |
How much does the youngest dog weigh?
Schema:
- Pets(PetID, PetType, pet_age, weight) | SELECT weight FROM Pets ORDER BY pet_age ASC NULLS LAST LIMIT 1; |
Find the actor who played " Alan Turing " in the movie " The Imitation Game "?
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 T2.role = 'Alan Turing' AND T3.title = 'The Imitation Game'; |
Show different publishers together with the number of publications they have.?
Schema:
- publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year) | SELECT Publisher, COUNT(*) AS num_publications FROM publication GROUP BY Publisher; |
Find the number of universities that have over a 20000 enrollment size for each affiliation type.?
Schema:
- university(Affiliation, Enrollment, Founded, Location, Nickname, Primary_conference, School) | SELECT COUNT(*) AS num_universities, Affiliation FROM university WHERE Enrollment > 20000 GROUP BY Affiliation; |
How long is the total lesson time taught by staff with first name as Janessa and last name as Sawayn?
Schema:
- Lessons(lesson_status_code)
- 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 SUM(TRY_CAST(lesson_time AS DOUBLE)) AS total_lesson_time FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Janessa' AND T2.last_name = 'Sawayn'; |
How many cinema do we have?
Schema:
- cinema(COUNT, Capacity, Location, Name, Openning_year, T1, c) | SELECT COUNT(*) AS num_cinema FROM cinema; |
Which languages are spoken by only one country in republic governments?
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 T2."Language" FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.GovernmentForm = 'Republic' GROUP BY T2."Language" HAVING COUNT(*) = 1; |
What are the names of the songs that do not have back vocals?
Schema:
- Vocals(COUNT, Type)
- Songs(Title) | SELECT DISTINCT Title FROM Vocals AS T1 JOIN Songs AS T2 ON T1.SongId = T2.SongId WHERE Title NOT IN (SELECT T2.Title FROM Vocals AS T1 JOIN Songs AS T2 ON T1.SongId = T2.SongId WHERE Type = 'back'); |
Find the year which offers the largest number of courses.?
Schema:
- section(COUNT, JO, Spr, T1, course_id, semester, year) | SELECT "year" FROM section GROUP BY "year" ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
What are the first and last names of all drivers who participated in the Australian Grand Prix but not the Chinese Grand Prix?
Schema:
- races(date, name)
- results(...)
- drivers(forename, nationality, surname) | SELECT T3.forename, T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceId = T2.raceId JOIN drivers AS T3 ON T2.driverId = T3.driverId WHERE T1.name = 'Chinese Grand Prix'; |
Show the number of customer cards.?
Schema:
- Customers_Cards(COUNT, card_id, card_number, card_type_code, customer_id, date_valid_from, date_valid_to) | SELECT COUNT(*) AS num_cards FROM Customers_Cards; |
What is the name of the highest mountain?
Schema:
- mountain(AVG, COUNT, Country, Height, JO, Name, Prominence, Range, T1, mck, mounta, mountain_altitude, ... (3 more)) | SELECT Name FROM mountain ORDER BY Height DESC NULLS LAST LIMIT 1; |
List the names of patients who have made appointments.?
Schema:
- Appointment(AppointmentID, Start)
- Patient(...) | SELECT Name FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN; |
what kind of papers does Luke Zettlemoyer publish?
Schema:
- paperKeyphrase(...)
- keyphrase(...)
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
- writes(...)
- author(...) | SELECT DISTINCT T1.keyphraseId FROM paperKeyphrase AS T2 JOIN keyphrase AS T1 ON T2.keyphraseId = T1.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId JOIN writes AS T4 ON T4.paperId = T3.paperId JOIN author AS T5 ON T4.authorId = T5.authorId WHERE T5.authorName = 'Luke Zettlemoyer'; |
What is the name of the marketing region that the store Rob Dinning belongs to?
Schema:
- Marketing_Regions(Ch, Marketing_Region_Descriptrion, Marketing_Region_Name)
- Stores(...) | SELECT T1.Marketing_Region_Name FROM Marketing_Regions AS T1 JOIN Stores AS T2 ON T1.Marketing_Region_Code = T2.Marketing_Region_Code WHERE T2.Store_Name = 'Rob Dinning'; |
Find the total balance across checking accounts.?
Schema:
- CHECKING(balance) | SELECT SUM(balance) AS total_balance FROM CHECKING; |
how many states do not have rivers?
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 COUNT(DISTINCT state_name) AS num_states FROM state WHERE state_name NOT IN (SELECT traverse FROM river); |
Find the names of rooms that have been reserved for more than 60 times.?
Schema:
- Reservations(Adults, CheckIn, FirstName, Kids, LastName)
- Rooms(K, RoomId, basePrice, bedType, beds, decor, maxOccupancy, roomName) | SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room, T2.roomName HAVING COUNT(*) > 60; |
display the employee name ( first name and last name ) and hire date for all employees in the same department as Clara.?
Schema:
- employees(COMMISSION_PCT, DEPARTMENT_ID, EMAIL, EMPLOYEE_ID, FIRST_NAME, HIRE_DATE, JOB_ID, LAST_NAME, M, MANAGER_ID, PHONE_NUMBER, SALARY, ... (12 more)) | SELECT FIRST_NAME, LAST_NAME, HIRE_DATE FROM employees WHERE DEPARTMENT_ID = (SELECT DEPARTMENT_ID FROM employees WHERE FIRST_NAME = 'Clara'); |
papers by brian curless about convolution?
Schema:
- paperKeyphrase(...)
- keyphrase(...)
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
- writes(...)
- author(...) | SELECT DISTINCT T1.authorId, T3.paperId FROM paperKeyphrase AS T2 JOIN keyphrase AS T5 ON T2.keyphraseId = T5.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId JOIN writes AS T4 ON T4.paperId = T3.paperId JOIN author AS T1 ON T4.authorId = T1.authorId WHERE T1.authorName = 'brian curless' AND T5.keyphraseName = 'convolution'; |
What are the wifi and screen mode type of the hardware model named "LG-P760"?
Schema:
- chip_model(Launch_year, Model_name, RAM_MiB, WiFi)
- phone(Accreditation_level, Accreditation_type, COUNT, Carrier, Company_name, Hardware_Model_name, Memory_in_G, Name, Spr, chip_model, p1, screen_mode)
- screen_mode(used_kb) | SELECT T1.WiFi, T3.Type FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T2.Hardware_Model_name = 'LG-P760'; |
How many types of products have Rodrick Heaney bought in total?
Schema:
- Customers(BIGINT, COUNT, Customer_Details, Customer_ID, Customer_name, Mar, Rat, TRY_CAST, V, address_line_1, address_line_2, amount_outstanding, ... (25 more))
- Customer_Orders(customer_id, order_date, order_id, order_shipping_charges)
- Order_Items(COUNT, DOUBLE, INT, TRY_CAST, order_id, order_item_id, order_quantity, product_id, product_quantity) | SELECT COUNT(DISTINCT T3.product_id) AS num_products FROM Customers AS T1 JOIN Customer_Orders AS T2 ON T1.customer_id = T2.customer_id JOIN Order_Items AS T3 ON T2.order_id = T3.order_id WHERE T1.customer_name = 'Rodrick Heaney'; |
What are the names of the technicians that have not been assigned to repair machines?
Schema:
- technician(Age, COUNT, JO, Start, Starting_Year, T1, Team, name)
- repair_assignment(...) | SELECT name FROM technician WHERE technician_id NOT IN (SELECT technician_id FROM repair_assignment); |
Papers written by sharon goldwater?
Schema:
- writes(...)
- author(...) | SELECT DISTINCT T2.paperId FROM writes AS T2 JOIN author AS T1 ON T2.authorId = T1.authorId WHERE T1.authorName = 'sharon goldwater'; |
How many rooms have king beds? Report the number for each decor type.?
Schema:
- Rooms(K, RoomId, basePrice, bedType, beds, decor, maxOccupancy, roomName) | SELECT decor, COUNT(*) AS num_rooms FROM Rooms WHERE bedType = 'King' GROUP BY decor; |
Find the names and publication dates of all catalogs that have catalog level number greater than 5.?
Schema:
- Catalogs(COUNT, catalog_publisher, date_of_latest_revision)
- Catalog_Structure(catalog_level_name, catalog_level_number) | SELECT T1.catalog_name, T1.date_of_publication FROM Catalogs AS T1 JOIN Catalog_Structure AS T2 ON T1.catalog_id = T2.catalog_id WHERE catalog_level_number > 5; |
List the council tax ids and their related cmi cross references of all the parking fines.?
Schema:
- Parking_Fines(cmi_cross_ref_id, council_tax_id) | SELECT council_tax_id, cmi_cross_ref_id FROM Parking_Fines; |
What are the weights of entrepreneurs in descending order of money requested?
Schema:
- entrepreneur(COUNT, Company, Investor, Money_Requested)
- people(Age, Birth_Date, Birth_Place, COUNT, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more)) | SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested DESC NULLS LAST; |
List all the activities we have.?
Schema:
- Activity(activity_name) | SELECT activity_name FROM Activity; |
List all businesses that are restaurant in Pennsylvania .?
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.state = 'Pennsylvania' AND T2.category_name = 'restaurant'; |
What are the white percentages of cities, and the corresponding crime rates of the counties they correspond to?
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 T1.White, T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID; |
What are the names of products with category "Spices"?
Schema:
- Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more)) | SELECT product_name FROM Products WHERE product_category_code = 'Spices'; |
What are the order dates of orders with price higher than 1000?
Schema:
- Customer_Orders(customer_id, order_date, order_id, order_shipping_charges)
- Order_Items(COUNT, DOUBLE, INT, TRY_CAST, order_id, order_item_id, order_quantity, product_id, product_quantity)
- Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more)) | SELECT T1.Order_Date FROM Customer_Orders AS T1 JOIN Order_Items AS T2 ON T1.Order_ID = T2.Order_ID JOIN Products AS T3 ON CAST(T2.Product_ID AS TEXT) = T3.Product_ID WHERE T3.Product_Price > 1000; |
What are the forenames and surnames of all unique drivers who had a lap time of less than 93000 milliseconds?
Schema:
- drivers(forename, nationality, surname)
- lapTimes(...) | SELECT DISTINCT T1.forename, T1.surname FROM drivers AS T1 JOIN lapTimes AS T2 ON T1.driverId = T2.driverId WHERE T2.milliseconds < 93000; |
what rivers are in illinois?
Schema:
- river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse) | SELECT river_name FROM river WHERE traverse = 'illinois'; |
Among those engineers who have visited, which engineer makes the least number of visits? List the engineer id, first name and last name.?
Schema:
- Maintenance_Engineers(COUNT, T1, engineer_id, first_name, last_name)
- Engineer_Visits(...) | SELECT T1.engineer_id, T1.first_name, T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 ON T1.engineer_id = T2.engineer_id GROUP BY T1.engineer_id, T1.first_name, T1.last_name ORDER BY COUNT(*) ASC NULLS LAST LIMIT 1; |
What is the average edispl for all volvos?
Schema:
- car_names(COUNT, Model)
- cars_data(Accelerate, Cylinders, Horsepower, MPG, T1, Weight, Year) | SELECT AVG(T2.Edispl) AS avg_edispl FROM car_names AS T1 JOIN cars_data AS T2 ON T1.MakeId = T2.Id WHERE T1.Model = 'volvo'; |
Show the average share count of transactions for different investors.?
Schema:
- Transactions(COUNT, DOUBLE, TRY_CAST, amount_of_transaction, date_of_transaction, investor_id, share_count, transaction_id, transaction_type_code) | SELECT investor_id, AVG(TRY_CAST(share_count AS DOUBLE)) AS avg_share_count FROM Transactions GROUP BY investor_id; |
How many likes correspond to each student id?
Schema:
- Likes(student_id) | SELECT student_id, COUNT(*) AS num_likes FROM Likes GROUP BY student_id; |
Find the total number of scientists.?
Schema:
- Scientists(Name) | SELECT COUNT(*) AS num_scientists FROM Scientists; |
Compute the mean price of procedures physician John Wen was trained in.?
Schema:
- Physician(I, Name)
- Trained_In(...)
- Procedures(Cost, Name) | SELECT AVG(T3.Cost) AS avg_price FROM Physician AS T1 JOIN Trained_In AS T2 ON T1.EmployeeID = T2.Physician JOIN Procedures AS T3 ON T3.Code = T2.Treatment WHERE T1.Name = 'John Wen'; |
Give the title of the course offered in Chandler during the Fall of 2010.?
Schema:
- course(COUNT, JO, SUM, Stat, T1, course_id, credits, dept_name, title)
- section(COUNT, JO, Spr, T1, course_id, semester, year) | SELECT T1.title FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id WHERE building = 'Chandler' AND semester = 'Fall' AND "year" = 2010; |
What was the conference name that approved Trophic Cascade ?
Schema:
- paperKeyphrase(...)
- keyphrase(...)
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) | SELECT DISTINCT T3.venueId 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 = 'Trophic Cascade'; |
What are names of the movies that are either made before 1980 or directed by James Cameron?
Schema:
- Movie(T1, director, title, year) | SELECT title FROM Movie WHERE director = 'James Cameron' OR "year" < 1980; |
whats the largest city?
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); |
Find the name of different colleges involved in the tryout in alphabetical order.?
Schema:
- Tryout(COUNT, EX, T1, cName, decision, pPos) | SELECT DISTINCT cName FROM Tryout ORDER BY cName ASC NULLS LAST; |
List the names of wrestlers and the teams in elimination in descending order of days held.?
Schema:
- Elimination(Benjam, Eliminated_By, Elimination_Move, T1, Team, Time)
- wrestler(COUNT, Days_held, Location, Name, Reign) | SELECT T2.Name, T1.Team FROM Elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = CAST(T2.Wrestler_ID AS TEXT) ORDER BY T2.Days_held DESC NULLS LAST; |
return me the total citations of papers in PVLDB in 2005 .?
Schema:
- publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year)
- journal(Theme, homepage, name) | SELECT SUM(T2.citation_num) AS total_citations FROM publication AS T2 JOIN journal AS T1 ON T2.jid = T1.jid WHERE T1.name = 'PVLDB' AND T2."year" = 2005; |
Find all 200 meter and 300 meter results of swimmers with nationality "Australia".?
Schema:
- swimmer(Name, Nationality, meter_100, meter_200, meter_300) | SELECT meter_200, meter_300 FROM swimmer WHERE Nationality = 'Australia'; |
What is the name of the high schooler who has the greatest number of likes?
Schema:
- Likes(student_id)
- Highschooler(COUNT, ID, grade, name) | SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.ID GROUP BY T1.student_id, T2.name ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
What are all the different food allergies?
Schema:
- Allergy_Type(Allergy, AllergyType, COUNT) | SELECT DISTINCT Allergy FROM Allergy_Type WHERE AllergyType = 'food'; |
what state is the biggest?
Schema:
- state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom) | SELECT state_name FROM state WHERE area = (SELECT MAX(area) FROM state); |
In which season and which stadium did any player have an injury of 'Foot injury' or 'Knee problem'?
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 T1.Season, 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.Injury = 'Foot injury' OR T3.Injury = 'Knee problem'; |
Show all student IDs with the number of sports and total number of games played?
Schema:
- SportsInfo(COUNT, GamesPlayed, OnScholarship, SportName, StuID) | SELECT StuID, COUNT(*) AS num_sports, SUM(GamesPlayed) AS total_games_played FROM SportsInfo GROUP BY StuID; |
What conferences did li dong submit to in 2016 ?
Schema:
- writes(...)
- author(...)
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) | SELECT DISTINCT T3.venueId 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 = 'li dong' AND T3."year" = 2016; |
What is the list of program names, sorted by the order of launch date?
Schema:
- program(Beij, Launch, Name, Origin, Owner) | SELECT Name FROM program ORDER BY Launch ASC NULLS LAST; |
How many employees do we have?
Schema:
- employee(Address, Age, Bdate, City, Fname, Lname, Name, Salary, Sex, eid, name, salary) | SELECT COUNT(*) AS num_employees FROM employee; |
Find the number of matches in different competitions.?
Schema:
- match_(Competition, Date, Match_ID, Venue) | SELECT COUNT(*) AS num_matches, Competition FROM match_ GROUP BY Competition; |
How many instruments does the song "Badlands" use?
Schema:
- Instruments(COUNT, Instrument)
- Songs(Title) | SELECT COUNT(DISTINCT Instrument) AS num_instruments FROM Instruments AS T1 JOIN Songs AS T2 ON T1.SongId = T2.SongId WHERE Title = 'Badlands'; |
What is the average, minimum, and maximum age of all singers from France?
Schema:
- singer(Age, Birth_Year, COUNT, Citizenship, Country, Name, Net_Worth_Millions, Song_Name, Song_release_year, T1, s) | SELECT AVG(Age) AS avg_age, MIN(Age) AS min_age, MAX(Age) AS max_age FROM singer WHERE Country = 'France'; |
give me the best american restaurant in the bay area ?
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'); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.