question
stringlengths
43
589
query
stringlengths
19
598
Show the names of players and names of their coaches.? 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, T2.Coach_name 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;
Find the number of distinct type of pets.? Schema: - Pets(PetID, PetType, pet_age, weight)
SELECT COUNT(DISTINCT PetType) AS num_pet_types FROM Pets;
What are the names of the districts that have both mall and village store style shops? Schema: - district(City_Area, City_Population, District_name, d) - store(Type) - store_district(...)
SELECT DISTINCT T1.District_name FROM district AS T1 WHERE EXISTS (SELECT 1 FROM store AS T2 JOIN store_district AS T3 ON T2.Store_ID = T3.Store_ID WHERE T1.District_ID = T3.District_ID AND T2.Type = 'City Mall') AND EXISTS (SELECT 1 FROM store AS T4 JOIN store_district AS T5 ON T4.Store_ID = T5.Store_ID WHERE T1.District_ID = T5.District_ID AND T4.Type = 'Village Store');
What type of game is Call of Destiny? Schema: - Video_Games(COUNT, Dest, GName, GType, onl)
SELECT GType FROM Video_Games WHERE GName = 'Call of Destiny';
For each director, return the director's name together with the title of the movie they directed that received the highest rating among all of their movies, and the value of that rating. Ignore movies whose director is NULL.? Schema: - Rating(Rat, mID, rID, stars) - Movie(T1, director, title, year)
SELECT T2.title, T1.stars, T2.director, AVG(T1.stars) AS avg_stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director IS NOT NULL GROUP BY director, T2.title, T1.stars, T2.director;
What is the average weight for each type of pet? Schema: - Pets(PetID, PetType, pet_age, weight)
SELECT AVG(weight) AS avg_weight, PetType FROM Pets GROUP BY PetType;
What is the id of the order which has the most items? Schema: - Orders(customer_id, date_order_placed, order_id) - Order_Items(COUNT, DOUBLE, INT, TRY_CAST, order_id, order_item_id, order_quantity, product_id, product_quantity)
SELECT T1.order_id FROM Orders AS T1 JOIN Order_Items AS T2 ON T1.order_id = T2.order_id GROUP BY T1.order_id ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
What is the total amount of products purchased before 2018-03-17 07:13:53? Schema: - Customer_Orders(customer_id, order_date, order_id, order_shipping_charges) - Order_Items(COUNT, DOUBLE, INT, TRY_CAST, order_id, order_item_id, order_quantity, product_id, product_quantity)
SELECT SUM(TRY_CAST(T2.order_quantity AS DOUBLE)) AS total_products_purchased FROM Customer_Orders AS T1 JOIN Order_Items AS T2 ON T1.order_id = T2.order_id WHERE T1.order_date < '2018-03-17 07:13:53';
how many David M. Blei papers are in AISTATS ? Schema: - venue(venueId, venueName) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...) - author(...)
SELECT DISTINCT COUNT(T3.paperId) AS num_papers FROM venue AS T4 JOIN paper AS T3 ON T4.venueId = T3.venueId JOIN writes AS T2 ON T2.paperId = T3.paperId JOIN author AS T1 ON T2.authorId = T1.authorId WHERE T1.authorName = 'David M. Blei' AND T4.venueName = 'AISTATS';
Find the total number of catalog contents.? Schema: - Catalog_Contents(capacity, catalog_entry_name, height, next_entry_id, price_in_dollars, price_in_euros, product_stock_number)
SELECT COUNT(*) AS num_catalog_contents FROM Catalog_Contents;
How many papers does michael i. jordan have in 2016 ? Schema: - writes(...) - author(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT COUNT(T2.paperId) AS num_papers 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 = 'michael i. jordan' AND T3."year" = 2016;
How many invoices do we have? Schema: - Invoices(COUNT, DOUBLE, Order_Quantity, Product_ID, TRY_CAST, invoice_date, invoice_details, invoice_number, order_id, payment_method_code)
SELECT COUNT(*) AS num_invoices FROM Invoices;
Count the number of likes for each student id.? Schema: - Likes(student_id)
SELECT student_id, COUNT(*) AS num_likes FROM Likes GROUP BY student_id;
Return the lowest version number, along with its corresponding template type code.? Schema: - Templates(COUNT, M, Template_ID, Template_Type_Code, Version_Number)
SELECT Version_Number, Template_Type_Code FROM Templates WHERE Version_Number = (SELECT MIN(Version_Number) FROM Templates);
How many customers are there in the customer type with the most customers? Schema: - Customers(BIGINT, COUNT, Customer_Details, Customer_ID, Customer_name, Mar, Rat, TRY_CAST, V, address_line_1, address_line_2, amount_outstanding, ... (25 more))
SELECT COUNT(*) AS num_customers FROM Customers WHERE customer_type_code IS NOT NULL GROUP BY customer_type_code ORDER BY num_customers DESC NULLS LAST LIMIT 1;
Show different type codes of products and the number of products with each type code.? Schema: - Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more))
SELECT Product_Type_Code, COUNT(*) AS num_products FROM Products GROUP BY Product_Type_Code;
Count the number of programs.? Schema: - program(Beij, Launch, Name, Origin, Owner)
SELECT COUNT(*) AS num_programs FROM program;
What is the location shared by most counties? Schema: - county_public_safety(COUNT, Case_burden, Crime_rate, Location, Name, Police_force, Police_officers, Population, T1)
SELECT Location FROM county_public_safety WHERE Location IS NOT NULL GROUP BY Location ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Which people severed as governor most frequently? Schema: - party(COUNT, Comptroller, First_year, Governor, Last_year, Left_office, Location, Minister, Number_of_hosts, Party, Party_Theme, Party_name, ... (3 more))
SELECT Governor FROM party WHERE Governor IS NOT NULL GROUP BY Governor ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
What are the names of customers who do not have any policies? 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)) - Policies(COUNT, Policy_Type_Code)
SELECT c.Customer_Details FROM Customers c LEFT JOIN Policies p ON c.Customer_ID = p.Customer_ID WHERE p.Customer_ID IS NULL;
What are the names of the reviewers who have rated a movie more than 3 stars before? Schema: - Rating(Rat, mID, rID, stars) - Reviewer(Lew, name, rID)
SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars > 3;
When did Linda Smith visit Subway? Schema: - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age) - Visits_Restaurant(ResID, StuID) - Restaurant(Address, Rating, ResID, ResName)
SELECT "Time" FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = 'Linda' AND Student.LName = 'Smith' AND Restaurant.ResName = 'Subway';
What are the names of teams from universities that have a below average enrollment? 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);
List the journals published in 2011? Schema: - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT journalId FROM paper WHERE "year" = 2011 GROUP BY journalId;
Which district has the largest population? Schema: - district(City_Area, City_Population, District_name, d)
SELECT District_name FROM district ORDER BY City_Population DESC NULLS LAST LIMIT 1;
From which hometowns did no gymnasts come from? Schema: - people(Age, Birth_Date, Birth_Place, COUNT, Country, Date_of_Birth, Height, Hometown, Is_Male, Name, Nationality, Party, ... (3 more)) - gymnast(Floor_Exercise_Points, Horizontal_Bar_Points)
SELECT DISTINCT T1.Hometown FROM people AS T1 LEFT JOIN (SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID) AS T3 ON T1.Hometown = T3.Hometown WHERE T3.Hometown IS NULL;
Which buildings have more than one company offices? Give me the building names.? Schema: - Office_locations(...) - buildings(Height, Status, Stories, name) - Companies(Assets_billion, Bank, COUNT, Ch, Headquarters, Industry, Market_Value_billion, Profits_billion, Sales_billion, T1, name)
SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id, T2.name HAVING COUNT(*) > 1;
which states lie on the largest river in the united states? Schema: - river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse)
SELECT traverse FROM river WHERE LENGTH = (SELECT MAX(LENGTH) FROM river);
What are the maximum price and score of wines produced by St. Helena appelation? Schema: - wine(Appelation, Cases, Grape, M, Name, Price, Score, Winery, Year, Z, w)
SELECT MAX(Price) AS max_price, MAX(Score) AS max_score FROM wine WHERE Appelation = 'St. Helena';
what are the last names of the teachers who teach grade 5? Schema: - list(COUNT, Classroom, FirstName, Grade, LastName) - teachers(Classroom, FirstName, LastName)
SELECT DISTINCT T2.LastName FROM list AS T1 JOIN teachers AS T2 ON T1.Classroom = T2.Classroom WHERE Grade = 5;
Liwen Xiong publication 2015? Schema: - writes(...) - author(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT T3.paperId FROM writes AS T2 JOIN author AS T1 ON T2.authorId = T1.authorId JOIN paper AS T3 ON T2.paperId = T3.paperId WHERE T1.authorName = 'Liwen Xiong' AND T3."year" = 2015;
What is the zip code that has the lowest average mean sea level pressure? Schema: - weather(AVG, COUNT, M, Ra, cloud_cover, date, diff, events, mean_humidity, mean_sea_level_pressure_inches, mean_temperature_f, mean_visibility_miles, ... (1 more))
SELECT zip_code FROM weather WHERE zip_code IS NOT NULL GROUP BY zip_code ORDER BY AVG(mean_sea_level_pressure_inches) ASC NULLS LAST LIMIT 1;
Find the names of the users whose number of followers is greater than that of the user named "Tyler Swift".? Schema: - user_profiles(email, followers, name, partitionid) - follows(f1)
SELECT T1.name FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f1 GROUP BY T2.f1, T1.name HAVING COUNT(*) > (SELECT COUNT(*) FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f1 WHERE T1.name = 'Tyler Swift');
How many contestants did not get voted? Schema: - CONTESTANTS(contestant_name) - VOTES(created, phone_number, state, vote_id)
SELECT COUNT(*) AS num_contestants FROM CONTESTANTS WHERE contestant_number NOT IN (SELECT contestant_number FROM VOTES);
Show name and salary for all employees sorted by salary.? Schema: - employee(Address, Age, Bdate, City, Fname, Lname, Name, Salary, Sex, eid, name, salary)
SELECT name, salary FROM employee ORDER BY salary ASC NULLS LAST;
Sort all the distinct product names in alphabetical order.? Schema: - Product(product_id, product_name)
SELECT DISTINCT product_name FROM Product ORDER BY product_name ASC NULLS LAST;
How many owners temporarily do not have any dogs? Schema: - Owners(email_address, first_name, last_name, state) - Dogs(abandoned_yn, age, breed_code, date_arrived, date_departed, name, size_code, weight)
SELECT COUNT(*) AS num_owners FROM Owners WHERE owner_id NOT IN (SELECT owner_id FROM Dogs);
What is the average and maximum capacities for all stadiums ? Schema: - stadium(Average, Average_Attendance, Capacity, Capacity_Percentage, City, Country, Home_Games, Location, Name, Opening_year, T1)
SELECT AVG(Capacity) AS avg_capacity, MAX(Capacity) AS max_capacity FROM stadium;
Show names, results and bulgarian commanders of the battles with no ships lost in the 'English Channel'.? 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 T1.name, T1."result", T1.bulgarian_commander FROM battle AS T1 LEFT JOIN ship AS T2 ON T1.id = T2.lost_in_battle AND T2.location = 'English Channel' WHERE T2.id IS NULL;
What are the ids of products from the supplier with id 2, which are more expensive than the average price across all products? Schema: - Product_Suppliers(COUNT, DOUBLE, TRY_CAST, product_id, supplier_id) - Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more))
SELECT T1.product_id FROM Product_Suppliers AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 2 AND T2.product_price > (SELECT AVG(product_price) FROM Products);
what is the population of the major cities in wisconsin? Schema: - city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more))
SELECT population FROM city WHERE population > 150000 AND state_name = 'wisconsin';
Find the last names of the faculty members who are playing Canoeing or Kayaking.? Schema: - Faculty(Building, COUNT, FacID, Fname, LName, Lname, Phone, Pr, Rank, Room, Sex) - Faculty_Participates_in(FacID) - Activity(activity_name)
SELECT DISTINCT T1.Lname FROM Faculty AS T1 JOIN Faculty_Participates_in AS T2 ON T1.FacID = T2.FacID JOIN Activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking';
Find the names of females who are friends with Zach? Schema: - Person(M, age, city, eng, gender, job, name) - PersonFriend(M, friend, name)
SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Zach' AND T1.gender = 'female';
who has the most papers in semantic parsing after 2005 ? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...)
SELECT DISTINCT COUNT(T4.paperId) AS num_papers, T3.authorId FROM paperKeyphrase AS T1 JOIN keyphrase AS T2 ON T1.keyphraseId = T2.keyphraseId JOIN paper AS T4 ON T4.paperId = T1.paperId JOIN writes AS T3 ON T3.paperId = T4.paperId WHERE T2.keyphraseName = 'semantic parsing' AND T4."year" > 2005 GROUP BY T3.authorId ORDER BY num_papers DESC NULLS LAST;
List the name of actors in ascending alphabetical order.? Schema: - actor(Afghan, Aust, COUNT, Character, Chr, Duration, Kev, Name, age, birth_city, birth_year, first_name, ... (4 more))
SELECT Name FROM actor ORDER BY Name ASC NULLS LAST;
which countries' tv channels are playing some cartoon written by Todd Casey? Schema: - TV_Channel(Content, Country, Engl, Hight_definition_TV, Language, Package_Option, Pixel_aspect_ratio_PAR, id, series_name) - Cartoon(Channel, Directed_by, Original_air_date, Production_code, Title, Written_by)
SELECT T1.Country FROM TV_Channel AS T1 JOIN Cartoon AS T2 ON T1.id = T2.Channel WHERE T2.Written_by = 'Todd Casey';
Show the names of cities in counties that have a crime rate less than 100.? Schema: - city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) - county_public_safety(COUNT, Case_burden, Crime_rate, Location, Name, Police_force, Police_officers, Population, T1)
SELECT Name FROM city WHERE County_ID IN (SELECT County_ID FROM county_public_safety WHERE Crime_rate < 100);
which state has the longest river? Schema: - river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse)
SELECT traverse FROM river WHERE LENGTH = (SELECT MAX(LENGTH) FROM river);
Does Richard Ladner publish in chi ? Schema: - venue(venueId, venueName) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...) - author(...)
SELECT DISTINCT T3.paperId FROM venue AS T4 JOIN paper AS T3 ON T4.venueId = T3.venueId JOIN writes AS T2 ON T2.paperId = T3.paperId JOIN author AS T1 ON T2.authorId = T1.authorId WHERE T1.authorName = 'Richard Ladner' AND T4.venueName = 'chi';
What are the earnings of poker players, ordered descending by value? Schema: - poker_player(Best_Finish, Earnings, Final_Table_Made, Money_Rank)
SELECT Earnings FROM poker_player ORDER BY Earnings DESC NULLS LAST;
How many products are in the 'Spices' category and have a typical price of over 1000? 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 WHERE product_category_code = 'Spices' AND TRY_CAST(typical_buying_price AS DOUBLE) > 1000;
Return the names of all the poker players.? 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;
What are the start and end dates for incidents with incident type code "NOISE"? Schema: - Behavior_Incident(NO, date_incident_end, date_incident_start, incident_type_code)
SELECT date_incident_start, date_incident_end FROM Behavior_Incident WHERE incident_type_code = 'NOISE';
What is the title and id of the film that has the greatest number of copies in inventory? Schema: - film(COUNT, Directed_by, Director, Gross_in_dollar, JO, LENGTH, Studio, T1, Title, language_id, rating, rental_rate, ... (3 more)) - inventory(COUNT, store_id)
SELECT T1.title, T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.title, T1.film_id ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
What is the description of role code ED? Schema: - Roles(Role_Code, Role_Description, Role_Name, role_code, role_description)
SELECT role_description FROM Roles WHERE role_code = 'ED';
What are the names of all tracks that belong to the Rock genre and whose media type is MPEG? Schema: - genres(name) - tracks(composer, milliseconds, name, unit_price) - media_types(name)
SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = 'Rock' OR T3.name = 'MPEG audio file';
How many car makers are there in each continents? List the continent name and the count.? Schema: - continents(...) - countries(...) - car_makers(...)
SELECT T1.Continent, COUNT(*) AS num_makers FROM continents AS T1 JOIN countries AS T2 ON T1.ContId = T2.Continent JOIN car_makers AS T3 ON T2.CountryId = T3.CountryId GROUP BY T1.Continent;
What are the titles and average ratings for all movies that have the lowest average rating? Schema: - Rating(Rat, mID, rID, stars) - Movie(T1, director, title, year)
SELECT T2.title, AVG(T1.stars) AS avg_rating FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID, T2.title ORDER BY avg_rating ASC NULLS LAST LIMIT 1;
Which party had the most hosts? Give me the party location.? Schema: - party(COUNT, Comptroller, First_year, Governor, Last_year, Left_office, Location, Minister, Number_of_hosts, Party, Party_Theme, Party_name, ... (3 more))
SELECT Location FROM party ORDER BY Number_of_hosts DESC NULLS LAST LIMIT 1;
Find the total number of reviews written in March? Schema: - review(i_id, rank, rating, text)
SELECT COUNT(DISTINCT "text") AS num_reviews FROM review WHERE "month" = 'March';
HOw many engineers are older than 30? Schema: - Person(M, age, city, eng, gender, job, name)
SELECT COUNT(*) AS num_engineers FROM Person WHERE age > 30 AND job = 'engineer';
Count the number of dogs that went through a treatment.? Schema: - Treatments(cost_of_treatment, date_of_treatment, dog_id, professional_id)
SELECT COUNT(DISTINCT dog_id) AS num_dogs FROM Treatments;
ACL papers by author? Schema: - venue(venueId, venueName) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...)
SELECT DISTINCT T2.paperId, 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 = 'ACL';
What is the campus fee of "San Francisco State University" in year 1996? Schema: - Campuses(Campus, County, Franc, Location) - csu_fees(CampusFee)
SELECT CampusFee FROM Campuses AS T1 JOIN csu_fees AS T2 ON T1.Id = T2.Campus WHERE T1.Campus = 'San Francisco State University' AND T2."Year" = 1996;
How much was the budget of " Finding Nemo "? Schema: - movie(Budget_million, Director, Find, Gross_worldwide, T1, Title, Year, budget, release_year, title)
SELECT budget FROM movie WHERE title = 'Finding Nemo';
Find the names of the trains that do not pass any station located in London.? Schema: - train_station(...) - train(Name, Service, Time, destination, name, origin, time, train_number) - station(Annual_entry_exit, Annual_interchanges, COUNT, Location, MAX, Main_Services, Mounta, Name, Number_of_Platforms, city, id, lat, ... (4 more))
SELECT T2.Name FROM train_station AS T1 JOIN train AS T2 ON T1.Train_ID = T2.Train_ID WHERE T1.Station_ID NOT IN (SELECT T4.Station_ID FROM train_station AS T3 JOIN station AS T4 ON T3.Station_ID = T4.Station_ID WHERE T4.Location = 'London');
what is the full name and id of the college with the largest number of baseball players? Schema: - college(College_Location, Leader_Name) - player_college(...)
SELECT T1.name_full, T1.college_id FROM college AS T1 JOIN player_college AS T2 ON T1.college_id = T2.college_id GROUP BY T1.name_full, T1.college_id ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
How many products have their color described as 'white' or have a characteristic with the name 'hot'? 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) - Ref_Colors(color_description)
SELECT COUNT(*) AS num_products 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 JOIN Ref_Colors AS T4 ON T1.color_code = T4.color_code WHERE T4.color_description = 'white' OR T3.characteristic_name = 'hot';
Which customers do not have any policies? Find the details of these 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)) - Customer_Policies(COUNT, Policy_Type_Code)
SELECT DISTINCT Customer_Details FROM Customers WHERE Customer_Details NOT IN (SELECT T1.Customer_Details FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_ID = T2.Customer_ID);
Papers about Question Answering? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT T3.paperId FROM paperKeyphrase AS T2 JOIN keyphrase AS T1 ON T2.keyphraseId = T1.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId WHERE T1.keyphraseName = 'Question Answering';
how many rivers do not traverse the state with the capital albany? Schema: - river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse) - state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom)
SELECT COUNT(river_name) AS num_rivers FROM river WHERE traverse NOT IN (SELECT state_name FROM state WHERE capital = 'albany');
Show the location code, the starting date and ending data in that location for all the documents.? Schema: - Document_Locations(COUNT, Date_in_Location_From, Date_in_Locaton_To, Location_Code)
SELECT Location_Code, Date_in_Location_From, Date_in_Locaton_To FROM Document_Locations;
What is the first, middle, and last name of the first student to register? 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 first_name, middle_name, last_name FROM Students ORDER BY date_first_registered ASC NULLS LAST LIMIT 1;
List the dates of debates with number of audience bigger than 150? Schema: - debate(Date, Venue)
SELECT "Date" FROM debate WHERE Num_of_Audience > 150;
List all people names in the order of their date of birth from old to young.? 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 Date_of_Birth ASC NULLS LAST;
What are all the distinct details of the 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 DISTINCT Customer_Details FROM Customers;
Show the guest first names, start dates, and end dates of all the apartment bookings.? Schema: - Apartment_Bookings(booking_end_date, booking_start_date, booking_status_code) - Guests(date_of_birth, gender_code, guest_first_name, guest_last_name)
SELECT T2.guest_first_name, T1.booking_start_date, T1.booking_end_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id;
What are the first year and last year of the parties whose theme is "Spring" or "Teqnology"? Schema: - party(COUNT, Comptroller, First_year, Governor, Last_year, Left_office, Location, Minister, Number_of_hosts, Party, Party_Theme, Party_name, ... (3 more))
SELECT First_year, Last_year FROM party WHERE Party_Theme = 'Spring' OR Party_Theme = 'Teqnology';
Which restaurants have highest rating? List the restaurant name and its rating.? Schema: - Restaurant(Address, Rating, ResID, ResName)
SELECT ResName, Rating FROM Restaurant ORDER BY Rating DESC NULLS LAST LIMIT 1;
Papers published in 2015 by Liwen Xiong? Schema: - writes(...) - author(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT T3.paperId FROM writes AS T2 JOIN author AS T1 ON T2.authorId = T1.authorId JOIN paper AS T3 ON T2.paperId = T3.paperId WHERE T1.authorName = 'Liwen Xiong' AND T3."year" = 2015;
Show the name of the county with the biggest population.? Schema: - county(County_name, Population, Zip_code)
SELECT County_name FROM county ORDER BY Population DESC NULLS LAST LIMIT 1;
Show the record companies shared by orchestras founded before 2003 and after 2003.? Schema: - orchestra(COUNT, Major_Record_Format, Record_Company, Year_of_Founded)
SELECT Record_Company FROM orchestra WHERE Year_of_Founded < 2003 AND Record_Company IN (SELECT Record_Company FROM orchestra WHERE Year_of_Founded > 2003);
where can i eat french food in the bay area ? Schema: - restaurant(...) - geographic(...) - location(...)
SELECT T3.house_number, T1.name FROM restaurant AS T1 JOIN geographic AS T2 ON T1.city_name = T2.city_name JOIN location AS T3 ON T1.id = T3.restaurant_id WHERE T2.region = 'bay area' AND T1.food_type = 'french';
which states have a river? Schema: - river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse)
SELECT traverse FROM river;
What are all the calendar dates and day Numbers? Schema: - Ref_Calendar(Calendar_Date, Day_Number)
SELECT Calendar_Date, Day_Number FROM Ref_Calendar;
return me the number of papers which contain the keyword " Natural Language " .? Schema: - publication_keyword(...) - keyword(keyword) - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year)
SELECT COUNT(DISTINCT T3.title) AS num_papers FROM publication_keyword AS T2 JOIN keyword AS T1 ON T2.kid = T1.kid JOIN publication AS T3 ON T3.pid = T2.pid WHERE T1.keyword = 'Natural Language';
What is the name of the bank branch that has lended the largest total amount in loans, specifically to customers with credit scores below 100? Schema: - loan(...) - bank(SUM, bname, city, morn, no_of_customers, state) - customer(COUNT, T1, acc_bal, acc_type, active, check, credit_score, cust_name, no_of_loans, sav, state, store_id)
SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_ID = CAST(T2.branch_ID AS TEXT) JOIN customer AS T3 ON T1.cust_ID = T3.cust_ID WHERE T3.credit_score < 100 GROUP BY T2.bname ORDER BY SUM(T1.amount) DESC NULLS LAST LIMIT 1;
What are the ids of all students for courses and what are the names of those courses? Schema: - Student_Course_Registrations(COUNT, student_id) - Courses(course_description, course_name)
SELECT T1.student_id, T2.course_name FROM Student_Course_Registrations AS T1 JOIN Courses AS T2 ON CAST(T1.course_id AS TEXT) = T2.course_id;
Find the number of owners who do not own any dogs at this moment.? Schema: - Owners(email_address, first_name, last_name, state) - Dogs(abandoned_yn, age, breed_code, date_arrived, date_departed, name, size_code, weight)
SELECT COUNT(*) AS num_owners FROM Owners WHERE owner_id NOT IN (SELECT owner_id FROM Dogs);
List the total points of gymnasts in descending order.? Schema: - gymnast(Floor_Exercise_Points, Horizontal_Bar_Points)
SELECT Total_Points FROM gymnast ORDER BY Total_Points DESC NULLS LAST;
where are mountains? Schema: - mountain(AVG, COUNT, Country, Height, JO, Name, Prominence, Range, T1, mck, mounta, mountain_altitude, ... (3 more))
SELECT state_name FROM mountain;
Which Advisor has most of students? List advisor and the number of students.? Schema: - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT Advisor, COUNT(*) AS num_students FROM Student WHERE Advisor IS NOT NULL GROUP BY Advisor ORDER BY num_students DESC NULLS LAST LIMIT 1;
What is the name of the party form that is most common? Schema: - Forms(form_type_code) - Party_Forms(...)
SELECT T1.form_name FROM Forms AS T1 JOIN Party_Forms AS T2 ON T1.form_id = T2.form_id GROUP BY T2.form_id, T1.form_name ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
How many clubs does "Linda Smith" have membership for? Schema: - Club(ClubDesc, ClubLocation, ClubName, Enterpr, Gam, Hopk, Tenn) - Member_of_club(...) - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT COUNT(*) AS num_clubs 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.Fname = 'Linda' AND T3.LName = 'Smith';
how many papers are based on ImageNet? Schema: - paperDataset(...) - dataset(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT COUNT(DISTINCT T3.paperId) AS num_papers FROM paperDataset AS T2 JOIN dataset AS T1 ON T2.datasetId = T1.datasetId JOIN paper AS T3 ON T3.paperId = T2.paperId WHERE T1.datasetName LIKE 'ImageNet';
What are the different reviewer names, movie titles, and stars for every rating where the reviewer had the same name as the director? Schema: - Rating(Rat, mID, rID, stars) - Movie(T1, director, title, year) - Reviewer(Lew, name, rID)
SELECT DISTINCT T3.name, T2.title, T1.stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T2.director = T3.name;
Show the case burden of counties in descending order of population.? Schema: - county_public_safety(COUNT, Case_burden, Crime_rate, Location, Name, Police_force, Police_officers, Population, T1)
SELECT Case_burden FROM county_public_safety ORDER BY Population DESC NULLS LAST;
Show titles of songs and names of singers.? Schema: - singer(Age, Birth_Year, COUNT, Citizenship, Country, Name, Net_Worth_Millions, Song_Name, Song_release_year, T1, s) - song(COUNT, M, art, artist_name, engl, f_id, genre_is, languages, rat, rating, releasedate, resolution, ... (1 more))
SELECT T2.Title, T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID;
How many distinct kinds of camera lenses are used to take photos of mountains in the country 'Ethiopia'? Schema: - mountain(AVG, COUNT, Country, Height, JO, Name, Prominence, Range, T1, mck, mounta, mountain_altitude, ... (3 more)) - photos(color, id, name)
SELECT COUNT(DISTINCT T2.camera_lens_id) AS num_lenses FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id WHERE T1.Country = 'Ethiopia';
What are the names of all the countries that became independent after 1950? Schema: - country(Capital, Continent, Country_name, Engl, GNP, GovernmentForm, HeadOfState, IndepYear, LifeExpectancy, M, Name, Official_native_language, ... (4 more))
SELECT Name FROM country WHERE IndepYear > 1950;