question
stringlengths
43
589
query
stringlengths
19
598
What is the title of the course that was offered at building Chandler during the fall semester in the year 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;
Find the name and capacity of the stadium where the event named "World Junior" happened.? Schema: - stadium(Average, Average_Attendance, Capacity, Capacity_Percentage, City, Country, Home_Games, Location, Name, Opening_year, T1) - event(Date, Event_Attendance, Name, Venue, Year)
SELECT T1.Name, T1.Capacity FROM stadium AS T1 JOIN event AS T2 ON T1.ID = T2.Stadium_ID WHERE T2.Name = 'World Junior';
What are the different first names and highest degree attained for professors teaching in the Computer Information Systems department? Schema: - CLASS(CLASS_CODE, CLASS_ROOM, CLASS_SECTION, CRS_CODE, PROF_NUM) - EMPLOYEE(EMP_DOB, EMP_FNAME, EMP_JOBCODE, EMP_LNAME) - PROFESSOR(DEPT_CODE, PROF_HIGH_DEGREE) - DEPARTMENT(Account, DEPT_ADDRESS, DEPT_NAME, H, SCHOOL_CODE)
SELECT DISTINCT T2.EMP_FNAME, T3.PROF_HIGH_DEGREE FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN PROFESSOR AS T3 ON T2.EMP_NUM = T3.EMP_NUM JOIN DEPARTMENT AS T4 ON T4.DEPT_CODE = T3.DEPT_CODE WHERE T4.DEPT_NAME = 'Computer Info. Systems';
return me the conferences, which have papers by " H. V. Jagadish " .? Schema: - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year) - conference(homepage, name) - writes(...) - author(...)
SELECT T2.name FROM publication AS T4 JOIN conference AS T2 ON T4.cid = CAST(T2.cid AS TEXT) JOIN writes AS T3 ON T3.pid = T4.pid JOIN author AS T1 ON T3.aid = T1.aid WHERE T1.name = 'H. V. Jagadish';
Which winery is the wine that has the highest score from? Schema: - wine(Appelation, Cases, Grape, M, Name, Price, Score, Winery, Year, Z, w)
SELECT Winery FROM wine ORDER BY Score DESC NULLS LAST LIMIT 1;
Find the name of persons who are friends with Bob.? Schema: - Person(M, age, city, eng, gender, job, name) - PersonFriend(M, friend, name)
SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Bob';
What are the names of conductors who have conducted orchestras founded after the year 2008? Schema: - conductor(Age, Name, Nationality, Year_of_Work) - orchestra(COUNT, Major_Record_Format, Record_Company, Year_of_Founded)
SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID WHERE Year_of_Founded > 2008;
For each year, return the year and the number of times the team Boston Red Stockings won in the postseasons.? Schema: - postseason(ties) - team(Name)
SELECT COUNT(*) AS num_wins, T1."year" FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' GROUP BY T1."year";
Find the name of captains whose rank are either Midshipman or Lieutenant.? Schema: - captain(COUNT, Class, INT, Name, Rank, TRY_CAST, age, capta, l)
SELECT Name FROM captain WHERE "Rank" = 'Midshipman' OR "Rank" = 'Lieutenant';
Show the average age for male and female students.? Schema: - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT AVG(Age) AS avg_age, Sex FROM Student GROUP BY Sex;
What is the name of department where has the largest number of professors with a Ph.D. degree? Schema: - PROFESSOR(DEPT_CODE, PROF_HIGH_DEGREE) - DEPARTMENT(Account, DEPT_ADDRESS, DEPT_NAME, H, SCHOOL_CODE)
SELECT T2.DEPT_NAME, T1.DEPT_CODE FROM PROFESSOR AS T1 JOIN DEPARTMENT AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE WHERE T1.PROF_HIGH_DEGREE = 'Ph.D.' GROUP BY T1.DEPT_CODE, T2.DEPT_NAME ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
What campuses are located in the county of Los Angeles? Schema: - Campuses(Campus, County, Franc, Location)
SELECT Campus FROM Campuses WHERE County = 'Los Angeles';
What is the detail of each visitor? Schema: - Visitors(Tourist_Details)
SELECT Tourist_Details FROM Visitors;
Find the first name and country code of the player who did the most number of tours.? Schema: - players(COUNT, birth_date, country_code, first_name, hand, last_name) - rankings(ranking_date, tours)
SELECT T1.country_code, T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id = T2.player_id ORDER BY T2.tours DESC NULLS LAST LIMIT 1;
What is the average longitude of stations that never had bike availability more than 10? 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 avg_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);
How many home games did the team Boston Red Stockings play from 1990 to 2000 in total? Schema: - home_game(attendance, year) - team(Name)
SELECT SUM(T1.games) AS num_games FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1."year" BETWEEN 1990 AND 2000;
What are the ids, full names, and phones of each 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 customer_id, customer_first_name, customer_last_name, customer_phone FROM Customers;
What are the maximum and minimum number of cities in all markets.? Schema: - market(Country, Number_cities)
SELECT MAX(Number_cities) AS max_number_cities, MIN(Number_cities) AS min_number_cities FROM market;
How many papers David M. Blei has in AISTATS ? Schema: - venue(venueId, venueName) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...) - author(...)
SELECT DISTINCT COUNT(T3.paperId) AS num_papers FROM venue AS T4 JOIN paper AS T3 ON T4.venueId = T3.venueId JOIN writes AS T2 ON T2.paperId = T3.paperId JOIN author AS T1 ON T2.authorId = T1.authorId WHERE T1.authorName = 'David M. Blei' AND T4.venueName = 'AISTATS';
What are the total points of gymnasts, ordered by their floor exercise points descending? Schema: - gymnast(Floor_Exercise_Points, Horizontal_Bar_Points)
SELECT Total_Points FROM gymnast ORDER BY Floor_Exercise_Points DESC NULLS LAST;
In zip code 94107, on which day neither Fog nor Rain was not observed? Schema: - weather(AVG, COUNT, M, Ra, cloud_cover, date, diff, events, mean_humidity, mean_sea_level_pressure_inches, mean_temperature_f, mean_visibility_miles, ... (1 more))
SELECT "date" FROM weather WHERE zip_code = 94107 AND events != 'Fog' AND events != 'Rain';
Show the name and phone for customers with a mailshot with outcome code 'No Response'.? 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)) - Mailshot_Customers(outcome_code)
SELECT T1.customer_name, T1.customer_phone FROM Customers AS T1 JOIN Mailshot_Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.outcome_code = 'No Response';
Which clubs have one or more members from the city with code "HOU"? Give me the names of the clubs.? 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 DISTINCT T1.ClubName 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 T3.city_code = 'HOU';
return me the papers on PVLDB after 2000 .? Schema: - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year) - journal(Theme, homepage, name)
SELECT T2.title FROM publication AS T2 JOIN journal AS T1 ON T2.jid = T1.jid WHERE T1.name = 'PVLDB' AND T2."year" > 2000;
papers with more than 10 citations? Schema: - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - cite(...)
SELECT DISTINCT T2.citingPaperId FROM paper AS T1 JOIN cite AS T2 ON T1.paperId = T2.citedPaperId GROUP BY T2.citingPaperId HAVING COUNT(DISTINCT T2.citedPaperId) > 10;
What is the highest cited paper by ohad shamir ? Schema: - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - cite(...) - writes(...) - author(...)
SELECT DISTINCT T4.citedPaperId, COUNT(T4.citedPaperId) AS num_citations FROM paper AS T3 JOIN cite AS T4 ON T3.paperId = T4.citedPaperId JOIN writes AS T2 ON T2.paperId = T3.paperId JOIN author AS T1 ON T2.authorId = T1.authorId WHERE T1.authorName = 'ohad shamir' GROUP BY T4.citedPaperId ORDER BY num_citations DESC NULLS LAST;
return me the organization " H. V. Jagadish " is in .? Schema: - organization(continent, homepage, name) - author(...)
SELECT T2.name FROM organization AS T2 JOIN author AS T1 ON T2.oid = T1.oid WHERE T1.name = 'H. V. Jagadish';
how many rivers run through idaho? Schema: - river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse)
SELECT COUNT(river_name) AS num_rivers FROM river WHERE traverse = 'idaho';
What type has the most games? Schema: - Video_Games(COUNT, Dest, GName, GType, onl)
SELECT GType FROM Video_Games WHERE GType IS NOT NULL GROUP BY GType ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
What is the product category description and unit of measurement of category "Herbs"? Schema: - Ref_Product_Categories(product_category_code, product_category_description, unit_of_measure)
SELECT product_category_description, unit_of_measure FROM Ref_Product_Categories WHERE product_category_code = 'Herbs';
Return the name of the heaviest 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 T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC NULLS LAST LIMIT 1;
What are the average prices of wines for different years? Schema: - wine(Appelation, Cases, Grape, M, Name, Price, Score, Winery, Year, Z, w)
SELECT AVG(Price) AS avg_price, "Year" FROM wine GROUP BY "Year";
What is the maximum mpg of the cars that had 8 cylinders or that were produced before 1980 ? Schema: - cars_data(Accelerate, Cylinders, Horsepower, MPG, T1, Weight, Year)
SELECT MAX(MPG) AS max_mpg FROM cars_data WHERE Cylinders = 8 OR "Year" < 1980;
in what state is mount whitney? 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';
where is a jamerican cuisine in san francisco ? Schema: - restaurant(...) - location(...)
SELECT T2.house_number, T1.name FROM restaurant AS T1 JOIN location AS T2 ON T1.id = T2.restaurant_id WHERE T2.city_name = 'san francisco' AND T1.name = 'jamerican cuisine';
how many rivers are found in idaho? Schema: - river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse)
SELECT COUNT(river_name) AS num_rivers FROM river WHERE traverse = 'idaho';
What is Kyle's id? Schema: - Highschooler(COUNT, ID, grade, name)
SELECT ID FROM Highschooler WHERE name = 'Kyle';
Which order's shipment tracking number is "3452"? Give me the id of the order.? Schema: - Shipments(order_id, shipment_date, shipment_tracking_number)
SELECT order_id FROM Shipments WHERE shipment_tracking_number = '3452';
Which problems are reported by the staff with last name "Bosco"? Show the ids of the problems.? Schema: - Problems(date_problem_reported, problem_id) - 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.problem_id FROM Problems AS T1 JOIN Staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_last_name = 'Bosco';
Find the id, forename and number of races of all drivers who have at least participated in two races? Schema: - drivers(forename, nationality, surname) - results(...) - races(date, name)
SELECT T1.driverId, T1.forename, COUNT(*) AS num_races FROM drivers AS T1 JOIN results AS T2 ON T1.driverId = T2.driverId JOIN races AS T3 ON T2.raceId = T3.raceId GROUP BY T1.driverId, T1.forename HAVING COUNT(*) >= 2;
What are the ids of the students who either registered or attended a course? Schema: - Student_Course_Registrations(COUNT, student_id) - Student_Course_Attendance(course_id, date_of_attendance, student_id)
SELECT DISTINCT student_id FROM (SELECT student_id FROM Student_Course_Registrations UNION ALL SELECT student_id FROM Student_Course_Attendance);
What are the team and the location of school each player belongs to? Schema: - player(Age, COUNT, Gender, Occupation, Player, Player_name, Po, Points, Position, Residence, Sponsor_name, T1, ... (12 more)) - school(Denom, Denomination, EX, Enrollment, Founded, Location, School_Colors, T1, Type)
SELECT T1.Team, T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID;
Find the titles of the papers the author "Stephanie Weirich" wrote.? Schema: - Authors(fname, lname) - Authorship(...) - Papers(title)
SELECT T3.title FROM Authors AS T1 JOIN Authorship AS T2 ON T1.authID = T2.authID JOIN Papers AS T3 ON T2.paperID = T3.paperID WHERE T1.fname = 'Stephanie' AND T1.lname = 'Weirich';
Who were the comptrollers of the parties associated with the delegates from district 1 or district 2? Schema: - election(Committee, Date, Delegate, District, Vote_Percent, Votes) - party(COUNT, Comptroller, First_year, Governor, Last_year, Left_office, Location, Minister, Number_of_hosts, Party, Party_Theme, Party_name, ... (3 more))
SELECT T2.Comptroller FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2;
Find the first names of students with age above 22.? Schema: - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT Fname FROM Student WHERE Age > 22;
Find the number of investors in total.? Schema: - Investors(Investor_details)
SELECT COUNT(*) AS num_investors FROM Investors;
List the names of companies in descending order of market value.? Schema: - Companies(Assets_billion, Bank, COUNT, Ch, Headquarters, Industry, Market_Value_billion, Profits_billion, Sales_billion, T1, name)
SELECT name FROM Companies ORDER BY Market_Value_billion DESC NULLS LAST;
List the names and birth dates of people in ascending alphabetical order of name.? Schema: - people(Age, Birth_Date, Birth_Place, COUNT, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more))
SELECT Name, Birth_Date FROM people ORDER BY Name ASC NULLS LAST;
What are the names of the different banks that have provided 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;
name the 50 capitals in the usa? Schema: - state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom)
SELECT capital FROM state;
Find the total amount of bonus given in all the evaluations.? Schema: - evaluation(Bonus)
SELECT SUM(Bonus) AS total_bonus FROM evaluation;
How many tests have result "Fail"? Schema: - Student_Tests_Taken(date_test_taken, test_result)
SELECT COUNT(*) AS num_tests FROM Student_Tests_Taken WHERE test_result = 'Fail';
Find the names of all instructors in Comp. Sci. department with salary > 80000.? Schema: - instructor(AVG, M, So, Stat, dept_name, name, salary)
SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.' AND salary > 80000;
What are the names of all airports in Cuba or Argentina? Schema: - airports(AirportCode, AirportName, Argent, COUNT, City, Country, city, country, elevation, name)
SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina';
What is the team and starting year for each technician? Schema: - technician(Age, COUNT, JO, Start, Starting_Year, T1, Team, name)
SELECT Team, Starting_Year FROM technician;
Return the names of the 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 T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID;
What are the names of products with price at most 200? Schema: - Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more))
SELECT Name FROM Products WHERE Price <= 200;
How many dorms are in the database? Schema: - Dorm(dorm_name, gender, student_capacity)
SELECT COUNT(*) AS num_dorms FROM Dorm;
What are all the possible breed type and size type combinations? Schema: - Dogs(abandoned_yn, age, breed_code, date_arrived, date_departed, name, size_code, weight)
SELECT DISTINCT breed_code, size_code FROM Dogs;
Where does the customer with the first name Linda live? And what is her email? Schema: - customer(COUNT, T1, acc_bal, acc_type, active, check, credit_score, cust_name, no_of_loans, sav, state, store_id) - address(address, district, phone, postal_code)
SELECT T2.address, T1.email FROM customer AS T1 JOIN address AS T2 ON T2.address_id = T1.address_id WHERE T1.first_name = 'LINDA';
Find the name and rank points of the winner who won the most times.? Schema: - matches_(COUNT, T1, loser_age, loser_name, minutes, tourney_name, winner_age, winner_hand, winner_name, winner_rank, winner_rank_points, year)
SELECT winner_name, SUM(winner_rank_points) AS total_rank_points FROM matches_ WHERE winner_name IS NOT NULL GROUP BY winner_name ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
What is total bonus given in all evaluations? Schema: - evaluation(Bonus)
SELECT SUM(Bonus) AS total_bonus FROM evaluation;
display all the information for all employees who have the letters D or S in their first name and also arrange the result in descending order by salary.? 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 * FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SALARY DESC NULLS LAST;
How many different scientists are assigned to any project? Schema: - AssignedTo(Scientist)
SELECT COUNT(DISTINCT Scientist) AS num_scientists FROM AssignedTo;
What are the first names of every student who has a cat or dog as a pet? 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 T3.PetID = T2.PetID WHERE T3.PetType = 'cat' OR T3.PetType = 'dog';
What is the code of the country with the most players? Schema: - players(COUNT, birth_date, country_code, first_name, hand, last_name)
SELECT country_code FROM players WHERE country_code IS NOT NULL GROUP BY country_code ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
How many draft copies does the document with id 2 have? Schema: - Draft_Copies(copy_number, document_id)
SELECT COUNT(*) AS num_draft_copies FROM Draft_Copies WHERE document_id = 2;
Find the average number of customers cross all banks.? Schema: - bank(SUM, bname, city, morn, no_of_customers, state)
SELECT AVG(no_of_customers) AS avg_no_of_customers FROM bank;
Current research on deep learning? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT T3.paperId, T3."year" FROM paperKeyphrase AS T2 JOIN keyphrase AS T1 ON T2.keyphraseId = T1.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId WHERE T1.keyphraseName = 'deep learning' ORDER BY T3."year" DESC NULLS LAST;
return me the papers by " H. V. Jagadish " on PVLDB after 2000 .? Schema: - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year) - journal(Theme, homepage, name) - writes(...) - author(...)
SELECT T4.title FROM publication AS T4 JOIN journal AS T2 ON T4.jid = T2.jid JOIN writes AS T3 ON T3.pid = T4.pid JOIN author AS T1 ON T3.aid = T1.aid WHERE T1.name = 'H. V. Jagadish' AND T2.name = 'PVLDB' AND T4."year" > 2000;
Give me the the first and last name of the faculty who advises the most students.? Schema: - Faculty(Building, COUNT, FacID, Fname, LName, Lname, Phone, Pr, Rank, Room, Sex) - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT T1.Fname, T1.Lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.Advisor GROUP BY T1.FacID, T1.Fname, T1.Lname ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Find the busiest source airport that runs most number of routes in China.? Schema: - airports(AirportCode, AirportName, Argent, COUNT, City, Country, city, country, elevation, name) - routes(...)
SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Count the number of ships.? Schema: - Ship(Built_Year, COUNT, Class, Flag, Name, Type)
SELECT COUNT(*) AS num_ships FROM Ship;
What are the different carriers for devices, listed in alphabetical order? Schema: - device(COUNT, Carrier, Software_Platform)
SELECT Carrier FROM device ORDER BY Carrier ASC NULLS LAST;
Return the number of airports.? Schema: - airports(AirportCode, AirportName, Argent, COUNT, City, Country, city, country, elevation, name)
SELECT COUNT(*) AS num_airports FROM airports;
What are the address and phone number of the buildings managed by "Brenden"? Schema: - Apartment_Buildings(building_address, building_description, building_full_name, building_manager, building_phone, building_short_name)
SELECT building_address, building_phone FROM Apartment_Buildings WHERE building_manager = 'Brenden';
Find the first name and office of history professor who did not get a Ph.D. degree.? Schema: - PROFESSOR(DEPT_CODE, PROF_HIGH_DEGREE) - EMPLOYEE(EMP_DOB, EMP_FNAME, EMP_JOBCODE, EMP_LNAME) - DEPARTMENT(Account, DEPT_ADDRESS, DEPT_NAME, H, SCHOOL_CODE)
SELECT T2.EMP_FNAME, T1.PROF_OFFICE FROM PROFESSOR AS T1 JOIN EMPLOYEE AS T2 ON T1.EMP_NUM = T2.EMP_NUM JOIN DEPARTMENT AS T3 ON T1.DEPT_CODE = T3.DEPT_CODE WHERE T3.DEPT_NAME = 'History' AND T1.PROF_HIGH_DEGREE != 'Ph.D.';
What is the total number of residents for the districts with the 3 largest areas? Schema: - district(City_Area, City_Population, District_name, d)
SELECT SUM(City_Population) AS total_residents FROM district WHERE City_Area IN (SELECT City_Area FROM district ORDER BY City_Area DESC NULLS LAST LIMIT 3);
How many institutions do not have an associated protein in our record? Schema: - Institution(COUNT, Enrollment, Founded, Type) - protein(...)
SELECT COUNT(*) AS num_institutions FROM Institution WHERE Institution_id NOT IN (SELECT Institution_id FROM protein);
What is the cmi cross reference id that is related to at least one council tax entry? List the cross reference id and source system code.? Schema: - CMI_Cross_References(source_system_code) - Council_Tax(...)
SELECT T1.cmi_cross_ref_id, T1.source_system_code FROM CMI_Cross_References AS T1 JOIN Council_Tax AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id GROUP BY T1.cmi_cross_ref_id, T1.source_system_code HAVING COUNT(*) >= 1;
When did Michael Stonebraker publish his GIS Database paper ? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...) - author(...)
SELECT DISTINCT T3."year" 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 = 'Michael Stonebraker' AND T5.keyphraseName = 'GIS Database';
What are the names of all cities with more than one airport and how many airports do they have? Schema: - airports(AirportCode, AirportName, Argent, COUNT, City, Country, city, country, elevation, name)
SELECT city, COUNT(*) AS num_airports FROM airports WHERE city IS NOT NULL GROUP BY city HAVING COUNT(*) > 1;
papers 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';
what state borders kentucky? Schema: - border_info(T1, border, state_name)
SELECT border FROM border_info WHERE state_name = 'kentucky';
Show the county name and population of all counties.? Schema: - county(County_name, Population, Zip_code)
SELECT County_name, Population FROM county;
which EMNLP 2010 papers have the most citations ? Schema: - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - cite(...) - venue(venueId, venueName)
SELECT DISTINCT T3.citedPaperId, COUNT(T3.citedPaperId) AS num_citations FROM paper AS T1 JOIN cite AS T3 ON T1.paperId = T3.citedPaperId JOIN venue AS T2 ON T2.venueId = T1.venueId WHERE T1."year" = 2010 AND T2.venueName = 'EMNLP' GROUP BY T3.citedPaperId ORDER BY num_citations DESC NULLS LAST;
Find the number of distinct currency codes used in drama workshop groups.? Schema: - Drama_Workshop_Groups(COUNT, Currency_Code, Marketing_Region_Code, Store_Name)
SELECT COUNT(DISTINCT Currency_Code) AS num_currencies FROM Drama_Workshop_Groups;
Which gender makes up the majority of the staff? 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)
SELECT gender FROM Staff WHERE gender IS NOT NULL GROUP BY gender ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
what state has the city with the largest population? Schema: - city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more))
SELECT state_name FROM city WHERE population = (SELECT MAX(population) FROM city);
What is the famous release date of the artist with the oldest age? Schema: - artist(Age, Artist, Country, Famous_Release_date, Famous_Title, Year_Join, artist_name, country, gender)
SELECT Famous_Release_date FROM artist ORDER BY Age DESC NULLS LAST LIMIT 1;
Find the name and id of the top 3 expensive rooms.? Schema: - Rooms(K, RoomId, basePrice, bedType, beds, decor, maxOccupancy, roomName)
SELECT RoomId, roomName FROM Rooms ORDER BY basePrice DESC NULLS LAST LIMIT 3;
List the position of players with average number of points scored by players of that position bigger than 20.? Schema: - player(Age, COUNT, Gender, Occupation, Player, Player_name, Po, Points, Position, Residence, Sponsor_name, T1, ... (12 more))
SELECT "Position" FROM player GROUP BY name, "Position" HAVING AVG(Points) > 20;
return me the papers written by " H. V. Jagadish " and " Yunyao Li " on PVLDB after 2005 .? Schema: - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year) - journal(Theme, homepage, name) - writes(...) - author(...)
SELECT T6.title FROM publication AS T6 JOIN journal AS T4 ON T6.jid = T4.jid JOIN writes AS T3 ON T3.pid = T6.pid JOIN writes AS T5 ON T5.pid = T6.pid JOIN author AS T1 ON T5.aid = T1.aid JOIN author AS T2 ON T3.aid = T2.aid WHERE T2.name = 'H. V. Jagadish' AND T1.name = 'Yunyao Li' AND T4.name = 'PVLDB' AND T6."year" > 2005;
Which month has the most happy hours? Schema: - happy_hour(COUNT, Month)
SELECT "Month" FROM happy_hour GROUP BY "Month" ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
List the all the distinct names of the products with the characteristic name 'warm'.? Schema: - Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more)) - Product_Characteristics(...) - Characteristics(characteristic_name)
SELECT DISTINCT T1.product_name FROM Products AS T1 JOIN Product_Characteristics AS T2 ON T1.product_id = T2.product_id JOIN Characteristics AS T3 ON T2.characteristic_id = T3.characteristic_id WHERE T3.characteristic_name = 'warm';
Which assets have 2 parts and have less than 2 fault logs? List the asset id and detail.? Schema: - Assets(asset_acquired_date, asset_details, asset_disposed_date, asset_id, asset_make, asset_model) - Asset_Parts(...) - Fault_Log(...)
SELECT ap.asset_id, ap.asset_details FROM (SELECT T1.asset_id, T1.asset_details FROM Assets AS T1 JOIN Asset_Parts AS T2 ON T1.asset_id = T2.asset_id GROUP BY T1.asset_id, T1.asset_details HAVING COUNT(*) = 2) AS ap JOIN (SELECT T1.asset_id, T1.asset_details FROM Assets AS T1 JOIN Fault_Log AS T2 ON T1.asset_id = T2.asset_id GROUP BY T1.asset_id, T1.asset_details HAVING COUNT(*) < 2) AS fl ON ap.asset_id = fl.asset_id;
What are the names of all songs produced by the artist with the first name "Marianne"? Schema: - Performance(...) - Band(...) - Songs(Title)
SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.Bandmate = T2.Id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.Firstname = 'Marianne';
find the number of restaurant rated more than 3.5? Schema: - category(...) - business(business_id, city, full_address, name, rating, review_count, state)
SELECT COUNT(DISTINCT T1.name) AS num_restaurants FROM category AS T2 JOIN business AS T1 ON T2.business_id = T1.business_id WHERE T1.rating > 3.5 AND T2.category_name = 'restaurant';
Show me the papers on Question Answering? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT T3.paperId FROM paperKeyphrase AS T2 JOIN keyphrase AS T1 ON T2.keyphraseId = T1.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId WHERE T1.keyphraseName = 'Question Answering';
Show the total number of rooms of the apartments in the building with short name "Columbus Square".? Schema: - Apartment_Buildings(building_address, building_description, building_full_name, building_manager, building_phone, building_short_name) - Apartments(AVG, COUNT, INT, SUM, TRY_CAST, apt_number, apt_type_code, bathroom_count, bedroom_count, room_count)
SELECT SUM(TRY_CAST(T2.room_count AS INT)) AS total_rooms FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_short_name = 'Columbus Square';