question stringlengths 43 589 | query stringlengths 19 598 |
|---|---|
What is the most cited paper of ohad shamir ?
Schema:
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
- cite(...)
- writes(...)
- author(...) | SELECT DISTINCT T4.citedPaperId, COUNT(T4.citedPaperId) AS num_citations FROM paper AS T3 JOIN cite AS T4 ON T3.paperId = T4.citedPaperId JOIN writes AS T2 ON T2.paperId = T3.paperId JOIN author AS T1 ON T2.authorId = T1.authorId WHERE T1.authorName = 'ohad shamir' GROUP BY T4.citedPaperId ORDER BY num_citations DESC NULLS LAST; |
Who is performing in the back stage position for the song "Der Kapitan"? Show the first name and last name.?
Schema:
- Performance(...)
- Band(...)
- Songs(Title) | SELECT T2.Firstname, T2.Lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.Bandmate = T2.Id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = 'Der Kapitan' AND T1.StagePosition = 'back'; |
List the name and cost of all procedures sorted by the cost from the highest to the lowest.?
Schema:
- Procedures(Cost, Name) | SELECT Name, Cost FROM Procedures ORDER BY Cost DESC NULLS LAST; |
What is the name of the game that has been played the most?
Schema:
- Plays_Games(GameID, Hours_Played, StuID)
- Video_Games(COUNT, Dest, GName, GType, onl) | SELECT GName FROM Plays_Games AS T1 JOIN Video_Games AS T2 ON T1.GameID = T2.GameID GROUP BY T1.GameID, GName ORDER BY SUM(Hours_Played) DESC NULLS LAST LIMIT 1; |
Show the names of customers who have both an order in completed status and an order in part status.?
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) | SELECT T1.customer_name FROM Customers AS T1 WHERE EXISTS (SELECT 1 FROM Customer_Orders AS T2 WHERE T1.customer_id = T2.customer_id AND T2.order_status_code = 'Completed') AND EXISTS (SELECT 1 FROM Customer_Orders AS T2 WHERE T1.customer_id = T2.customer_id AND T2.order_status_code = 'Part'); |
What is the total number of deaths and damage for all storms with a max speed greater than the average?
Schema:
- storm(Damage_millions_USD, Dates_active, Name, Number_Deaths) | SELECT SUM(Number_Deaths) AS num_deaths, SUM(Damage_millions_USD) AS total_damage FROM storm WHERE Max_speed > (SELECT AVG(Max_speed) FROM storm); |
For each bed type, find the average base price of different bed type.?
Schema:
- Rooms(K, RoomId, basePrice, bedType, beds, decor, maxOccupancy, roomName) | SELECT bedType, AVG(basePrice) AS avg_base_price FROM Rooms GROUP BY bedType; |
Find the details of the shops that can be reached by walk.?
Schema:
- Shops(...)
- 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 T1.Shop_Details FROM Shops AS T1 JOIN Tourist_Attractions AS T2 ON T1.Shop_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = 'walk'; |
How many accounts have a savings balance above the average savings balance?
Schema:
- SAVINGS(SAV, balance) | SELECT COUNT(*) AS num_accounts FROM SAVINGS WHERE balance > (SELECT AVG(balance) FROM SAVINGS); |
List the names of all distinct wines that are made of red color grape.?
Schema:
- grapes(...)
- wine(Appelation, Cases, Grape, M, Name, Price, Score, Winery, Year, Z, w) | SELECT DISTINCT T2.Name FROM grapes AS T1 JOIN wine AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'Red'; |
What are the names of all customers, ordered by account balance?
Schema:
- customer(COUNT, T1, acc_bal, acc_type, active, check, credit_score, cust_name, no_of_loans, sav, state, store_id) | SELECT cust_name FROM customer ORDER BY acc_bal ASC NULLS LAST; |
What is the name of the perpetrator with the biggest weight.?
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 T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Weight DESC NULLS LAST LIMIT 1; |
What is the first and last name of the faculty members who participated in at least one activity? For each of them, also show the number of activities they participated in.?
Schema:
- Faculty(Building, COUNT, FacID, Fname, LName, Lname, Phone, Pr, Rank, Room, Sex)
- Faculty_Participates_in(FacID) | SELECT T1.Fname, T1.Lname, COUNT(*) AS num_activities, T1.FacID FROM Faculty AS T1 JOIN Faculty_Participates_in AS T2 ON T1.FacID = T2.FacID GROUP BY T1.FacID, T1.Fname, T1.Lname; |
Count the total number of games the team Boston Red Stockings attended from 1990 to 2000.?
Schema:
- home_game(attendance, year)
- team(Name) | SELECT SUM(T1.games) AS num_games FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1."year" BETWEEN 1990 AND 2000; |
Show distinct first and last names for all customers with an account.?
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))
- Accounts(Account_Details, Account_ID, Statement_ID, account_id, account_name, customer_id, date_account_opened, other_account_details) | SELECT DISTINCT T1.customer_first_name, T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id; |
Show total hours per week and number of games played for student David Shieber.?
Schema:
- SportsInfo(COUNT, GamesPlayed, OnScholarship, SportName, StuID)
- Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age) | SELECT SUM(HoursPerWeek) AS total_hours_per_week, SUM(GamesPlayed) AS num_games_played FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.Fname = 'David' AND T2.LName = 'Shieber'; |
What are the names of all the media types?
Schema:
- media_types(name) | SELECT name FROM media_types; |
springfield is in what state?
Schema:
- city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) | SELECT state_name FROM city WHERE city_name = 'springfield'; |
How many classes exist for each school?
Schema:
- CLASS(CLASS_CODE, CLASS_ROOM, CLASS_SECTION, CRS_CODE, PROF_NUM)
- COURSE(C, CRS_CODE, CRS_CREDIT, CRS_DESCRIPTION, DEPT_CODE)
- DEPARTMENT(Account, DEPT_ADDRESS, DEPT_NAME, H, SCHOOL_CODE) | SELECT COUNT(*) AS num_classes, T3.SCHOOL_CODE FROM CLASS AS T1 JOIN COURSE AS T2 ON T1.CRS_CODE = T2.CRS_CODE JOIN DEPARTMENT AS T3 ON T2.DEPT_CODE = T3.DEPT_CODE GROUP BY T3.SCHOOL_CODE; |
What are the names of people in ascending order of weight?
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 Weight ASC NULLS LAST; |
Count the number of conductors.?
Schema:
- conductor(Age, Name, Nationality, Year_of_Work) | SELECT COUNT(*) AS num_conductors FROM conductor; |
What is the first and last name of all employees who live in the city Damianfort?
Schema:
- Addresses(address_content, city, country, line_1, line_1_number_building, line_2, state_province_county, town_city, zip_postcode)
- 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.first_name, T2.last_name FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T1.city = 'Damianfort'; |
What are the names of studios that have made two or more films?
Schema:
- film(COUNT, Directed_by, Director, Gross_in_dollar, JO, LENGTH, Studio, T1, Title, language_id, rating, rental_rate, ... (3 more)) | SELECT Studio FROM film WHERE Studio IS NOT NULL GROUP BY Studio HAVING COUNT(*) >= 2; |
Count the number of budgets in year 2001 or before whose budgeted amount is greater than 3000?
Schema:
- budget(Budgeted) | SELECT COUNT(*) AS num_budgets FROM budget WHERE Budgeted > 3000 AND "Year" <= 2001; |
What other details can you tell me about students in reverse alphabetical order?
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 other_student_details FROM Students ORDER BY other_student_details DESC NULLS LAST; |
what is the highest point in the states bordering colorado?
Schema:
- highlow(M, highest_elevation, highest_point, lowest_elevation, lowest_point, state_name)
- border_info(T1, border, state_name) | SELECT highest_point FROM highlow WHERE state_name IN (SELECT border FROM border_info WHERE state_name = 'colorado') ORDER BY highest_elevation DESC NULLS LAST LIMIT 1; |
Show names of musicals which have at least three actors.?
Schema:
- actor(Afghan, Aust, COUNT, Character, Chr, Duration, Kev, Name, age, birth_city, birth_year, first_name, ... (4 more))
- musical(Award, COUNT, Name, Nom, Nominee, Result, T1) | SELECT T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID, T2.Name HAVING COUNT(*) >= 3; |
What is the phone number and postal code of the address 1031 Daugavpils Parkway?
Schema:
- address(address, district, phone, postal_code) | SELECT phone, postal_code FROM address WHERE address = '1031 Daugavpils Parkway'; |
What are the codes of countries with more than 50 players?
Schema:
- players(COUNT, birth_date, country_code, first_name, hand, last_name) | SELECT country_code FROM players WHERE country_code IS NOT NULL GROUP BY country_code HAVING COUNT(*) > 50; |
Find the name and training hours of players whose hours are below 1500.?
Schema:
- Player(HS, pName, weight, yCard) | SELECT pName, HS FROM Player WHERE HS < 1500; |
Advisor 1121 has how many students?
Schema:
- Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age) | SELECT COUNT(*) AS num_students FROM Student WHERE Advisor = 1121; |
What are the numbers of wines for different grapes?
Schema:
- wine(Appelation, Cases, Grape, M, Name, Price, Score, Winery, Year, Z, w) | SELECT COUNT(*) AS num_wines, Grape FROM wine GROUP BY Grape; |
What are the maximum and minimum number of silver medals for clubs.?
Schema:
- club_rank(Gold, Silver, Total) | SELECT MAX(Silver) AS max_silver, MIN(Silver) AS min_silver FROM club_rank; |
What are the id of songs whose format is mp3.?
Schema:
- files(COUNT, duration, f_id, formats) | SELECT f_id FROM files WHERE formats = 'mp3'; |
Which buildings do not have any company office? Give me the building names.?
Schema:
- buildings(Height, Status, Stories, name)
- Office_locations(...) | SELECT name FROM buildings WHERE id NOT IN (SELECT building_id FROM Office_locations); |
What region is Kabul in?
Schema:
- country(Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, M, Name, Official_native_language, ... (4 more))
- city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) | SELECT Region FROM country AS T1 JOIN city AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = 'Kabul'; |
What are the average prices of products, grouped by manufacturer name?
Schema:
- Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more))
- Manufacturers(Aust, Beij, Founder, Headquarter, I, M, Name, Revenue) | SELECT AVG(T1.Price) AS avg_price, T2.Name FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name; |
What information is there on albums from 2010?
Schema:
- Albums(COUNT, Label, Title) | SELECT * FROM Albums WHERE "Year" = 2010; |
What is the investor that has invested in the most number of entrepreneurs?
Schema:
- entrepreneur(COUNT, Company, Investor, Money_Requested) | SELECT Investor FROM entrepreneur WHERE Investor IS NOT NULL GROUP BY Investor ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
Find the list of cities that no customer is living in.?
Schema:
- Addresses(address_content, city, country, line_1, line_1_number_building, line_2, state_province_county, town_city, zip_postcode)
- 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) | SELECT city FROM Addresses WHERE city NOT IN (SELECT DISTINCT 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); |
Find the last names of faculties in building Barton in alphabetic order.?
Schema:
- Faculty(Building, COUNT, FacID, Fname, LName, Lname, Phone, Pr, Rank, Room, Sex) | SELECT LName FROM Faculty WHERE Building = 'Barton' ORDER BY LName ASC NULLS LAST; |
What is the average number of hours spent practicing for students who got rejected?
Schema:
- Player(HS, pName, weight, yCard)
- Tryout(COUNT, EX, T1, cName, decision, pPos) | SELECT AVG(T1.HS) AS avg_hours_spent FROM Player AS T1 JOIN Tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'no'; |
Show all the buildings along with the number of faculty members the buildings have.?
Schema:
- Faculty(Building, COUNT, FacID, Fname, LName, Lname, Phone, Pr, Rank, Room, Sex) | SELECT Building, COUNT(*) AS num_faculty FROM Faculty GROUP BY Building; |
What is the minimum, mean, and maximum age across all students?
Schema:
- Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age) | SELECT MIN(Age) AS min_age, AVG(Age) AS avg_age, MAX(Age) AS max_age FROM Student; |
Find the id and location of circuits that belong to France or Belgium?
Schema:
- circuits(circuitId, country, location, name) | SELECT circuitId, location FROM circuits WHERE country = 'France' OR country = 'Belgium'; |
Show the member name and hometown who registered a branch in 2016.?
Schema:
- membership_register_branch(...)
- member_(Address, Age, COUNT, Card_Number, Country, Hometown, Level, Member_ID, Member_Name, Membership_card, Name, Party_ID, ... (1 more)) | SELECT T2.Name, T2.Hometown FROM membership_register_branch AS T1 JOIN member_ AS T2 ON T1.Member_ID = T2.Member_ID WHERE T1.Register_Year = 2016; |
which states do ohio river flow through?
Schema:
- river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse) | SELECT traverse FROM river WHERE river_name = 'ohio'; |
How many counties correspond to each police force?
Schema:
- county_public_safety(COUNT, Case_burden, Crime_rate, Location, Name, Police_force, Police_officers, Population, T1) | SELECT Police_force, COUNT(*) AS num_counties FROM county_public_safety GROUP BY Police_force; |
What are the names of the states where at least 3 heads were born?
Schema:
- head(age, born_state, head_ID, name) | SELECT born_state FROM head WHERE born_state IS NOT NULL GROUP BY born_state HAVING COUNT(*) >= 3; |
How many times did Boston Red Stockings lose in 2009 postseason?
Schema:
- postseason(ties)
- team(Name) | SELECT COUNT(*) AS num_losses FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1."year" = 2009; |
What is the project id and detail for the project with at least two documents?
Schema:
- Projects(COUNT, Hours, Name, Project_Details, Project_ID, organ, organisation_id, project_details)
- Documents(COUNT, Document_Description, Document_ID, Document_Name, Document_Type_Code, I, K, Project_ID, Robb, Template_ID, access_count, document_id, ... (7 more)) | SELECT T1.Project_ID, T1.Project_Details FROM Projects AS T1 JOIN Documents AS T2 ON T1.Project_ID = T2.Project_ID GROUP BY T1.Project_ID, T1.Project_Details HAVING COUNT(*) > 2; |
Which city has most number of arriving flights?
Schema:
- airports(AirportCode, AirportName, Argent, COUNT, City, Country, city, country, elevation, name)
- flights(DestAirport, FlightNo, SourceAirport) | SELECT T1.City FROM airports AS T1 JOIN flights AS T2 ON T1.AirportCode = T2.DestAirport GROUP BY T1.City ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
For each denomination, return the denomination and the count of schools with that denomination.?
Schema:
- school(Denom, Denomination, EX, Enrollment, Founded, Location, School_Colors, T1, Type) | SELECT Denomination, COUNT(*) AS num_schools FROM school GROUP BY Denomination; |
What is the age of the doctor named Zach?
Schema:
- Person(M, age, city, eng, gender, job, name) | SELECT age FROM Person WHERE job = 'doctor' AND name = 'Zach'; |
List all characteristics of product named "sesame" with type code "Grade".?
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 WHERE T1.product_name = 'sesame' AND T3.characteristic_type_code = 'Grade'; |
What is the total revenue of each manufacturer?
Schema:
- Manufacturers(Aust, Beij, Founder, Headquarter, I, M, Name, Revenue) | SELECT SUM(Revenue) AS total_revenue, Name FROM Manufacturers GROUP BY Name; |
What are the names of people who are shorter than average?
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 WHERE Height < (SELECT AVG(Height) FROM people); |
How many faculty members participate in an activity?
Schema:
- Faculty_Participates_in(FacID) | SELECT COUNT(DISTINCT FacID) AS num_faculty FROM Faculty_Participates_in; |
What are the names, checking balances, and savings balances for all customers?
Schema:
- ACCOUNTS(name)
- CHECKING(balance)
- SAVINGS(SAV, balance) | SELECT T2.balance AS checking_balance, T3.balance AS savings_balance, T1.name FROM ACCOUNTS AS T1 JOIN CHECKING AS T2 ON T1.custid = T2.custid JOIN SAVINGS AS T3 ON T1.custid = T3.custid; |
Return the names of poker players sorted by their earnings descending.?
Schema:
- people(Age, Birth_Date, Birth_Place, COUNT, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more))
- poker_player(Best_Finish, Earnings, Final_Table_Made, Money_Rank) | SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Earnings DESC NULLS LAST; |
Return the weight of the shortest person.?
Schema:
- people(Age, Birth_Date, Birth_Place, COUNT, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more)) | SELECT Weight FROM people ORDER BY Height ASC NULLS LAST LIMIT 1; |
Find the team names of the universities whose enrollments are smaller than the average enrollment size.?
Schema:
- university(Affiliation, Enrollment, Founded, Location, Nickname, Primary_conference, School)
- basketball_match(ACC_Percent, All_Home, School_ID, Team_Name) | SELECT T2.Team_Name FROM university AS T1 JOIN basketball_match AS T2 ON T1.School_ID = T2.School_ID WHERE Enrollment < (SELECT AVG(Enrollment) FROM university); |
Where did li dong publish in 2016 ?
Schema:
- writes(...)
- author(...)
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) | SELECT DISTINCT T3.venueId 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 = 'li dong' AND T3."year" = 2016; |
Count the number of different teams involved in match season.?
Schema:
- match_season(COUNT, College, Draft_Class, Draft_Pick_Number, JO, Player, Position, T1, Team) | SELECT COUNT(DISTINCT Team) AS num_teams FROM match_season; |
What is the total number of companies?
Schema:
- company(Bank, COUNT, Company, Headquarters, Industry, JO, Main_Industry, Market_Value, Name, Profits_in_Billion, Rank, Retail, ... (4 more)) | SELECT COUNT(*) AS num_companies FROM company; |
Find all procedures which cost more than 1000 or which physician John Wen was trained in.?
Schema:
- Procedures(Cost, Name)
- Physician(I, Name)
- Trained_In(...) | SELECT DISTINCT Name FROM (SELECT Name FROM Procedures WHERE Cost > 1000 UNION ALL SELECT T3.Name FROM Physician AS T1 JOIN Trained_In AS T2 ON T1.EmployeeID = T2.Physician JOIN Procedures AS T3 ON T3.Code = T2.Treatment WHERE T1.Name = 'John Wen'); |
What is the largest amount of horsepower for the models with 3 cylinders and what make is it?
Schema:
- car_names(COUNT, Model)
- cars_data(Accelerate, Cylinders, Horsepower, MPG, T1, Weight, Year) | SELECT T2.Horsepower, T1.Make FROM car_names AS T1 JOIN cars_data AS T2 ON T1.MakeId = T2.Id WHERE T2.Cylinders = 3 ORDER BY T2.Horsepower DESC NULLS LAST LIMIT 1; |
Show the average price range of hotels that have 5 star ratings and allow pets.?
Schema:
- Hotels(hotel_id, other_hotel_details, pets_allowed_yn, price_range, star_rating_code) | SELECT AVG(price_range) AS avg_price_range FROM Hotels WHERE star_rating_code = '5' AND pets_allowed_yn = '1'; |
What is the most popular paper this year in CVPR ?
Schema:
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
- cite(...)
- venue(venueId, venueName) | SELECT DISTINCT T3.citedPaperId, COUNT(T3.citingPaperId) AS num_citations FROM paper AS T1 JOIN cite AS T3 ON T1.paperId = T3.citedPaperId JOIN venue AS T2 ON T2.venueId = T1.venueId WHERE T1."year" = 2016 AND T2.venueName = 'CVPR' GROUP BY T3.citedPaperId ORDER BY num_citations DESC NULLS LAST; |
How many different industries are the companies in?
Schema:
- Companies(Assets_billion, Bank, COUNT, Ch, Headquarters, Industry, Market_Value_billion, Profits_billion, Sales_billion, T1, name) | SELECT COUNT(DISTINCT Industry) AS num_industries FROM Companies; |
How many teachers are there?
Schema:
- teacher(Age, COUNT, D, Hometown, Name) | SELECT COUNT(*) AS num_teachers FROM teacher; |
Tell me the the claim date and settlement date for each settlement case.?
Schema:
- Settlements(Amount_Settled, Date_Claim_Made, Date_Claim_Settled, Settlement_Amount) | SELECT Date_Claim_Made, Date_Claim_Settled FROM Settlements; |
Find the average ranking for each player and their first name.?
Schema:
- players(COUNT, birth_date, country_code, first_name, hand, last_name)
- rankings(ranking_date, tours) | SELECT AVG(ranking) AS avg_ranking, T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id = T2.player_id GROUP BY T1.player_id, T1.first_name; |
For each account type, find the average account balance of customers with credit score lower than 50.?
Schema:
- customer(COUNT, T1, acc_bal, acc_type, active, check, credit_score, cust_name, no_of_loans, sav, state, store_id) | SELECT AVG(acc_bal) AS avg_balance, acc_type FROM customer WHERE credit_score < 50 GROUP BY acc_type; |
Show the name of track with most number of races.?
Schema:
- race(Class, Date, Name)
- track(Location, Name, Seat, Seating, T1, Year_Opened) | SELECT T2.Name FROM race AS T1 JOIN track AS T2 ON T1.Track_ID = CAST(T2.Track_ID AS TEXT) GROUP BY T1.Track_ID, T2.Name ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1; |
Which faculty do not participate in any activity? Find their faculty ids.?
Schema:
- Faculty(Building, COUNT, FacID, Fname, LName, Lname, Phone, Pr, Rank, Room, Sex)
- Faculty_Participates_in(FacID) | SELECT FacID FROM Faculty WHERE FacID NOT IN (SELECT FacID FROM Faculty_Participates_in); |
For each party, find its location and the name of its host. Sort the result in ascending order of the age of the host.?
Schema:
- party_host(...)
- host(Age, COUNT, Name, Nationality)
- party(COUNT, Comptroller, First_year, Governor, Last_year, Left_office, Location, Minister, Number_of_hosts, Party, Party_Theme, Party_name, ... (3 more)) | SELECT T3.Location, 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 ORDER BY T2.Age ASC NULLS LAST; |
List the names of the top 5 oldest people.?
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 Age DESC NULLS LAST LIMIT 5; |
Return the name of the youngest captain.?
Schema:
- captain(COUNT, Class, INT, Name, Rank, TRY_CAST, age, capta, l) | SELECT Name FROM captain ORDER BY age ASC NULLS LAST LIMIT 1; |
what state bordering oklahoma has the largest population?
Schema:
- state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom)
- border_info(T1, border, state_name) | SELECT state_name FROM state WHERE state_name IN (SELECT border FROM border_info WHERE state_name = 'oklahoma') ORDER BY population DESC NULLS LAST LIMIT 1; |
Which parties have delegates in both the "Appropriations" committee and the "Economic Matters" committee?
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 T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee IN ('Appropriations', 'Economic Matters') GROUP BY T2.Party HAVING COUNT(DISTINCT T1.Committee) = 2; |
What are the names and scores of wines that are made of white color grapes?
Schema:
- grapes(...)
- wine(Appelation, Cases, Grape, M, Name, Price, Score, Winery, Year, Z, w) | SELECT T2.Name, T2.Score FROM grapes AS T1 JOIN wine AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'White'; |
What is the average price of the products for each category?
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, product_category_code FROM Products GROUP BY product_category_code; |
List the name of the pilots who have flied for both a company that mainly provide 'Cargo' services and a company that runs 'Catering services' activities.?
Schema:
- operate_company(Group_Equity_Shareholding, Type)
- flight(Altitude, COUNT, Date, Pilot, Vehicle_Flight_number, Velocity, arrival_date, departure_date, destination, distance, flno, origin, ... (1 more)) | SELECT T2.Pilot FROM operate_company AS T1 JOIN flight AS T2 ON T1.id = T2.company_id WHERE T1.Principal_activities = 'Cargo' AND T2.Pilot IN (SELECT T2.Pilot FROM operate_company AS T1 JOIN flight AS T2 ON T1.id = T2.company_id WHERE T1.Principal_activities = 'Catering services'); |
What is the name of school that has the smallest enrollment in each state?
Schema:
- College(M, cName, enr, state) | SELECT cName, state, MIN(enr) AS min_enr FROM College GROUP BY state, cName; |
Who is the director of the movie " James Bond " ?
Schema:
- director(Afghan, name, nationality)
- directed_by(...)
- movie(Budget_million, Director, Find, Gross_worldwide, T1, Title, Year, budget, release_year, title) | SELECT T2.name FROM director AS T2 JOIN directed_by AS T1 ON T2.did = T1.did JOIN movie AS T3 ON T3.mid = T1.msid WHERE T3.title = 'James Bond'; |
How many players played each position?
Schema:
- match_season(COUNT, College, Draft_Class, Draft_Pick_Number, JO, Player, Position, T1, Team) | SELECT "Position", COUNT(*) AS num_players FROM match_season GROUP BY "Position"; |
What are the names of wines made from red grapes and with prices above 50?
Schema:
- grapes(...)
- wine(Appelation, Cases, Grape, M, Name, Price, Score, Winery, Year, Z, w) | SELECT T2.Name FROM grapes AS T1 JOIN wine AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'Red' AND T2.Price > 50; |
what year had the most NIPS papers ?
Schema:
- venue(venueId, venueName)
- paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) | SELECT DISTINCT COUNT(T1.paperId) AS num_papers, T1."year" FROM venue AS T2 JOIN paper AS T1 ON T2.venueId = T1.venueId WHERE T2.venueName = 'NIPS' GROUP BY T1."year" ORDER BY num_papers DESC NULLS LAST; |
What are the names of courses with 1 credit?
Schema:
- Course(CName, Credits, Days) | SELECT CName FROM Course WHERE Credits = 1; |
Find all the campuses opened in 1958.?
Schema:
- Campuses(Campus, County, Franc, Location) | SELECT Campus FROM Campuses WHERE "Year" = 1958; |
What are the distinct names of wines with prices higher than any wine from John Anthony winery.?
Schema:
- wine(Appelation, Cases, Grape, M, Name, Price, Score, Winery, Year, Z, w) | SELECT DISTINCT Name FROM wine WHERE Price > (SELECT MIN(Price) FROM wine WHERE Winery = 'John Anthony'); |
Show the name and theme for all concerts and the number of singers in each concert.?
Schema:
- singer_in_concert(...)
- concert(COUNT, Year) | SELECT T2.concert_Name, T2.Theme, COUNT(*) AS num_singers FROM singer_in_concert AS T1 JOIN concert AS T2 ON T1.concert_ID = T2.concert_ID GROUP BY T2.concert_ID, T2.concert_Name, T2.Theme; |
Show names of shops and the carriers of devices they have in stock.?
Schema:
- stock(Quantity)
- device(COUNT, Carrier, Software_Platform)
- shop(Address, District, INT, Location, Manager_name, Name, Number_products, Open_Year, Score, Shop_ID, Shop_Name, T1, ... (1 more)) | SELECT T3.Shop_Name, T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID; |
Find the id and name of the most expensive base price room.?
Schema:
- Rooms(K, RoomId, basePrice, bedType, beds, decor, maxOccupancy, roomName) | SELECT RoomId, roomName FROM Rooms ORDER BY basePrice DESC NULLS LAST LIMIT 1; |
For students who have pets , how many pets does each student have ? list their ids instead of names .?
Schema:
- Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
- Has_Pet(...) | SELECT COUNT(*) AS num_pets, T1.StuID FROM Student AS T1 JOIN Has_Pet AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID; |
What are the names of entrepreneurs and their corresponding investors, ordered descending by the amount 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 names and genders of players with a coach starting after 2011.?
Schema:
- player_coach(...)
- coach(...)
- player(Age, COUNT, Gender, Occupation, Player, Player_name, Po, Points, Position, Residence, Sponsor_name, T1, ... (12 more)) | SELECT T3.Player_name, T3.Gender FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID WHERE T1.Starting_year > 2011; |
How much money did Lucas Mancini spend?
Schema:
- customers(Mart, city, company, country, email, first_name, last_name, phone, state)
- invoices(billing_city, billing_country, billing_state, total) | SELECT SUM(T2.total) AS total_money FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = 'Lucas' AND T1.last_name = 'Mancini'; |
What are the first and last names of the instructors who teach the top 3 number of courses?
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 GROUP BY T1.Instructor, T2.Fname, T2.LName ORDER BY COUNT(*) DESC NULLS LAST LIMIT 3; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.