question
stringlengths
43
589
query
stringlengths
19
598
What are the wines that have prices higher than 50 and made of Red color grapes? 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;
How many high schoolers are there? Schema: - Highschooler(COUNT, ID, grade, name)
SELECT COUNT(*) AS num_highschoolers FROM Highschooler;
What are the names of scientists who are not working on the project with the most hours? Schema: - Scientists(Name) - AssignedTo(Scientist) - Projects(COUNT, Hours, Name, Project_Details, Project_ID, organ, organisation_id, project_details)
SELECT Name FROM Scientists WHERE Name NOT IN (SELECT T3.Name FROM AssignedTo AS T1 JOIN Projects AS T2 ON T1.Project = T2.Code JOIN Scientists AS T3 ON T1.Scientist = T3.SSN WHERE T2.Hours = (SELECT MAX(Hours) FROM Projects));
List the name, nationality and id of all male architects ordered by their names lexicographically.? Schema: - architect(gender, id, name, nationality)
SELECT name, nationality, id FROM architect WHERE gender = 'male' ORDER BY name ASC NULLS LAST;
Find the locations that have more than one movie theater with capacity above 300.? Schema: - cinema(COUNT, Capacity, Location, Name, Openning_year, T1, c)
SELECT Location FROM cinema WHERE Capacity > 300 AND Location IS NOT NULL GROUP BY Location HAVING COUNT(*) > 1;
Show the countries that have managers of age above 50 or below 46.? Schema: - manager(Age, Country, Level, Name, Working_year_starts, m1)
SELECT Country FROM manager WHERE Age > 50 OR Age < 46;
what is the largest state in usa? Schema: - state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom)
SELECT state_name FROM state WHERE area = (SELECT MAX(area) FROM state);
What are the best NLP conferences ? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - cite(...)
SELECT DISTINCT COUNT(DISTINCT T4.citingPaperId) AS num_papers, T3.venueId 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 = 'NLP' GROUP BY T3.venueId ORDER BY num_papers DESC NULLS LAST;
When did the staff member with first name as Janessa and last name as Sawayn leave the company? Schema: - 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 date_left_staff FROM Staff WHERE first_name = 'Janessa' AND last_name = 'Sawayn';
Show the name of storms which don't have affected region in record.? Schema: - storm(Damage_millions_USD, Dates_active, Name, Number_Deaths) - affected_region(Region_id)
SELECT Name FROM storm WHERE Storm_ID NOT IN (SELECT Storm_ID FROM affected_region);
return me all the researchers in Databases area in " University of Michigan " .? Schema: - domain_author(...) - author(...) - domain(...) - organization(continent, homepage, name)
SELECT T1.name FROM domain_author AS T4 JOIN author AS T1 ON T4.aid = T1.aid JOIN domain AS T3 ON T3.did = T4.did JOIN organization AS T2 ON T2.oid = T1.oid WHERE T3.name = 'Databases' AND T2.name = 'University of Michigan';
What is the number of professors for different school? Schema: - DEPARTMENT(Account, DEPT_ADDRESS, DEPT_NAME, H, SCHOOL_CODE) - PROFESSOR(DEPT_CODE, PROF_HIGH_DEGREE)
SELECT COUNT(*) AS num_professors, T1.SCHOOL_CODE FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE;
What are the ids, types, and details of the organization with the most research staff? Schema: - Organisations(...) - Research_Staff(staff_details)
SELECT T1.organisation_id, T1.organisation_type, T1.organisation_details FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id, T1.organisation_type, T1.organisation_details ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
Show the studios that have produced films with director "Nicholas Meyer" and "Walter Hill".? Schema: - film(COUNT, Directed_by, Director, Gross_in_dollar, JO, LENGTH, Studio, T1, Title, language_id, rating, rental_rate, ... (3 more))
SELECT DISTINCT T1.Studio FROM (SELECT Studio FROM film WHERE Director = 'Nicholas Meyer') AS T1 JOIN (SELECT Studio FROM film WHERE Director = 'Walter Hill') AS T2 ON T1.Studio = T2.Studio;
List the name, location, mascot for all schools.? Schema: - School(County, Enrollment, Location, Mascot, School_name)
SELECT School_name, Location, Mascot FROM School;
return me the total citations of papers in the VLDB conference in 2005 .? Schema: - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year) - conference(homepage, name)
SELECT SUM(T2.citation_num) AS total_citations FROM publication AS T2 JOIN conference AS T1 ON T2.cid = CAST(T1.cid AS TEXT) WHERE T1.name = 'VLDB' AND T2."year" = 2005;
List the names of members who did not participate in any round.? Schema: - member_(Address, Age, COUNT, Card_Number, Country, Hometown, Level, Member_ID, Member_Name, Membership_card, Name, Party_ID, ... (1 more)) - round(...)
SELECT Name FROM member_ WHERE Member_ID NOT IN (SELECT Member_ID FROM round);
What are the names and years of the movies that has the top 3 highest rating star? Schema: - Rating(Rat, mID, rID, stars) - Movie(T1, director, title, year)
SELECT T2.title, T2."year" FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY T1.stars DESC NULLS LAST LIMIT 3;
Number of ACL papers with more than 2 citations? Schema: - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - cite(...) - venue(venueId, venueName)
SELECT DISTINCT COUNT(T3.citingPaperId) AS num_papers FROM paper AS T1 JOIN cite AS T3 ON T1.paperId = T3.citedPaperId JOIN venue AS T2 ON T2.venueId = T1.venueId WHERE T2.venueName = 'ACL' GROUP BY T3.citingPaperId HAVING COUNT(DISTINCT T3.citedPaperId) > 2;
Find the name of customers whose credit score is below the average credit scores of all customers.? 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 WHERE credit_score < (SELECT AVG(credit_score) FROM customer);
What is the last name of the staff member in charge of the complaint on the product with the lowest price? Schema: - Staff(COUNT, Name, Other_Details, date_joined_staff, date_left_staff, date_of_birth, email_address, first_name, gender, last_name, middle_name, nickname) - Complaints(complaint_status_code, complaint_type_code) - Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more))
SELECT T1.last_name FROM Staff AS T1 JOIN Complaints AS T2 ON T1.staff_id = T2.staff_id JOIN Products AS T3 ON T2.product_id = T3.product_id ORDER BY T3.product_price ASC NULLS LAST LIMIT 1;
What are the names of the songs whose rating is below the rating of all songs in English? Schema: - song(COUNT, M, art, artist_name, engl, f_id, genre_is, languages, rat, rating, releasedate, resolution, ... (1 more))
SELECT song_name FROM song WHERE rating < (SELECT MIN(rating) FROM song WHERE languages = 'english');
What is the first name and last name of the customer that has email "luisg@embraer.com.br"? Schema: - Customer(Email, FirstName, LastName, State, lu)
SELECT FirstName, LastName FROM Customer WHERE Email = 'luisg@embraer.com.br';
What are the names of the countries and average invoice size of the top countries by size? Schema: - invoices(billing_city, billing_country, billing_state, total)
SELECT billing_country, AVG(total) AS avg_invoice_size FROM invoices WHERE billing_country IS NOT NULL GROUP BY billing_country ORDER BY avg_invoice_size DESC NULLS LAST LIMIT 10;
how many programs are there? Schema: - program(Beij, Launch, Name, Origin, Owner)
SELECT COUNT(*) AS num_programs FROM program;
Show the name, role code, and date of birth for the employee with name 'Armani'.? Schema: - Employees(COUNT, Date_of_Birth, Employee_ID, Employee_Name, Role_Code, employee_id, employee_name, role_code)
SELECT Employee_Name, Role_Code, Date_of_Birth FROM Employees WHERE Employee_Name = 'Armani';
How many games were played in park "Columbia Park" in 1907? Schema: - home_game(attendance, year) - park(city, state)
SELECT COUNT(*) AS num_games FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1."year" = 1907 AND T2.park_name = 'Columbia Park';
where is a good restaurant in the yosemite and mono lake area for french food ? 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 = 'yosemite and mono lake area' AND T1.food_type = 'french' AND T1.rating > 2.5;
What is the code of airport that has the highest number of flights? Schema: - airports(AirportCode, AirportName, Argent, COUNT, City, Country, city, country, elevation, name) - flights(DestAirport, FlightNo, SourceAirport)
SELECT T1.AirportCode FROM airports AS T1 JOIN flights AS T2 ON T1.AirportCode = T2.DestAirport OR T1.AirportCode = T2.SourceAirport GROUP BY T1.AirportCode ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
List all the contact channel codes that 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;
what state has the highest population density? Schema: - state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom)
SELECT state_name FROM state WHERE density = (SELECT MAX(density) FROM state);
How many cars have more than 4 cylinders? Schema: - cars_data(Accelerate, Cylinders, Horsepower, MPG, T1, Weight, Year)
SELECT COUNT(*) AS num_cars FROM cars_data WHERE Cylinders > 4;
what are the cities of the state with the highest point? Schema: - city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more)) - highlow(M, highest_elevation, highest_point, lowest_elevation, lowest_point, state_name)
SELECT city_name FROM city WHERE state_name IN (SELECT state_name FROM highlow WHERE highest_elevation = (SELECT MAX(highest_elevation) FROM highlow));
What are the names of the teachers and the courses they teach in ascending alphabetical order by the name of the teacher? Schema: - course_arrange(...) - course(COUNT, JO, SUM, Stat, T1, course_id, credits, dept_name, title) - teacher(Age, COUNT, D, Hometown, Name)
SELECT T3.Name, T2.Course FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID = T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID = T3.Teacher_ID ORDER BY T3.Name ASC NULLS LAST;
When does Michael Stonebraker publish the first VLDB paper ? Schema: - venue(venueId, venueName) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...) - author(...)
SELECT DISTINCT T3."year" 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 = 'Michael Stonebraker' AND T4.venueName = 'VLDB' ORDER BY T3."year" ASC NULLS LAST;
which is the longest river in usa? Schema: - river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse)
SELECT river_name FROM river WHERE LENGTH = (SELECT MAX(LENGTH) FROM river);
What are all the movies rated as R? List the titles.? Schema: - film(COUNT, Directed_by, Director, Gross_in_dollar, JO, LENGTH, Studio, T1, Title, language_id, rating, rental_rate, ... (3 more))
SELECT title FROM film WHERE rating = 'R';
What are the names of the counties of public safety, ordered by population descending? Schema: - county_public_safety(COUNT, Case_burden, Crime_rate, Location, Name, Police_force, Police_officers, Population, T1)
SELECT Name FROM county_public_safety ORDER BY Population DESC NULLS LAST;
Find all restaurant reviewed by Patrick in " Dallas "? Schema: - category(...) - business(business_id, city, full_address, name, rating, review_count, state) - review(i_id, rank, rating, text) - user_(name)
SELECT T1."name" FROM category AS T2 JOIN business AS T1 ON T2.business_id = T1.business_id JOIN review AS T3 ON T3.business_id = T1.business_id JOIN user_ AS T4 ON T4.user_id = T3.user_id WHERE T1.city = 'Dallas' AND T2.category_name = 'restaurant' AND T4.name = 'Patrick';
Find the prices of products which has never received a single complaint.? Schema: - Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more)) - Complaints(complaint_status_code, complaint_type_code)
SELECT product_price FROM Products WHERE product_id NOT IN (SELECT product_id FROM Complaints);
List all the model names sorted by their launch year.? Schema: - chip_model(Launch_year, Model_name, RAM_MiB, WiFi)
SELECT Model_name FROM chip_model ORDER BY Launch_year ASC NULLS LAST;
what state has the highest population? Schema: - state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom)
SELECT state_name FROM state WHERE population = (SELECT MAX(population) FROM state);
What are the id and the amount of refund of the booking that incurred the most times of payments? Schema: - Bookings(Actual_Delivery_Date, COUNT, Order_Date, Planned_Delivery_Date, Status_Code) - Payments(Amount_Payment, COUNT, Date_Payment_Made, Payment_ID, Payment_Method_Code, V, amount_due, amount_paid, payment_date, payment_type_code)
SELECT T1.booking_id, T1.amount_of_refund FROM Bookings AS T1 JOIN Payments AS T2 ON T1.booking_id = T2.booking_id GROUP BY T1.booking_id, T1.amount_of_refund ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
List the distinct police forces of counties whose location is not on east side.? 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';
return me all the 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 T3.title 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';
Find the white grape used to produce wines with scores above 90.? Schema: - grapes(...) - wine(Appelation, Cases, Grape, M, Name, Price, Score, Winery, Year, Z, w)
SELECT DISTINCT T1.Grape FROM grapes AS T1 JOIN wine AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'White' AND T2.Score > 90;
What are the names of actors, ordered alphabetically? 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;
Find products with max page size as "A4" and pages per minute color smaller than 5.? Schema: - product(COUNT, pages_per_minute_color, product)
SELECT product FROM product WHERE max_page_size = 'A4' AND pages_per_minute_color < 5;
Find the name of scientists who are assigned to some project.? Schema: - AssignedTo(Scientist) - Scientists(Name)
SELECT T2.Name FROM AssignedTo AS T1 JOIN Scientists AS T2 ON T1.Scientist = T2.SSN;
What is the height of the mountain climbined by the climbing who had the most points? Schema: - climber(Country, K, Name, Points) - mountain(AVG, COUNT, Country, Height, JO, Name, Prominence, Range, T1, mck, mounta, mountain_altitude, ... (3 more))
SELECT T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T1.Points DESC NULLS LAST LIMIT 1;
what wyoming city has the largest population? Schema: - city(COUNT, City, District, GDP, M, Name, Official_Name, Population, Regional_Population, SUM, Status, T1, ... (10 more))
SELECT city_name FROM city WHERE population = (SELECT MAX(population) FROM city WHERE state_name = 'wyoming') AND state_name = 'wyoming';
What are the names and descriptions of the photos taken at the tourist attraction "film festival"? Schema: - Photos(Name) - 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.Name, T1.Description FROM Photos AS T1 JOIN Tourist_Attractions AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = 'film festival';
What is the count of the car models produced in the United States? Schema: - model_list(Maker, Model) - car_makers(...) - countries(...)
SELECT COUNT(*) AS num_models FROM model_list AS T1 JOIN car_makers AS T2 ON T1.Maker = T2.Id JOIN countries AS T3 ON T2.CountryId = T3.CountryId WHERE T3.CountryName = 'usa';
Give me the first name and last name for all the female members of the club "Bootup Baltimore".? Schema: - Club(ClubDesc, ClubLocation, ClubName, Enterpr, Gam, Hopk, Tenn) - Member_of_club(...) - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT T3.Fname, T3.LName FROM Club AS T1 JOIN Member_of_club AS T2 ON T1.ClubID = T2.ClubID JOIN Student AS T3 ON T2.StuID = T3.StuID WHERE T1.ClubName = 'Bootup Baltimore' AND T3.Sex = 'F';
how many french restaurants are there in palo alto ? Schema: - restaurant(...) - location(...)
SELECT COUNT(*) AS num_french_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';
Show all director names who have a movie in the year 1999 or 2000.? Schema: - movie(Budget_million, Director, Find, Gross_worldwide, T1, Title, Year, budget, release_year, title)
SELECT Director FROM movie WHERE "Year" = 1999 OR "Year" = 2000;
For each citizenship, how many singers are from that country? Schema: - singer(Age, Birth_Year, COUNT, Citizenship, Country, Name, Net_Worth_Millions, Song_Name, Song_release_year, T1, s)
SELECT Citizenship, COUNT(*) AS num_singers FROM singer GROUP BY Citizenship;
Find the ids and names of members who are under age 30 or with black membership card.? Schema: - member_(Address, Age, COUNT, Card_Number, Country, Hometown, Level, Member_ID, Member_Name, Membership_card, Name, Party_ID, ... (1 more))
SELECT Name, Member_ID FROM member_ WHERE Membership_card = 'Black' OR Age < 30;
Show the names of phones and the districts of markets they are on, in ascending order of the ranking of the market.? Schema: - phone_market(...) - market(Country, Number_cities) - phone(Accreditation_level, Accreditation_type, COUNT, Carrier, Company_name, Hardware_Model_name, Memory_in_G, Name, Spr, chip_model, p1, screen_mode)
SELECT T3.Name, T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = CAST(T3.Phone_ID AS TEXT) ORDER BY T2.Ranking ASC NULLS LAST;
How many female students (sex is F) whose age is below 25? Schema: - Student(Advisor, Age, COUNT, Fname, L, LName, M, Major, Sex, StuID, city_code, oldest_age)
SELECT COUNT(*) AS num_students FROM Student WHERE Sex = 'F' AND Age < 25;
Find all actors who were born in " New York City " in 1984? Schema: - actor(Afghan, Aust, COUNT, Character, Chr, Duration, Kev, Name, age, birth_city, birth_year, first_name, ... (4 more))
SELECT name FROM actor WHERE birth_city = 'New York City' AND birth_year = 1984;
How many customers have at least one order with status "Cancelled"? Schema: - Customer_Orders(customer_id, order_date, order_id, order_shipping_charges)
SELECT COUNT(DISTINCT customer_id) AS num_customers FROM Customer_Orders WHERE order_status = 'Cancelled';
What is the name of the staff that is in charge of the attraction named "US museum"? Schema: - Staff(COUNT, Name, Other_Details, date_joined_staff, date_left_staff, date_of_birth, email_address, first_name, gender, last_name, middle_name, nickname) - 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.Name FROM Staff AS T1 JOIN Tourist_Attractions AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = 'US museum';
which river runs through the most states? Schema: - river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse)
SELECT river_name FROM river GROUP BY (river_name) ORDER BY COUNT(DISTINCT traverse) DESC NULLS LAST LIMIT 1;
How many items in inventory does store 1 have? Schema: - inventory(COUNT, store_id)
SELECT COUNT(*) AS num_items FROM inventory WHERE store_id = 1;
give me a restaurant on buchanan in san francisco that serves good arabic food ? Schema: - restaurant(...) - location(...)
SELECT T2.house_number, T1.name FROM restaurant AS T1 JOIN location AS T2 ON T1.id = T2.restaurant_id WHERE T2.city_name = 'san francisco' AND T2.street_name = 'buchanan' AND T1.food_type = 'arabic' AND T1.rating > 2.5;
Return the ids corresponding to templates with the description 'Presentation'.? Schema: - Ref_Template_Types(Template_Type_Code, Template_Type_Description) - Templates(COUNT, M, Template_ID, Template_Type_Code, Version_Number)
SELECT T2.Template_ID FROM Ref_Template_Types AS T1 JOIN Templates AS T2 ON T1.Template_Type_Code = T2.Template_Type_Code WHERE T1.Template_Type_Description = 'Presentation';
Find the faculty rank that has the least members.? Schema: - Faculty(Building, COUNT, FacID, Fname, LName, Lname, Phone, Pr, Rank, Room, Sex)
SELECT "Rank" FROM Faculty GROUP BY "Rank" ORDER BY COUNT(*) ASC NULLS LAST LIMIT 1;
What is the name of the product with the color description 'yellow'? Schema: - Products(COUNT, Code, Din, Manufacturer, Name, Price, Product_Name, Product_Price, Product_Type_Code, T1, Trad, cum, ... (11 more)) - Ref_Colors(color_description)
SELECT T1.product_name FROM Products AS T1 JOIN Ref_Colors AS T2 ON T1.color_code = T2.color_code WHERE T2.color_description = 'yellow';
What is the document id and name with greatest number of paragraphs? Schema: - Paragraphs(COUNT, Document_ID, Other_Details, Paragraph_Text, T1) - 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.Document_ID, T2.Document_Name FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.Document_ID = T2.Document_ID GROUP BY T1.Document_ID, T2.Document_Name ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
what keywords are used by Luke Zettlemoyer? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year) - writes(...) - author(...)
SELECT DISTINCT T1.keyphraseId FROM paperKeyphrase AS T2 JOIN keyphrase AS T1 ON T2.keyphraseId = T1.keyphraseId JOIN paper AS T3 ON T3.paperId = T2.paperId JOIN writes AS T4 ON T4.paperId = T3.paperId JOIN author AS T5 ON T4.authorId = T5.authorId WHERE T5.authorName = 'Luke Zettlemoyer';
return me the number of the keywords of " Making database systems usable " .? Schema: - publication_keyword(...) - keyword(keyword) - publication(COUNT, Mak, Price, Publ, Publication_Date, Publisher, T1, abstract, citation_num, reference_num, title, year)
SELECT COUNT(DISTINCT T1.keyword) AS num_keywords FROM publication_keyword AS T3 JOIN keyword AS T1 ON T3.kid = T1.kid JOIN publication AS T2 ON T2.pid = T3.pid WHERE T2.title = 'Making database systems usable';
what is the highest point in texas? Schema: - highlow(M, highest_elevation, highest_point, lowest_elevation, lowest_point, state_name)
SELECT highest_point FROM highlow WHERE state_name = 'texas';
Return the name of each physician and the number of patients he or she treats.? Schema: - Physician(I, Name) - Patient(...)
SELECT T1.Name, COUNT(*) AS num_patients FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID, T1.Name;
Which staff have contacted which engineers? List the staff name and the engineer first name and last name.? Schema: - Staff(COUNT, Name, Other_Details, date_joined_staff, date_left_staff, date_of_birth, email_address, first_name, gender, last_name, middle_name, nickname) - Engineer_Visits(...) - Maintenance_Engineers(COUNT, T1, engineer_id, first_name, last_name)
SELECT T1.staff_name, T3.first_name, T3.last_name FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id JOIN Maintenance_Engineers AS T3 ON T2.engineer_id = T3.engineer_id;
What are the first names of all players, and their average rankings? Schema: - players(COUNT, birth_date, country_code, first_name, hand, last_name) - rankings(ranking_date, tours)
SELECT T1.first_name, AVG(ranking) AS avg_ranking FROM players AS T1 JOIN rankings AS T2 ON T1.player_id = T2.player_id GROUP BY T1.player_id, T1.first_name;
What are lines 1 and 2 of the addressed of the customer with the email "vbogisich@example.org"? 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 address_line_1, address_line_2 FROM Customers WHERE email_address = 'vbogisich@example.org';
For each classroom, show the classroom number and count the number of distinct grades that use the room.? Schema: - list(COUNT, Classroom, FirstName, Grade, LastName)
SELECT Classroom, COUNT(DISTINCT Grade) AS num_grades FROM list GROUP BY Classroom;
What is the average gpa of the students enrolled in the course with code ACCT-211? Schema: - ENROLL(...) - STUDENT(DEPT_CODE, STU_DOB, STU_FNAME, STU_GPA, STU_HRS, STU_LNAME, STU_PHONE) - CLASS(CLASS_CODE, CLASS_ROOM, CLASS_SECTION, CRS_CODE, PROF_NUM)
SELECT AVG(T2.STU_GPA) AS avg_gpa FROM ENROLL AS T1 JOIN STUDENT AS T2 ON T1.STU_NUM = T2.STU_NUM JOIN CLASS AS T3 ON T1.CLASS_CODE = T3.CLASS_CODE WHERE T3.CRS_CODE = 'ACCT-211';
Find the total credits of all classes offered by each department.? Schema: - COURSE(C, CRS_CODE, CRS_CREDIT, CRS_DESCRIPTION, DEPT_CODE) - CLASS(CLASS_CODE, CLASS_ROOM, CLASS_SECTION, CRS_CODE, PROF_NUM)
SELECT SUM(T1.CRS_CREDIT) AS total_credits, T1.DEPT_CODE FROM COURSE AS T1 JOIN CLASS AS T2 ON T1.CRS_CODE = T2.CRS_CODE GROUP BY T1.DEPT_CODE;
What is the maximum, minimum and average market share of the listed browsers? Schema: - browser(id, market_share, name)
SELECT MAX(market_share) AS max_market_share, MIN(market_share) AS min_market_share, AVG(market_share) AS avg_market_share FROM browser;
How many characteristics does the product named "laurel" have? 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 COUNT(*) AS num_characteristics 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 = 'laurel';
Find the full name of employee who supported the most number of customers.? 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)) - customers(Mart, city, company, country, email, first_name, last_name, phone, state)
SELECT T1.first_name, T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id = T2.support_rep_id GROUP BY T1.id, T1.first_name, T1.last_name ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1;
What are the names of the storms that affected both the regions of Afghanistan and Albania? 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 IN ('Afghanistan', 'Albania') GROUP BY T3.Name HAVING COUNT(DISTINCT T2.Region_name) = 2;
What are the titles of films that do not have a film market estimation? Schema: - film(COUNT, Directed_by, Director, Gross_in_dollar, JO, LENGTH, Studio, T1, Title, language_id, rating, rental_rate, ... (3 more)) - film_market_estimation(High_Estimate, Low_Estimate, Type)
SELECT Title FROM film WHERE Film_ID NOT IN (SELECT Film_ID FROM film_market_estimation);
What are the total amount of money in the invoices billed from Chicago, Illinois? Schema: - invoices(billing_city, billing_country, billing_state, total)
SELECT SUM(total) AS total_money FROM invoices WHERE billing_city = 'Chicago' AND billing_state = 'IL';
which rivers run through states that border the state with the capital atlanta? Schema: - river(COUNT, DIST, LENGTH, M, country_name, illino, m, river_name, traverse) - border_info(T1, border, state_name) - state(M, area, aust, capital, country_name, density, population, population_per_square_km, rhode, state_name, wyom)
SELECT river_name FROM river WHERE traverse IN (SELECT border FROM border_info WHERE state_name IN (SELECT state_name FROM state WHERE capital = 'atlanta'));
What is the latest movie by " Jim Jarmusch "? Schema: - director(Afghan, name, nationality) - directed_by(...) - movie(Budget_million, Director, Find, Gross_worldwide, T1, Title, Year, budget, release_year, title)
SELECT T3.title FROM director AS T2 JOIN directed_by AS T1 ON T2.did = T1.did JOIN movie AS T3 ON T3.mid = T1.msid WHERE T2.name = 'Jim Jarmusch' ORDER BY T3.release_year DESC NULLS LAST LIMIT 1;
Show the number of high schoolers for each grade.? Schema: - Highschooler(COUNT, ID, grade, name)
SELECT grade, COUNT(*) AS num_highschoolers FROM Highschooler GROUP BY grade;
Return the characters for actors, ordered by age descending.? Schema: - actor(Afghan, Aust, COUNT, Character, Chr, Duration, Kev, Name, age, birth_city, birth_year, first_name, ... (4 more))
SELECT "Character" FROM actor ORDER BY age DESC NULLS LAST;
what are the populations of states which border texas? 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 T2.population FROM state AS T2 JOIN border_info AS T1 ON T2.state_name = T1.border WHERE T1.state_name = 'texas';
How many distinct president votes are recorded? Schema: - Voting_record(Election_Cycle, President_Vote, Registration_Date, Secretary_Vote, Vice_President_Vote)
SELECT COUNT(DISTINCT President_Vote) AS num_president_votes FROM Voting_record;
Find the person who has exactly one friend.? Schema: - PersonFriend(M, friend, name)
SELECT name FROM PersonFriend WHERE name IS NOT NULL GROUP BY name HAVING COUNT(*) = 1;
latest deep learning papers? Schema: - paperKeyphrase(...) - keyphrase(...) - paper(For, Switch, journalId, juic, learn, mach, paperId, title, venueId, year)
SELECT DISTINCT T3.paperId, T3."year" 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 = 'deep learning' ORDER BY T3."year" DESC NULLS LAST;
Show all destinations and the number of flights to each destination.? Schema: - flight(Altitude, COUNT, Date, Pilot, Vehicle_Flight_number, Velocity, arrival_date, departure_date, destination, distance, flno, origin, ... (1 more))
SELECT destination, COUNT(*) AS num_flights FROM flight GROUP BY destination;
What are the ids of instructors who didnt' teach? Schema: - instructor(AVG, M, So, Stat, dept_name, name, salary) - teaches(ID, Spr, semester)
SELECT ID FROM instructor WHERE ID NOT IN (SELECT ID FROM teaches);
How many musicals has each nominee been nominated for? Schema: - musical(Award, COUNT, Name, Nom, Nominee, Result, T1)
SELECT Nominee, COUNT(*) AS num_musicals FROM musical GROUP BY Nominee;
papers by sharon goldwater ? Schema: - writes(...) - author(...)
SELECT DISTINCT T2.paperId FROM writes AS T2 JOIN author AS T1 ON T2.authorId = T1.authorId WHERE T1.authorName = 'sharon goldwater';
Find the first name of the students who permanently live in the country Haiti or have the cell phone number 09700166582 .? 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)) - Addresses(address_content, city, country, line_1, line_1_number_building, line_2, state_province_county, town_city, zip_postcode)
SELECT T1.first_name FROM Students AS T1 JOIN Addresses AS T2 ON T1.permanent_address_id = T2.address_id WHERE T2.country = 'Haiti' OR T1.cell_mobile_number = '09700166582';
Find the number of reviews.? Schema: - review(i_id, rank, rating, text)
SELECT COUNT(*) AS num_reviews FROM review;