question
stringlengths
43
589
query
stringlengths
19
598
Which year had the greatest 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;
How many different software platforms are there for devices? Schema: - device(COUNT, Carrier, Software_Platform)
SELECT COUNT(DISTINCT Software_Platform) AS num_platforms FROM device;
How many students attend course English? Schema: - Courses(course_description, course_name) - Student_Course_Attendance(course_id, date_of_attendance, student_id)
SELECT COUNT(*) AS num_students FROM Courses AS T1 JOIN Student_Course_Attendance AS T2 ON T1.course_id = CAST(T2.course_id AS TEXT) WHERE T1.course_name = 'English';
Find all movies that star both " Woody Strode " and " Jason Robards "? 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 T4.title FROM cast_ AS T5 JOIN actor AS T1 ON T5.aid = T1.aid JOIN movie AS T4 ON T4.mid = T5.msid JOIN cast_ AS T3 ON T4.mid = T3.msid JOIN actor AS T2 ON T3.aid = T2.aid WHERE T1.name = 'Woody Strode' AND T2.name = 'Jason Robards';
Find the latest movie which " Gabriele Ferzetti " acted in? Schema: - cast_(...) - actor(Afghan, Aust, COUNT, Character, Chr, Duration, Kev, Name, age, birth_city, birth_year, first_name, ... (4 more)) - movie(Budget_million, Director, Find, Gross_worldwide, T1, Title, Year, budget, release_year, title)
SELECT T1.name FROM cast_ AS T2 JOIN actor AS T1 ON T2.aid = T1.aid JOIN movie AS T3 ON T3.mid = T2.msid WHERE T1.name = 'Gabriele Ferzetti' ORDER BY T3.release_year DESC NULLS LAST LIMIT 1;
What are total transaction amounts for each transaction type? Schema: - Financial_Transactions(COUNT, F, SUM, account_id, invoice_number, transaction_amount, transaction_id, transaction_type)
SELECT transaction_type, SUM(transaction_amount) AS total_transaction_amount FROM Financial_Transactions GROUP BY transaction_type;
What are the student ID and login name of the student who are enrolled in the most courses? Schema: - Student_Course_Enrolment(course_id, date_of_completion, date_of_enrolment, student_id) - Students(cell_mobile_number, current_address_id, date_first_registered, date_left, date_of_latest_logon, email_address, family_name, first_name, last_name, login_name, middle_name, other_student_details, ... (1 more))
SELECT T1.student_id, T2.login_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id, T2.login_name ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
How many papers did michael i. jordan publish in 2016? Schema: - writes(...) - author(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT COUNT(T2.paperId) AS num_papers 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 = 'michael i. jordan' AND T3."year" = 2016;
Which players are from Indonesia? 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 T2.Player FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Country_name = 'Indonesia';
Show the locations shared by shops with open year later than 2012 and shops with open year before 2008.? Schema: - shop(Address, District, INT, Location, Manager_name, Name, Number_products, Open_Year, Score, Shop_ID, Shop_Name, T1, ... (1 more))
SELECT Location FROM shop WHERE Open_Year > 2012 AND Location IN (SELECT Location FROM shop WHERE Open_Year < 2008);
Give the nationality that is most common across all people.? Schema: - people(Age, Birth_Date, Birth_Place, COUNT, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more))
SELECT Nationality FROM people WHERE Nationality IS NOT NULL GROUP BY Nationality ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
What is the average weight and year for each year? Schema: - cars_data(Accelerate, Cylinders, Horsepower, MPG, T1, Weight, Year)
SELECT AVG(Weight) AS avg_weight, "Year" FROM cars_data GROUP BY "Year";
How many rooms have a king bed? Schema: - Rooms(K, RoomId, basePrice, bedType, beds, decor, maxOccupancy, roomName)
SELECT COUNT(*) AS num_rooms FROM Rooms WHERE bedType = 'King';
Which model has the most version(make) of cars? Schema: - car_names(COUNT, Model)
SELECT Model FROM car_names WHERE Model IS NOT NULL GROUP BY Model ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
papers about Parsing that used Jeopardy! Questions and were published at ACL 2014? Schema: - paperDataset(...) - dataset(...) - paperKeyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - venue(venueId, venueName) - keyphrase(...)
SELECT DISTINCT T2.paperId FROM paperDataset AS T3 JOIN dataset AS T5 ON T3.datasetId = T5.datasetId JOIN paperKeyphrase AS T4 ON T4.paperId = T3.paperId JOIN paper AS T2 ON T2.paperId = T3.paperId JOIN venue AS T6 ON T6.venueId = T2.venueId JOIN keyphrase AS T1 ON T4.keyphraseId = T1.keyphraseId WHERE T5.datasetName = 'Jeopardy! Questions' AND T1.keyphraseName = 'Parsing' AND T2."year" = 2014 AND T6.venueName = 'ACL';
Which owner owns the most dogs? List the owner id, first name and last name.? Schema: - Dogs(abandoned_yn, age, breed_code, date_arrived, date_departed, name, size_code, weight) - Owners(email_address, first_name, last_name, state)
SELECT T1.owner_id, T2.first_name, T2.last_name FROM Dogs AS T1 JOIN Owners AS T2 ON T1.owner_id = T2.owner_id GROUP BY T1.owner_id, T2.first_name, T2.last_name ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Give the address of the staff member who has the first name Elsa.? Schema: - staff(...) - address(address, district, phone, postal_code)
SELECT T2.address FROM staff AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE T1.first_name = 'Elsa';
Show the ids of all employees who have either destroyed a document or made an authorization to do this.? Schema: - Documents_to_be_Destroyed(Destroyed_by_Employee_ID, Destruction_Authorised_by_Employee_ID)
SELECT DISTINCT Destroyed_by_Employee_ID FROM (SELECT Destroyed_by_Employee_ID FROM Documents_to_be_Destroyed UNION ALL SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_Destroyed);
Which destination has least number of flights? Schema: - flight(Altitude, COUNT, Date, Pilot, Vehicle_Flight_number, Velocity, arrival_date, departure_date, destination, distance, flno, origin, ... (1 more))
SELECT destination FROM flight WHERE destination IS NOT NULL GROUP BY destination ORDER BY COUNT(*) ASC NULLS LAST LIMIT 1;
Which city has the least number of customers whose type code is "Good Credit Rating"? 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 town_city FROM Customers WHERE customer_type_code = 'Good Credit Rating' AND town_city IS NOT NULL GROUP BY town_city ORDER BY COUNT(*) ASC NULLS LAST LIMIT 1;
Which vocal type is the most frequently appearring type? Schema: - Vocals(COUNT, Type)
SELECT Type FROM Vocals WHERE Type IS NOT NULL GROUP BY Type ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
What is the first name of the professor who is teaching CIS-220 and QM-261? Schema: - EMPLOYEE(EMP_DOB, EMP_FNAME, EMP_JOBCODE, EMP_LNAME) - CLASS(CLASS_CODE, CLASS_ROOM, CLASS_SECTION, CRS_CODE, PROF_NUM)
SELECT T1.EMP_FNAME FROM EMPLOYEE AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE T2.CRS_CODE = 'CIS-220' AND EXISTS (SELECT 1 FROM CLASS AS T2_sub WHERE T2_sub.CRS_CODE = 'QM-261' AND T1.EMP_NUM = T2_sub.PROF_NUM);
Which city does the student whose last name is "Kim" live in? Schema: - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT city_code FROM Student WHERE LName = 'Kim';
What are the room numbers and corresponding buildings for classrooms which can seat between 50 to 100 students? Schema: - classroom(building, capacity, room_number)
SELECT building, room_number FROM classroom WHERE capacity BETWEEN 50 AND 100;
return me the papers written by " H. V. Jagadish " and " Divesh Srivastava " with the most number of citations .? Schema: - writes(...) - author(...) - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year)
SELECT T5.title FROM writes AS T3 JOIN author AS T2 ON T3.aid = T2.aid JOIN publication AS T5 ON T3.pid = T5.pid JOIN writes AS T4 ON T4.pid = T5.pid JOIN author AS T1 ON T4.aid = T1.aid WHERE T2.name = 'Divesh Srivastava' AND T1.name = 'H. V. Jagadish' ORDER BY T5.citation_num DESC NULLS LAST LIMIT 1;
List the vote ids, phone numbers and states of all votes.? Schema: - VOTES(created, phone_number, state, vote_id)
SELECT vote_id, phone_number, state FROM VOTES;
What is the total checking balance in all accounts? Schema: - CHECKING(balance)
SELECT SUM(balance) AS total_checking_balance FROM CHECKING;
How many different series and contents are listed in the TV Channel table? Schema: - TV_Channel(Content, Country, Engl, Hight_definition_TV, Language, Package_Option, Pixel_aspect_ratio_PAR, id, series_name)
SELECT COUNT(DISTINCT series_name) AS num_series, COUNT(DISTINCT Content) AS num_contents FROM TV_Channel;
Show names and seatings, ordered by seating for all tracks opened after 2000.? Schema: - track(Location, Name, Seat, Seating, T1, Year_Opened)
SELECT Name, Seating FROM track WHERE Year_Opened > 2000 ORDER BY Seating ASC NULLS LAST;
Find the ids of the problems reported after the date of any problems reported by the staff Rylan Homenick.? 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 date_problem_reported > (SELECT MAX(date_problem_reported) FROM Problems AS T3 JOIN Staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = 'Rylan' AND T4.staff_last_name = 'Homenick');
keyphrases Christof Dallermassl used in papers written last year? Schema: - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - paperKeyphrase(...) - writes(...) - author(...)
SELECT DISTINCT T2.keyphraseId FROM paper AS T3 JOIN paperKeyphrase AS T2 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 = 'Christof Dallermassl' AND T3."year" = 2000;
what rivers are in states that border alabama? Schema: - river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse) - border_info(T1, border, state_name)
SELECT river_name FROM river WHERE traverse IN (SELECT border FROM border_info WHERE state_name = 'alabama');
Find the names of swimmers who has a result of "win".? Schema: - swimmer(Name, Nationality, meter_100, meter_200, meter_300) - record(...)
SELECT T1.Name FROM swimmer AS T1 JOIN record AS T2 ON T1.ID = T2.Swimmer_ID WHERE "Result" = 'Win';
Papers written by Liwen Xiong in 2015? Schema: - writes(...) - author(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT T3.paperId FROM writes AS T2 JOIN author AS T1 ON T2.authorId = T1.authorId JOIN paper AS T3 ON T2.paperId = T3.paperId WHERE T1.authorName = 'Liwen Xiong' AND T3."year" = 2015;
Find the file format that is used by the most files.? Schema: - files(COUNT, duration, f_id, formats)
SELECT formats FROM files WHERE formats IS NOT NULL GROUP BY formats ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
what is the largest state that borders california? Schema: - state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom) - border_info(T1, border, state_name)
SELECT state_name FROM state WHERE area = (SELECT MAX(area) FROM state WHERE state_name IN (SELECT border FROM border_info WHERE state_name = 'california')) AND state_name IN (SELECT border FROM border_info WHERE state_name = 'california');
What was the best paper at TACL 2014 ? Schema: - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - cite(...) - venue(venueId, venueName)
SELECT DISTINCT COUNT(DISTINCT T3.citingPaperId) AS num_citations, T1.paperId 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" = 2014 AND T2.venueName = 'TACL' GROUP BY T1.paperId ORDER BY num_citations DESC NULLS LAST;
What cities do students live in? Schema: - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT DISTINCT city_code FROM Student;
Find the customer who started a policy most recently.? Schema: - Policies(COUNT, Policy_Type_Code) - Customers(BIGINT, COUNT, Customer_Details, Customer_ID, Customer_name, Mar, Rat, TRY_CAST, V, address_line_1, address_line_2, amount_outstanding, ... (25 more))
SELECT T2.Customer_Details FROM Policies AS T1 JOIN Customers AS T2 ON T1.Customer_ID = T2.Customer_ID WHERE T1.Start_Date = (SELECT MAX(Start_Date) FROM Policies);
Show the ids and details of the investors who have at least two transactions with type code "SALE".? Schema: - Investors(Investor_details) - Transactions(COUNT, DOUBLE, TRY_CAST, amount_of_transaction, date_of_transaction, investor_id, share_count, transaction_id, transaction_type_code)
SELECT T2.investor_id, T1.Investor_details FROM Investors AS T1 JOIN Transactions AS T2 ON T1.investor_id = T2.investor_id WHERE T2.transaction_type_code = 'SALE' GROUP BY T2.investor_id, T1.Investor_details HAVING COUNT(*) >= 2;
recent papers by sanjeev arora? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...) - author(...)
SELECT DISTINCT T1.keyphraseName, T3."year" 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 = 'sanjeev arora' ORDER BY T3."year" DESC NULLS LAST;
What is the most frequent status of bookings? Schema: - Bookings(Actual_Delivery_Date, COUNT, Order_Date, Planned_Delivery_Date, Status_Code)
SELECT Status_Code FROM Bookings WHERE Status_Code IS NOT NULL GROUP BY Status_Code ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
What are the chip model and screen mode of the phone with hardware model name "LG-P760"? Schema: - phone(Accreditation_level, Accreditation_type, COUNT, Carrier, Company_name, Hardware_Model_name, Memory_in_G, Name, Spr, chip_model, p1, screen_mode)
SELECT chip_model, screen_mode FROM phone WHERE Hardware_Model_name = 'LG-P760';
What is the total number of degrees granted after 2000 for each Orange county campus? Schema: - Campuses(Campus, County, Franc, Location) - degrees(Campus, Degrees, SUM, Year)
SELECT T1.Campus, SUM(T2.Degrees) AS total_degrees FROM Campuses AS T1 JOIN degrees AS T2 ON T1.Id = T2.Campus WHERE T1.County = 'Orange' AND T2."Year" >= 2000 GROUP BY T1.Campus;
What is the name and age of the pilot younger than 30 who has won the most number of times? Schema: - pilot(Age, COUNT, Join_Year, Name, Nationality, Pilot_name, Position, Rank, Team) - match_(Competition, Date, Match_ID, Venue)
SELECT T1.Name, T1.Age FROM pilot AS T1 JOIN match_ AS T2 ON T1.Pilot_Id = T2.Winning_Pilot WHERE T1.Age < 30 GROUP BY T1.Pilot_Id, T1.Name, T1.Age ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Which engineers have never visited to maintain the assets? List the engineer first name and last name.? Schema: - Maintenance_Engineers(COUNT, T1, engineer_id, first_name, last_name) - Engineer_Visits(...)
SELECT first_name, last_name FROM Maintenance_Engineers WHERE engineer_id NOT IN (SELECT engineer_id FROM Engineer_Visits);
What are the names for tracks without a race in class 'GT'.? Schema: - track(Location, Name, Seat, Seating, T1, Year_Opened) - race(Class, Date, Name)
SELECT T1.Name FROM track AS T1 LEFT JOIN (SELECT T2.Name FROM race AS T1 JOIN track AS T2 ON T1.Track_ID = CAST(T2.Track_ID AS TEXT) WHERE T1.Class = 'GT') AS T2 ON T1.Name = T2.Name WHERE T2.Name IS NULL;
For each party, return its theme and the name of its host.? Schema: - party_host(...) - host(Age, COUNT, Name, Nationality) - party(COUNT, Comptroller, First_year, Governor, Last_year, Left_office, Location, Minister, Number_of_hosts, Party, Party_Theme, Party_name, ... (3 more))
SELECT T3.Party_Theme, T2.Name FROM party_host AS T1 JOIN host AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID;
what city has the least population? 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 MIN(population) FROM city);
Return the full name and id of the actor or actress who starred in the greatest number of 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, T2.actor_id FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.first_name, T2.last_name, T2.actor_id ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
How much is the track Fast As a Shark? Schema: - tracks(composer, milliseconds, name, unit_price)
SELECT unit_price FROM tracks WHERE name = 'Fast As a Shark';
How many distinct courses are enrolled in by students? Schema: - Student_Course_Enrolment(course_id, date_of_completion, date_of_enrolment, student_id)
SELECT COUNT(course_id) AS num_courses FROM Student_Course_Enrolment;
What is the total amount of payment? Schema: - Payments(Amount_Payment, COUNT, Date_Payment_Made, Payment_ID, Payment_Method_Code, V, amount_due, amount_paid, payment_date, payment_type_code)
SELECT SUM(Amount_Payment) AS total_payment FROM Payments;
How many movies did " Quentin Tarantino " direct before 2010 ? Schema: - director(Afghan, name, nationality) - directed_by(...) - movie(Budget_million, Director, Find, Gross_worldwide, T1, Title, Year, budget, release_year, title)
SELECT COUNT(DISTINCT T3.title) AS num_movies FROM director AS T2 JOIN directed_by AS T1 ON T2.did = T1.did JOIN movie AS T3 ON T3.mid = T1.msid WHERE T2.name = 'Quentin Tarantino' AND T3.release_year < 2010;
Which college have both players with position midfielder and players with position defender? Schema: - match_season(COUNT, College, Draft_Class, Draft_Pick_Number, JO, Player, Position, T1, Team)
SELECT DISTINCT T1.College FROM (SELECT College FROM match_season WHERE "Position" = 'Midfielder') AS T1 JOIN (SELECT College FROM match_season WHERE "Position" = 'Defender') AS T2 ON T1.College = T2.College;
How many papers does Ed Desmond have in Semantic Parsing area ? Schema: - paperKeyphrase(...) - keyphrase(...) - writes(...) - author(...)
SELECT DISTINCT COUNT(DISTINCT T3.paperId) AS num_papers FROM paperKeyphrase AS T1 JOIN keyphrase AS T4 ON T1.keyphraseId = T4.keyphraseId JOIN writes AS T3 ON T3.paperId = T1.paperId JOIN author AS T2 ON T3.authorId = T2.authorId WHERE T2.authorName = 'Ed Desmond' AND T4.keyphraseName = 'Semantic Parsing';
How many airlines does Russia has? Schema: - airlines(Abbreviation, Airline, COUNT, Country, active, country, name)
SELECT COUNT(*) AS num_airlines FROM airlines WHERE country = 'Russia';
What are the names of courses without prerequisites? Schema: - course(COUNT, JO, SUM, Stat, T1, course_id, credits, dept_name, title) - prereq(...)
SELECT title FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq);
How many different position for players are listed? Schema: - player(Age, COUNT, Gender, Occupation, Player, Player_name, Po, Points, Position, Residence, Sponsor_name, T1, ... (12 more))
SELECT COUNT(DISTINCT "Position") AS num_positions FROM player;
what is the highest elevation in the united states? Schema: - highlow(M, highest_elevation, highest_point, lowest_elevation, lowest_point, state_name)
SELECT MAX(highest_elevation) AS max_elevation FROM highlow;
what is the capital of the state with the highest point? Schema: - highlow(M, highest_elevation, highest_point, lowest_elevation, lowest_point, state_name) - state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom)
SELECT T1.capital FROM highlow AS T2 JOIN state AS T1 ON T1.state_name = T2.state_name WHERE T2.highest_elevation = (SELECT MAX(highest_elevation) FROM highlow);
Find the package choice and series name of the TV channel that has high definition TV.? Schema: - TV_Channel(Content, Country, Engl, Hight_definition_TV, Language, Package_Option, Pixel_aspect_ratio_PAR, id, series_name)
SELECT Package_Option, series_name FROM TV_Channel WHERE Hight_definition_TV = 'yes';
What are the names of artists who did not have an exhibition in 2004? Schema: - artist(Age, Artist, Country, Famous_Release_date, Famous_Title, Year_Join, artist_name, country, gender) - exhibition(Theme, Ticket_Price, Year)
SELECT Name FROM artist AS T2 WHERE NOT EXISTS (SELECT 1 FROM exhibition AS T1 WHERE T1.Artist_ID = T2.Artist_ID AND T1."Year" = 2004);
Find the name and flag of ships that are not steered by any captain with Midshipman rank.? Schema: - Ship(Built_Year, COUNT, Class, Flag, Name, Type) - captain(COUNT, Class, INT, Name, Rank, TRY_CAST, age, capta, l)
SELECT Name, Flag FROM Ship WHERE Ship_ID NOT IN (SELECT Ship_ID FROM captain WHERE "Rank" = 'Midshipman');
List the name of tracks belongs to genre Rock or genre Jazz.? Schema: - genres(name) - tracks(composer, milliseconds, name, unit_price)
SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = 'Rock' OR T1.name = 'Jazz';
What are the room names and ids of all the rooms that cost more than 160 and can accommodate more than two people.? Schema: - Rooms(K, RoomId, basePrice, bedType, beds, decor, maxOccupancy, roomName)
SELECT roomName, RoomId FROM Rooms WHERE basePrice > 160 AND maxOccupancy > 2;
What is the first name of the author with last name "Ueno"? Schema: - Authors(fname, lname)
SELECT fname FROM Authors WHERE lname = 'Ueno';
What is the id, forname and surname of the driver who had the first position in terms of laptime at least twice? Schema: - drivers(forename, nationality, surname) - lapTimes(...)
SELECT T1.driverId, T1.forename, T1.surname FROM drivers AS T1 JOIN lapTimes AS T2 ON T1.driverId = T2.driverId WHERE "position" = '1' GROUP BY T1.driverId, T1.forename, T1.surname HAVING COUNT(*) >= 2;
chi papers? Schema: - venue(venueId, venueName) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT T1.paperId FROM venue AS T2 JOIN paper AS T1 ON T2.venueId = T1.venueId WHERE T2.venueName = 'chi';
What is the total population and average area of countries in the continent of North America whose area is bigger than 3000 ? Schema: - country(Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, M, Name, Official_native_language, ... (4 more))
SELECT SUM(Population) AS total_population, AVG(SurfaceArea) AS avg_area FROM country WHERE Continent = 'North America' AND SurfaceArea > 3000;
what is the population density of the smallest state? Schema: - state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom)
SELECT density FROM state WHERE area = (SELECT MIN(area) FROM state);
Find the author for each submission and list them in ascending order of submission score.? Schema: - submission(Author, COUNT, College, Scores)
SELECT Author FROM submission ORDER BY Scores ASC NULLS LAST;
how many states in the us does the shortest river run through? Schema: - river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse)
SELECT COUNT(DISTINCT traverse) AS num_states FROM river WHERE LENGTH = (SELECT MIN(DISTINCT LENGTH) FROM river);
Where is the club "Pen and Paper Gaming" located? Schema: - Club(ClubDesc, ClubLocation, ClubName, Enterpr, Gam, Hopk, Tenn)
SELECT ClubLocation FROM Club WHERE ClubName = 'Pen and Paper Gaming';
What is the paper about 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';
Count the number of programs broadcast for each time section of a day.? Schema: - broadcast(Program_ID, Time_of_day)
SELECT COUNT(*) AS num_programs, Time_of_day FROM broadcast GROUP BY Time_of_day;
For grants with both documents described as 'Regular' and documents described as 'Initial Application', list its start date.? Schema: - Grants(grant_amount, organisation_id) - Documents(COUNT, Document_Description, Document_ID, Document_Name, Document_Type_Code, I, K, Project_ID, Robb, Template_ID, access_count, document_id, ... (7 more)) - Document_Types(document_description, document_type_code)
SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Regular' AND T1.grant_start_date IN (SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Initial Application');
What are the total scores of the body builders whose birthday contains the string "January" ? 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 T1.Total FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Birth_Date LIKE '%January%';
Find the number of students that have at least one grade "B".? Schema: - Enrolled_in(Fname, Grade, LName, StuID, T2, T3, gradepoint)
SELECT COUNT(DISTINCT StuID) AS num_students FROM Enrolled_in WHERE Grade = 'B';
Show the names of journalists that have reported more than one event.? Schema: - news_report(...) - event(Date, Event_Attendance, Name, Venue, Year) - journalist(Age, COUNT, Name, Nationality, T1, Years_working)
SELECT T3.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name HAVING COUNT(*) > 1;
Which room has the highest rate? List the room's full name, rate, check in and check out date.? Schema: - Reservations(Adults, CheckIn, FirstName, Kids, LastName) - Rooms(K, RoomId, basePrice, bedType, beds, decor, maxOccupancy, roomName)
SELECT T2.roomName, T1.Rate, T1.CheckIn, T1.CheckOut FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room, T2.roomName, T1.Rate, T1.CheckIn, T1.CheckOut ORDER BY T1.Rate DESC NULLS LAST LIMIT 1;
How many tips has Michelle written in April? 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."month" = 'April' AND T2.name = 'Michelle';
how many cities does texas have? 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';
Which clubs are located at "AKW"? Return the club names.? Schema: - Club(ClubDesc, ClubLocation, ClubName, Enterpr, Gam, Hopk, Tenn)
SELECT ClubName FROM Club WHERE ClubLocation = 'AKW';
Show the location codes and the number of documents in each location.? Schema: - Document_Locations(COUNT, Date_in_Location_From, Date_in_Locaton_To, Location_Code)
SELECT Location_Code, COUNT(*) AS num_documents FROM Document_Locations GROUP BY Location_Code;
Show the nations that have both journalists with more than 10 years of working and journalists with less than 3 years of working.? Schema: - journalist(Age, COUNT, Name, Nationality, T1, Years_working)
SELECT DISTINCT T1.Nationality FROM journalist AS T1 JOIN journalist AS T2 ON T1.Nationality = T2.Nationality WHERE T1.Years_working > 10 AND T2.Years_working < 3;
What are the names of the singers who sang the top 3 most highly rated songs and what countries do they hail from? Schema: - artist(Age, Artist, Country, Famous_Release_date, Famous_Title, Year_Join, artist_name, country, gender) - song(COUNT, M, art, artist_name, engl, f_id, genre_is, languages, rat, rating, releasedate, resolution, ... (1 more))
SELECT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.rating DESC NULLS LAST LIMIT 3;
Find the name of rooms whose price is higher than the average price.? Schema: - Rooms(K, RoomId, basePrice, bedType, beds, decor, maxOccupancy, roomName)
SELECT roomName FROM Rooms WHERE basePrice > (SELECT AVG(basePrice) FROM Rooms);
What are the names of the teachers who are aged either 32 or 33? Schema: - teacher(Age, COUNT, D, Hometown, Name)
SELECT Name FROM teacher WHERE Age = '32' OR Age = '33';
Compute the total salary that the player with first name Len and last name Barker received between 1985 to 1990.? Schema: - salary(salary) - player(Age, COUNT, Gender, Occupation, Player, Player_name, Po, Points, Position, Residence, Sponsor_name, T1, ... (12 more))
SELECT SUM(T1.salary) AS total_salary FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id WHERE T2.name_first = 'Len' AND T2.name_last = 'Barker' AND T1."year" BETWEEN 1985 AND 1990;
what are some syntactic parsing papers that chris dyer did not write ? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...) - author(...)
SELECT DISTINCT T1.authorName, 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 != 'chris dyer' AND T5.keyphraseName = 'syntactic parsing';
Find the name of all the cities and states.? Schema: - Addresses(address_content, city, country, line_1, line_1_number_building, line_2, state_province_county, town_city, zip_postcode)
SELECT DISTINCT town_city FROM (SELECT town_city FROM Addresses UNION ALL SELECT state_province_county FROM Addresses);
Return the address of customer 10.? Schema: - Addresses(address_content, city, country, line_1, line_1_number_building, line_2, state_province_county, town_city, zip_postcode) - Customer_Addresses(address_type_code)
SELECT T1.address_details FROM Addresses AS T1 JOIN Customer_Addresses AS T2 ON T1.address_id = T2.address_id WHERE T2.customer_id = 10;
what is the highest point in delaware in meters? Schema: - highlow(M, highest_elevation, highest_point, lowest_elevation, lowest_point, state_name)
SELECT highest_elevation FROM highlow WHERE state_name = 'delaware';
give me some restaurants good for french food ? Schema: - restaurant(...) - location(...)
SELECT T2.house_number, T1.name FROM restaurant AS T1 JOIN location AS T2 ON T1.id = T2.restaurant_id WHERE T1.food_type = 'french' AND T1.rating > 2.5;
What are the distinct billing countries of the invoices? Schema: - Invoice(BillingCountry)
SELECT DISTINCT BillingCountry FROM Invoice;
What are the average height and weight across males (sex is M)? Schema: - people(Age, Birth_Date, Birth_Place, COUNT, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more))
SELECT AVG(Height) AS avg_height, AVG(Weight) AS avg_weight FROM people WHERE Sex = 'M';
Find the names of states that have some college students playing in goalie and mid positions.? Schema: - College(M, cName, enr, state) - Tryout(COUNT, EX, T1, cName, decision, pPos)
SELECT DISTINCT T1.state FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie' AND T1.cName IN (SELECT T3.cName FROM College AS T3 JOIN Tryout AS T4 ON T3.cName = T4.cName WHERE T4.pPos = 'mid');
How much does each charge type costs? List both charge type and amount.? Schema: - Charges(charge_amount, charge_type)
SELECT charge_type, charge_amount FROM Charges;
Find the names of departments that are located in Houston.? Schema: - department(Budget_in_Billions, COUNT, Creation, Dname, F, Market, Mgr_start_date, budget, building, dept_name, name) - dept_locations(...)
SELECT T1.Dname FROM department AS T1 JOIN dept_locations AS T2 ON T1.Dnumber = T2.Dnumber WHERE T2.Dlocation = 'Houston';