question stringlengths 43 589 | query stringlengths 19 598 |
|---|---|
Find all the songs that do not have a back vocal.?
Schema:
- Vocals(COUNT, Type)
- Songs(Title) | SELECT DISTINCT Title FROM Vocals AS T1 JOIN Songs AS T2 ON T1.SongId = T2.SongId WHERE Title NOT IN (SELECT T2.Title FROM Vocals AS T1 JOIN Songs AS T2 ON T1.SongId = T2.SongId WHERE Type = 'back'); |
What is the average hours across all projects?
Schema:
- Projects(COUNT, Hours, Name, Project_Details, Project_ID, organ, organisation_id, project_details) | SELECT AVG(Hours) AS avg_hours FROM Projects; |
what is the smallest state that the mississippi river runs through?
Schema:
- state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom)
- river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse) | SELECT state_name FROM state WHERE area = (SELECT MIN(area) FROM state WHERE state_name IN (SELECT traverse FROM river WHERE river_name = 'mississippi')) AND state_name IN (SELECT traverse FROM river WHERE river_name = 'mississippi'); |
Compute the total amount of payment processed.?
Schema:
- Payments(Amount_Payment, COUNT, Date_Payment_Made, Payment_ID, Payment_Method_Code, V, amount_due, amount_paid, payment_date, payment_type_code) | SELECT SUM(Amount_Payment) AS total_payment FROM Payments; |
Show all distinct building descriptions.?
Schema:
- Apartment_Buildings(building_address, building_description, building_full_name, building_manager, building_phone, building_short_name) | SELECT DISTINCT building_description FROM Apartment_Buildings; |
What are all the role codes, role names, and role descriptions?
Schema:
- Roles(Role_Code, Role_Description, Role_Name, role_code, role_description) | SELECT Role_Code, Role_Name, Role_Description FROM Roles; |
What is the name of the customer who has made the largest amount of claim in a single claim?
Schema:
- Claim_Headers(Amount_Piad)
- Policies(COUNT, Policy_Type_Code)
- Customers(BIGINT, COUNT, Customer_Details, Customer_ID, Customer_name, Mar, Rat, TRY_CAST, V, address_line_1, address_line_2, amount_outstanding, ... (25 more)) | SELECT T3.Customer_Details FROM Claim_Headers AS T1 JOIN Policies AS T2 ON T1.Policy_ID = T2.Policy_ID JOIN Customers AS T3 ON T2.Customer_ID = T3.Customer_ID WHERE T1.Amount_Claimed = (SELECT MAX(Amount_Claimed) FROM Claim_Headers); |
Which countries in europe have at least 3 car manufacturers?
Schema:
- countries(...)
- continents(...)
- car_makers(...) | SELECT T1.CountryName FROM countries AS T1 JOIN continents AS T2 ON T1.Continent = T2.ContId JOIN car_makers AS T3 ON T1.CountryId = T3.CountryId WHERE T2.Continent = 'europe' GROUP BY T1.CountryName HAVING COUNT(*) >= 3; |
What is the average age of students who have city code "NYC" and have secretary votes for the spring election cycle?
Schema:
- Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
- Voting_record(Election_Cycle, President_Vote, Registration_Date, Secretary_Vote, Vice_President_Vote) | SELECT AVG(T1.Age) AS avg_age FROM Student AS T1 JOIN Voting_record AS T2 ON T1.StuID = Secretary_Vote WHERE T1.city_code = 'NYC' AND T2.Election_Cycle = 'Spring'; |
What is the total likes on tips from Niloofar?
Schema:
- user_(name)
- tip(month, text) | SELECT SUM(T1.likes) AS total_likes FROM user_ AS T2 JOIN tip AS T1 ON T2.user_id = T1.user_id WHERE T2.name = 'Niloofar'; |
Find the name and city of the airport which is the source for the most number of flight routes.?
Schema:
- airports(AirportCode, AirportName, Argent, COUNT, City, Country, city, country, elevation, name)
- routes(...) | SELECT T1.name, T1.city, T2.src_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name, T1.city, T2.src_apid ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
Find the name and checking balance of the account with the lowest savings balance.?
Schema:
- ACCOUNTS(name)
- CHECKING(balance)
- SAVINGS(SAV, balance) | SELECT T1.name, T2.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 T3.balance ASC NULLS LAST LIMIT 1; |
What are the different affiliations, and how many schools with each have an enrollment size of above 20000?
Schema:
- university(Affiliation, Enrollment, Founded, Location, Nickname, Primary_conference, School) | SELECT COUNT(*) AS num_schools, Affiliation FROM university WHERE Enrollment > 20000 GROUP BY Affiliation; |
How many different cities have these stations?
Schema:
- station(Annual_entry_exit, Annual_interchanges, COUNT, Location, MAX, Main_Services, Mounta, Name, Number_of_Platforms, city, id, lat, ... (4 more)) | SELECT COUNT(DISTINCT city) AS num_cities FROM station; |
Find the title of course that is provided by Statistics but not Psychology departments.?
Schema:
- course(COUNT, JO, SUM, Stat, T1, course_id, credits, dept_name, title) | SELECT title FROM course WHERE dept_name = 'Statistics' AND title NOT IN (SELECT title FROM course WHERE dept_name = 'Psychology'); |
What are airlines that have some flight departing from airport 'AHD'?
Schema:
- airlines(Abbreviation, Airline, COUNT, Country, active, country, name)
- flights(DestAirport, FlightNo, SourceAirport) | SELECT T1.Airline FROM airlines AS T1 JOIN flights AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = 'AHD'; |
what is the high point 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 are the names of all of Alice's friends of friends?
Schema:
- PersonFriend(M, friend, name)
- Person(M, age, city, eng, gender, job, name) | SELECT DISTINCT T4.name FROM PersonFriend AS T1 JOIN Person AS T2 ON T1.name = T2.name JOIN PersonFriend AS T3 ON T1.friend = T3.name JOIN PersonFriend AS T4 ON T3.friend = T4.name WHERE T2.name = 'Alice' AND T4.name != 'Alice'; |
Find all the phone numbers.?
Schema:
- Available_Policies(COUNT, Customer_Phone, Life, policy_type_code) | SELECT Customer_Phone FROM Available_Policies; |
Find the committees that have delegates both from from the democratic party and the liberal party.?
Schema:
- election(Committee, Date, Delegate, District, Vote_Percent, Votes)
- party(COUNT, Comptroller, First_year, Governor, Last_year, Left_office, Location, Minister, Number_of_hosts, Party, Party_Theme, Party_name, ... (3 more)) | SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party IN ('Democratic', 'Liberal') GROUP BY T1.Committee HAVING COUNT(DISTINCT T2.Party) = 2; |
What are all the distinct payment types?
Schema:
- Payments(Amount_Payment, COUNT, Date_Payment_Made, Payment_ID, Payment_Method_Code, V, amount_due, amount_paid, payment_date, payment_type_code) | SELECT DISTINCT payment_type_code FROM Payments; |
What are the distinct registration dates and the election cycles?
Schema:
- Voting_record(Election_Cycle, President_Vote, Registration_Date, Secretary_Vote, Vice_President_Vote) | SELECT DISTINCT Registration_Date, Election_Cycle FROM Voting_record; |
Who is the person whose age is below 30?
Schema:
- Person(M, age, city, eng, gender, job, name) | SELECT name FROM Person WHERE age < 30; |
What are all the different product names, and how many complains has each received?
Schema:
- Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more))
- Complaints(complaint_status_code, complaint_type_code) | SELECT T1.product_name, COUNT(*) AS num_complains FROM Products AS T1 JOIN Complaints AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name; |
What are the wines that have prices lower than 50 and have appelations in Monterey county?
Schema:
- appellations(Area, County)
- wine(Appelation, Cases, Grape, M, Name, Price, Score, Winery, Year, Z, w) | SELECT T2.Name FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Monterey' AND T2.Price < 50; |
What is the payment method code and party phone of the party with the email 'enrico09@example.com'?
Schema:
- Parties(party_email, party_phone, payment_method_code) | SELECT payment_method_code, party_phone FROM Parties WHERE party_email = 'enrico09@example.com'; |
How many rooms does each block floor have?
Schema:
- Block(...)
- Room(BlockCode, RoomType, Unavailable) | SELECT COUNT(*) AS num_rooms, T1.BlockFloor FROM Block AS T1 JOIN Room AS T2 ON T1.BlockFloor = T2.BlockFloor AND T1.BlockCode = T2.BlockCode GROUP BY T1.BlockFloor; |
What are the names and cities of the branches that do not have any registered members?
Schema:
- branch(Address_road, City, Name, Open_year, membership_amount)
- membership_register_branch(...) | SELECT Name, City FROM branch WHERE Branch_ID NOT IN (SELECT Branch_ID FROM membership_register_branch); |
sharon goldwater papers?
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'; |
Find the name of the employee who got the highest one time bonus.?
Schema:
- employee(Address, Age, Bdate, City, Fname, Lname, Name, Salary, Sex, eid, name, salary)
- evaluation(Bonus) | SELECT T1.Name FROM employee AS T1 JOIN evaluation AS T2 ON CAST(T1.Employee_ID AS TEXT) = T2.Employee_ID ORDER BY T2.Bonus DESC NULLS LAST LIMIT 1; |
List the codes of all courses that take place in room KLR209.?
Schema:
- CLASS(CLASS_CODE, CLASS_ROOM, CLASS_SECTION, CRS_CODE, PROF_NUM) | SELECT CLASS_CODE FROM CLASS WHERE CLASS_ROOM = 'KLR209'; |
What are the appelations for wines produced after 2008 but not in the Central Coast area?
Schema:
- wine(Appelation, Cases, Grape, M, Name, Price, Score, Winery, Year, Z, w)
- appellations(Area, County) | SELECT Appelation FROM wine WHERE "Year" > 2008 AND Appelation NOT IN (SELECT Appelation FROM appellations WHERE Area = 'Central Coast'); |
List phone number and email address of customer with more than 2000 outstanding balance.?
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 phone_number, email_address FROM Customers WHERE amount_outstanding > 2000; |
what is the population of the state with the highest population density?
Schema:
- state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom) | SELECT population FROM state WHERE density = (SELECT MAX(density) FROM state); |
Which airline has most number of flights?
Schema:
- airlines(Abbreviation, Airline, COUNT, Country, active, country, name)
- flights(DestAirport, FlightNo, SourceAirport) | SELECT T1.Airline FROM airlines AS T1 JOIN flights AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
How many movies are there that are 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 is the average number of bedrooms of all apartments?
Schema:
- Apartments(AVG, COUNT, INT, SUM, TRY_CAST, apt_number, apt_type_code, bathroom_count, bedroom_count, room_count) | SELECT AVG(bedroom_count) AS avg_bedrooms FROM Apartments; |
What is the most popular payment method?
Schema:
- Payments(Amount_Payment, COUNT, Date_Payment_Made, Payment_ID, Payment_Method_Code, V, amount_due, amount_paid, payment_date, payment_type_code) | SELECT Payment_Method_Code FROM Payments WHERE Payment_Method_Code IS NOT NULL GROUP BY Payment_Method_Code ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
What are the different ids and names of the battles that lost any 'Brig' type shipes?
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 DISTINCT T1.id, T1.name FROM battle AS T1 JOIN ship AS T2 ON T1.id = T2.lost_in_battle WHERE T2.ship_type = 'Brig'; |
Find the number of teachers who teach the student called MADLOCK RAY.?
Schema:
- list(COUNT, Classroom, FirstName, Grade, LastName)
- teachers(Classroom, FirstName, LastName) | SELECT COUNT(*) AS num_teachers FROM list AS T1 JOIN teachers AS T2 ON T1.Classroom = T2.Classroom WHERE T1.FirstName = 'MADLOCK' AND T1.LastName = 'RAY'; |
Count the number of employees?
Schema:
- employee(Address, Age, Bdate, City, Fname, Lname, Name, Salary, Sex, eid, name, salary) | SELECT COUNT(*) AS num_employees FROM employee; |
ACL papers with less than 5 citations?
Schema:
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
- cite(...)
- venue(venueId, venueName) | SELECT DISTINCT T3.citingPaperId FROM paper AS T1 JOIN cite AS T3 ON T1.paperId = T3.citedPaperId JOIN venue AS T2 ON T2.venueId = T1.venueId WHERE T2.venueName = 'ACL' GROUP BY T3.citingPaperId HAVING COUNT(DISTINCT T3.citedPaperId) < 5; |
return me the paper with the most citations .?
Schema:
- publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year) | SELECT title FROM publication ORDER BY citation_num DESC NULLS LAST LIMIT 1; |
What are the facility codes of the apartments with more than four bedrooms?
Schema:
- Apartment_Facilities(...)
- Apartments(AVG, COUNT, INT, SUM, TRY_CAST, apt_number, apt_type_code, bathroom_count, bedroom_count, room_count) | SELECT T1.facility_code FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4; |
List the names of entrepreneurs and their companies in descending order of money requested?
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, T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested DESC NULLS LAST; |
Show the delegate and committee information of elections.?
Schema:
- election(Committee, Date, Delegate, District, Vote_Percent, Votes) | SELECT Delegate, Committee FROM election; |
What is the partition id of the user named "Iron Man".?
Schema:
- user_profiles(email, followers, name, partitionid) | SELECT partitionid FROM user_profiles WHERE name = 'Iron Man'; |
How many artworks are there?
Schema:
- artwork(COUNT, Name, Type) | SELECT COUNT(*) AS num_artworks FROM artwork; |
List the maximum, minimum and average number of used kb in screen mode.?
Schema:
- screen_mode(used_kb) | SELECT MAX(used_kb) AS max_used_kb, MIN(used_kb) AS min_used_kb, AVG(used_kb) AS avg_used_kb FROM screen_mode; |
Which apartments have bookings with status code "Confirmed"? Return their apartment numbers.?
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 DISTINCT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = 'Confirmed'; |
Find the number of routes for each source airport and the airport name.?
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; |
Count the number of different affiliation types.?
Schema:
- university(Affiliation, Enrollment, Founded, Location, Nickname, Primary_conference, School) | SELECT COUNT(DISTINCT Affiliation) AS num_affiliations FROM university; |
Find the name of product that is produced by both companies Creative Labs and Sony.?
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 T1.Name FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code WHERE T2.Name = 'Creative Labs' AND EXISTS (SELECT 1 FROM Products AS T3 JOIN Manufacturers AS T4 ON T3.Manufacturer = T4.Code WHERE T3.Name = 'Sony' AND T1.Name = T3.Name); |
What language is predominantly spoken in Aruba?
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.Name = 'Aruba' ORDER BY Percentage DESC NULLS LAST LIMIT 1; |
How many unique labels are there for albums?
Schema:
- Albums(COUNT, Label, Title) | SELECT COUNT(DISTINCT Label) AS num_labels FROM Albums; |
Find the student ID and personal name of the student with at least two enrollments.?
Schema:
- Student_Course_Enrolment(course_id, date_of_completion, date_of_enrolment, student_id)
- Students(cell_mobile_number, current_address_id, date_first_registered, date_left, date_of_latest_logon, email_address, family_name, first_name, last_name, login_name, middle_name, other_student_details, ... (1 more)) | SELECT T1.student_id, T2.personal_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id, T2.personal_name HAVING COUNT(*) >= 2; |
What are the minimum and maximum crime rate of counties?
Schema:
- county_public_safety(COUNT, Case_burden, Crime_rate, Location, Name, Police_force, Police_officers, Population, T1) | SELECT MIN(Crime_rate) AS min_crime_rate, MAX(Crime_rate) AS max_crime_rate FROM county_public_safety; |
Which clubs have one or more members from the city with code "BAL"? Give me the names of the clubs.?
Schema:
- Club(ClubDesc, ClubLocation, ClubName, Enterpr, Gam, Hopk, Tenn)
- Member_of_club(...)
- Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age) | SELECT DISTINCT T1.ClubName FROM Club AS T1 JOIN Member_of_club AS T2 ON T1.ClubID = T2.ClubID JOIN Student AS T3 ON T2.StuID = T3.StuID WHERE T3.city_code = 'BAL'; |
Show all distinct positions of matches.?
Schema:
- match_season(COUNT, College, Draft_Class, Draft_Pick_Number, JO, Player, Position, T1, Team) | SELECT DISTINCT "Position" FROM match_season; |
What are the three largest cities in terms of regional population?
Schema:
- city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) | SELECT City FROM city ORDER BY Regional_Population DESC NULLS LAST LIMIT 3; |
what state has the sparsest population density?
Schema:
- state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom) | SELECT state_name FROM state WHERE density = (SELECT MIN(density) FROM state); |
return me the number of papers on PVLDB after 2000 .?
Schema:
- publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year)
- journal(Theme, homepage, name) | SELECT COUNT(DISTINCT T2.title) AS num_papers FROM publication AS T2 JOIN journal AS T1 ON T2.jid = T1.jid WHERE T1.name = 'PVLDB' AND T2."year" > 2000; |
Find the name and email of the user whose name contains the word ‘Swift’.?
Schema:
- user_profiles(email, followers, name, partitionid) | SELECT name, email FROM user_profiles WHERE name LIKE '%Swift%'; |
How many phones belongs to each accreditation type?
Schema:
- phone(Accreditation_level, Accreditation_type, COUNT, Carrier, Company_name, Hardware_Model_name, Memory_in_G, Name, Spr, chip_model, p1, screen_mode) | SELECT Accreditation_type, COUNT(*) AS num_phones FROM phone GROUP BY Accreditation_type; |
Show the locations that have both performances with more than 2000 attendees and performances with less than 1000 attendees.?
Schema:
- performance(Attendance, COUNT, Date, Location, T1) | SELECT DISTINCT T1.Location FROM performance AS T1 JOIN performance AS T2 ON T1.Location = T2.Location WHERE T1.Attendance > 2000 AND T2.Attendance < 1000; |
What is the maximum, minimum, and average amount of money outsanding for all 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 MAX(amount_outstanding) AS max_amount_outstanding, MIN(amount_outstanding) AS min_amount_outstanding, AVG(amount_outstanding) AS avg_amount_outstanding FROM Customers; |
What are the medicine and trade names that can interact as an inhibitor and activitor with enzymes?
Schema:
- medicine(FDA_approved, Trade_Name, name)
- medicine_enzyme_interaction(interaction_type) | SELECT DISTINCT T1.name, T1.Trade_Name FROM (SELECT T1.name, T1.Trade_Name, T1.id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE T2.interaction_type = 'inhibitor') AS T1 JOIN (SELECT T1.name, T1.Trade_Name, T1.id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE T2.interaction_type = 'activitor') AS T2 ON T1.name = T2.name AND T1.Trade_Name = T2.Trade_Name AND T1.id = T2.id; |
datasets with 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 is the number of graduates in "San Francisco State University" in year 2004?
Schema:
- discipline_enrollments(...)
- Campuses(Campus, County, Franc, Location) | SELECT SUM(T1.Graduate) AS num_graduates FROM discipline_enrollments AS T1 JOIN Campuses AS T2 ON T1.Campus = T2.Id WHERE T1."Year" = 2004 AND T2.Campus = 'San Francisco State University'; |
What are the names of departments that have primarily affiliated physicians.?
Schema:
- Affiliated_With(Department, Physician, PrimaryAffiliation)
- Department(Building, COUNT, DNO, DName, DPhone, DepartmentID, Division, FacID, Head, LName, Room, T2) | SELECT DISTINCT T2.Name FROM Affiliated_With AS T1 JOIN Department AS T2 ON T1.Department = T2.DepartmentID WHERE PrimaryAffiliation = 1; |
What is the location with the most cinemas opened in year 2010 or later?
Schema:
- cinema(COUNT, Capacity, Location, Name, Openning_year, T1, c) | SELECT Location FROM cinema WHERE Openning_year >= 2010 AND Location IS NOT NULL GROUP BY Location ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
Find the number of shops in each location.?
Schema:
- shop(Address, District, INT, Location, Manager_name, Name, Number_products, Open_Year, Score, Shop_ID, Shop_Name, T1, ... (1 more)) | SELECT COUNT(*) AS num_shops, Location FROM shop GROUP BY Location; |
How many games are held after season 2007?
Schema:
- game(Date, Home_team, Season) | SELECT COUNT(*) AS num_games FROM game WHERE Season > 2007; |
How long does track Fast As a Shark has?
Schema:
- tracks(composer, milliseconds, name, unit_price) | SELECT milliseconds FROM tracks WHERE name = 'Fast As a Shark'; |
Find all Bars in " Los Angeles " with at least 30 reviews and average rating above 3 stars?
Schema:
- category(...)
- business(business_id, city, full_address, name, rating, review_count, state) | SELECT T1.name FROM category AS T2 JOIN business AS T1 ON T2.business_id = T1.business_id WHERE T1.city = 'Los Angeles' AND T1.rating > 3 AND T1.review_count > 30 AND T2.category_name = 'Bars'; |
Return the names of people, ordered alphabetically.?
Schema:
- people(Age, Birth_Date, Birth_Place, COUNT, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more)) | SELECT Name FROM people ORDER BY Name ASC NULLS LAST; |
Find the name of the students who have more than one advisor?
Schema:
- student(COUNT, H, dept_name, name, tot_cred)
- advisor(s_ID) | SELECT T1.name FROM student AS T1 JOIN advisor AS T2 ON T1.ID = T2.s_ID GROUP BY T2.s_ID, T1.name HAVING COUNT(*) > 1; |
What are the names of all races that occurred after 12:00:00 or before 09:00:00?
Schema:
- races(date, name) | SELECT name FROM races WHERE "time" > '12:00:00' OR "time" < '09:00:00'; |
What are the names of tourist attractions that can be reached by bus or is at address 254 Ottilie Junction?
Schema:
- Locations(Address, Location_Name, Other_Details)
- 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 T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = '254 Ottilie Junction' OR T2.How_to_Get_There = 'bus'; |
How many transaction does account with name 337 have?
Schema:
- Financial_Transactions(COUNT, F, SUM, account_id, invoice_number, transaction_amount, transaction_id, transaction_type)
- Accounts(Account_Details, Account_ID, Statement_ID, account_id, account_name, customer_id, date_account_opened, other_account_details) | SELECT COUNT(*) AS num_transactions FROM Financial_Transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id WHERE T2.account_name = '337'; |
How many artists are above age 46 and joined after 1990?
Schema:
- artist(Age, Artist, Country, Famous_Release_date, Famous_Title, Year_Join, artist_name, country, gender) | SELECT COUNT(*) AS num_artists FROM artist WHERE Age > 46 AND Year_Join > 1990; |
What are the names of all genres in alphabetical order, combined with its ratings?
Schema:
- genre(g_name, rating) | SELECT g_name, rating FROM genre ORDER BY g_name ASC NULLS LAST; |
how many degrees were conferred between 1998 and 2002?
Schema:
- Campuses(Campus, County, Franc, Location)
- degrees(Campus, Degrees, SUM, Year) | SELECT T1.Campus, SUM(T2.Degrees) AS num_degrees FROM Campuses AS T1 JOIN degrees AS T2 ON T1.Id = T2.Campus WHERE T2."Year" >= 1998 AND T2."Year" <= 2002 GROUP BY T1.Campus; |
What are the ids and locations of all circuits in France or Belgium?
Schema:
- circuits(circuitId, country, location, name) | SELECT circuitId, location FROM circuits WHERE country = 'France' OR country = 'Belgium'; |
which river traverses most states?
Schema:
- river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse) | SELECT river_name FROM river GROUP BY (river_name) ORDER BY COUNT(DISTINCT traverse) DESC NULLS LAST LIMIT 1; |
What is the name of customers who do not use Cash as payment method.?
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_name FROM Customers WHERE payment_method != 'Cash'; |
What are the birth year and citizenship of singers?
Schema:
- singer(Age, Birth_Year, COUNT, Citizenship, Country, Name, Net_Worth_Millions, Song_Name, Song_release_year, T1, s) | SELECT Birth_Year, Citizenship FROM singer; |
Return the the details of all products.?
Schema:
- Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more)) | SELECT DISTINCT product_details FROM Products; |
What is the description for the CIS-220 and how many credits does it have?
Schema:
- COURSE(C, CRS_CODE, CRS_CREDIT, CRS_DESCRIPTION, DEPT_CODE) | SELECT CRS_CREDIT, CRS_DESCRIPTION FROM COURSE WHERE CRS_CODE = 'CIS-220'; |
How many sections does each course have?
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 performances are there?
Schema:
- performance(Attendance, COUNT, Date, Location, T1) | SELECT COUNT(*) AS num_performances FROM performance; |
How many orders have detail "Second time"?
Schema:
- Customer_Orders(customer_id, order_date, order_id, order_shipping_charges) | SELECT COUNT(*) AS num_orders FROM Customer_Orders WHERE order_details = 'Second time'; |
what are the states that the ohio run through?
Schema:
- river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse) | SELECT traverse FROM river WHERE river_name = 'ohio'; |
What is Astrid Gruber's email and phone number?
Schema:
- customers(Mart, city, company, country, email, first_name, last_name, phone, state) | SELECT email, phone FROM customers WHERE first_name = 'Astrid' AND last_name = 'Gruber'; |
How many campuses exist are in the county of LA?
Schema:
- Campuses(Campus, County, Franc, Location) | SELECT COUNT(*) AS num_campuses FROM Campuses WHERE County = 'Los Angeles'; |
What are the first and last names of all customers with between 1000 and 3000 dollars outstanding?
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 first_name, last_name FROM Customers WHERE amount_outstanding BETWEEN 1000 AND 3000; |
people in boulder?
Schema:
- city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) | SELECT population FROM city WHERE city_name = 'boulder'; |
Show the names of authors from college "Florida" or "Temple"?
Schema:
- submission(Author, COUNT, College, Scores) | SELECT Author FROM submission WHERE College = 'Florida' OR College = 'Temple'; |
Find the movie which is classified in the most number of genres?
Schema:
- genre(g_name, rating)
- classification(...)
- movie(Budget_million, Director, Find, Gross_worldwide, T1, Title, Year, budget, release_year, title) | SELECT T3.title FROM genre AS T2 JOIN classification AS T1 ON T2.gid = T1.gid JOIN movie AS T3 ON T3.mid = T1.msid GROUP BY T3.title ORDER BY COUNT(DISTINCT T2.genre) DESC NULLS LAST LIMIT 1; |
what state is salem the capital of?
Schema:
- state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom) | SELECT state_name FROM state WHERE capital = 'salem'; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.