question
stringlengths
43
589
query
stringlengths
19
598
Which professionals live in the state of Indiana or have done treatment on more than 2 treatments? List his or her id, last name and cell phone.? Schema: - Professionals(Wiscons, cell_number, city, email_address, home_phone, role_code, state, street) - Treatments(cost_of_treatment, date_of_treatment, dog_id, professional_id)
SELECT DISTINCT professional_id, last_name, cell_number FROM (SELECT professional_id, last_name, cell_number FROM Professionals WHERE state = 'Indiana' UNION ALL SELECT T1.professional_id, T1.last_name, T1.cell_number FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id, T1.last_name, T1.cell_number HAVING COUNT(*) > 2);
what is the largest city in states that border california? Schema: - city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) - border_info(T1, border, state_name)
SELECT city_name FROM city WHERE population = (SELECT MAX(population) FROM city 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');
Find the starting date and ending data in location for the document named "Robin CV".? Schema: - Document_Locations(COUNT, Date_in_Location_From, Date_in_Locaton_To, Location_Code) - All_Documents(Date_Stored, Document_Name, Document_Type_Code)
SELECT T1.Date_in_Location_From, T1.Date_in_Locaton_To FROM Document_Locations AS T1 JOIN All_Documents AS T2 ON T1.Document_ID = T2.Document_ID WHERE T2.Document_Name = 'Robin CV';
Show names for all employees with salary more than the average.? Schema: - employee(Address, Age, Bdate, City, Fname, Lname, Name, Salary, Sex, eid, name, salary)
SELECT name FROM employee WHERE salary > (SELECT AVG(salary) FROM employee);
What are the papers from pldi 2015 ? Schema: - venue(venueId, venueName) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT T1.paperId FROM venue AS T2 JOIN paper AS T1 ON T2.venueId = T1.venueId WHERE T1."year" = 2015 AND T2.venueName = 'pldi';
What is the average fastest lap speed for the Monaco Grand Prix in 2008? Schema: - races(date, name) - results(...)
SELECT AVG(TRY_CAST(T2.fastestLapSpeed AS DOUBLE)) AS avg_speed FROM races AS T1 JOIN results AS T2 ON T1.raceId = T2.raceId WHERE T1."year" = 2008 AND T1.name = 'Monaco Grand Prix';
return me the authors who have more than 10 papers in PVLDB .? Schema: - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year) - journal(Theme, homepage, name) - writes(...) - author(...)
SELECT T1.name 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 T2.name = 'PVLDB' GROUP BY T1.name HAVING COUNT(DISTINCT T4.title) > 10;
Show all product names and the total quantity ordered for each product name.?
SELECT T2.product_name, SUM(TRY_CAST(T1.product_quantity AS DECIMAL(19,2))) AS total_quantity FROM "Order_items" AS T1 JOIN "Products" AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name;
which city in wyoming has the largest 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 MAX(population) FROM city WHERE state_name = 'wyoming') AND state_name = 'wyoming';
What is the id and market share of the browser Safari? Schema: - browser(id, market_share, name)
SELECT id, market_share FROM browser WHERE name = 'Safari';
Find the id and rank of the team that has the highest average attendance rate in 2014.? Schema: - home_game(attendance, year) - team(Name)
SELECT T2.team_id, T2."rank" FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id WHERE T1."year" = 2014 GROUP BY T2.team_id, T2."rank" ORDER BY AVG(T1.attendance) DESC NULLS LAST LIMIT 1;
What is the count of enzymes without any interactions? Schema: - enzyme(Chromosome, Location, OMIM, Porphyria, Product, name) - medicine_enzyme_interaction(interaction_type)
SELECT COUNT(*) AS num_enzymes FROM enzyme WHERE id NOT IN (SELECT enzyme_id FROM medicine_enzyme_interaction);
Return the amount of the largest payment.? Schema: - payment(amount, payment_date)
SELECT amount FROM payment ORDER BY amount DESC NULLS LAST LIMIT 1;
What is the birthday of the staff member with first name as Janessa and last name as Sawayn? 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 date_of_birth FROM Staff WHERE first_name = 'Janessa' AND last_name = 'Sawayn';
What is the average expected life expectancy for countries in the region of Central Africa? Schema: - country(Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, M, Name, Official_native_language, ... (4 more))
SELECT AVG(LifeExpectancy) AS avg_life_expectancy FROM country WHERE Region = 'Central Africa';
How many faculty members did the university that conferred the most degrees in 2002 have? Schema: - Campuses(Campus, County, Franc, Location) - faculty(Faculty) - degrees(Campus, Degrees, SUM, Year)
SELECT T2.Faculty FROM Campuses AS T1 JOIN faculty AS T2 ON T1.Id = T2.Campus JOIN degrees AS T3 ON T1.Id = T3.Campus AND T2."Year" = T3."Year" WHERE T2."Year" = 2002 ORDER BY T3.Degrees DESC NULLS LAST LIMIT 1;
acl papers in 2012 about Parsing? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - venue(venueId, venueName)
SELECT DISTINCT T3.paperId FROM paperKeyphrase AS T2 JOIN keyphrase AS T1 ON T2.keyphraseId = T1.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId JOIN venue AS T4 ON T4.venueId = T3.venueId WHERE T1.keyphraseName = 'Parsing' AND T3."year" = 2012 AND T4.venueName = 'acl';
Show names for all aircrafts with distances more than the average.? Schema: - aircraft(Description, aid, d, distance, name)
SELECT name FROM aircraft WHERE distance > (SELECT AVG(distance) FROM aircraft);
What are the personal names used both by some course authors and some students? Schema: - Course_Authors_and_Tutors(address_line_1, family_name, login_name, personal_name) - 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 DISTINCT Course_Authors_and_Tutors.personal_name FROM Course_Authors_and_Tutors JOIN Students ON Course_Authors_and_Tutors.personal_name = Students.personal_name;
papers where sharon goldwater is an author? 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 apartment type codes and apartment numbers in the buildings managed by "Kyle".? 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 T2.apt_type_code, T2.apt_number FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_manager = 'Kyle';
List the emails of the professionals who live in the state of Hawaii or the state of Wisconsin.? Schema: - Professionals(Wiscons, cell_number, city, email_address, home_phone, role_code, state, street)
SELECT email_address FROM Professionals WHERE state = 'Hawaii' OR state = 'Wisconsin';
Find the names of all distinct wines that have appellations in North Coast area.? Schema: - appellations(Area, County) - wine(Appelation, Cases, Grape, M, Name, Price, Score, Winery, Year, Z, w)
SELECT DISTINCT T2.Name FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = 'North Coast';
What are the store names of drama workshop groups? Schema: - Drama_Workshop_Groups(COUNT, Currency_Code, Marketing_Region_Code, Store_Name)
SELECT Store_Name FROM Drama_Workshop_Groups;
Which states have more than 2 parks? Schema: - park(city, state)
SELECT state FROM park WHERE state IS NOT NULL GROUP BY state HAVING COUNT(*) > 2;
Show the number of customers for each gender.? 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 gender, COUNT(*) AS num_customers FROM Customers GROUP BY gender;
List venues of all matches in the order of their dates starting from the most recent one.? Schema: - match_(Competition, Date, Match_ID, Venue)
SELECT Venue FROM match_ ORDER BY "Date" DESC NULLS LAST;
What are the last names of students studying major 50? Schema: - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT LName FROM Student WHERE Major = 50;
What are the names of modern rooms that have a base price lower than $160 and two beds.? Schema: - Rooms(K, RoomId, basePrice, bedType, beds, decor, maxOccupancy, roomName)
SELECT roomName FROM Rooms WHERE basePrice < 160 AND beds = 2 AND decor = 'modern';
What are the first and last name for those employees who works either in department 70 or 90? Schema: - employees(COMMISSION_PCT, DEPARTMENT_ID, EMAIL, EMPLOYEE_ID, FIRST_NAME, HIRE_DATE, JOB_ID, LAST_NAME, M, MANAGER_ID, PHONE_NUMBER, SALARY, ... (12 more))
SELECT FIRST_NAME, LAST_NAME FROM employees WHERE DEPARTMENT_ID = 70 OR DEPARTMENT_ID = 90;
Count the number of regions.? Schema: - region(Label, Region_code, Region_name)
SELECT COUNT(*) AS num_regions FROM region;
List document IDs, document names, and document descriptions for all documents.? Schema: - Documents(COUNT, Document_Description, Document_ID, Document_Name, Document_Type_Code, I, K, Project_ID, Robb, Template_ID, access_count, document_id, ... (7 more))
SELECT Document_ID, Document_Name, Document_Description FROM Documents;
What are the classes of races that have two or more corresponding races? Schema: - race(Class, Date, Name)
SELECT Class FROM race WHERE Class IS NOT NULL GROUP BY Class HAVING COUNT(*) >= 2;
List the ids of the problems from the product "voluptatem" that are reported after 1995? Schema: - Problems(date_problem_reported, problem_id) - Product(product_id, product_name)
SELECT T1.problem_id FROM Problems AS T1 JOIN Product AS T2 ON T1.product_id = T2.product_id WHERE T2.product_name = 'voluptatem' AND T1.date_problem_reported > '1995';
What is minimum and maximum share of TV series? Schema: - TV_series(Air_Date, Episode, Rating, Share, Weekly_Rank)
SELECT MAX(Share) AS max_share, MIN(Share) AS min_share FROM TV_series;
What are the names of the songs that have a lower rating than at least one blues song? Schema: - song(COUNT, M, art, artist_name, engl, f_id, genre_is, languages, rat, rating, releasedate, resolution, ... (1 more))
SELECT song_name FROM song WHERE rating < (SELECT MAX(rating) FROM song WHERE genre_is = 'blues');
How many invoices were billed from Chicago, IL? Schema: - invoices(billing_city, billing_country, billing_state, total)
SELECT COUNT(*) AS num_invoices FROM invoices WHERE billing_city = 'Chicago' AND billing_state = 'IL';
How many lesson does customer with first name Ray took? Schema: - Lessons(lesson_status_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 COUNT(*) AS num_lessons FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'Ray';
Show white percentages of cities and the crime rates of counties they are in.? Schema: - city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) - county_public_safety(COUNT, Case_burden, Crime_rate, Location, Name, Police_force, Police_officers, Population, T1)
SELECT T1.White, T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID;
Find the names of all the product characteristics.? Schema: - Characteristics(characteristic_name)
SELECT DISTINCT characteristic_name FROM Characteristics;
Select the names of manufacturer whose products have an average price higher than or equal to $150.? Schema: - Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more)) - Manufacturers(Aust, Beij, Founder, Headquarter, I, M, Name, Revenue)
SELECT AVG(T1.Price) AS avg_price, T2.Name FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name HAVING AVG(T1.Price) >= 150;
Count the number of companies.? Schema: - Companies(Assets_billion, Bank, COUNT, Ch, Headquarters, Industry, Market_Value_billion, Profits_billion, Sales_billion, T1, name)
SELECT COUNT(*) AS num_companies FROM Companies;
What are the average, minimum, and maximum ticket prices for exhibitions that happened prior to 2009? Schema: - exhibition(Theme, Ticket_Price, Year)
SELECT AVG(Ticket_Price) AS avg_ticket_price, MIN(Ticket_Price) AS min_ticket_price, MAX(Ticket_Price) AS max_ticket_price FROM exhibition WHERE "Year" < 2009;
Show ids for all employees with at least 100000 salary.? Schema: - employee(Address, Age, Bdate, City, Fname, Lname, Name, Salary, Sex, eid, name, salary)
SELECT eid FROM employee WHERE salary > 100000;
what is the smallest city of the smallest state in the us? Schema: - city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) - state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom)
SELECT city_name FROM city WHERE population = (SELECT MIN(population) FROM city WHERE state_name IN (SELECT state_name FROM state WHERE area = (SELECT MIN(area) FROM state))) AND state_name IN (SELECT state_name FROM state WHERE area = (SELECT MIN(area) FROM state));
What is the number of cars with a horsepower greater than 150? Schema: - cars_data(Accelerate, Cylinders, Horsepower, MPG, T1, Weight, Year)
SELECT COUNT(*) AS num_cars FROM cars_data WHERE Horsepower > 150;
What are the details for all projects that did not hire any staff in a research role? Schema: - Projects(COUNT, Hours, Name, Project_Details, Project_ID, organ, organisation_id, project_details) - Project_Staff(COUNT, date_from, date_to, role_code)
SELECT project_details FROM Projects WHERE project_id NOT IN (SELECT project_id FROM Project_Staff WHERE role_code = 'researcher');
For each citizenship, what is the maximum net worth? Schema: - singer(Age, Birth_Year, COUNT, Citizenship, Country, Name, Net_Worth_Millions, Song_Name, Song_release_year, T1, s)
SELECT Citizenship, MAX(Net_Worth_Millions) AS max_net_worth_millions FROM singer GROUP BY Citizenship;
What is the zip code in which the average mean sea level pressure is the lowest? 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 zip_code FROM weather WHERE zip_code IS NOT NULL GROUP BY zip_code ORDER BY AVG(mean_sea_level_pressure_inches) ASC NULLS LAST LIMIT 1;
Return the name and country corresponding to the artist who has had the most exhibitions.? Schema: - exhibition(Theme, Ticket_Price, Year) - artist(Age, Artist, Country, Famous_Release_date, Famous_Title, Year_Join, artist_name, country, gender)
SELECT T2.Name, T2.Country FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID, T2.Name, T2.Country ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
What is the gender of the teacher with last name "Medhurst"? Schema: - Teachers(email_address, first_name, gender, last_name)
SELECT gender FROM Teachers WHERE last_name = 'Medhurst';
where can i eat french food in mountain view ? 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 = 'mountain view' AND T1.food_type = 'french';
Which origin has most number of flights? Schema: - flight(Altitude, COUNT, Date, Pilot, Vehicle_Flight_number, Velocity, arrival_date, departure_date, destination, distance, flno, origin, ... (1 more))
SELECT origin FROM flight WHERE origin IS NOT NULL GROUP BY origin ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
What are the package options and the name of the series for the TV Channel that supports 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';
Give the name of each department and the number of employees in each.? 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)) - departments(DEPARTMENT_NAME, Market)
SELECT T2.DEPARTMENT_NAME, COUNT(*) AS num_employees FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID GROUP BY T2.DEPARTMENT_NAME;
Show the statuses of roller coasters longer than 3300 or higher than 100.? Schema: - roller_coaster(DOUBLE, Height, LENGTH, Park, Speed, Status, TRY_CAST)
SELECT Status FROM roller_coaster WHERE LENGTH > 3300 OR Height > 100;
What are the name and description for role code "MG"? Schema: - Roles(Role_Code, Role_Description, Role_Name, role_code, role_description)
SELECT Role_Name, Role_Description FROM Roles WHERE Role_Code = 'MG';
What are the languages that are used most often in songs? Schema: - song(COUNT, M, art, artist_name, engl, f_id, genre_is, languages, rat, rating, releasedate, resolution, ... (1 more))
SELECT languages FROM song WHERE languages IS NOT NULL GROUP BY languages ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
What is department name and office for the professor whose last name is Heffington? Schema: - 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 T3.DEPT_NAME, T2.PROF_OFFICE FROM EMPLOYEE AS T1 JOIN PROFESSOR AS T2 ON T1.EMP_NUM = T2.EMP_NUM JOIN DEPARTMENT AS T3 ON T2.DEPT_CODE = T3.DEPT_CODE WHERE T1.EMP_LNAME = 'Heffington';
What is the number of colleges with a student population greater than 15000? Schema: - College(M, cName, enr, state)
SELECT COUNT(*) AS num_colleges FROM College WHERE enr > 15000;
Find the Char cells, Pixels and Hardware colours for the screen of the phone whose hardware model name is "LG-P760".? Schema: - screen_mode(used_kb) - phone(Accreditation_level, Accreditation_type, COUNT, Carrier, Company_name, Hardware_Model_name, Memory_in_G, Name, Spr, chip_model, p1, screen_mode)
SELECT T1.Char_cells, T1.Pixels, T1.Hardware_colours FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T2.Hardware_Model_name = 'LG-P760';
Find the average number of staff working for the museums that were open before 2009.? Schema: - museum(Name, Open_Year)
SELECT AVG(Num_of_Staff) AS avg_num_of_staff FROM museum WHERE Open_Year < '2009';
Return the flag that is most common among all ships.? Schema: - Ship(Built_Year, COUNT, Class, Flag, Name, Type)
SELECT Flag FROM Ship WHERE Flag IS NOT NULL GROUP BY Flag ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Show the station name with at least two trains.? Schema: - train_station(...) - station(Annual_entry_exit, Annual_interchanges, COUNT, Location, MAX, Main_Services, Mounta, Name, Number_of_Platforms, city, id, lat, ... (4 more))
SELECT T2.Name FROM train_station AS T1 JOIN station AS T2 ON T1.Station_ID = T2.Station_ID GROUP BY T1.Station_ID, T2.Name HAVING COUNT(*) >= 2;
show me a good arabic restaurant in mountain view ? 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 = 'mountain view' AND T1.food_type = 'arabic' AND T1.rating > 2.5;
List the record company shared by the most number of orchestras.? Schema: - orchestra(COUNT, Major_Record_Format, Record_Company, Year_of_Founded)
SELECT Record_Company FROM orchestra WHERE Record_Company IS NOT NULL GROUP BY Record_Company ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
What are the first name and last name of Linda Smith's advisor? 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 WHERE T2.Fname = 'Linda' AND T2.Lname = 'Smith';
how many states have cities named springfield? Schema: - city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more))
SELECT COUNT(state_name) AS num_states FROM city WHERE city_name = 'springfield';
Find all invoice dates corresponding to customers with first name Astrid and last name Gruber.? Schema: - Customer(Email, FirstName, LastName, State, lu) - Invoice(BillingCountry)
SELECT T2.InvoiceDate FROM Customer AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.FirstName = 'Astrid' AND LastName = 'Gruber';
What are the unique block codes that have available rooms? Schema: - Room(BlockCode, RoomType, Unavailable)
SELECT DISTINCT BlockCode FROM Room WHERE Unavailable = 0;
return me the papers by " H. V. Jagadish " on VLDB conference .? Schema: - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year) - conference(homepage, name) - writes(...) - author(...)
SELECT T4.title 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' AND T2.name = 'VLDB';
What are the details of the student who registered for the most number of courses? Schema: - Students(cell_mobile_number, current_address_id, date_first_registered, date_left, date_of_latest_logon, email_address, family_name, first_name, last_name, login_name, middle_name, other_student_details, ... (1 more)) - Student_Course_Registrations(COUNT, student_id)
SELECT T1.student_details FROM Students AS T1 JOIN Student_Course_Registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id, T1.student_details ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
which rivers are in illinois? Schema: - river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse)
SELECT river_name FROM river WHERE traverse = 'illinois';
Show names of technicians and series of machines they are assigned to repair.? Schema: - repair_assignment(...) - machine(...) - technician(Age, COUNT, JO, Start, Starting_Year, T1, Team, name)
SELECT T3.name, T2.Machine_series FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id;
What papers has brian curless written on convolution ? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...) - author(...)
SELECT DISTINCT T1.authorId, T3.paperId FROM paperKeyphrase AS T2 JOIN keyphrase AS T5 ON T2.keyphraseId = T5.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId JOIN writes AS T4 ON T4.paperId = T3.paperId JOIN author AS T1 ON T4.authorId = T1.authorId WHERE T1.authorName = 'brian curless' AND T5.keyphraseName = 'convolution';
For each classroom report the grade that is taught in it. Report just the classroom number and the grade number.? Schema: - list(COUNT, Classroom, FirstName, Grade, LastName)
SELECT DISTINCT Classroom, Grade FROM list;
List the dog name, age and weight of the dogs who have been abandoned? 1 stands for yes, and 0 stands for no.? Schema: - Dogs(abandoned_yn, age, breed_code, date_arrived, date_departed, name, size_code, weight)
SELECT name, age, weight FROM Dogs WHERE abandoned_yn = '1';
When did the episode "A Love of a Lifetime" air? Schema: - TV_series(Air_Date, Episode, Rating, Share, Weekly_Rank)
SELECT Air_Date FROM TV_series WHERE Episode = 'A Love of a Lifetime';
Return the template type description of the template type with the code AD.? Schema: - Ref_Template_Types(Template_Type_Code, Template_Type_Description)
SELECT Template_Type_Description FROM Ref_Template_Types WHERE Template_Type_Code = 'AD';
large-scale datasets used in semantic parsing? Schema: - paperDataset(...) - dataset(...) - paperKeyphrase(...) - keyphrase(...)
SELECT DISTINCT T2.datasetId FROM paperDataset AS T3 JOIN dataset AS T2 ON T3.datasetId = T2.datasetId JOIN paperKeyphrase AS T1 ON T1.paperId = T3.paperId JOIN keyphrase AS T4 ON T1.keyphraseId = T4.keyphraseId WHERE T4.keyphraseName = 'semantic parsing';
What are the locations that have both tracks with more than 90000 seats, and tracks with fewer than 70000 seats? Schema: - track(Location, Name, Seat, Seating, T1, Year_Opened)
SELECT DISTINCT T1.Location FROM (SELECT Location FROM track WHERE Seating > 90000) T1, (SELECT Location FROM track WHERE Seating < 70000) AS T2 WHERE T1.Location = T2.Location;
What are the dates of birth of entrepreneurs with investor "Simon Woodroffe" or "Peter Jones"? 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.Date_of_Birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = 'Simon Woodroffe' OR T1.Investor = 'Peter Jones';
Show the headquarters that have both companies in banking industry and companies in oil and gas industry.? Schema: - company(Bank, COUNT, Company, Headquarters, Industry, JO, Main_Industry, Market_Value, Name, Profits_in_Billion, Rank, Retail, ... (4 more))
SELECT DISTINCT T1.Headquarters FROM (SELECT Headquarters FROM company WHERE Industry = 'Banking') AS T1 JOIN (SELECT Headquarters FROM company WHERE Industry = 'Oil and gas') AS T2 ON T1.Headquarters = T2.Headquarters;
Which patients made more than one appointment? Tell me the name and phone number of these patients.? Schema: - Appointment(AppointmentID, Start) - Patient(...)
SELECT Name, Phone FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY T1.Patient, Name, Phone HAVING COUNT(*) > 1;
which rivers run through states bordering 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');
could you tell me what is the highest point in the state of texas? Schema: - highlow(M, highest_elevation, highest_point, lowest_elevation, lowest_point, state_name)
SELECT highest_point FROM highlow WHERE state_name = 'texas';
What is the average horsepower of the cars before 1980? Schema: - cars_data(Accelerate, Cylinders, Horsepower, MPG, T1, Weight, Year)
SELECT AVG(Horsepower) AS avg_horsepower FROM cars_data WHERE "Year" < 1980;
List the name and date the battle that has lost the ship named 'Lettice' and the ship named 'HMS Atalanta'? Schema: - battle(Baldw, bulgarian_commander, date, latin_commander, name, result) - ship(COUNT, DIST, JO, K, Name, Nationality, T1, Tonnage, Type, disposition_of_ship, name, tonnage)
SELECT T1.name, T1."date" FROM battle AS T1 JOIN ship AS T2 ON T1.id = T2.lost_in_battle WHERE T2.name = 'Lettice' AND T1.name IN (SELECT T3.name FROM battle AS T3 JOIN ship AS T4 ON T3.id = T4.lost_in_battle WHERE T4.name = 'HMS Atalanta');
In 2014, what are the id and rank of the team that has the largest average number of attendance? Schema: - home_game(attendance, year) - team(Name)
SELECT T2.team_id, T2."rank" FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id WHERE T1."year" = 2014 GROUP BY T2.team_id, T2."rank" ORDER BY AVG(T1.attendance) DESC NULLS LAST LIMIT 1;
return me the total citations of the papers in " 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)
SELECT SUM(T4.citation_num) AS total_citations FROM organization AS T2 JOIN author AS T1 ON T2.oid = T1.oid JOIN writes AS T3 ON T3.aid = T1.aid JOIN publication AS T4 ON T3.pid = T4.pid WHERE T2.name = 'University of Michigan';
how many square kilometers in the us? Schema: - state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom)
SELECT SUM(area) AS total_area_km2 FROM state;
Which cities have lower temperature in March than in Dec and have never served as host cities? Schema: - city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) - temperature(...) - hosting_city(Host_City, Year)
SELECT T1.City FROM city AS T1 JOIN temperature AS T2 ON T1.City_ID = T2.City_ID WHERE T2.Mar < T2."Dec" AND T1.City NOT IN (SELECT T3.City FROM city AS T3 JOIN hosting_city AS T4 ON T3.City_ID = T4.Host_City);
What are the names of all aircrafts that John Williams have certificates to be able to fly? Schema: - employee(Address, Age, Bdate, City, Fname, Lname, Name, Salary, Sex, eid, name, salary) - certificate(eid) - aircraft(Description, aid, d, distance, name)
SELECT T3.name FROM employee AS T1 JOIN certificate AS T2 ON T1.eid = T2.eid JOIN aircraft AS T3 ON T3.aid = T2.aid WHERE T1.name = 'John Williams';
What are the numbers of all flights that can cover a distance of more than 2000? Schema: - flight(Altitude, COUNT, Date, Pilot, Vehicle_Flight_number, Velocity, arrival_date, departure_date, destination, distance, flno, origin, ... (1 more))
SELECT flno FROM flight WHERE distance > 2000;
How many sections does each course has? Schema: - CLASS(CLASS_CODE, CLASS_ROOM, CLASS_SECTION, CRS_CODE, PROF_NUM)
SELECT COUNT(*) AS num_sections, CRS_CODE FROM CLASS GROUP BY CRS_CODE;
How many farms are there? Schema: - farm(Cows, Working_Horses)
SELECT COUNT(*) AS num_farms FROM farm;
Show the names of the drivers without a school bus.? Schema: - driver(Age, Home_city, Name, Party) - school_bus(Years_Working)
SELECT Name FROM driver WHERE Driver_ID NOT IN (SELECT Driver_ID FROM school_bus);
What is the role with the smallest number of employees? Find the role codes.? Schema: - Employees(COUNT, Date_of_Birth, Employee_ID, Employee_Name, Role_Code, employee_id, employee_name, role_code)
SELECT Role_Code FROM Employees WHERE Role_Code IS NOT NULL GROUP BY Role_Code ORDER BY COUNT(*) ASC NULLS LAST LIMIT 1;
Show the themes of parties and the names of the party hosts.? 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 is the lowest and highest rating star? Schema: - Rating(Rat, mID, rID, stars)
SELECT MIN(stars) AS min_stars, MAX(stars) AS max_stars FROM Rating;