question
stringlengths
43
589
query
stringlengths
19
598
name all the lakes of us? Schema: - lake(lake_name, state_name)
SELECT lake_name FROM lake;
What is the first name of every student who has a dog but does not have a cat? Schema: - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age) - Has_Pet(...) - Pets(PetID, PetType, pet_age, weight)
SELECT DISTINCT T1.Fname FROM Student AS T1 JOIN Has_Pet AS T2 ON T1.StuID = T2.StuID JOIN Pets AS T3 ON T2.PetID = T3.PetID WHERE T3.PetType = 'dog' AND T1.StuID NOT IN (SELECT T1.StuID FROM Student AS T1 JOIN Has_Pet AS T2 ON T1.StuID = T2.StuID JOIN Pets AS T3 ON T2.PetID = T3.PetID WHERE T3.PetType = 'cat');
How many aircrafts do we have? Schema: - aircraft(Description, aid, d, distance, name)
SELECT COUNT(*) AS num_aircrafts FROM aircraft;
What papers does Richard Ladner have in chi ? Schema: - venue(venueId, venueName) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...) - author(...)
SELECT DISTINCT T3.paperId FROM venue AS T4 JOIN paper AS T3 ON T4.venueId = T3.venueId JOIN writes AS T2 ON T2.paperId = T3.paperId JOIN author AS T1 ON T2.authorId = T1.authorId WHERE T1.authorName = 'Richard Ladner' AND T4.venueName = 'chi';
How many movies did " Humphrey Bogart " act in before 1942 ? 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 COUNT(DISTINCT T2.title) AS num_movies FROM cast_ AS T3 JOIN actor AS T1 ON T3.aid = T1.aid JOIN movie AS T2 ON T2.mid = T3.msid WHERE T1.name = 'Humphrey Bogart' AND T2.release_year < 1942;
find the names of programs whose origin is not in Beijing.? Schema: - program(Beij, Launch, Name, Origin, Owner)
SELECT Name FROM program WHERE Origin != 'Beijing';
list all the businesses which have a review by Niloofar? Schema: - review(i_id, rank, rating, text) - business(business_id, city, full_address, name, rating, review_count, state) - user_(name)
SELECT T1."name" FROM review AS T2 JOIN business AS T1 ON T2.business_id = T1.business_id JOIN user_ AS T3 ON T3.user_id = T2.user_id WHERE T3.name = 'Niloofar';
What are the details for the paragraph that includes the text 'Korea ' ? Schema: - Paragraphs(COUNT, Document_ID, Other_Details, Paragraph_Text, T1)
SELECT Other_Details FROM Paragraphs WHERE Paragraph_Text LIKE '%Korea%';
What is the first name and last name of the student who have most number of sports? Schema: - SportsInfo(COUNT, GamesPlayed, OnScholarship, SportName, StuID) - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT T2.Fname, T2.LName FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID, T2.Fname, T2.LName ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
What is the name and the average gpa of department whose students have the highest average gpa? Schema: - STUDENT(DEPT_CODE, STU_DOB, STU_FNAME, STU_GPA, STU_HRS, STU_LNAME, STU_PHONE) - DEPARTMENT(Account, DEPT_ADDRESS, DEPT_NAME, H, SCHOOL_CODE)
SELECT T2.DEPT_NAME, AVG(T1.STU_GPA) AS avg_gpa FROM STUDENT AS T1 JOIN DEPARTMENT AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.DEPT_CODE, T2.DEPT_NAME ORDER BY avg_gpa DESC NULLS LAST LIMIT 1;
List the first names of people in alphabetical order? Schema: - People(first_name)
SELECT first_name FROM People ORDER BY first_name ASC NULLS LAST;
Who has written the most papers at chi ? Schema: - venue(venueId, venueName) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...)
SELECT DISTINCT COUNT(DISTINCT 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 T3.venueName = 'chi' GROUP BY T1.authorId ORDER BY num_papers DESC NULLS LAST;
Who is performing in the back stage position for the song "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' AND T1.StagePosition = 'back';
What are the categories of music festivals for which there have been more than 1 music festival? Schema: - music_festival(COUNT, Category, Date_of_ceremony, Result)
SELECT Category FROM music_festival WHERE Category IS NOT NULL GROUP BY Category HAVING COUNT(*) > 1;
For each policy type, return its type code and its count in the record.? Schema: - Policies(COUNT, Policy_Type_Code)
SELECT Policy_Type_Code, COUNT(*) AS num_policies FROM Policies GROUP BY Policy_Type_Code;
What is the average rating and resolution of all bangla songs? Schema: - song(COUNT, M, art, artist_name, engl, f_id, genre_is, languages, rat, rating, releasedate, resolution, ... (1 more))
SELECT AVG(rating) AS avg_rating, AVG(resolution) AS avg_resolution FROM song WHERE languages = 'bangla';
Find the names of the customers who have order status both "On Road" and "Shipped".? 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)
SELECT DISTINCT T1.customer_name FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id = T2.customer_id JOIN Orders AS T3 ON T1.customer_id = T3.customer_id WHERE (T2.order_status = 'On Road' AND T3.order_status = 'Shipped');
For each team, return the team name, id and the maximum salary among the team.? Schema: - team(Name) - salary(salary)
SELECT T1.name, T1.team_id, MAX(T2.salary) AS max_salary FROM team AS T1 JOIN salary AS T2 ON T1.team_id = T2.team_id GROUP BY T1.name, T1.team_id;
What are the themes of parties ordered by the number of hosts in ascending manner? Schema: - party(COUNT, Comptroller, First_year, Governor, Last_year, Left_office, Location, Minister, Number_of_hosts, Party, Party_Theme, Party_name, ... (3 more))
SELECT Party_Theme FROM party ORDER BY Number_of_hosts ASC NULLS LAST;
what are the cities in texas? Schema: - city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more))
SELECT city_name FROM city WHERE state_name = 'texas';
How much amount in total were claimed in the most recently created document? Schema: - Claim_Headers(Amount_Piad) - Claims_Documents(...)
SELECT SUM(T1.Amount_Claimed) AS total_amount FROM Claim_Headers AS T1 JOIN Claims_Documents AS T2 ON T1.Claim_Header_ID = T2.Claim_ID WHERE T2.Created_Date = (SELECT Created_Date FROM Claims_Documents ORDER BY Created_Date ASC NULLS LAST LIMIT 1);
Show the name of the shop that have the largest quantity of devices in stock.? Schema: - stock(Quantity) - shop(Address, District, INT, Location, Manager_name, Name, Number_products, Open_Year, Score, Shop_ID, Shop_Name, T1, ... (1 more))
SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID, T2.Shop_Name ORDER BY SUM(T1.Quantity) DESC NULLS LAST LIMIT 1;
What are the names of the people who teach math courses? Schema: - course_arrange(...) - course(COUNT, JO, SUM, Stat, T1, course_id, credits, dept_name, title) - teacher(Age, COUNT, D, Hometown, Name)
SELECT T3.Name FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID = T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID = T3.Teacher_ID WHERE T2.Course = 'Math';
How many courses have more than 2 credits? Schema: - Course(CName, Credits, Days)
SELECT COUNT(*) AS num_courses FROM Course WHERE Credits > 2;
What is the location of the club named "Tennis Club"? Schema: - Club(ClubDesc, ClubLocation, ClubName, Enterpr, Gam, Hopk, Tenn)
SELECT ClubLocation FROM Club WHERE ClubName = 'Tennis Club';
How many players were in the team Boston Red Stockings in 2000? Schema: - salary(salary) - team(Name)
SELECT COUNT(*) AS num_players FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1."year" = 2000;
What are the grapes, wineries and years for wines with price higher than 100, sorted by year? Schema: - wine(Appelation, Cases, Grape, M, Name, Price, Score, Winery, Year, Z, w)
SELECT Grape, Winery, "Year" FROM wine WHERE Price > 100 ORDER BY "Year";
What are the authors of submissions and their colleges? Schema: - submission(Author, COUNT, College, Scores)
SELECT Author, College FROM submission;
Show the names of pilots and fleet series of the aircrafts they have flied with in ascending order of the rank of the pilot.? Schema: - pilot_record(...) - aircraft(Description, aid, d, distance, name) - pilot(Age, COUNT, Join_Year, Name, Nationality, Pilot_name, Position, Rank, Team)
SELECT T3.Pilot_name, T2.Fleet_Series FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID ORDER BY T3."Rank" ASC NULLS LAST;
What are the famous titles of artists who have not only had volumes that spent more than 2 weeks on top but also volumes that spent less than 2 weeks on top? Schema: - artist(Age, Artist, Country, Famous_Release_date, Famous_Title, Year_Join, artist_name, country, gender) - volume(Artist_ID, Issue_Date, Song, Weeks_on_Top)
SELECT T1.Famous_Title FROM artist AS T1 WHERE EXISTS (SELECT 1 FROM volume AS T2 WHERE T1.Artist_ID = T2.Artist_ID AND T2.Weeks_on_Top > 2) AND EXISTS (SELECT 1 FROM volume AS T2 WHERE T1.Artist_ID = T2.Artist_ID AND T2.Weeks_on_Top < 2);
How many albums has Billy Cobham released? Schema: - albums(I, title) - artists(...)
SELECT COUNT(*) AS num_albums FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = 'Billy Cobham';
For each language, list the number of TV Channels that use it.? Schema: - TV_Channel(Content, Country, Engl, Hight_definition_TV, Language, Package_Option, Pixel_aspect_ratio_PAR, id, series_name)
SELECT "Language", COUNT(*) AS num_channels FROM TV_Channel GROUP BY "Language";
What is the maximum and minimum grade point of students who live in NYC? Schema: - Enrolled_in(Fname, Grade, LName, StuID, T2, T3, gradepoint) - Gradeconversion(...) - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT MAX(T2.gradepoint) AS max_gradepoint, MIN(T2.gradepoint) AS min_gradepoint FROM Enrolled_in AS T1 JOIN Gradeconversion AS T2 ON T1.Grade = T2.lettergrade JOIN Student AS T3 ON T1.StuID = T3.StuID WHERE T3.city_code = 'NYC';
Which model saves the most gasoline? That is to say, have the maximum miles per gallon.? Schema: - car_names(COUNT, Model) - cars_data(Accelerate, Cylinders, Horsepower, MPG, T1, Weight, Year)
SELECT T1.Model FROM car_names AS T1 JOIN cars_data AS T2 ON T1.MakeId = T2.Id ORDER BY T2.MPG DESC NULLS LAST LIMIT 1;
Find the name of bank branches that provided some loans.? Schema: - bank(SUM, bname, city, morn, no_of_customers, state) - loan(...)
SELECT DISTINCT T1.bname FROM bank AS T1 JOIN loan AS T2 ON CAST(T1.branch_ID AS TEXT) = T2.branch_ID;
what is the highest mountain in texas? Schema: - highlow(M, highest_elevation, highest_point, lowest_elevation, lowest_point, state_name)
SELECT highest_point FROM highlow WHERE state_name = 'texas';
What are the names of all the scientists in alphabetical order? Schema: - Scientists(Name)
SELECT Name FROM Scientists ORDER BY Name ASC NULLS LAST;
What are the names of the states that have 2 to 4 employees living there? Schema: - Addresses(address_content, city, country, line_1, line_1_number_building, line_2, state_province_county, town_city, zip_postcode) - 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 T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.state_province_county HAVING COUNT(*) BETWEEN 2 AND 4;
Return me the number of cities that has " Panda Express " .? Schema: - business(business_id, city, full_address, name, rating, review_count, state)
SELECT COUNT(DISTINCT city) AS num_cities FROM business WHERE name = 'Panda Express';
which state has the smallest area that borders texas? 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 MIN(area) FROM state WHERE state_name IN (SELECT border FROM border_info WHERE state_name = 'texas')) AND state_name IN (SELECT border FROM border_info WHERE state_name = 'texas');
What is the last name of the first individual contacted from the organization with the maximum UK Vat number across all organizations? Schema: - Organizations(date_formed, organization_name) - Organization_Contact_Individuals(...) - Individuals(...)
SELECT T3.individual_last_name FROM Organizations AS T1 JOIN Organization_Contact_Individuals AS T2 ON T1.organization_id = T2.organization_id JOIN Individuals AS T3 ON T2.individual_id = T3.individual_id WHERE TRY_CAST(T1.uk_vat_number AS BIGINT) = (SELECT MAX(TRY_CAST(uk_vat_number AS BIGINT)) FROM Organizations) ORDER BY T2.date_contact_to ASC NULLS LAST LIMIT 1;
what is the lowest point of all states through which the mississippi river runs through? Schema: - highlow(M, highest_elevation, highest_point, lowest_elevation, lowest_point, state_name) - river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse)
SELECT lowest_point FROM highlow WHERE state_name IN (SELECT traverse FROM river WHERE river_name = 'mississippi') ORDER BY lowest_elevation ASC NULLS LAST LIMIT 1;
List the name and tonnage ordered by in descending alphaetical order for the names.? Schema: - ship(COUNT, DIST, JO, K, Name, Nationality, T1, Tonnage, Type, disposition_of_ship, name, tonnage)
SELECT name, tonnage FROM ship ORDER BY name DESC NULLS LAST;
Papers authored 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';
Show the names of members and names of colleges they go to.? Schema: - college(College_Location, Leader_Name) - member_(Address, Age, COUNT, Card_Number, Country, Hometown, Level, Member_ID, Member_Name, Membership_card, Name, Party_ID, ... (1 more))
SELECT T2.Name, T1.Name FROM college AS T1 JOIN member_ AS T2 ON T1.College_ID = T2.College_ID;
What are the different types of player positions? Schema: - Tryout(COUNT, EX, T1, cName, decision, pPos)
SELECT COUNT(DISTINCT pPos) AS num_positions FROM Tryout;
What are the first names for all students who are from the major numbered 600? Schema: - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT Fname FROM Student WHERE Major = 600;
What is the name and salary of the employee with the id 242518965? Schema: - employee(Address, Age, Bdate, City, Fname, Lname, Name, Salary, Sex, eid, name, salary)
SELECT name, salary FROM employee WHERE eid = 242518965;
Show each location and the number of cinemas there.? Schema: - cinema(COUNT, Capacity, Location, Name, Openning_year, T1, c)
SELECT Location, COUNT(*) AS num_cinemas FROM cinema GROUP BY Location;
NIPS authors? Schema: - venue(venueId, venueName) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...)
SELECT DISTINCT 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 T3.venueName = 'NIPS';
What is the average age of all gymnasts? 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 AVG(T2.Age) AS avg_age FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID;
How many players did Boston Red Stockings have in 2000? Schema: - salary(salary) - team(Name)
SELECT COUNT(*) AS num_players FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1."year" = 2000;
Which players won awards in both 1960 and 1961? Return their first names and last names.? Schema: - player(Age, COUNT, Gender, Occupation, Player, Player_name, Po, Points, Position, Residence, Sponsor_name, T1, ... (12 more)) - player_award(...)
SELECT T1.name_first, T1.name_last FROM player AS T1 JOIN player_award AS T2 ON T1.player_id = T2.player_id WHERE T2."year" IN (1960, 1961) GROUP BY T1.name_first, T1.name_last HAVING COUNT(DISTINCT T2."year") = 2;
How many different instruments does the musician with the last name "Heilo" use? Schema: - Instruments(COUNT, Instrument) - Band(...)
SELECT COUNT(DISTINCT Instrument) AS num_instruments FROM Instruments AS T1 JOIN Band AS T2 ON T1.BandmateId = T2.Id WHERE T2.Lastname = 'Heilo';
what is 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 state_name FROM state WHERE density = (SELECT MAX(density) FROM state);
List the campuses in Los Angeles county.? Schema: - Campuses(Campus, County, Franc, Location)
SELECT Campus FROM Campuses WHERE County = 'Los Angeles';
Find all the male members of club "Hopkins Student Enterprises". Show the first name 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 = 'Hopkins Student Enterprises' AND T3.Sex = 'M';
Find the number of voting records in total.? Schema: - Voting_record(Election_Cycle, President_Vote, Registration_Date, Secretary_Vote, Vice_President_Vote)
SELECT COUNT(*) AS num_voting_records FROM Voting_record;
What are the GDP and population of the city that already served as a host more than once? Schema: - city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) - hosting_city(Host_City, Year)
SELECT T1.GDP, T1.Regional_Population FROM city AS T1 JOIN hosting_city AS T2 ON T1.City_ID = T2.Host_City GROUP BY T2.Host_City, T1.GDP, T1.Regional_Population HAVING COUNT(*) > 1;
Find the states of the colleges that have students in the tryout who played in striker position.? Schema: - College(M, cName, enr, state) - Tryout(COUNT, EX, T1, cName, decision, pPos)
SELECT T1.state FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'striker';
Return me the number of tips that are written by Michelle in 2010 .? Schema: - user_(name) - tip(month, text)
SELECT COUNT(DISTINCT T1."text") AS num_tips FROM user_ AS T2 JOIN tip AS T1 ON T2.user_id = T1.user_id WHERE T1."year" = 2010 AND T2.name = 'Michelle';
What is the zip code of the address in the city Port Chelsea? Schema: - Addresses(address_content, city, country, line_1, line_1_number_building, line_2, state_province_county, town_city, zip_postcode)
SELECT zip_postcode FROM Addresses WHERE city = 'Port Chelsea';
Which channels broadcast both in the morning and at night? Give me the channel names.? Schema: - channel(Name, Owner, Rating_in_percent, Share_in_percent) - broadcast(Program_ID, Time_of_day)
SELECT DISTINCT T1.Name FROM channel AS T1 JOIN broadcast AS T2 ON T1.Channel_ID = T2.Channel_ID WHERE T2.Time_of_day = 'Morning' AND T1.Name IN (SELECT T1.Name FROM channel AS T1 JOIN broadcast AS T2 ON T1.Channel_ID = T2.Channel_ID WHERE T2.Time_of_day = 'Night');
what is the largest 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';
return me the keywords in the papers of " University of Michigan " .? Schema: - organization(continent, homepage, name) - author(...) - writes(...) - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year) - publication_keyword(...) - keyword(keyword)
SELECT T1.keyword FROM organization AS T6 JOIN author AS T2 ON T6.oid = T2.oid JOIN writes AS T4 ON T4.aid = T2.aid JOIN publication AS T5 ON T4.pid = T5.pid JOIN publication_keyword AS T3 ON T5.pid = T3.pid JOIN keyword AS T1 ON T3.kid = T1.kid WHERE T6.name = 'University of Michigan';
Where is the birth place of " Kevin Spacey "? Schema: - actor(Afghan, Aust, COUNT, Character, Chr, Duration, Kev, Name, age, birth_city, birth_year, first_name, ... (4 more))
SELECT birth_city FROM actor WHERE name = 'Kevin Spacey';
How many papers does jamie callan publish each year ? Schema: - writes(...) - author(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT COUNT(T3.paperId) AS num_papers, T3."year" FROM writes AS T2 JOIN author AS T1 ON T2.authorId = T1.authorId JOIN paper AS T3 ON T2.paperId = T3.paperId WHERE T1.authorName = 'jamie callan' GROUP BY T3."year";
Find the names of stadiums whose capacity is smaller than the average capacity.? Schema: - stadium(Average, Average_Attendance, Capacity, Capacity_Percentage, City, Country, Home_Games, Location, Name, Opening_year, T1)
SELECT Name FROM stadium WHERE Capacity < (SELECT AVG(Capacity) FROM stadium);
List the weight of the body builders who have snatch score higher than 140 or have the height greater than 200.? Schema: - body_builder(Clean_Jerk, Snatch, Total) - people(Age, Birth_Date, Birth_Place, COUNT, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more))
SELECT T2.Weight FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Snatch > 140 OR T2.Height > 200;
who authored papers at NIPS ? Schema: - venue(venueId, venueName) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...)
SELECT DISTINCT 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 T3.venueName = 'NIPS';
what states border states that border the state with the largest population? Schema: - border_info(T1, border, state_name) - state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom)
SELECT T1.border FROM border_info AS T2 JOIN border_info AS T1 ON T2.border = T1.state_name WHERE T2.state_name IN (SELECT state_name FROM state WHERE population = (SELECT MAX(population) FROM state));
Give the title of the prerequisite to the course International Finance.? Schema: - course(COUNT, JO, SUM, Stat, T1, course_id, credits, dept_name, title) - prereq(...)
SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.title = 'International Finance');
How many airlines are there? Schema: - airlines(Abbreviation, Airline, COUNT, Country, active, country, name)
SELECT COUNT(*) AS num_airlines FROM airlines;
What are the death and injury situations caused by the ship with tonnage 't'? Schema: - death(injured) - ship(COUNT, DIST, JO, K, Name, Nationality, T1, Tonnage, Type, disposition_of_ship, name, tonnage)
SELECT T1.killed, T1.injured FROM death AS T1 JOIN ship AS T2 ON T1.caused_by_ship_id = T2.id WHERE T2.tonnage = 't';
Have Peter Mertens and Dina Barbian written a paper together ? Schema: - writes(...) - author(...)
SELECT DISTINCT T3.paperId FROM writes AS T3 JOIN author AS T2 ON T3.authorId = T2.authorId JOIN writes AS T4 ON T4.paperId = T3.paperId JOIN author AS T1 ON T4.authorId = T1.authorId WHERE T2.authorName = 'Peter Mertens' AND T1.authorName = 'Dina Barbian';
Show names of teachers and the number of courses they teach.? Schema: - course_arrange(...) - teacher(Age, COUNT, D, Hometown, Name)
SELECT T2.Name, COUNT(*) AS num_courses FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T2.Teacher_ID GROUP BY T2.Name;
In what year did Ye Cao publish the most papers? Schema: - writes(...) - author(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT COUNT(DISTINCT T3.paperId) AS num_papers, T3."year" FROM writes AS T2 JOIN author AS T1 ON T2.authorId = T1.authorId JOIN paper AS T3 ON T2.paperId = T3.paperId WHERE T1.authorName LIKE 'Ye Cao' GROUP BY T3."year" ORDER BY num_papers DESC NULLS LAST;
Show the school name and type for schools without a school bus.? Schema: - school(Denom, Denomination, EX, Enrollment, Founded, Location, School_Colors, T1, Type) - school_bus(Years_Working)
SELECT School, Type FROM school WHERE School_ID NOT IN (SELECT School_ID FROM school_bus);
Count the number of United Airlines flights that arrive in Aberdeen.? Schema: - flights(DestAirport, FlightNo, SourceAirport) - airports(AirportCode, AirportName, Argent, COUNT, City, Country, city, country, elevation, name) - airlines(Abbreviation, Airline, COUNT, Country, active, country, name)
SELECT COUNT(*) AS num_flights FROM flights AS T1 JOIN airports AS T2 ON T1.DestAirport = T2.AirportCode JOIN airlines AS T3 ON T3.uid = T1.Airline WHERE T2.City = 'Aberdeen' AND T3.Airline = 'United Airlines';
What are all the album titles, in alphabetical order? Schema: - Album(Title)
SELECT Title FROM Album ORDER BY Title ASC NULLS LAST;
Show the company of the tallest entrepreneur.? 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 T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Height DESC NULLS LAST LIMIT 1;
What is the tax source system code related to the benefits and overpayments? List the code and the benifit id, order by benifit id.? Schema: - CMI_Cross_References(source_system_code) - Benefits_Overpayments(...)
SELECT T1.source_system_code, T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Benefits_Overpayments AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id ORDER BY T2.council_tax_id ASC NULLS LAST;
How many flights depart from City Aberdeen? Schema: - flights(DestAirport, FlightNo, SourceAirport) - airports(AirportCode, AirportName, Argent, COUNT, City, Country, city, country, elevation, name)
SELECT COUNT(*) AS num_flights FROM flights AS T1 JOIN airports AS T2 ON T1.SourceAirport = T2.AirportCode WHERE T2.City = 'Aberdeen';
List the name and residence for players whose occupation is not "Researcher".? Schema: - player(Age, COUNT, Gender, Occupation, Player, Player_name, Po, Points, Position, Residence, Sponsor_name, T1, ... (12 more))
SELECT Player_name, Residence FROM player WHERE Occupation != 'Researcher';
Which staff members are assigned to the problem with id 1? Give me their first and last names.? Schema: - Staff(COUNT, Name, Other_Details, date_joined_staff, date_left_staff, date_of_birth, email_address, first_name, gender, last_name, middle_name, nickname) - Problem_Log(log_entry_date, log_entry_description, problem_id, problem_log_id)
SELECT DISTINCT staff_first_name, staff_last_name FROM Staff AS T1 JOIN Problem_Log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T2.problem_id = 1;
List all the possible ways to get to attractions, together with the number of attractions accessible by these methods.? 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))
SELECT How_to_Get_There, COUNT(*) AS num_attractions FROM Tourist_Attractions GROUP BY How_to_Get_There;
What are the titles and ids for albums containing tracks with unit price greater than 1? Schema: - Album(Title) - Track(Milliseconds, Name, UnitPrice)
SELECT T1.Title, T2.AlbumId FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId WHERE T2.UnitPrice > 1 GROUP BY T1.Title, T2.AlbumId;
Return the first name, last name and email of the owners living in a state whose name contains the substring 'North'.? Schema: - Owners(email_address, first_name, last_name, state)
SELECT first_name, last_name, email_address FROM Owners WHERE state LIKE '%North%';
What country does Roberto Almeida live? Schema: - customers(Mart, city, company, country, email, first_name, last_name, phone, state)
SELECT country FROM customers WHERE first_name = 'Roberto' AND last_name = 'Almeida';
What are the different ids and names of the stations that have 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;
Show all church names that have hosted least two weddings.? Schema: - church(Name, Open_Date, Organized_by) - wedding(...)
SELECT T1.Name FROM church AS T1 JOIN wedding AS T2 ON T1.Church_ID = T2.Church_ID GROUP BY T1.Church_ID, T1.Name HAVING COUNT(*) >= 2;
Show all locations and the number of gas stations in each location ordered by the count.? Schema: - gas_station(COUNT, Location, Manager_Name, Open_Year, Station_ID)
SELECT Location, COUNT(*) AS num_gas_stations FROM gas_station WHERE Location IS NOT NULL GROUP BY Location ORDER BY num_gas_stations ASC NULLS LAST;
Find the first names and offices of all professors sorted by alphabetical order of their first name.? Schema: - PROFESSOR(DEPT_CODE, PROF_HIGH_DEGREE) - EMPLOYEE(EMP_DOB, EMP_FNAME, EMP_JOBCODE, EMP_LNAME)
SELECT T2.EMP_FNAME, T1.PROF_OFFICE FROM PROFESSOR AS T1 JOIN EMPLOYEE AS T2 ON T1.EMP_NUM = T2.EMP_NUM ORDER BY T2.EMP_FNAME ASC NULLS LAST;
what are the population of california? Schema: - state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom)
SELECT population FROM state WHERE state_name = 'california';
What is the effective date of the claim that has the largest amount of total settlement? Schema: - Claims(Amount_Claimed, Amount_Settled, Date_Claim_Made, Date_Claim_Settled) - Settlements(Amount_Settled, Date_Claim_Made, Date_Claim_Settled, Settlement_Amount)
SELECT T1.Effective_Date FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_ID = T2.Claim_ID GROUP BY T1.Claim_ID, T1.Effective_Date ORDER BY SUM(T2.Settlement_Amount) DESC NULLS LAST LIMIT 1;
List the name of tracks belongs to genre Rock or media type is MPEG audio file.? Schema: - genres(name) - tracks(composer, milliseconds, name, unit_price) - media_types(name)
SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = 'Rock' OR T3.name = 'MPEG audio file';
Who was the actor that 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';
what are the populations of states through which the mississippi river runs? 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 names and descriptions of the products that are of 'Cutlery' type and have daily hire cost lower than 20? Schema: - Products_for_Hire(daily_hire_cost, product_description, product_name, product_type_code)
SELECT product_name, product_description FROM Products_for_Hire WHERE product_type_code = 'Cutlery' AND daily_hire_cost < 20;
What is the installation date for each ending station on all the trips? 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 T1.id, T2.installation_date FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id = T2.id;