question
stringlengths
43
589
query
stringlengths
19
598
where is a restaurant on buchanan in san francisco that serves good arabic 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 T2.city_name = 'san francisco' AND T2.street_name = 'buchanan' AND T1.food_type = 'arabic' AND T1.rating > 2.5;
return me the number of papers in PVLDB containing keyword " Keyword search " .? Schema: - publication_keyword(...) - keyword(keyword) - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year) - journal(Theme, homepage, name)
SELECT COUNT(DISTINCT T4.title) AS num_papers FROM publication_keyword AS T2 JOIN keyword AS T1 ON T2.kid = T1.kid JOIN publication AS T4 ON T4.pid = T2.pid JOIN journal AS T3 ON T4.jid = T3.jid WHERE T3.name = 'PVLDB' AND T1.keyword = 'Keyword search';
Which classroom has the most students? Schema: - list(COUNT, Classroom, FirstName, Grade, LastName)
SELECT Classroom FROM list WHERE Classroom IS NOT NULL GROUP BY Classroom ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
What is the official language spoken in the country whose head of state is Beatrix? 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 T2."Language" FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.HeadOfState = 'Beatrix' AND T2.IsOfficial = 'T';
Return the minimum, maximum, and average seating across all tracks.? Schema: - track(Location, Name, Seat, Seating, T1, Year_Opened)
SELECT MIN(Seating) AS min_seating, MAX(Seating) AS max_seating, AVG(Seating) AS avg_seating FROM track;
Wat is the tax source system code and master customer id of the taxes related to each parking fine id? Schema: - CMI_Cross_References(source_system_code) - Parking_Fines(cmi_cross_ref_id, council_tax_id)
SELECT T1.source_system_code, T1.master_customer_id, T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Parking_Fines AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id;
What is the total salary expenses of team Boston Red Stockings in 2010? Schema: - salary(salary) - team(Name)
SELECT SUM(T1.salary) AS total_salary_expenses FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1."year" = 2010;
Return the total number of distinct customers.? 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 COUNT(*) AS num_customers FROM Customers;
Most cited papers on parsing? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - cite(...)
SELECT DISTINCT T4.citedPaperId, COUNT(T4.citedPaperId) AS num_cites FROM paperKeyphrase AS T2 JOIN keyphrase AS T1 ON T2.keyphraseId = T1.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId JOIN cite AS T4 ON T3.paperId = T4.citedPaperId WHERE T1.keyphraseName = 'parsing' GROUP BY T4.citedPaperId ORDER BY num_cites DESC NULLS LAST;
List all information about college sorted by enrollment number in the ascending order.? Schema: - College(M, cName, enr, state)
SELECT * FROM College ORDER BY enr ASC NULLS LAST;
How old is the youngest person for each job? Schema: - Person(M, age, city, eng, gender, job, name)
SELECT MIN(age) AS min_age, job FROM Person GROUP BY job;
Find the owner id and zip code of the owner who spent the most money in total for his or her dogs.? Schema: - Owners(email_address, first_name, last_name, state) - Dogs(abandoned_yn, age, breed_code, date_arrived, date_departed, name, size_code, weight) - Treatments(cost_of_treatment, date_of_treatment, dog_id, professional_id)
SELECT T1.owner_id, T1.zip_code FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id JOIN Treatments AS T3 ON T2.dog_id = T3.dog_id GROUP BY T1.owner_id, T1.zip_code ORDER BY SUM(T3.cost_of_treatment) DESC NULLS LAST LIMIT 1;
What are the names of parties that have no members? Schema: - party(COUNT, Comptroller, First_year, Governor, Last_year, Left_office, Location, Minister, Number_of_hosts, Party, Party_Theme, Party_name, ... (3 more)) - member_(Address, Age, COUNT, Card_Number, Country, Hometown, Level, Member_ID, Member_Name, Membership_card, Name, Party_ID, ... (1 more))
SELECT Party_name FROM party WHERE Party_ID NOT IN (SELECT Party_ID FROM member_);
List the top 5 genres by number of tracks. List genres name and total tracks.? Schema: - genres(name) - tracks(composer, milliseconds, name, unit_price)
SELECT T1.name, COUNT(*) AS num_tracks FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id, T1.name ORDER BY num_tracks DESC NULLS LAST LIMIT 5;
List the name of physicians who never took any appointment.? Schema: - Physician(I, Name) - Appointment(AppointmentID, Start)
SELECT DISTINCT Name FROM Physician WHERE Name NOT IN (SELECT T2.Name FROM Appointment AS T1 JOIN Physician AS T2 ON T1.Physician = T2.EmployeeID);
Show me all the restaurants.? Schema: - Restaurant(Address, Rating, ResID, ResName)
SELECT ResName FROM Restaurant;
What is the number of movies produced in 2013 ? Schema: - movie(Budget_million, Director, Find, Gross_worldwide, T1, Title, Year, budget, release_year, title)
SELECT COUNT(DISTINCT title) AS num_movies FROM movie WHERE release_year = 2013;
How many different types of pet are there? Schema: - Pets(PetID, PetType, pet_age, weight)
SELECT COUNT(DISTINCT PetType) AS num_pet_types FROM Pets;
What are the names of cities that are in the county with the most police officers? 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 Name FROM city WHERE County_ID = (SELECT County_ID FROM county_public_safety ORDER BY Police_officers DESC NULLS LAST LIMIT 1);
Show all distinct cities in the address record.? Schema: - Addresses(address_content, city, country, line_1, line_1_number_building, line_2, state_province_county, town_city, zip_postcode)
SELECT DISTINCT city FROM Addresses;
What is the name of the department htat has no students minoring in it? Schema: - Department(Building, COUNT, DNO, DName, DPhone, DepartmentID, Division, FacID, Head, LName, Room, T2) - Minor_in(...)
SELECT DName FROM Department WHERE DName NOT IN (SELECT T1.DName FROM Department AS T1 JOIN Minor_in AS T2 ON T1.DNO = T2.DNO);
Which city has the most customers living in? 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_Addresses(address_type_code) - Addresses(address_content, city, country, line_1, line_1_number_building, line_2, state_province_county, town_city, zip_postcode)
SELECT T3.city FROM Customers AS T1 JOIN Customer_Addresses AS T2 ON T1.customer_id = T2.customer_id JOIN Addresses AS T3 ON T2.address_id = T3.address_id GROUP BY T3.city ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Which apartment type has the largest number of total rooms? Return the apartment type code, its number of bathrooms and number of bedrooms.? Schema: - Apartments(AVG, COUNT, INT, SUM, TRY_CAST, apt_number, apt_type_code, bathroom_count, bedroom_count, room_count)
SELECT apt_type_code, bathroom_count, bedroom_count FROM Apartments WHERE apt_type_code IS NOT NULL AND bathroom_count IS NOT NULL AND bedroom_count IS NOT NULL GROUP BY apt_type_code, bathroom_count, bedroom_count ORDER BY SUM(TRY_CAST(room_count AS INT)) DESC NULLS LAST LIMIT 1;
who wrote the most CVPR papers in 2007? Schema: - venue(venueId, venueName) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...)
SELECT DISTINCT COUNT(T2.paperId) AS num_papers, T1.authorId FROM venue AS T3 JOIN paper AS T2 ON T3.venueId = T2.venueId JOIN writes AS T1 ON T1.paperId = T2.paperId WHERE T2."year" = 2007 AND T3.venueName = 'CVPR' GROUP BY T1.authorId ORDER BY num_papers DESC NULLS LAST;
Count different addresses of each school.? Schema: - DEPARTMENT(Account, DEPT_ADDRESS, DEPT_NAME, H, SCHOOL_CODE)
SELECT COUNT(DISTINCT DEPT_ADDRESS) AS num_addresses, SCHOOL_CODE FROM DEPARTMENT GROUP BY SCHOOL_CODE;
what is the city with the smallest 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);
Which model has the least amount of RAM? List the model name and the amount of RAM.? Schema: - chip_model(Launch_year, Model_name, RAM_MiB, WiFi)
SELECT Model_name, RAM_MiB FROM chip_model ORDER BY RAM_MiB ASC NULLS LAST LIMIT 1;
Find all reviews about " Kabob Palace " in year 2014? Schema: - review(i_id, rank, rating, text) - business(business_id, city, full_address, name, rating, review_count, state)
SELECT T2."text" FROM review AS T2 JOIN business AS T1 ON T2.business_id = T1.business_id WHERE T1.name = 'Kabob Palace' AND T2."year" = 2014;
What are the names and seatings for all tracks opened after 2000, ordered by seating? Schema: - track(Location, Name, Seat, Seating, T1, Year_Opened)
SELECT Name, Seating FROM track WHERE Year_Opened > 2000 ORDER BY Seating ASC NULLS LAST;
Who are the actors born in " Austin " after 1980 ? Schema: - actor(Afghan, Aust, COUNT, Character, Chr, Duration, Kev, Name, age, birth_city, birth_year, first_name, ... (4 more))
SELECT name FROM actor WHERE birth_city = 'Austin' AND birth_year > 1980;
Find the names of either colleges in LA with greater than 15000 size or in state AZ with less than 13000 enrollment.? Schema: - College(M, cName, enr, state)
SELECT DISTINCT cName FROM (SELECT cName FROM College WHERE enr < 13000 AND state = 'AZ' UNION ALL SELECT cName FROM College WHERE enr > 15000 AND state = 'LA');
What are the title and director of the films without any schedule? Schema: - film(COUNT, Directed_by, Director, Gross_in_dollar, JO, LENGTH, Studio, T1, Title, language_id, rating, rental_rate, ... (3 more)) - schedule(...)
SELECT Title, Directed_by FROM film WHERE Film_ID NOT IN (SELECT Film_ID FROM schedule);
Count the number of courses with more than 2 credits.? Schema: - Course(CName, Credits, Days)
SELECT COUNT(*) AS num_courses FROM Course WHERE Credits > 2;
What is the name and distance for aircraft with id 12? Schema: - aircraft(Description, aid, d, distance, name)
SELECT name, distance FROM aircraft WHERE aid = 12;
Find the type code of the most frequently used policy.? Schema: - Policies(COUNT, Policy_Type_Code)
SELECT Policy_Type_Code FROM Policies WHERE Policy_Type_Code IS NOT NULL GROUP BY Policy_Type_Code ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Show the names of members that have a rank in round higher than 3.? Schema: - member_(Address, Age, COUNT, Card_Number, Country, Hometown, Level, Member_ID, Member_Name, Membership_card, Name, Party_ID, ... (1 more)) - round(...)
SELECT T1.Name FROM member_ AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID WHERE T2.Rank_in_Round > 3;
Count the number of all the calendar items.? Schema: - Ref_Calendar(Calendar_Date, Day_Number)
SELECT COUNT(*) AS num_calendar_items FROM Ref_Calendar;
What is the total population and maximum GNP in Asia? 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, MAX(GNP) AS max_gnp FROM country WHERE Continent = 'Asia';
Find the products which have problems reported by both Lacey Bosco and Kenton Champlin? Schema: - Problems(date_problem_reported, problem_id) - Product(product_id, product_name) - 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 T2.product_name FROM Problems AS T1 JOIN Product AS T2 ON T1.product_id = T2.product_id JOIN Staff AS T3 ON T1.reported_by_staff_id = T3.staff_id JOIN (SELECT T1.product_id FROM Problems AS T1 JOIN Staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = 'Kenton' AND T2.staff_last_name = 'Champlin') AS T4 ON T2.product_id = T4.product_id WHERE T3.staff_first_name = 'Lacey' AND T3.staff_last_name = 'Bosco';
Show the date valid from and the date valid to for the card with card number '4560596484842'.? Schema: - Customers_Cards(COUNT, card_id, card_number, card_type_code, customer_id, date_valid_from, date_valid_to)
SELECT date_valid_from, date_valid_to FROM Customers_Cards WHERE card_number = '4560596484842';
What papers have been written by Peter Mertens and Dina Barbian .? Schema: - writes(...) - author(...)
SELECT DISTINCT T3.paperId FROM writes AS T3 JOIN author AS T2 ON T3.authorId = T2.authorId JOIN writes AS T4 ON T4.paperId = T3.paperId JOIN author AS T1 ON T4.authorId = T1.authorId WHERE T2.authorName = 'Peter Mertens' AND T1.authorName = 'Dina Barbian';
How many vehicles exist? Schema: - Vehicles(vehicle_details, vehicle_id)
SELECT COUNT(*) AS num_vehicles FROM Vehicles;
How many members does the club "Tennis Club" has? Schema: - Club(ClubDesc, ClubLocation, ClubName, Enterpr, Gam, Hopk, Tenn) - Member_of_club(...) - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT COUNT(*) AS num_members FROM Club AS T1 JOIN Member_of_club AS T2 ON T1.ClubID = T2.ClubID JOIN Student AS T3 ON T2.StuID = T3.StuID WHERE T1.ClubName = 'Tennis Club';
List the number of invoices 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';
Show the date of the tallest perpetrator.? Schema: - people(Age, Birth_Date, Birth_Place, COUNT, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more)) - perpetrator(Country, Date, Injured, Killed, Location, Year)
SELECT T2."Date" FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Height DESC NULLS LAST LIMIT 1;
Find the id and last name of the student that has the most behavior incidents? Schema: - Behavior_Incident(NO, date_incident_end, date_incident_start, incident_type_code) - 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.last_name FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id, T2.last_name ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Which document type is described with the prefix 'Initial'? Schema: - Document_Types(document_description, document_type_code)
SELECT document_type_code FROM Document_Types WHERE document_description LIKE 'Initial%';
show all train numbers and names ordered by their time from early to late.? Schema: - train(Name, Service, Time, destination, name, origin, time, train_number)
SELECT train_number, name FROM train ORDER BY "time";
What are the types of vocals used in the song "Le Pop"? Schema: - Vocals(COUNT, Type) - Songs(Title)
SELECT Type FROM Vocals AS T1 JOIN Songs AS T2 ON T1.SongId = T2.SongId WHERE Title = 'Le Pop';
Find the names of all the clubs that have at least a member from the city with city code "BAL".? Schema: - Club(ClubDesc, ClubLocation, ClubName, Enterpr, Gam, Hopk, Tenn) - Member_of_club(...) - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT DISTINCT T1.ClubName FROM Club AS T1 JOIN Member_of_club AS T2 ON T1.ClubID = T2.ClubID JOIN Student AS T3 ON T2.StuID = T3.StuID WHERE T3.city_code = 'BAL';
How many film are there? Schema: - film(COUNT, Directed_by, Director, Gross_in_dollar, JO, LENGTH, Studio, T1, Title, language_id, rating, rental_rate, ... (3 more))
SELECT COUNT(*) AS num_films FROM film;
What is the most popular file format? 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 are all the tv series created by " Shonda Rhimes " ? Schema: - producer(...) - made_by(...) - tv_series(...)
SELECT T2.title FROM producer AS T1 JOIN made_by AS T3 ON T1.pid = T3.pid JOIN tv_series AS T2 ON T2.sid = T3.msid WHERE T1.name = 'Shonda Rhimes';
Count the number of chip model that do not have wifi.? Schema: - chip_model(Launch_year, Model_name, RAM_MiB, WiFi)
SELECT COUNT(*) AS num_models FROM chip_model WHERE WiFi = 'No';
Count the number of customers who are active.? Schema: - customer(COUNT, T1, acc_bal, acc_type, active, check, credit_score, cust_name, no_of_loans, sav, state, store_id)
SELECT COUNT(*) AS num_customers FROM customer WHERE active = '1';
What is the savings balance of the account belonging to the customer with the highest checking balance? Schema: - ACCOUNTS(name) - CHECKING(balance) - SAVINGS(SAV, balance)
SELECT T3.balance FROM ACCOUNTS AS T1 JOIN CHECKING AS T2 ON T1.custid = T2.custid JOIN SAVINGS AS T3 ON T1.custid = T3.custid ORDER BY T2.balance DESC NULLS LAST LIMIT 1;
How many professors are in the accounting dept? Schema: - PROFESSOR(DEPT_CODE, PROF_HIGH_DEGREE) - DEPARTMENT(Account, DEPT_ADDRESS, DEPT_NAME, H, SCHOOL_CODE)
SELECT COUNT(*) AS num_professors FROM PROFESSOR AS T1 JOIN DEPARTMENT AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE WHERE DEPT_NAME = 'Accounting';
What are the flight numbers for the aircraft Airbus A340-300? Schema: - flight(Altitude, COUNT, Date, Pilot, Vehicle_Flight_number, Velocity, arrival_date, departure_date, destination, distance, flno, origin, ... (1 more)) - aircraft(Description, aid, d, distance, name)
SELECT T1.flno FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = 'Airbus A340-300';
How many different courses offered by Physics department? Schema: - course(COUNT, JO, SUM, Stat, T1, course_id, credits, dept_name, title)
SELECT COUNT(DISTINCT course_id) AS num_courses FROM course WHERE dept_name = 'Physics';
where is jamerican cuisine ? 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.name = 'jamerican cuisine';
Find all users who have written tips for " Barrio Cafe " in 2015? Schema: - tip(month, text) - business(business_id, city, full_address, name, rating, review_count, state) - user_(name)
SELECT T3."name" FROM tip AS T2 JOIN business AS T1 ON T2.business_id = T1.business_id JOIN user_ AS T3 ON T3.user_id = T2.user_id WHERE T1."name" = 'Barrio Cafe' AND T2."year" = 2015;
Who is the "CTO" of club "Hopkins Student Enterprises"? Show the first name and last name.? Schema: - Club(ClubDesc, ClubLocation, ClubName, Enterpr, Gam, Hopk, Tenn) - Member_of_club(...) - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT T3.Fname, T3.LName FROM Club AS T1 JOIN Member_of_club AS T2 ON T1.ClubID = T2.ClubID JOIN Student AS T3 ON T2.StuID = T3.StuID WHERE T1.ClubName = 'Hopkins Student Enterprises' AND T2."Position" = 'CTO';
For each airport name, how many routes start at that airport, ordered from most to least? Schema: - airports(AirportCode, AirportName, Argent, COUNT, City, Country, city, country, elevation, name) - routes(...)
SELECT COUNT(*) AS num_routes, T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name ORDER BY num_routes DESC NULLS LAST;
Find the names of all instructors in the Art department who have taught some course and the 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';
Find the name of the source user with the highest average trust score.? Schema: - useracct(...) - trust(...)
SELECT T1.name FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.source_u_id GROUP BY T2.source_u_id, T1.name ORDER BY AVG(trust) DESC NULLS LAST LIMIT 1;
who published at acl 2016 ? Schema: - venue(venueId, venueName) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...)
SELECT DISTINCT T1.authorId FROM venue AS T3 JOIN paper AS T2 ON T3.venueId = T2.venueId JOIN writes AS T1 ON T1.paperId = T2.paperId WHERE T2."year" = 2016 AND T3.venueName = 'acl';
Find all movies directed by " Asghar Farhadi " and featuring " Taraneh Alidoosti "? 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) - directed_by(...) - director(Afghan, name, nationality)
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 directed_by AS T2 ON T4.mid = T2.msid JOIN director AS T3 ON T3.did = T2.did WHERE T1.name = 'Taraneh Alidoosti' AND T3.name = 'Asghar Farhadi';
What are the names of entrepreneurs whose investor is not "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';
Show ids for all transactions whose amounts are greater than the average.? Schema: - Financial_Transactions(COUNT, F, SUM, account_id, invoice_number, transaction_amount, transaction_id, transaction_type)
SELECT transaction_id FROM Financial_Transactions WHERE transaction_amount > (SELECT AVG(transaction_amount) FROM Financial_Transactions);
Find the semester and year which has the least number of student taking any class.? Schema: - takes(COUNT, semester, year)
SELECT semester, "year" FROM takes GROUP BY semester, "year" ORDER BY COUNT(*) ASC NULLS LAST LIMIT 1;
Papers about TAIL 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';
Give me a list of all the channel names sorted by the channel rating in descending order.? Schema: - channel(Name, Owner, Rating_in_percent, Share_in_percent)
SELECT Name FROM channel ORDER BY Rating_in_percent DESC NULLS LAST;
Show different occupations along with the number of players in each occupation.? Schema: - player(Age, COUNT, Gender, Occupation, Player, Player_name, Po, Points, Position, Residence, Sponsor_name, T1, ... (12 more))
SELECT Occupation, COUNT(*) AS num_players FROM player GROUP BY Occupation;
Find the name of medication used on the patient who stays in room 111? Schema: - Stay(Patient, Room, StayStart) - Patient(...) - Prescribes(...) - Medication(Name)
SELECT T4.Name FROM Stay AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN JOIN Prescribes AS T3 ON T3.Patient = T2.SSN JOIN Medication AS T4 ON T3.Medication = T4.Code WHERE Room = 111;
who are the authors at NIPS ? Schema: - venue(venueId, venueName) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...)
SELECT DISTINCT T1.authorId FROM venue AS T3 JOIN paper AS T2 ON T3.venueId = T2.venueId JOIN writes AS T1 ON T1.paperId = T2.paperId WHERE T3.venueName = 'NIPS';
Sort the customer names in alphabetical order.? Schema: - Customers(BIGINT, COUNT, Customer_Details, Customer_ID, Customer_name, Mar, Rat, TRY_CAST, V, address_line_1, address_line_2, amount_outstanding, ... (25 more))
SELECT Customer_Details FROM Customers ORDER BY Customer_Details ASC NULLS LAST;
List the name of rooms with king or queen bed.? Schema: - Rooms(K, RoomId, basePrice, bedType, beds, decor, maxOccupancy, roomName)
SELECT roomName FROM Rooms WHERE bedType = 'King' OR bedType = 'Queen';
What is the average number of pages per minute color? Schema: - product(COUNT, pages_per_minute_color, product)
SELECT AVG(pages_per_minute_color) AS avg_pages_per_minute_color FROM product;
Give the airport code and airport name corresonding to the city Anthony.? Schema: - airports(AirportCode, AirportName, Argent, COUNT, City, Country, city, country, elevation, name)
SELECT AirportCode, AirportName FROM airports WHERE City = 'Anthony';
List the names of members who did not attend any performance.? Schema: - member_(Address, Age, COUNT, Card_Number, Country, Hometown, Level, Member_ID, Member_Name, Membership_card, Name, Party_ID, ... (1 more)) - member_attendance(...)
SELECT Name FROM member_ WHERE Member_ID NOT IN (SELECT Member_ID FROM member_attendance);
Count the number of tracks that are part of the rock genre.? Schema: - Genre(Name) - Track(Milliseconds, Name, UnitPrice)
SELECT COUNT(*) AS num_tracks FROM Genre AS T1 JOIN Track AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = 'Rock';
Show the range that has the most number of mountains.? Schema: - mountain(AVG, COUNT, Country, Height, JO, Name, Prominence, Range, T1, mck, mounta, mountain_altitude, ... (3 more))
SELECT "Range" FROM mountain GROUP BY "Range" ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
List all 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;
Who are the owners of the programs that broadcast both in the morning and at night? Schema: - program(Beij, Launch, Name, Origin, Owner) - broadcast(Program_ID, Time_of_day)
SELECT DISTINCT T1.Owner FROM program AS T1 JOIN broadcast AS T2 ON T1.Program_ID = T2.Program_ID WHERE T2.Time_of_day = 'Morning' AND T1.Owner IN (SELECT T1.Owner FROM program AS T1 JOIN broadcast AS T2 ON T1.Program_ID = T2.Program_ID WHERE T2.Time_of_day = 'Night');
Find the weight of the youngest dog.? Schema: - Pets(PetID, PetType, pet_age, weight)
SELECT weight FROM Pets ORDER BY pet_age ASC NULLS LAST LIMIT 1;
How many different advisors are listed? Schema: - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT COUNT(DISTINCT Advisor) AS num_advisors FROM Student;
Return the average age across all gymnasts.? Schema: - gymnast(Floor_Exercise_Points, Horizontal_Bar_Points) - people(Age, Birth_Date, Birth_Place, COUNT, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more))
SELECT AVG(T2.Age) AS avg_age FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID;
How many airports are there per country? Order the countries by decreasing number of airports.? Schema: - airports(AirportCode, AirportName, Argent, COUNT, City, Country, city, country, elevation, name)
SELECT COUNT(*) AS num_airports, country FROM airports WHERE country IS NOT NULL GROUP BY country ORDER BY num_airports DESC NULLS LAST;
where are some restaurants good for arabic food on buchanan in san francisco ? Schema: - restaurant(...) - location(...)
SELECT T2.house_number, T1.name FROM restaurant AS T1 JOIN location AS T2 ON T1.id = T2.restaurant_id WHERE T2.city_name = 'san francisco' AND T2.street_name = 'buchanan' AND T1.food_type = 'arabic' AND T1.rating > 2.5;
How is the math course described? Schema: - Courses(course_description, course_name)
SELECT course_description FROM Courses WHERE course_name = 'math';
Give the ids for documents that have the budget description 'Government'.? Schema: - Documents_with_Expenses(Budget_Type_Code, COUNT, Document_ID) - Ref_Budget_Codes(Budget_Type_Code, Budget_Type_Description)
SELECT T1.Document_ID FROM Documents_with_Expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_Code = T2.Budget_Type_Code WHERE T2.Budget_Type_Description = 'Government';
What is the id of the organization with the maximum number of outcomes and how many outcomes are there? Schema: - Projects(COUNT, Hours, Name, Project_Details, Project_ID, organ, organisation_id, project_details) - Project_Outcomes(outcome_code)
SELECT T1.organisation_id, COUNT(*) AS num_outcomes FROM Projects AS T1 JOIN Project_Outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.organisation_id ORDER BY num_outcomes DESC NULLS LAST LIMIT 1;
What are the distinct location names? Schema: - Locations(Address, Location_Name, Other_Details)
SELECT DISTINCT Location_Name FROM Locations;
What are the names of all employees who have a salary higher than 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);
Find the start and end dates of behavior incidents of students with last name "Fahey".? Schema: - Behavior_Incident(NO, date_incident_end, date_incident_start, incident_type_code) - 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.date_incident_start, date_incident_end FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.last_name = 'Fahey';
How many publications does Christopher D. Manning have ? Schema: - writes(...) - author(...)
SELECT DISTINCT COUNT(DISTINCT T2.paperId) AS num_publications FROM writes AS T2 JOIN author AS T1 ON T2.authorId = T1.authorId WHERE T1.authorName = 'Christopher D. Manning';
Count the number of classrooms in Lamberton.? Schema: - classroom(building, capacity, room_number)
SELECT COUNT(*) AS num_classrooms FROM classroom WHERE building = 'Lamberton';
Return the booking start date and end date for the apartments that have type code "Duplex".? Schema: - Apartment_Bookings(booking_end_date, booking_start_date, booking_status_code) - Apartments(AVG, COUNT, INT, SUM, TRY_CAST, apt_number, apt_type_code, bathroom_count, bedroom_count, room_count)
SELECT T1.booking_start_date, T1.booking_end_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = 'Duplex';
What are the names of all the clubs starting with the oldest? Schema: - club(Region, Start_year, name)
SELECT name FROM club ORDER BY Start_year ASC NULLS LAST;
What are the region names affected by the storm with a number of deaths of least 10? Schema: - affected_region(Region_id) - region(Label, Region_code, Region_name) - storm(Damage_millions_USD, Dates_active, Name, Number_Deaths)
SELECT T2.Region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.Region_id = T2.Region_id JOIN storm AS T3 ON T1.Storm_ID = T3.Storm_ID WHERE T3.Number_Deaths >= 10;