question
stringlengths
43
589
query
stringlengths
19
598
What are the id of each employee and the number of document destroyed by that employee? Schema: - Documents_to_be_Destroyed(Destroyed_by_Employee_ID, Destruction_Authorised_by_Employee_ID)
SELECT Destroyed_by_Employee_ID, COUNT(*) AS num_documents FROM Documents_to_be_Destroyed GROUP BY Destroyed_by_Employee_ID;
what are some good places for arabic in mountain view ? Schema: - restaurant(...) - location(...)
SELECT T2.house_number, T1.name FROM restaurant AS T1 JOIN location AS T2 ON T1.id = T2.restaurant_id WHERE T2.city_name = 'mountain view' AND T1.food_type = 'arabic' AND T1.rating > 2.5;
What are the titles and directors of all movies that have a rating higher than the average James Cameron film rating? Schema: - Rating(Rat, mID, rID, stars) - Movie(T1, director, title, year)
SELECT T2.title, T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars > (SELECT AVG(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.director = 'James Cameron');
What are the phones and emails of workshop groups in which services are performed? Schema: - Drama_Workshop_Groups(COUNT, Currency_Code, Marketing_Region_Code, Store_Name) - Services(Service_Type_Code, Service_name)
SELECT T1.Store_Phone, T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID;
How many cartoons did each director create? Schema: - Cartoon(Channel, Directed_by, Original_air_date, Production_code, Title, Written_by)
SELECT COUNT(*) AS num_cartoons, Directed_by FROM Cartoon GROUP BY Directed_by;
Who performed the song named "Le Pop"? 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 = 'Le Pop';
List the names of states that have more than 2 parks.? Schema: - park(city, state)
SELECT state FROM park WHERE state IS NOT NULL GROUP BY state HAVING COUNT(*) > 2;
Who has published more papers in chi ? Schema: - venue(venueId, venueName) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...)
SELECT DISTINCT COUNT(DISTINCT 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 T3.venueName = 'chi' GROUP BY T1.authorId ORDER BY num_papers DESC NULLS LAST;
Count the number of tests with "Fail" result.? Schema: - Student_Tests_Taken(date_test_taken, test_result)
SELECT COUNT(*) AS num_tests FROM Student_Tests_Taken WHERE test_result = 'Fail';
Find the number of employees whose title is IT Staff from each city? Schema: - employees(COMMISSION_PCT, DEPARTMENT_ID, EMAIL, EMPLOYEE_ID, FIRST_NAME, HIRE_DATE, JOB_ID, LAST_NAME, M, MANAGER_ID, PHONE_NUMBER, SALARY, ... (12 more))
SELECT COUNT(*) AS num_employees, city FROM employees WHERE title = 'IT Staff' GROUP BY city;
How many students does each advisor have? Schema: - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT Advisor, COUNT(*) AS num_students FROM Student GROUP BY Advisor;
What has sharon goldwater published ? 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';
eccv 2014 papers using ImageNet? Schema: - paperDataset(...) - dataset(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - venue(venueId, venueName)
SELECT DISTINCT T3.paperId FROM paperDataset AS T2 JOIN dataset AS T1 ON T2.datasetId = T1.datasetId JOIN paper AS T3 ON T3.paperId = T2.paperId JOIN venue AS T4 ON T4.venueId = T3.venueId WHERE T1.datasetName = 'ImageNet' AND T3."year" = 2014 AND T4.venueName = 'eccv';
Count the number of different account types.? Schema: - customer(COUNT, T1, acc_bal, acc_type, active, check, credit_score, cust_name, no_of_loans, sav, state, store_id)
SELECT COUNT(DISTINCT acc_type) AS num_account_types FROM customer;
What are the open and close dates of all the policies used by the customer who have "Diana" in part of their names? 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)) - Customers_Policies(...)
SELECT T2.Date_Opened, T2.Date_Closed FROM Customers AS T1 JOIN Customers_Policies AS T2 ON T1.Customer_ID = T2.Customer_ID WHERE T1.Customer_name LIKE '%Diana%';
What are the names and ages of every person who is a friend of both Dan and Alice? Schema: - Person(M, age, city, eng, gender, job, name) - PersonFriend(M, friend, name)
SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' AND T1.name IN (SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice');
Count the number of products.? Schema: - Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more))
SELECT COUNT(*) AS num_products FROM Products;
List the names of courses in alphabetical order? Schema: - Courses(course_description, course_name)
SELECT course_name FROM Courses ORDER BY course_name ASC NULLS LAST;
Return the names of gymnasts who did not grow up in Santo Domingo.? 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 T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T2.Hometown != 'Santo Domingo';
how many of dan klein 's papers cite michael i. jordan? Schema: - writes(...) - author(...) - cite(...)
SELECT DISTINCT COUNT(T5.citingPaperId) AS num_papers FROM writes AS T3 JOIN author AS T2 ON T3.authorId = T2.authorId JOIN cite AS T5 ON T3.paperId = T5.citedPaperId JOIN writes AS T4 ON T4.paperId = T5.citingPaperId JOIN author AS T1 ON T4.authorId = T1.authorId WHERE T2.authorName = 'michael i. jordan' AND T1.authorName = 'dan klein';
Show the position of players and the corresponding number of players.? 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";
give me a good restaurant in mountain view for 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 = 'mountain view' AND T1.food_type = 'arabic' AND T1.rating > 2.5;
What are the distinct nominees of the musicals with the award that is not "Tony Award"? Schema: - musical(Award, COUNT, Name, Nom, Nominee, Result, T1)
SELECT DISTINCT Nominee FROM musical WHERE Award != 'Tony Award';
which state border kentucky? Schema: - border_info(T1, border, state_name)
SELECT border FROM border_info WHERE state_name = 'kentucky';
Count the number of financial transactions that correspond to each account id.? Schema: - Financial_Transactions(COUNT, F, SUM, account_id, invoice_number, transaction_amount, transaction_id, transaction_type)
SELECT COUNT(*) AS num_transactions, account_id FROM Financial_Transactions GROUP BY account_id;
What is the number of nations that use English and Dutch? 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 COUNT(*) AS num_nations FROM (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2."Language" IN ('English', 'Dutch') GROUP BY T1.Name HAVING COUNT(DISTINCT T2."Language") = 2) AS t;
Which buildings have apartments that have more than two bathrooms? Give me the addresses of the buildings.? Schema: - Apartment_Buildings(building_address, building_description, building_full_name, building_manager, building_phone, building_short_name) - Apartments(AVG, COUNT, INT, SUM, TRY_CAST, apt_number, apt_type_code, bathroom_count, bedroom_count, room_count)
SELECT T1.building_address FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T2.bathroom_count > 2;
Show all publishers which do not have a book in 1989.? Schema: - book_club(Author_or_Editor, Book_Title, COUNT, Category, Publ, Publisher, T1)
SELECT Publisher FROM book_club WHERE Publisher NOT IN (SELECT Publisher FROM book_club WHERE "Year" = 1989);
Count the number of different complaint type codes.? Schema: - Complaints(complaint_status_code, complaint_type_code)
SELECT COUNT(DISTINCT complaint_type_code) AS num_complaint_types FROM Complaints;
What is the apartment number of the apartment with the most beds? Schema: - Apartments(AVG, COUNT, INT, SUM, TRY_CAST, apt_number, apt_type_code, bathroom_count, bedroom_count, room_count)
SELECT apt_number FROM Apartments ORDER BY bedroom_count DESC NULLS LAST LIMIT 1;
For each aircraft that has won an award, what is its name and how many time has it won? Schema: - aircraft(Description, aid, d, distance, name) - match_(Competition, Date, Match_ID, Venue)
SELECT T1.Aircraft, COUNT(*) AS num_awards FROM aircraft AS T1 JOIN match_ AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T1.Aircraft_ID, T1.Aircraft;
What are the heights of perpetrators in descending order of the number of people they injured? 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.Height FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Injured DESC NULLS LAST;
what is the capital of the state with the most inhabitants? Schema: - state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom)
SELECT capital FROM state WHERE population = (SELECT MAX(population) FROM state);
What are the names and headquarters of all manufacturers, ordered by revenue descending? Schema: - Manufacturers(Aust, Beij, Founder, Headquarter, I, M, Name, Revenue)
SELECT Name, Headquarter FROM Manufacturers ORDER BY Revenue DESC NULLS LAST;
what is the highest point in the usa? Schema: - highlow(M, highest_elevation, highest_point, lowest_elevation, lowest_point, state_name)
SELECT highest_point FROM highlow WHERE highest_elevation = (SELECT MAX(highest_elevation) FROM highlow);
Among all the claims, which settlements have a claimed amount that is no more than the average? List the claim start date.? Schema: - Claims(Amount_Claimed, Amount_Settled, Date_Claim_Made, Date_Claim_Settled)
SELECT Date_Claim_Made FROM Claims WHERE Amount_Settled <= (SELECT AVG(Amount_Settled) FROM Claims);
What document types do have more than 10000 total access number.? Schema: - Documents(COUNT, Document_Description, Document_ID, Document_Name, Document_Type_Code, I, K, Project_ID, Robb, Template_ID, access_count, document_id, ... (7 more))
SELECT document_type_code FROM Documents WHERE document_type_code IS NOT NULL GROUP BY document_type_code HAVING SUM(access_count) > 10000;
Whare the names, friends, and ages of all people who are older than the average age of a person? Schema: - Person(M, age, city, eng, gender, job, name) - PersonFriend(M, friend, name)
SELECT DISTINCT T2.name, T2.friend, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT AVG(age) FROM Person);
What is the name of Eric C. Kerrigan 's Liquid Automatica paper ? Schema: - paperKeyphrase(...) - keyphrase(...) - writes(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - author(...) - venue(venueId, venueName)
SELECT DISTINCT T2.title FROM paperKeyphrase AS T5 JOIN keyphrase AS T3 ON T5.keyphraseId = T3.keyphraseId JOIN writes AS T4 ON T4.paperId = T5.paperId JOIN paper AS T2 ON T4.paperId = T2.paperId JOIN author AS T1 ON T4.authorId = T1.authorId JOIN venue AS T6 ON T6.venueId = T2.venueId WHERE T1.authorName LIKE 'Eric C. Kerrigan' AND T3.keyphraseName = 'Liquid' AND T6.venueName = 'Automatica';
What is the average credit score for customers who have never taken a loan? Schema: - customer(COUNT, T1, acc_bal, acc_type, active, check, credit_score, cust_name, no_of_loans, sav, state, store_id) - loan(...)
SELECT AVG(credit_score) AS avg_credit_score FROM customer WHERE cust_ID NOT IN (SELECT cust_ID FROM loan);
Who are all the directors? Schema: - film(COUNT, Directed_by, Director, Gross_in_dollar, JO, LENGTH, Studio, T1, Title, language_id, rating, rental_rate, ... (3 more))
SELECT DISTINCT Directed_by FROM film;
Paper on parsing with most citations? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - cite(...)
SELECT DISTINCT T4.citedPaperId, COUNT(T4.citedPaperId) AS num_citations 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_citations DESC NULLS LAST;
What are the names, ages, and countries of artists, sorted by the year they joined? Schema: - artist(Age, Artist, Country, Famous_Release_date, Famous_Title, Year_Join, artist_name, country, gender) - ASC(...)
SELECT Name, Age, Country FROM artist ORDER BY Year_Join ASC NULLS LAST;
how many states have a higher point than the highest point of the state with the largest capital city in the us? Schema: - highlow(M, highest_elevation, highest_point, lowest_elevation, lowest_point, state_name) - state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom) - city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more))
SELECT COUNT(state_name) AS num_states FROM highlow WHERE highest_elevation > (SELECT highest_elevation FROM highlow WHERE state_name = (SELECT state_name FROM state WHERE capital = (SELECT city_name FROM city WHERE population = (SELECT MAX(population) FROM city))));
Which contact channel codes were used less than 5 times? Schema: - Customer_Contact_Channels(DATEDIFF, DAY, active_from_date, active_to_date, channel_code, contact_number, diff)
SELECT channel_code FROM Customer_Contact_Channels WHERE channel_code IS NOT NULL GROUP BY channel_code HAVING COUNT(customer_id) < 5;
which EMNLP 2010 papers have been cited the most ? Schema: - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - cite(...) - venue(venueId, venueName)
SELECT DISTINCT T3.citedPaperId, COUNT(T3.citedPaperId) 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" = 2010 AND T2.venueName = 'EMNLP' GROUP BY T3.citedPaperId ORDER BY num_citations DESC NULLS LAST;
How many drivers participated in the race Australian Grand Prix held in 2009? Schema: - results(...) - races(date, name)
SELECT COUNT(*) AS num_drivers FROM results AS T1 JOIN races AS T2 ON T1.raceId = T2.raceId WHERE T2.name = 'Australian Grand Prix' AND "year" = 2009;
Which is the email of the party that has used the services the most number of times? Schema: - Parties(party_email, party_phone, payment_method_code) - Party_Services(...)
SELECT T1.party_email FROM Parties AS T1 JOIN Party_Services AS T2 ON T1.party_id = T2.customer_id GROUP BY T1.party_email ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Show all locations that have train stations with at least 15 platforms and train stations with more than 25 total passengers.? Schema: - station(Annual_entry_exit, Annual_interchanges, COUNT, Location, MAX, Main_Services, Mounta, Name, Number_of_Platforms, city, id, lat, ... (4 more))
SELECT DISTINCT Location FROM station WHERE Number_of_Platforms >= 15 AND Total_Passengers > 25;
What are the papers of brian curless in convolution ? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...) - author(...)
SELECT DISTINCT T1.authorId, T3.paperId FROM paperKeyphrase AS T2 JOIN keyphrase AS T5 ON T2.keyphraseId = T5.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId JOIN writes AS T4 ON T4.paperId = T3.paperId JOIN author AS T1 ON T4.authorId = T1.authorId WHERE T1.authorName = 'brian curless' AND T5.keyphraseName = 'convolution';
Find the distinct first names of the students who have class senator votes.? 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 DISTINCT T1.Fname FROM Student AS T1 JOIN Voting_record AS T2 ON T1.StuID = T2.Class_Senator_Vote;
how is the most cited author in CVPR ? Schema: - venue(venueId, venueName) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...) - cite(...)
SELECT DISTINCT COUNT(DISTINCT T4.citingPaperId) AS num_citations, T1.authorId FROM venue AS T3 JOIN paper AS T2 ON T3.venueId = T2.venueId JOIN writes AS T1 ON T1.paperId = T2.paperId JOIN cite AS T4 ON T1.paperId = T4.citedPaperId WHERE T3.venueName = 'CVPR' GROUP BY T1.authorId ORDER BY num_citations DESC NULLS LAST;
What are the names and ids of all stations that have more than 14 bikes available on average or had bikes installed in December? Schema: - station(Annual_entry_exit, Annual_interchanges, COUNT, Location, MAX, Main_Services, Mounta, Name, Number_of_Platforms, city, id, lat, ... (4 more)) - status(...)
SELECT name, id FROM (SELECT T1.name, T1.id FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.station_id IS NOT NULL AND T1.name IS NOT NULL AND T1.id IS NOT NULL GROUP BY T2.station_id, T1.name, T1.id HAVING AVG(T2.bikes_available) > 14 UNION ALL SELECT name, id FROM station WHERE installation_date LIKE '12/%') WHERE name IS NOT NULL AND id IS NOT NULL GROUP BY name, id;
What are the towns from which at least two teachers come from? Schema: - teacher(Age, COUNT, D, Hometown, Name)
SELECT Hometown FROM teacher WHERE Hometown IS NOT NULL GROUP BY Hometown HAVING COUNT(*) >= 2;
What is the total horses record for each farm, sorted ascending? Schema: - farm(Cows, Working_Horses)
SELECT Total_Horses FROM farm ORDER BY Total_Horses ASC NULLS LAST;
Count the number of exhibitions that have had an attendnance of over 100 or a ticket prices under 10.? Schema: - exhibition_record(...) - exhibition(Theme, Ticket_Price, Year)
SELECT COUNT(*) AS num_exhibitions FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.Exhibition_ID = T2.Exhibition_ID WHERE T1.Attendance > 100 OR T2.Ticket_Price < 10;
how many french restaurant are there in palo alto ? Schema: - restaurant(...) - location(...)
SELECT COUNT(*) AS num_restaurants FROM restaurant AS T1 JOIN location AS T2 ON T1.id = T2.restaurant_id WHERE T2.city_name = 'palo alto' AND T1.food_type = 'french';
What are the different police forces of counties that are not located in the East? Schema: - county_public_safety(COUNT, Case_burden, Crime_rate, Location, Name, Police_force, Police_officers, Population, T1)
SELECT DISTINCT Police_force FROM county_public_safety WHERE Location != 'East';
What are the states with colleges that have enrollments less than the some other college? Schema: - College(M, cName, enr, state)
SELECT DISTINCT state FROM College WHERE enr < (SELECT MAX(enr) FROM College);
convolution by brian curless? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...) - author(...)
SELECT DISTINCT T1.authorId, T3.paperId FROM paperKeyphrase AS T2 JOIN keyphrase AS T5 ON T2.keyphraseId = T5.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId JOIN writes AS T4 ON T4.paperId = T3.paperId JOIN author AS T1 ON T4.authorId = T1.authorId WHERE T1.authorName = 'brian curless' AND T5.keyphraseName = 'convolution';
How many different cities do have some airport in the country of Greenland? Schema: - airports(AirportCode, AirportName, Argent, COUNT, City, Country, city, country, elevation, name)
SELECT COUNT(DISTINCT city) AS num_cities FROM airports WHERE country = 'Greenland';
What is Weekly Rank of TV series with Episode "A Love of a Lifetime"? Schema: - TV_series(Air_Date, Episode, Rating, Share, Weekly_Rank)
SELECT Weekly_Rank FROM TV_series WHERE Episode = 'A Love of a Lifetime';
Count the number of captains that have each rank.? Schema: - captain(COUNT, Class, INT, Name, Rank, TRY_CAST, age, capta, l)
SELECT COUNT(*) AS num_captains, "Rank" FROM captain GROUP BY "Rank";
What is the number of wins the team Boston Red Stockings got in the postseasons each year in history? Schema: - postseason(ties) - team(Name)
SELECT COUNT(*) AS num_wins, T1."year" FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' GROUP BY T1."year";
Which bike traveled the most often in zip code 94002? Schema: - trip(COUNT, bike_id, duration, end_station_name, id, start_date, start_station_id, start_station_name, zip_code)
SELECT bike_id FROM trip WHERE zip_code = 94002 AND bike_id IS NOT NULL GROUP BY bike_id ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Which claim processing stage has the most claims? Show the claim status name.? Schema: - Claims_Processing(Claim_Outcome_Code) - Claims_Processing_Stages(Claim_Status_Description, Claim_Status_Name)
SELECT T2.Claim_Status_Name FROM Claims_Processing AS T1 JOIN Claims_Processing_Stages AS T2 ON T1.Claim_Stage_ID = T2.Claim_Stage_ID GROUP BY T1.Claim_Stage_ID, T2.Claim_Status_Name ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
What is the average fastest lap speed in race named 'Monaco Grand Prix' in 2008 ? Schema: - races(date, name) - results(...)
SELECT AVG(TRY_CAST(T2.fastestLapSpeed AS DOUBLE)) AS avg_speed FROM races AS T1 JOIN results AS T2 ON T1.raceId = T2.raceId WHERE T1."year" = 2008 AND T1.name = 'Monaco Grand Prix';
What is the total number of students enrolled in schools without any goalies? Schema: - College(M, cName, enr, state) - Tryout(COUNT, EX, T1, cName, decision, pPos)
SELECT SUM(enr) AS num_students FROM College WHERE cName NOT IN (SELECT cName FROM Tryout WHERE pPos = 'goalie');
what states have cities named springfield? 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 exhibitions have a attendance more than 100 or have a ticket price below 10? Schema: - exhibition_record(...) - exhibition(Theme, Ticket_Price, Year)
SELECT COUNT(*) AS num_exhibitions FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.Exhibition_ID = T2.Exhibition_ID WHERE T1.Attendance > 100 OR T2.Ticket_Price < 10;
What are all the employee ids and the names of the countries in which they work? Schema: - employees(COMMISSION_PCT, DEPARTMENT_ID, EMAIL, EMPLOYEE_ID, FIRST_NAME, HIRE_DATE, JOB_ID, LAST_NAME, M, MANAGER_ID, PHONE_NUMBER, SALARY, ... (12 more)) - departments(DEPARTMENT_NAME, Market) - locations(COUNTRY_ID) - countries(...)
SELECT T1.EMPLOYEE_ID, T4.COUNTRY_NAME FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID JOIN locations AS T3 ON T2.LOCATION_ID = T3.LOCATION_ID JOIN countries AS T4 ON T3.COUNTRY_ID = T4.COUNTRY_ID;
What is the publisher with most number of books? Schema: - book_club(Author_or_Editor, Book_Title, COUNT, Category, Publ, Publisher, T1)
SELECT Publisher FROM book_club WHERE Publisher IS NOT NULL GROUP BY Publisher ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
List the campus that have between 600 and 1000 faculty lines in year 2004.? Schema: - Campuses(Campus, County, Franc, Location) - faculty(Faculty)
SELECT T1.Campus FROM Campuses AS T1 JOIN faculty AS T2 ON T1.Id = T2.Campus WHERE T2.Faculty >= 600 AND T2.Faculty <= 1000 AND T1."Year" = 2004;
What are the start date and end date of the booking that has booked the product named 'Book collection A'? Schema: - Products_for_Hire(daily_hire_cost, product_description, product_name, product_type_code) - Products_Booked(booked_count, product_id) - Bookings(Actual_Delivery_Date, COUNT, Order_Date, Planned_Delivery_Date, Status_Code)
SELECT T3.booking_start_date, T3.booking_end_date FROM Products_for_Hire AS T1 JOIN Products_Booked AS T2 ON T1.product_id = T2.product_id JOIN Bookings AS T3 ON T2.booking_id = T3.booking_id WHERE T1.product_name = 'Book collection A';
What are the names of customers who have not taken a Mortage loan? Schema: - customer(COUNT, T1, acc_bal, acc_type, active, check, credit_score, cust_name, no_of_loans, sav, state, store_id) - loan(...)
SELECT DISTINCT cust_name FROM customer WHERE cust_name NOT IN (SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID WHERE T2.loan_type = 'Mortgages');
Please show the name of the conductor that has conducted orchestras founded after 2008.? Schema: - conductor(Age, Name, Nationality, Year_of_Work) - orchestra(COUNT, Major_Record_Format, Record_Company, Year_of_Founded)
SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID WHERE Year_of_Founded > 2008;
How many flights do we have? Schema: - flight(Altitude, COUNT, Date, Pilot, Vehicle_Flight_number, Velocity, arrival_date, departure_date, destination, distance, flno, origin, ... (1 more))
SELECT COUNT(*) AS num_flights FROM flight;
What is the customer id of the customer who has the most orders? 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)) - Orders(customer_id, date_order_placed, order_id)
SELECT T1.customer_id FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
What is average age of male for different job title? Schema: - Person(M, age, city, eng, gender, job, name)
SELECT AVG(age) AS avg_age, job FROM Person WHERE gender = 'male' GROUP BY job;
display the emails of the employees who have no commission percentage and salary within the range 7000 to 12000 and works in that department which number is 50.? Schema: - employees(COMMISSION_PCT, DEPARTMENT_ID, EMAIL, EMPLOYEE_ID, FIRST_NAME, HIRE_DATE, JOB_ID, LAST_NAME, M, MANAGER_ID, PHONE_NUMBER, SALARY, ... (12 more))
SELECT EMAIL FROM employees WHERE COMMISSION_PCT IS NULL AND SALARY BETWEEN 7000 AND 12000 AND DEPARTMENT_ID = 50;
return me all the papers in VLDB conference in " University of Michigan " .? Schema: - organization(continent, homepage, name) - author(...) - writes(...) - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year) - conference(homepage, name)
SELECT T5.title FROM organization AS T3 JOIN author AS T1 ON T3.oid = T1.oid JOIN writes AS T4 ON T4.aid = T1.aid JOIN publication AS T5 ON T4.pid = T5.pid JOIN conference AS T2 ON T5.cid = CAST(T2.cid AS TEXT) WHERE T2.name = 'VLDB' AND T3.name = 'University of Michigan';
What are the ids of the students who attended courses in the statistics department in order of attendance date.? Schema: - Courses(course_description, course_name) - Student_Course_Attendance(course_id, date_of_attendance, student_id)
SELECT T2.student_id FROM Courses AS T1 JOIN Student_Course_Attendance AS T2 ON T1.course_id = CAST(T2.course_id AS TEXT) WHERE T1.course_name = 'statistics' ORDER BY T2.date_of_attendance ASC NULLS LAST;
Find the total population of the top 3 districts with the largest area.? Schema: - district(City_Area, City_Population, District_name, d)
SELECT SUM(City_Population) AS total_population FROM district WHERE City_Area IN (SELECT City_Area FROM district ORDER BY City_Area DESC NULLS LAST LIMIT 3);
How many members are there? Schema: - member_(Address, Age, COUNT, Card_Number, Country, Hometown, Level, Member_ID, Member_Name, Membership_card, Name, Party_ID, ... (1 more))
SELECT COUNT(*) AS num_members FROM member_;
Show all storm names affecting region "Denmark".? Schema: - affected_region(Region_id) - region(Label, Region_code, Region_name) - storm(Damage_millions_USD, Dates_active, Name, Number_Deaths)
SELECT T3.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 T2.Region_name = 'Denmark';
What is the number of distinct teams that suffer elimination? Schema: - Elimination(Benjam, Eliminated_By, Elimination_Move, T1, Team, Time)
SELECT COUNT(DISTINCT Team) AS num_teams FROM Elimination;
Show different carriers of phones together with the number of phones with each carrier.? Schema: - phone(Accreditation_level, Accreditation_type, COUNT, Carrier, Company_name, Hardware_Model_name, Memory_in_G, Name, Spr, chip_model, p1, screen_mode)
SELECT Carrier, COUNT(*) AS num_phones FROM phone GROUP BY Carrier;
What are the Asian countries which have a population larger than that of any country in Africa? Schema: - country(Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, M, Name, Official_native_language, ... (4 more))
SELECT Name FROM country WHERE Continent = 'Asia' AND Population > (SELECT MIN(Population) FROM country WHERE Continent = 'Africa');
What are the names of all directors who made one movie? Schema: - Movie(T1, director, title, year)
SELECT director FROM Movie WHERE director IS NOT NULL GROUP BY director HAVING COUNT(*) = 1;
How many faculty lines are there in the university that conferred the least number of degrees in year 2001? Schema: - Campuses(Campus, County, Franc, Location) - faculty(Faculty) - degrees(Campus, Degrees, SUM, Year)
SELECT T2.Faculty FROM Campuses AS T1 JOIN faculty AS T2 ON T1.Id = T2.Campus JOIN degrees AS T3 ON T1.Id = T3.Campus AND T2."Year" = T3."Year" WHERE T2."Year" = 2001 ORDER BY T3.Degrees ASC NULLS LAST LIMIT 1;
What are the invoice dates for customers with the first name Astrid and the last name Gruber? Schema: - Customer(Email, FirstName, LastName, State, lu) - Invoice(BillingCountry)
SELECT T2.InvoiceDate FROM Customer AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.FirstName = 'Astrid' AND LastName = 'Gruber';
How many students are enrolled in some classes that are taught by an accounting professor? Schema: - CLASS(CLASS_CODE, CLASS_ROOM, CLASS_SECTION, CRS_CODE, PROF_NUM) - ENROLL(...) - COURSE(C, CRS_CODE, CRS_CREDIT, CRS_DESCRIPTION, DEPT_CODE) - DEPARTMENT(Account, DEPT_ADDRESS, DEPT_NAME, H, SCHOOL_CODE)
SELECT COUNT(*) AS num_students FROM CLASS AS T1 JOIN ENROLL AS T2 ON T1.CLASS_CODE = T2.CLASS_CODE JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN DEPARTMENT AS T4 ON T3.DEPT_CODE = T4.DEPT_CODE WHERE T4.DEPT_NAME = 'Accounting';
Who are the friends of Bob? Schema: - Person(M, age, city, eng, gender, job, name) - PersonFriend(M, friend, name)
SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Bob';
Show total hours per week and number of games played for students under 20.? 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.Age < 20;
What are the origins of all flights that are headed to Honolulu? Schema: - flight(Altitude, COUNT, Date, Pilot, Vehicle_Flight_number, Velocity, arrival_date, departure_date, destination, distance, flno, origin, ... (1 more))
SELECT origin FROM flight WHERE destination = 'Honolulu';
Count the number of different affected regions.? Schema: - affected_region(Region_id)
SELECT COUNT(DISTINCT Region_id) AS num_regions FROM affected_region;
where can we find some restaurants in the bay area ? Schema: - location(...) - restaurant(...) - geographic(...)
SELECT T2.house_number, T1.name FROM location AS T2 JOIN restaurant AS T1 ON T1.id = T2.restaurant_id WHERE T1.city_name IN (SELECT city_name FROM geographic WHERE region = 'bay area');
Show the names of all the activities Mark Giuliano participates in.? Schema: - Faculty(Building, COUNT, FacID, Fname, LName, Lname, Phone, Pr, Rank, Room, Sex) - Faculty_Participates_in(FacID) - Activity(activity_name)
SELECT T3.activity_name FROM Faculty AS T1 JOIN Faculty_Participates_in AS T2 ON T1.FacID = T2.FacID JOIN Activity AS T3 ON T3.actid = T2.actid WHERE T1.Fname = 'Mark' AND T1.Lname = 'Giuliano';
What are the phone numbers and email addresses of all customers who have an outstanding balance of more than 2000? 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;
give me the states that border kentucky? Schema: - border_info(T1, border, state_name)
SELECT border FROM border_info WHERE state_name = 'kentucky';