sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
Which of the previous products are more expensive than the average price of all products? | Do you mean to find the names of those products that are more expensive than the average price of all products? | Only the names of those products supplied by supplier id 2. | 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 name of the division in which Club Brugge and Genk competed on September 13, 2009? | SELECT T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.Date = '2009-09-13' and T1.HomeTeam = 'Club Brugge' AND T1.AwayTeam = 'Genk' |
Find the names of all artists that have "a" in their names. | SELECT Name FROM ARTIST WHERE Name LIKE "%a%" |
Who was the lead with John Shuster as skip in the season of 2009–10? | SELECT lead FROM table_name_83 WHERE skip = "john shuster" AND season = "2009–10" |
Remove all instructor IDs who did not teach in Spring 2010 from the list. | Did you mean retain the instructor IDs who both teach in Spring 2010 and in Fall 2009 | Retain the instructor IDs who did not teach in Spring 2010 but did teach in Fall 2009 | SELECT id FROM teaches WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT id FROM teaches WHERE semester = 'Spring' AND YEAR = 2010 |
How many strokes under par was the player who scored 71? | SELECT to_par FROM table_name_43 WHERE score = 71 |
What are the names of all tracks that are on playlists titled Movies? | SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T3.id = T2.playlist_id WHERE T3.name = "Movies"; |
What base pair has 832 genes? | SELECT base_pairs FROM table_name_79 WHERE genes = 832 |
Please name any three products that have been discontinued in the meat or poultry category. | SELECT T2.ProductName FROM Categories AS T1 INNER JOIN Products AS T2 ON T1.CategoryID = T2.CategoryID WHERE T2.Discontinued = 1 AND T1.CategoryName = 'Meat/Poultry' LIMIT 3 |
List the brands of lenses that took both a picture of mountains with range 'Toubkal Atlas' and a picture of mountains with range 'Lasta Massif' | SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T1.range = 'Toubkal Atlas' INTERSECT SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T1.range = 'Lasta Massif' |
Show all the ranks and the number of male and female faculty for each rank. | SELECT rank , sex , count(*) FROM Faculty GROUP BY rank , sex |
What is the bounding box of the object sample in image no.5 that has a self-relation? | SELECT T2.X, T2.Y, T2.W, T2.H FROM IMG_REL AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.IMG_ID = T2.IMG_ID WHERE T1.IMG_ID = 5 AND T1.OBJ1_SAMPLE_ID = T1.OBJ2_SAMPLE_ID |
who had high rebounds at game 69? | SELECT high_rebounds FROM table_27700375_10 WHERE game = 69 |
What constituency does the Conservative Darren Millar belong to? | SELECT constituency FROM table_name_93 WHERE conservative = "darren millar" |
what is the worlds smallest population? | SELECT MIN(world) FROM table_19017269_5 |
Find the name of the customer that has been involved in the most policies. | SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id GROUP BY t2.customer_details ORDER BY count(*) DESC LIMIT 1 |
How many airports are there per city in the United States? Order the cities by decreasing number of airports. | SELECT count(*) , city FROM airports WHERE country = 'United States' GROUP BY city ORDER BY count(*) DESC |
Can you find their addresses and add them to the chart? | SELECT customer_name ,customer_address FROM customers WHERE customer_id NOT IN ( SELECT customer_id FROM customer_address_history ) |
What is the name of the Chassis of Diver Maria Teresa de Filippis in round 1? | SELECT chassis FROM table_name_62 WHERE rounds = "1" AND driver = "maria teresa de filippis" |
Which Arena has an Opponent of @ oilers, and a Date of may 25? | SELECT arena FROM table_name_79 WHERE opponent = "@ oilers" AND date = "may 25" |
Name the tournament for may 18, 1997 | SELECT tournament FROM table_name_90 WHERE date = "may 18, 1997" |
What are the distinct name of the mills built by the architects who have also built a bridge longer than 80 meters? | SELECT DISTINCT T1.name FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id = T2.id JOIN bridge AS T3 ON T3.architect_id = T2.id WHERE T3.length_meters > 80 |
Name the party with edward boland | SELECT party FROM table_1341865_23 WHERE incumbent = "Edward Boland" |
How many author published papers in the 'IEEE Computer' journal? | SELECT COUNT(T2.Name) FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId INNER JOIN Journal AS T3 ON T1.JournalId = T3.Id WHERE T3.FullName = 'IEEE Computer' |
What was the method in the fight against Chris Myers? | SELECT method FROM table_name_15 WHERE opponent = "chris myers" |
Which cities have lower temperature in March than in Dec and have never served as host cities? | SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Dec EXCEPT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city |
What is the average end year of the player from swe and a summer transfer window? | SELECT AVG(ends) FROM table_name_81 WHERE nat = "swe" AND transfer_window = "summer" |
How many bikes can be borrowed in San Jose Diridon Caltrain Station at 12:06:01 on 2013/8/29? | SELECT T2.bikes_available FROM station AS T1 INNER JOIN status AS T2 ON T1.id = T2.station_id WHERE T1.name = 'San Jose Diridon Caltrain Station' AND T2.time = '2013/08/29 12:06:01' |
How many places have more than 33 points? | SELECT COUNT(place) FROM table_name_96 WHERE points = 33 |
Show the name, location, open year for all tracks with a seating higher than the average. | SELECT name , LOCATION , year_opened FROM track WHERE seating > (SELECT avg(seating) FROM track) |
What states have at least two representatives? | SELECT State FROM representative GROUP BY State HAVING COUNT(*) >= 2 |
What is the organisation type and id of the organisation which has the most number of research staff? | SELECT T1.organisation_type , T1.organisation_id FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY count(*) DESC LIMIT 1 |
How many credit cards does customer Blanche Huels have? | SELECT COUNT(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = "Blanche" AND T2.customer_last_name = "Huels" AND T1.card_type_code = "Credit" |
What is a park in Anaheim? | SELECT T2.park_name FROM park as t2 WHERE T2.city = "Anaheim" |
What years did the branches open? | SELECT Open_year FROM branch ORDER BY membership_amount DESC LIMIT 3 |
If the district is Virginia 17, who are the candidates? | SELECT candidates FROM table_2668416_18 WHERE district = "Virginia 17" |
period between 1985 - 1990 have minimum infant mortality rate of what. | SELECT MIN(infant_mortality_rate) FROM table_21258_1 WHERE period = "1985 - 1990" |
Find the team of the player of the highest age. | SELECT Team FROM player ORDER BY Age DESC LIMIT 1; |
What is the total number of Games, when Losses is greater than 6, when Club is "Club Sportif Sfaxien", and when Wins is less than 3? | SELECT COUNT(games) FROM table_name_58 WHERE losses > 6 AND club = "club sportif sfaxien" AND wins < 3 |
Who did wilson reis fight against that lasted less than 3 rounds with a time of 1:02? | SELECT opponent FROM table_name_25 WHERE round < 3 AND time = "1:02" |
Which episodes did Katie Palmer write? | SELECT title FROM table_27823058_1 WHERE written_by = "Katie Palmer" |
Among the students who filed for bankruptcy with an absence in school of no more than 6 months, how many students enlisted for the fire department? | SELECT COUNT(T1.name) FROM longest_absense_from_school AS T1 INNER JOIN filed_for_bankrupcy AS T2 ON T1.name = T2.name INNER JOIN enlist AS T3 ON T3.name = T2.name WHERE T3.organ = 'fire_department' |
Find the names of all directors whose movies are rated by Sarah Martinez | SELECT DISTINCT T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Sarah Martinez' |
Where is the home venue of Bengaluru FC? | SELECT home_venue FROM table_name_95 WHERE team = "bengaluru fc" |
What is the diff for a club that has a value of 662 for points for? | SELECT diff FROM table_name_46 WHERE points_for = "662" |
What are the countries of all airlines whose names start with Orbit? | SELECT country FROM airlines WHERE name LIKE 'Orbit%' |
What is the sum of the points with less goals conceded than 51, larger than position 1, has a draw of 7, and more losses than 5? | SELECT SUM(points) FROM table_name_12 WHERE goals_conceded < 51 AND position > 1 AND draws = 7 AND loses > 5 |
which of those enzymes is in the medicine with the name Aripiprazole? | SELECT T3.name FROM medicine_enzyme_interaction AS T1 JOIN medicine AS T2 ON T1.medicine_id = T2.id JOIN enzyme AS T3 ON T1.enzyme_id = T3.id WHERE T2.name = 'Aripiprazole' and T3.location = "Cytosol" |
Among the customers with an average income per inhabitant above 3000, what percentage are in their eighties? | SELECT CAST(SUM(CASE WHEN T1.age BETWEEN 80 AND 89 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T2.INCOME_K > 3000 |
What is the status code, phone number, and email address of the customer whose last name is Kohler or whose first name is Marina? | SELECT customer_status_code , cell_mobile_phone_number , email_address FROM Customers WHERE first_name = "Marina" OR last_name = "Kohler" |
can you show me the name and salary of all instructors? | SELECT name, salary FROM instructor |
What was the little league team from Kentucky when the little league team from Michigan was Grosse Pointe Farms-City LL Grosse Pointe Farms? | SELECT kentucky FROM table_18461045_1 WHERE michigan = "Grosse Pointe Farms-City LL Grosse Pointe Farms" |
what is the lowest league goals when the league apps is 1 and the fa cup goals is more than 0? | SELECT MIN(league_goals) FROM table_name_1 WHERE league_apps = "1" AND fa_cup_goals > 0 |
Which election had the least votes? | select election_id from election where votes = ( SELECT min ( votes ) FROM election ) |
Tell me the position for the student id 1001 ? | Do you mean the city code for students? | yes | SELECT city_code FROM Student where StuID = 1001 |
How many blocks did the player who had 59 rebounds have? | SELECT blocks FROM table_24850487_5 WHERE rebounds = 59 |
List the different director IDs of the movies whose user rating is more than 4. | SELECT DISTINCT T2.directorid FROM u2base AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.rating > 4 |
Please list the descriptions of the series code SM.POP.TOTL for all the countries that are under the lending category of the International Development Associations. | SELECT T2.Description FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.LendingCategory = 'IDA' AND T2.Seriescode = 'SM.POP.TOTL' |
How many producers does the movie "The Amityville Horror" have? | SELECT COUNT(T2.person_id) FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title = 'The Amityville Horror' AND T2.job = 'Producer' |
Name the Result of new zealand Nationality / Opponent? | SELECT result FROM table_name_56 WHERE nationality___opponent = "new zealand" |
Return all the committees that have delegates from Democratic party. | SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Democratic" |
Show the names of festivals that have nominated artworks of type "Program Talent Show". | SELECT T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID WHERE T2.Type = "Program Talent Show" |
Set this result in ascending order of department number | SELECT first_name , last_name , hire_date , salary , department_id FROM employees WHERE first_name NOT LIKE '%M%' ORDER BY department_id |
What was the score in Tie number 16? | SELECT score FROM table_name_16 WHERE tie_no = "16" |
What are the names of parties that have both delegates on "Appropriations"? | SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = "Appropriations" INTERSECT SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = "Economic Matters" |
Show the premise type and address type code for all customer addresses. | SELECT T2.premises_type, T1.address_type_code FROM customer_addresses AS T1 JOIN premises AS T2 ON T1.premise_id = T2.premise_id |
How many season 3 appearances by Morgan the Dog? | SELECT MAX(season_3) FROM table_26240046_1 WHERE played_by = "Morgan the Dog" |
Which position has the highest number of female employees with a 2 year degree? | SELECT T2.positiontitle FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T2.educationrequired = '2 year degree' AND T1.gender = 'F' GROUP BY T2.positiontitle ORDER BY COUNT(T2.positiontitle) DESC LIMIT 1 |
How many payments were made throughout the month of August 2005? | SELECT SUM(amount) FROM payment WHERE payment_date LIKE '2005-08%' |
In what place did the golfer that scored 68-70-69=207 finish? | SELECT place FROM table_name_59 WHERE score = 68 - 70 - 69 = 207 |
List the first and last name of students who are not living in the city with code HKG, and sorted the results by their ages. | SELECT fname , lname FROM student WHERE city_code != 'HKG' ORDER BY age |
I need the number of amenities for the dorms that can accommodate more than 100 students | Are you asking for the number of distinct amenities for dorms whose student capacity is greater than 100? | yes | SELECT count ( DISTINCT T2.amenid ) , T1.dormid FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid WHERE T1.student_capacity > 100 GROUP BY T1.dormid |
Which segment c's segment b is refrigerators? | SELECT segment_c FROM table_name_58 WHERE segment_b = "refrigerators" |
what is the latitude of San Jose Civic Center? | SELECT distinct T1.lat FROM station AS T1 JOIN trip AS T2 where T1.name = 'San Jose Civic Center' |
Name the heightfor city of license of malone, ny | SELECT height_m___ft__ FROM table_name_44 WHERE city_of_license = "malone, ny" |
How many orders were shipped in 1998? | SELECT COUNT(l_orderkey) FROM lineitem WHERE STRFTIME('%Y', l_shipdate) = '1998' |
what about the least? | SELECT Policy_Type_Code FROM Customer_Policies GROUP BY Policy_Type_Code ORDER BY count ( * ) LIMIT 1 |
Which last names are both used by customers and by staff? | SELECT last_name FROM Customers INTERSECT SELECT last_name FROM Staff |
Which region is associated with the catalog value of 512335? | SELECT region FROM table_name_57 WHERE catalog = "512335" |
What is the image ID of page 1 of the menu "Zentral Theater Terrace"? | SELECT T2.image_id FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T1.name = 'Zentral Theater Terrace' AND T2.page_number = 1 |
What is the platelet count for congenital afibrinogenemia? | SELECT platelet_count FROM table_238124_1 WHERE condition = "Congenital afibrinogenemia" |
Among the episodes that were aired in 1998, how many won an International Monitor Awards? | SELECT COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE strftime('%Y', T1.air_date) = '1998' AND T2.organization = 'International Monitor Awards' AND T2.result = 'Winner' |
What is the company name of the supplier who supplies the product with the highest unit price? | SELECT T2.CompanyName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.UnitPrice = ( SELECT MAX(UnitPrice) FROM Products ) |
In which city's office does Sandy Adams work at? | SELECT T2.locationcity FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T1.lastname = 'Adams' AND T1.firstname = 'Sandy' |
What is the most frequently used payment method? | SELECT payment_method FROM Customers GROUP BY payment_method ORDER BY count ( * ) DESC LIMIT 1 |
What is No. 7, when Region (Year) is Arizona (2010)? | SELECT no_7 FROM table_name_85 WHERE region__year_ = "arizona (2010)" |
What's the title of the episode that got the most 7-star votes in star score? | SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 7 ORDER BY T2.votes DESC LIMIT 1; |
What is the device id of the oldest user? | SELECT device_id FROM gender_age WHERE age = ( SELECT MAX(age) FROM gender_age ) |
what's the result with candidates being billy tauzin (d) unopposed | SELECT result FROM table_1341586_19 WHERE candidates = "Billy Tauzin (D) Unopposed" |
which To par has a Country of united states, and a Player of dave stockton? | SELECT to_par FROM table_name_42 WHERE country = "united states" AND player = "dave stockton" |
What is the least total when there are more than 2 golds and fewer than 0 silver? | SELECT MIN(total) FROM table_name_6 WHERE gold > 2 AND silver < 0 |
How many points did Costa score in the Macau Grand Prix since 2011? | SELECT points FROM table_name_23 WHERE season > 2011 AND series = "macau grand prix" |
How many different results were there for the number of votes fro Obama in the county where he got 27.8% of the votes? | SELECT COUNT(obama_number) FROM table_20350118_1 WHERE obama_percentage = "27.8%" |
What date did Collingwood play as the home team? | SELECT date FROM table_name_75 WHERE home_team = "collingwood" |
Who is the visitor team on Saturday, November 22 when linköpings hc was the home team and there were more than 20 rounds? | SELECT visitor FROM table_name_89 WHERE home = "linköpings hc" AND round > 20 AND date = "saturday, november 22" |
What is the record for January 7? | SELECT record FROM table_name_21 WHERE date = "january 7" |
How many different students are involved in sports? | SELECT count(DISTINCT StuID) FROM Sportsinfo |
Please calculate the average temperature of those trips that started at Market at 4th in 2013. | SELECT AVG(T2.mean_temperature_f) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE SUBSTR(CAST(T2.date AS TEXT), -4) = '2013' AND T1.start_station_name = 'Market at 4th' |
Which engine has more than 1 point after 1981? | SELECT engine FROM table_name_71 WHERE points > 1 AND year > 1981 |
Which Release date has a Required OS of windows, a Type of 2d, and a Developer(s) of zeonix? | SELECT release_date FROM table_name_59 WHERE required_os = "windows" AND type = "2d" AND developer_s_ = "zeonix" |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.