question
stringlengths
43
589
query
stringlengths
19
598
Return the grade for the high schooler named Kyle.? Schema: - Highschooler(COUNT, ID, grade, name)
SELECT grade FROM Highschooler WHERE name = 'Kyle';
Report the first name and last name of all the students.? Schema: - list(COUNT, Classroom, FirstName, Grade, LastName)
SELECT DISTINCT FirstName, LastName FROM list;
List the ids, names and market shares of all browsers.? Schema: - browser(id, market_share, name)
SELECT id, name, market_share FROM browser;
How many total tours were there for each ranking date? Schema: - rankings(ranking_date, tours)
SELECT SUM(tours) AS num_tours, ranking_date FROM rankings GROUP BY ranking_date;
How many cities are in Australia? Schema: - city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) - country(Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, M, Name, Official_native_language, ... (4 more))
SELECT COUNT(*) AS num_cities FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id WHERE T2.country = 'Australia';
What are the ids of templates with template type code PP or PPT? Schema: - Templates(COUNT, M, Template_ID, Template_Type_Code, Version_Number)
SELECT Template_ID FROM Templates WHERE Template_Type_Code = 'PP' OR Template_Type_Code = 'PPT';
TAIL papers used in NIPS? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - venue(venueId, venueName)
SELECT DISTINCT T3.paperId FROM paperKeyphrase AS T2 JOIN keyphrase AS T1 ON T2.keyphraseId = T1.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId JOIN venue AS T4 ON T4.venueId = T3.venueId WHERE T1.keyphraseName = 'TAIL' AND T4.venueName = 'NIPS';
which neighbourhood has the most number of businesses in Madison? Schema: - neighbourhood(...) - business(business_id, city, full_address, name, rating, review_count, state)
SELECT T1.neighbourhood_name FROM neighbourhood AS T1 JOIN business AS T2 ON T1.business_id = T2.business_id WHERE T2.city = 'Madison' GROUP BY T1.neighbourhood_name ORDER BY COUNT(DISTINCT T2.name) DESC NULLS LAST LIMIT 1;
Find the the grape whose white color grapes are used to produce wines with scores higher than 90.? Schema: - grapes(...) - wine(Appelation, Cases, Grape, M, Name, Price, Score, Winery, Year, Z, w)
SELECT DISTINCT T1.Grape FROM grapes AS T1 JOIN wine AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'White' AND T2.Score > 90;
Tell me the total quantity of products bought by the customer called "Rodrick Heaney".? Schema: - Customers(BIGINT, COUNT, Customer_Details, Customer_ID, Customer_name, Mar, Rat, TRY_CAST, V, address_line_1, address_line_2, amount_outstanding, ... (25 more)) - Customer_Orders(customer_id, order_date, order_id, order_shipping_charges) - Order_Items(COUNT, DOUBLE, INT, TRY_CAST, order_id, order_item_id, order_quantity, product_id, product_quantity)
SELECT SUM(TRY_CAST(T3.order_quantity AS DOUBLE)) AS total_quantity FROM Customers AS T1 JOIN Customer_Orders AS T2 ON T1.customer_id = T2.customer_id JOIN Order_Items AS T3 ON T2.order_id = T3.order_id WHERE T1.customer_name = 'Rodrick Heaney';
What are all the document type codes and document type names? Schema: - Ref_Document_Types(Document_Type_Code, Document_Type_Description, Document_Type_Name, document_type_code, document_type_description)
SELECT Document_Type_Code, Document_Type_Name FROM Ref_Document_Types;
Find the ids of the departments where any manager is managing 4 or more employees.? 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 DISTINCT DEPARTMENT_ID FROM employees WHERE DEPARTMENT_ID IS NOT NULL AND MANAGER_ID IS NOT NULL GROUP BY DEPARTMENT_ID, MANAGER_ID HAVING COUNT(EMPLOYEE_ID) >= 4;
Return the lot details of lots that belong to investors with details "l"? Schema: - Investors(Investor_details) - Lots(investor_id, lot_details)
SELECT T2.lot_details FROM Investors AS T1 JOIN Lots AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = 'l';
How many female actors were born in " New York City " after 1980 ? Schema: - actor(Afghan, Aust, COUNT, Character, Chr, Duration, Kev, Name, age, birth_city, birth_year, first_name, ... (4 more))
SELECT COUNT(DISTINCT name) AS num_actors FROM actor WHERE birth_city = 'New York City' AND birth_year > 1980 AND gender = 'female';
What is the sum of total pounds of purchase in year 2018 for all branches in London? Schema: - purchase(...) - branch(Address_road, City, Name, Open_year, membership_amount)
SELECT SUM(Total_pounds) AS total_pounds FROM purchase AS T1 JOIN branch AS T2 ON T1.Branch_ID = T2.Branch_ID WHERE T2.City = 'London' AND T1."Year" = 2018;
Find distinct cities of address of students? Schema: - Addresses(address_content, city, country, line_1, line_1_number_building, line_2, state_province_county, town_city, zip_postcode) - People_Addresses(...) - 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 T1.city FROM Addresses AS T1 JOIN People_Addresses AS T2 ON T1.address_id = T2.address_id JOIN Students AS T3 ON T2.person_id = T3.student_id;
What is each customer's move in date, and the corresponding customer id and details? Schema: - Customers(BIGINT, COUNT, Customer_Details, Customer_ID, Customer_name, Mar, Rat, TRY_CAST, V, address_line_1, address_line_2, amount_outstanding, ... (25 more)) - Customer_Events(Customer_Event_ID, date_moved_in, property_id)
SELECT T2.date_moved_in, T1.customer_id, T1.customer_details FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id;
Find the name of customers who do not have a loan with a type of Mortgages.? Schema: - customer(COUNT, T1, acc_bal, acc_type, active, check, credit_score, cust_name, no_of_loans, sav, state, store_id) - loan(...)
SELECT DISTINCT cust_name FROM customer WHERE cust_name NOT IN (SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID WHERE T2.loan_type = 'Mortgages');
Which industry has the most companies? Schema: - Companies(Assets_billion, Bank, COUNT, Ch, Headquarters, Industry, Market_Value_billion, Profits_billion, Sales_billion, T1, name)
SELECT Industry FROM Companies WHERE Industry IS NOT NULL GROUP BY Industry ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
What are the names of companies with revenue between 100 and 150? Schema: - Manufacturers(Aust, Beij, Founder, Headquarter, I, M, Name, Revenue)
SELECT Name FROM Manufacturers WHERE Revenue BETWEEN 100 AND 150;
What is the id and name of the department store that has both marketing and managing department? Schema: - Departments(...) - Department_Stores(COUNT, dept_store_chain_id)
SELECT DISTINCT T2.dept_store_id, T2.store_name FROM Departments AS T1 JOIN Department_Stores AS T2 ON T1.dept_store_id = T2.dept_store_id WHERE T1.department_name IN ('marketing', 'managing');
Find the first name and last name of the instructor of course that has course name? Schema: - Course(CName, Credits, Days) - Faculty(Building, COUNT, FacID, Fname, LName, Lname, Phone, Pr, Rank, Room, Sex)
SELECT T2.Fname, T2.LName FROM Course AS T1 JOIN Faculty AS T2 ON T1.Instructor = T2.FacID WHERE T1.CName = 'COMPUTER LITERACY';
List each donator name and the amount of endowment in descending order of the amount of endowment.? Schema: - endowment(School_id, amount, donator_name)
SELECT donator_name, SUM(amount) AS total_endowment FROM endowment WHERE donator_name IS NOT NULL GROUP BY donator_name ORDER BY total_endowment DESC NULLS LAST;
Show minimum and maximum amount of memberships for all branches opened in 2011 or located at city London.? Schema: - branch(Address_road, City, Name, Open_year, membership_amount)
SELECT MIN(membership_amount) AS min_membership_amount, MAX(membership_amount) AS max_membership_amount FROM branch WHERE Open_year = 2011 OR City = 'London';
What are the titles of all movies that have not been rated? Schema: - Movie(T1, director, title, year) - Rating(Rat, mID, rID, stars)
SELECT title FROM Movie WHERE mID NOT IN (SELECT mID FROM Rating);
What is the name of the semester with no students enrolled? Schema: - Semesters(...) - Student_Enrolment(...)
SELECT semester_name FROM Semesters WHERE semester_id NOT IN(SELECT semester_id FROM Student_Enrolment);
What is the name of the winner with the most rank points who participated in the Australian Open tournament? 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 FROM matches_ WHERE tourney_name = 'Australian Open' ORDER BY winner_rank_points DESC NULLS LAST LIMIT 1;
display the employee id and salary of all employees who report to Payam (first name).? 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 EMPLOYEE_ID, SALARY FROM employees WHERE MANAGER_ID = (SELECT EMPLOYEE_ID FROM employees WHERE FIRST_NAME = 'Payam');
what is the area of new mexico in square kilometers? Schema: - state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom)
SELECT area FROM state WHERE state_name = 'new mexico';
Show the host names for parties with number of hosts greater than 20.? 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 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 WHERE T3.Number_of_hosts > 20;
Show all the information about election.? Schema: - election(Committee, Date, Delegate, District, Vote_Percent, Votes)
SELECT * FROM election;
Find the names of the artists who have produced English songs but have never received rating higher than 8.? Schema: - song(COUNT, M, art, artist_name, engl, f_id, genre_is, languages, rat, rating, releasedate, resolution, ... (1 more))
SELECT DISTINCT artist_name FROM song WHERE languages = 'english' AND artist_name NOT IN (SELECT artist_name FROM song WHERE rating > 8);
topics used by Luke Zettlemoyer? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...) - author(...)
SELECT DISTINCT T1.keyphraseId FROM paperKeyphrase AS T2 JOIN keyphrase AS T1 ON T2.keyphraseId = T1.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId JOIN writes AS T4 ON T4.paperId = T3.paperId JOIN author AS T5 ON T4.authorId = T5.authorId WHERE T5.authorName = 'Luke Zettlemoyer';
Show each premise type and the number of premises in that type.? Schema: - Premises(premise_details, premises_type)
SELECT premises_type, COUNT(*) AS num_premises FROM Premises GROUP BY premises_type;
How many perpetrators are there? Schema: - perpetrator(Country, Date, Injured, Killed, Location, Year)
SELECT COUNT(*) AS num_perpetrators FROM perpetrator;
What is the name and job title of the staff who was assigned the latest? 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) - Staff_Department_Assignments(COUNT, date_assigned_to, department_id, job_title_code, staff_id)
SELECT T1.staff_name, T2.job_title_code FROM Staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id ORDER BY T2.date_assigned_to DESC NULLS LAST LIMIT 1;
Please show the software platforms of devices in descending order of the count.? Schema: - device(COUNT, Carrier, Software_Platform)
SELECT Software_Platform FROM device WHERE Software_Platform IS NOT NULL GROUP BY Software_Platform ORDER BY COUNT(*) DESC NULLS LAST;
give me some restaurants on bethel island rd in bethel island ? 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 = 'bethel island' AND T2.street_name = 'bethel island rd';
papers by Richard Ladner published at chi? Schema: - venue(venueId, venueName) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...) - author(...)
SELECT DISTINCT T3.paperId FROM venue AS T4 JOIN paper AS T3 ON T4.venueId = T3.venueId JOIN writes AS T2 ON T2.paperId = T3.paperId JOIN author AS T1 ON T2.authorId = T1.authorId WHERE T1.authorName = 'Richard Ladner' AND T4.venueName = 'chi';
List the name of all different customers who have some loan sorted by their total loan amount.? Schema: - customer(COUNT, T1, acc_bal, acc_type, active, check, credit_score, cust_name, no_of_loans, sav, state, store_id) - loan(...)
SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID GROUP BY T1.cust_name ORDER BY SUM(T2.amount) ASC NULLS LAST;
Return the name of the marketing region the store Rob Dinning is located in.? Schema: - Marketing_Regions(Ch, Marketing_Region_Descriptrion, Marketing_Region_Name) - Stores(...)
SELECT T1.Marketing_Region_Name FROM Marketing_Regions AS T1 JOIN Stores AS T2 ON T1.Marketing_Region_Code = T2.Marketing_Region_Code WHERE T2.Store_Name = 'Rob Dinning';
How many users are logged in? Schema: - Users(COUNT, password, role_code, user_log, user_name)
SELECT COUNT(*) AS num_users FROM Users WHERE TRY_CAST(user_login AS INT) = 1;
what is the largest river in texas state? Schema: - river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse)
SELECT river_name FROM river WHERE LENGTH = (SELECT MAX(LENGTH) FROM river WHERE traverse = 'texas') AND traverse = 'texas';
What are the first names of the teachers who teach grade 1? Schema: - list(COUNT, Classroom, FirstName, Grade, LastName) - teachers(Classroom, FirstName, LastName)
SELECT DISTINCT T2.FirstName FROM list AS T1 JOIN teachers AS T2 ON T1.Classroom = T2.Classroom WHERE Grade = 1;
Show the names of products that are in at least two events.? Schema: - Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more)) - Products_in_Events(...)
SELECT T1.Product_Name FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name HAVING COUNT(*) >= 2;
What is the average price for products? Schema: - Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more))
SELECT AVG(Product_Price) AS avg_price FROM Products;
Which language does the film AIRPORT POLLOCK use? List the language name.? Schema: - film(COUNT, Directed_by, Director, Gross_in_dollar, JO, LENGTH, Studio, T1, Title, language_id, rating, rental_rate, ... (3 more)) - language_(...)
SELECT T2.name FROM film AS T1 JOIN language_ AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'AIRPORT POLLOCK';
For each director who directed more than one movie, what are the titles and dates of release for all those movies? Schema: - Movie(T1, director, title, year)
SELECT T1.title, T1."year" FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title != T2.title;
What is the total amount of grant money given to each organization and what is its id? Schema: - Grants(grant_amount, organisation_id)
SELECT SUM(grant_amount) AS total_grant_amount, organisation_id FROM Grants GROUP BY organisation_id;
Show the names of students who have a grade higher than 5 and have at least 2 friends.? Schema: - Friend(student_id) - Highschooler(COUNT, ID, grade, name)
SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.ID WHERE T2.grade > 5 GROUP BY T1.student_id, T2.name HAVING COUNT(*) >= 2;
Return the names of entrepreneurs do no not have the investor Rachel Elnaugh.? 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 WHERE T1.Investor != 'Rachel Elnaugh';
What is the description of the color used by least products? Schema: - Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more)) - Ref_Colors(color_description)
SELECT T2.color_description FROM Products AS T1 JOIN Ref_Colors AS T2 ON T1.color_code = T2.color_code GROUP BY T2.color_description ORDER BY COUNT(*) ASC NULLS LAST LIMIT 1;
How many movie directors are there? Schema: - movie(Budget_million, Director, Find, Gross_worldwide, T1, Title, Year, budget, release_year, title)
SELECT COUNT(DISTINCT Director) AS num_directors FROM movie;
What are the names of storms that did not affect two or more regions? Schema: - storm(Damage_millions_USD, Dates_active, Name, Number_Deaths) - affected_region(Region_id)
SELECT Name FROM storm WHERE Name NOT IN (SELECT T1.Name FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID, T1.Name HAVING COUNT(*) >= 2);
What is all the information about hiring? Schema: - hiring(...)
SELECT * FROM hiring;
What paper did Michael Armstrong wrote in the 90s ? Schema: - writes(...) - author(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT T3."year", T2.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 LIKE 'Michael Armstrong' AND T3."year" LIKE '199';
What is the code of each role and the number of employees in each role? Schema: - Employees(COUNT, Date_of_Birth, Employee_ID, Employee_Name, Role_Code, employee_id, employee_name, role_code)
SELECT Role_Code, COUNT(*) AS num_employees FROM Employees GROUP BY Role_Code;
Find the invoice numbers which are created before 1989-09-03 or after 2007-12-25.? Schema: - Invoices(COUNT, DOUBLE, Order_Quantity, Product_ID, TRY_CAST, invoice_date, invoice_details, invoice_number, order_id, payment_method_code)
SELECT invoice_number FROM Invoices WHERE invoice_date < '1989-09-03 23:59:59' OR invoice_date > '2007-12-25 00:00:00';
What are the 5 most recent papers of Mirella Lapata ? Schema: - writes(...) - author(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT T3.paperId, T3."year" FROM writes AS T2 JOIN author AS T1 ON T2.authorId = T1.authorId JOIN paper AS T3 ON T2.paperId = T3.paperId WHERE T1.authorName = 'Mirella Lapata' ORDER BY T3."year" DESC NULLS LAST LIMIT 5;
Give me the times and numbers of all trains that go to Chennai, ordered by time.? Schema: - train(Name, Service, Time, destination, name, origin, time, train_number)
SELECT "time", train_number FROM train WHERE destination = 'Chennai' ORDER BY "time";
What is the invoice number and invoice date for the invoice with most number of transactions? Schema: - Financial_Transactions(COUNT, F, SUM, account_id, invoice_number, transaction_amount, transaction_id, transaction_type) - Invoices(COUNT, DOUBLE, Order_Quantity, Product_ID, TRY_CAST, invoice_date, invoice_details, invoice_number, order_id, payment_method_code)
SELECT T2.invoice_number, T2.invoice_date FROM Financial_Transactions AS T1 JOIN Invoices AS T2 ON T1.invoice_number = T2.invoice_number GROUP BY T2.invoice_number, T2.invoice_date ORDER BY COUNT(T2.invoice_date) DESC NULLS LAST LIMIT 1;
What is the name of the manager with the most gas stations that opened after 2000? Schema: - gas_station(COUNT, Location, Manager_Name, Open_Year, Station_ID)
SELECT Manager_Name FROM gas_station WHERE Open_Year > 2000 AND Manager_Name IS NOT NULL GROUP BY Manager_Name ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Which professional did not operate any treatment on dogs? List the professional's id, role and email.? 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 T1.professional_id, T1.role_code, T1.email_address FROM Professionals AS T1 LEFT JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id WHERE T2.professional_id IS NULL;
How many different addresses do the students currently live? 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))
SELECT COUNT(DISTINCT current_address_id) AS num_addresses FROM Students;
List the id of students who attended statistics courses in the order of attendance date.? Schema: - Courses(course_description, course_name) - Student_Course_Attendance(course_id, date_of_attendance, student_id)
SELECT T2.student_id FROM Courses AS T1 JOIN Student_Course_Attendance AS T2 ON T1.course_id = CAST(T2.course_id AS TEXT) WHERE T1.course_name = 'statistics' ORDER BY T2.date_of_attendance ASC NULLS LAST;
What are the issue dates of volumes associated with the artist "Gorgoroth"? Schema: - artist(Age, Artist, Country, Famous_Release_date, Famous_Title, Year_Join, artist_name, country, gender) - volume(Artist_ID, Issue_Date, Song, Weeks_on_Top)
SELECT T2.Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.Artist = 'Gorgoroth';
return me the papers by " H. V. Jagadish " on VLDB conference with more than 200 citations .? 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' AND T4.citation_num > 200;
return me the authors who have 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';
Show all cities along with the number of drama workshop groups in each city.? Schema: - Addresses(address_content, city, country, line_1, line_1_number_building, line_2, state_province_county, town_city, zip_postcode) - Drama_Workshop_Groups(COUNT, Currency_Code, Marketing_Region_Code, Store_Name)
SELECT T1.City_Town, COUNT(*) AS num_drama_workshop_groups FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = CAST(T2.Address_ID AS TEXT) GROUP BY T1.City_Town;
Which problems were reported before the date of any problem reported by the staff Lysanne Turcotte? Give me 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 date_problem_reported < (SELECT MIN(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 = 'Lysanne' AND T4.staff_last_name = 'Turcotte');
Find the state of the college which player Charles is attending.? Schema: - College(M, cName, enr, state) - Tryout(COUNT, EX, T1, cName, decision, pPos) - Player(HS, pName, weight, yCard)
SELECT T1.state FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName JOIN Player AS T3 ON T2.pID = T3.pID WHERE T3.pName = 'Charles';
Find the names of bank branches that have provided a loan to any customer whose credit score is below 100.? Schema: - loan(...) - bank(SUM, bname, city, morn, no_of_customers, state) - customer(COUNT, T1, acc_bal, acc_type, active, check, credit_score, cust_name, no_of_loans, sav, state, store_id)
SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_ID = CAST(T2.branch_ID AS TEXT) JOIN customer AS T3 ON T1.cust_ID = T3.cust_ID WHERE T3.credit_score < 100;
Return the number of music festivals of each category.? Schema: - music_festival(COUNT, Category, Date_of_ceremony, Result)
SELECT Category, COUNT(*) AS num_festivals FROM music_festival GROUP BY Category;
Show the outcome code of mailshots along with the number of mailshots in each outcome code.? Schema: - Mailshot_Customers(outcome_code)
SELECT outcome_code, COUNT(*) AS num_mailshots FROM Mailshot_Customers GROUP BY outcome_code;
Return the categories of music festivals that have the result "Awarded".? Schema: - music_festival(COUNT, Category, Date_of_ceremony, Result)
SELECT Category FROM music_festival WHERE "Result" = 'Awarded';
What are card ids, customer ids, card types, and card numbers for each customer card? Schema: - Customers_Cards(COUNT, card_id, card_number, card_type_code, customer_id, date_valid_from, date_valid_to)
SELECT card_id, customer_id, card_type_code, card_number FROM Customers_Cards;
What is the first name of all employees who do not give any lessons? 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) - Lessons(lesson_status_code)
SELECT first_name FROM Staff WHERE first_name NOT IN (SELECT T2.first_name FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id);
What are the distinct name, location and products of the enzymes which has any 'inhibitor' interaction? Schema: - enzyme(Chromosome, Location, OMIM, Porphyria, Product, name) - medicine_enzyme_interaction(interaction_type)
SELECT DISTINCT T1.name, T1.Location, T1.Product FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.enzyme_id = T1.id WHERE T2.interaction_type = 'inhibitor';
List first name and last name of customers lived in city Lockmanfurt.? 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)) - Addresses(address_content, city, country, line_1, line_1_number_building, line_2, state_province_county, town_city, zip_postcode)
SELECT T1.first_name, T1.last_name FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T2.city = 'Lockmanfurt';
List the id and type of each thing, and the details of the organization that owns it.? Schema: - Things(...) - Organizations(date_formed, organization_name)
SELECT T1.thing_id, T1.Type_of_Thing_Code, T2.organization_details FROM Things AS T1 JOIN Organizations AS T2 ON T1.organization_id = T2.organization_id;
What are the names of Art instructors who have taught a course, and the corresponding course id? Schema: - instructor(AVG, M, So, Stat, dept_name, name, salary) - teaches(ID, Spr, semester)
SELECT name, course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID WHERE T1.dept_name = 'Art';
Return the name of the characteristic that is most common across all products.? 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 T3.characteristic_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 GROUP BY T3.characteristic_name ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
topics popular at NIPS 2015? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - venue(venueId, venueName)
SELECT DISTINCT COUNT(T3.paperId) AS num_papers, T1.keyphraseId FROM paperKeyphrase AS T2 JOIN keyphrase AS T1 ON T2.keyphraseId = T1.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId JOIN venue AS T4 ON T4.venueId = T3.venueId WHERE T3."year" = 2015 AND T4.venueName = 'NIPS' GROUP BY T1.keyphraseId ORDER BY num_papers DESC NULLS LAST;
What is the official name and status of the city with the most residents? Schema: - city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more))
SELECT Official_Name, Status FROM city ORDER BY Population DESC NULLS LAST LIMIT 1;
Show the transportation method most people choose to get to tourist attractions.? Schema: - Tourist_Attractions(Al, COUNT, How_to_Get_There, Name, Opening_Hours, Rosal, T1, T3, Tour, Tourist_Attraction_ID, Tourist_Details, Tourist_ID, ... (2 more))
SELECT How_to_Get_There FROM Tourist_Attractions WHERE How_to_Get_There IS NOT NULL GROUP BY How_to_Get_There ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Find the name of the department that offers the highest total credits? Schema: - course(COUNT, JO, SUM, Stat, T1, course_id, credits, dept_name, title)
SELECT dept_name FROM course WHERE dept_name IS NOT NULL GROUP BY dept_name ORDER BY SUM(credits) DESC NULLS LAST LIMIT 1;
What is the detail of the location UK Gallery? Schema: - Locations(Address, Location_Name, Other_Details)
SELECT Other_Details FROM Locations WHERE Location_Name = 'UK Gallery';
What are all info of students who registered courses but not attended courses? Schema: - Student_Course_Registrations(COUNT, student_id) - Student_Course_Attendance(course_id, date_of_attendance, student_id)
SELECT * FROM Student_Course_Registrations WHERE student_id NOT IN (SELECT student_id FROM Student_Course_Attendance);
What are the names of catalog entries with level number 8? Schema: - Catalog_Contents(capacity, catalog_entry_name, height, next_entry_id, price_in_dollars, price_in_euros, product_stock_number) - Catalog_Contents_Additional_Attributes(...)
SELECT T1.catalog_entry_name FROM Catalog_Contents AS T1 JOIN Catalog_Contents_Additional_Attributes AS T2 ON T1.catalog_entry_id = T2.catalog_entry_id WHERE T2.catalog_level_number = '8';
What is the number of cars with a greater accelerate than the one with the most horsepower? Schema: - cars_data(Accelerate, Cylinders, Horsepower, MPG, T1, Weight, Year)
SELECT COUNT(*) AS num_cars FROM cars_data WHERE Accelerate > (SELECT Accelerate FROM cars_data ORDER BY Horsepower DESC NULLS LAST LIMIT 1);
What are the countries where either English or Dutch is the official language ? Schema: - country(Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, M, Name, Official_native_language, ... (4 more)) - countrylanguage(COUNT, CountryCode, Engl, Language)
SELECT DISTINCT Name FROM (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2."Language" = 'english' AND IsOfficial = 't' UNION ALL SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2."Language" = 'dutch' AND IsOfficial = 't');
List the name and number of followers for each user, and sort the results by the number of followers in descending order.? Schema: - user_profiles(email, followers, name, partitionid)
SELECT name, followers FROM user_profiles ORDER BY followers DESC NULLS LAST;
What are the names of ships that were involved in a mission launched after 1928? Schema: - mission(...) - ship(COUNT, DIST, JO, K, Name, Nationality, T1, Tonnage, Type, disposition_of_ship, name, tonnage)
SELECT T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T1.Launched_Year > 1928;
Find the name and attribute ID of the attribute definitions with attribute value 0.? Schema: - Attribute_Definitions(attribute_data_type, attribute_name) - Catalog_Contents_Additional_Attributes(...)
SELECT T1.attribute_name, T1.attribute_id FROM Attribute_Definitions AS T1 JOIN Catalog_Contents_Additional_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE TRY_CAST(T2.attribute_value AS INT) = 0;
How many vocal types are used in the song "Le Pop"? Schema: - Vocals(COUNT, Type) - Songs(Title)
SELECT COUNT(*) AS num_vocal_types FROM Vocals AS T1 JOIN Songs AS T2 ON T1.SongId = T2.SongId WHERE Title = 'Le Pop';
What is the total number of products that are in orders with status "Cancelled"? Schema: - Customer_Orders(customer_id, order_date, order_id, order_shipping_charges) - Order_Items(COUNT, DOUBLE, INT, TRY_CAST, order_id, order_item_id, order_quantity, product_id, product_quantity)
SELECT SUM(TRY_CAST(T2.order_quantity AS DOUBLE)) AS num_products FROM Customer_Orders AS T1 JOIN Order_Items AS T2 ON T1.order_id = T2.order_id WHERE T1.order_status = 'Cancelled';
Show the players and the years played.? Schema: - player(Age, COUNT, Gender, Occupation, Player, Player_name, Po, Points, Position, Residence, Sponsor_name, T1, ... (12 more))
SELECT Player, Years_Played FROM player;
What are the details of the project with no outcomes? Schema: - Projects(COUNT, Hours, Name, Project_Details, Project_ID, organ, organisation_id, project_details) - Project_Outcomes(outcome_code)
SELECT project_details FROM Projects WHERE project_id NOT IN (SELECT project_id FROM Project_Outcomes);
Count the number of entrepreneurs.? Schema: - entrepreneur(COUNT, Company, Investor, Money_Requested)
SELECT COUNT(*) AS num_entrepreneurs FROM entrepreneur;
How many members have the black membership card? Schema: - member_(Address, Age, COUNT, Card_Number, Country, Hometown, Level, Member_ID, Member_Name, Membership_card, Name, Party_ID, ... (1 more))
SELECT COUNT(*) AS num_members FROM member_ WHERE Membership_card = 'Black';