sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
What are the names of the customers who have made two or less orders? | SELECT T2.customer_name FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING count(*) <= 2 |
When has a Week of 8? | SELECT date FROM table_name_73 WHERE week = 8 |
What is 2002 when 2009 is 54.0? | SELECT 2002 FROM table_27146868_1 WHERE 2009 = "54.0" |
What are the names and ids of stations that had more than 14 bikes available on average or were installed in December? | SELECT T1.name , T1.id FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id GROUP BY T2.station_id HAVING avg(T2.bikes_available) > 14 UNION SELECT name , id FROM station WHERE installation_date LIKE "12/%" |
what is the age of the host id 3? | SELECT age from host where Host_ID = 3 |
Which business had the most number of inspections? Give the Id number for that business. | SELECT business_id FROM inspections GROUP BY business_id ORDER BY COUNT(business_id) DESC LIMIT 1 |
Among all the donors from New York, how many of them are teachers? | SELECT COUNT(donationid) FROM donations WHERE is_teacher_acct = 't' AND donor_city = 'New York' |
How many courses does the department of Computer Information Systmes offer? | SELECT count(*) FROM department AS T1 JOIN course AS T2 ON T1.dept_code = T2.dept_code WHERE dept_name = "Computer Info. Systems" |
What was the resolution of the fight where andre roberts record was 9-1? | SELECT res FROM table_name_60 WHERE record = "9-1" |
What is the average and total capacity for all dorms who are of gender X? | SELECT avg(student_capacity) , sum(student_capacity) FROM dorm WHERE gender = 'X' |
Which year did the "Internet, Multimedia Systems and Applications" conference publish the most papers? | SELECT T2.Year FROM Conference AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.ConferenceId WHERE T1.FullName = 'Internet, Multimedia Systems and Applications' GROUP BY T2.Year ORDER BY COUNT(T2.Id) DESC LIMIT 1 |
Nice! Can you show me a list of the names of all of the schools? | SELECT School FROM university |
What are the clean and jerk score of the body builder with the highest total score? | SELECT Clean_Jerk FROM body_builder ORDER BY Total DESC LIMIT 1 |
What catalog had an Epic Records label in CD format? | SELECT catalog FROM table_name_16 WHERE label = "epic records" AND format = "cd" |
Which College/junior/club team has a Pick # of 1? | SELECT college_junior_club_team FROM table_name_27 WHERE pick__number = "1" |
In which platform does the game titled 15 Days available? | SELECT T1.platform_name FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN game_publisher AS T3 ON T2.game_publisher_id = T3.id INNER JOIN game AS T4 ON T3.game_id = T4.id WHERE T4.game_name = 'Counter Force' |
What was the Champion of the Tournament with a Score of 79–75 OT? | SELECT champion__seed_ FROM table_name_1 WHERE score = "79–75 ot" |
Find all the payment dates for the payments with an amount larger than 10 and the payments handled by a staff person with the first name Elsa. | SELECT payment_date FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa' |
Which bike had a grid less than 35 and time at 37:58.607? | SELECT bike FROM table_name_13 WHERE grid < 35 AND time = "37:58.607" |
What is the average of all transactions with the transaction type code "SALE"? | SELECT avg ( amount_of_transaction ) FROM TRANSACTIONS WHERE transaction_type_code = "SALE" |
What is the restaurant's name and ID located at Ocean Avenue, San Francisco? | SELECT T2.label, T1.id_restaurant FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'san francisco' AND T1.street_name = 'ocean avenue' |
Show me the policy id of the policy type code Life insurance? | SELECT Policy_ID FROM available_policies where policy_type_code = "Life Insurance" |
find the name of the customers who have at most two orders | SELECT T2.customer_name FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING count ( * ) < = 2 |
what is the ID of the Church of Christ? | SELECT church_id FROM church where name = "Pure Church of Christ" |
Score of 118–114, and a Record of 8–1 is what lowest game? | SELECT MIN(game) FROM table_name_64 WHERE score = "118–114" AND record = "8–1" |
How many review did he have | SELECT count ( * ) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id ORDER BY count ( * ) DESC LIMIT 1 |
What's the Years as tallest with a Street address of 324 E. 11th Street? | SELECT years_as_tallest FROM table_name_12 WHERE street_address = "324 e. 11th street" |
What Utah Jazz guard, played at BYU? | SELECT player FROM table_name_52 WHERE position = "guard" AND school_club_team = "byu" |
What is the surface area and GNP of the country where Namibe district belongs? | SELECT T2.SurfaceArea, T2.GNP FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.District = 'Namibe' |
Who wrote the episode originally aired on September 29, 1999? | SELECT written_by FROM table_18646432_4 WHERE original_air_date = "September 29, 1999" |
Please list the countries and years of film market estimations. | SELECT T2.Country, T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID |
How many companies were created by Andy? | SELECT COUNT(*) FROM manufacturers WHERE founder = 'Andy' |
Who was the pole position for the rnd equalling 12? | SELECT pole_position FROM table_10707176_2 WHERE rnd = "12" |
What is the first and last name of the student participating in the most activities? | SELECT T1.fname , T1.lname FROM Student AS T1 JOIN Participates_in AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY count(*) DESC LIMIT 1 |
Show all template type codes with less than three templates. | SELECT template_type_code FROM Templates GROUP BY template_type_code HAVING count(*) < 3 |
Who plays goaltender for the Vancouver Canucks? | SELECT player FROM table_name_22 WHERE position = "goaltender" AND nhl_team = "vancouver canucks" |
What year did the term end for the office elected in 1984 | SELECT term_ended FROM table_1602620_1 WHERE elected = 1984 |
What is the 2004 tournament that has a Q1 of 2011? | SELECT 2004 FROM table_name_10 WHERE 2011 = "q1" |
What is the total point count of the youngest gymnast? | SELECT T1.Total_Points FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Age ASC LIMIT 1 |
what gender has an asian black bear? | SELECT gender FROM table_26615633_3 WHERE species = "Asian black bear" |
What is the average number of draws that have a total of 1 and a goal difference of 2:0? | SELECT AVG(draws) FROM table_name_67 WHERE total = 1 AND goal_difference = "2:0" |
What was the average game with a record of 4-4-0? | SELECT AVG(game) FROM table_name_58 WHERE record = "4-4-0" |
Between 2014 to 2016, what is the average inpsection score of the establishment owned by Yiu Tim Chan in 808 Pacific Ave, San Francisco? | SELECT AVG(T1.score) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE STRFTIME('%Y', T1.`date`) BETWEEN '2014' AND '2016' AND T2.owner_name = 'Yiu Tim Chan' AND T2.address = '808 Pacific Ave' AND T2.city = 'San Francisco' |
what is the material of the surface in the dehradun , uttarakhand, india location | SELECT surface FROM table_29127804_3 WHERE location = "Dehradun , Uttarakhand, India" |
Please name the coin that ranked first among the coins traded on April 29, 2013. | SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-29' AND T2.cmc_rank = 1 |
Which crytocurrency had a bigger number of coins circulating in the market and in the general public's hands on 2013/4/28, Bitcoin or Litecoin? | SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T1.name IN ('Bitcoin', 'Litecoin') ORDER BY T2.circulating_supply DESC LIMIT 1 |
Which city has the lowest GDP? Please list the city name and its GDP. | SELECT city , GDP FROM city ORDER BY GDP LIMIT 1 |
Give the level of education and occupation of customers ages from 20 to 35 with an income K of 2000 and below. | SELECT T1.EDUCATIONNUM, T1.OCCUPATION FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T2.INCOME_K < 2000 AND T1.age >= 20 AND T1.age <= 35 |
Name who wrote 5ajn11 | SELECT written_by FROM table_23235679_1 WHERE production_code = "5AJN11" |
Find the payment method that is used most frequently. | SELECT payment_method FROM customers GROUP BY payment_method ORDER BY count(*) DESC LIMIT 1 |
Which Start has a 0 Conv, 0 Pens and 8 Tries? | SELECT start FROM table_name_54 WHERE conv = "0" AND pens = "0" AND tries = "8" |
List the distinct police forces of counties whose location is not on east side. | SELECT DISTINCT Police_force FROM county_public_safety WHERE LOCATION != "East" |
Name the team with high assists of nelson (5) | SELECT team FROM table_name_83 WHERE high_assists = "nelson (5)" |
What are the names of the students who took classes in 2009 or 2010? | SELECT DISTINCT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE YEAR = 2009 OR YEAR = 2010 |
What are the names of the courses taught by the tutor whose personal name is "Julio"? | SELECT T2.course_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T1.personal_name = "Julio" |
what is the date for the game in prague for the world group, consolation round competition? | SELECT date FROM table_name_57 WHERE location = "prague" AND competition = "world group, consolation round" |
What was the highest number of points when flaps were 0? | SELECT MAX(points) FROM table_24405773_1 WHERE flaps = 0 |
Show the names of all the activities Mark Giuliano participates in. | 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" |
Show the name of the company with company id 1? | SELECT company FROM company WHERE company_id = '1' |
What is the season number of the episode written by Matt Witten , Richard Sweren? | SELECT no_in_season FROM table_2618152_1 WHERE written_by = "Matt Witten , Richard Sweren" |
Who is the villain in the movie "The Great Mouse Detective"? | SELECT villian FROM characters WHERE movie_title = 'The Great Mouse Detective' |
What is the highest position with less than 17 losses, more than 57 goals, and a goal difference less than 4? | SELECT MAX(position) FROM table_name_39 WHERE losses < 17 AND goals_for > 57 AND goal_difference < 4 |
Name the candidates for new york 21 | SELECT candidates FROM table_2668243_17 WHERE district = "New York 21" |
Which district in Chicago has the most community areas? | SELECT side FROM Community_Area GROUP BY side ORDER BY COUNT(side) DESC LIMIT 1 |
what is the f id of bangala | SELECT f_id from song where languages = 'bangla' |
Who were the candidates when gregory w. meeks was the incumbent | SELECT candidates FROM table_1341395_33 WHERE incumbent = "Gregory W. Meeks" |
What film did michaylo ilyenko make with best actor in a supporting role? | SELECT film_name FROM table_10236830_1 WHERE director = "Michaylo Ilyenko" AND nomination = "Best Actor in a Supporting Role" |
What were the total number of points when there was a lost larger than 6, when the team was Once Municipal, and when the number of goals scored was less than 8? | SELECT COUNT(points) FROM table_name_45 WHERE lost > 6 AND team = "once municipal" AND goals_scored < 8 |
How many of the papers are preprinted? | SELECT COUNT(Id) FROM Paper WHERE ConferenceId = 0 AND JournalId = 0 |
Who is the winner of the Florence to Genoa course? | SELECT winner FROM table_name_95 WHERE course = "florence to genoa" |
what is the teams for season 1950-51? | SELECT teams FROM table_name_89 WHERE season = "1950-51" |
What is the number of faculty lines in campus "Long Beach State University" in 2002? | SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2002 AND T2.campus = "Long Beach State University" |
How many times did Boston Red Stockings lose in 2009 postseason? | SELECT count(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2009; |
When was the first movie released and who directed it? | SELECT movie_release_year, director_name FROM movies WHERE movie_release_year IS NOT NULL ORDER BY movie_release_year ASC LIMIT 1 |
Who was the driver/passengar when the position was smaller than 8, the third was 1, and there was 1 win? | SELECT driver___passenger FROM table_name_56 WHERE third = "1" AND position < 8 AND wins = "1" |
How many Professors are in building NEB? | SELECT count(*) FROM Faculty WHERE Rank = "Professor" AND building = "NEB" |
What's the average Year for the Position of 7th (sf)? | SELECT AVG(year) FROM table_name_47 WHERE position = "7th (sf)" |
What is the highest attendance on September 14, 1986? | SELECT MAX(attendance) FROM table_name_84 WHERE date = "september 14, 1986" |
What is the average rank of a nation that had 219,721 in 2012? | SELECT AVG(rank) FROM table_name_6 WHERE 2012 = 219 OFFSET 721 |
What is the customer first, last name and id with the most number of accounts? | SELECT T2.customer_first_name , T2.customer_last_name , T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count ( * ) DESC LIMIT 1 |
Among the dishes, how many of them were created between 2011-03-31 at 20:24:46 UTC and 2011-04-15 at 23:09:51 UTC. | SELECT SUM(CASE WHEN T2.created_at BETWEEN '2011-03-31 20:24:46 UTC' AND '2011-04-15 23:09:51 UTC' THEN 1 ELSE 0 END) FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id |
What are the descriptions of those courses? | SELECT crs_description FROM department AS T1 JOIN course AS T2 ON T1.dept_code = T2.dept_code WHERE dept_name = "Computer Info. Systems" |
Name the market value for rhb capital | SELECT market_value__billion_$_ FROM table_19112_3 WHERE company = "RHB Capital" |
List the organisation id with the maximum outcome count, and the count. | SELECT T1.organisation_id , count(*) FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.organisation_id ORDER BY count(*) DESC LIMIT 1 |
Name the total number of years for brm straight-4 | SELECT COUNT(year) FROM table_name_65 WHERE engine = "brm straight-4" |
What are the campuses that opened in 1958? | SELECT campus FROM campuses WHERE YEAR = 1958 |
Name the most rank for population more than 93,378 | SELECT MAX(rank) FROM table_name_5 WHERE population > 93 OFFSET 378 |
What was the opponent for july 21? | SELECT opponent FROM table_name_35 WHERE date = "july 21" |
What is the minimum share count of the transaction type code PUR? | SELECT share_count FROM TRANSACTIONS where transaction_type_code = 'PUR' and share_count ! = "" order by share_count limit 1 |
Name the rally base for 5 round | SELECT rally_base FROM table_23385853_1 WHERE round = 5 |
Who was Dainty June when Boyd Gaines was Herbie? | SELECT dainty_june FROM table_name_27 WHERE herbie = "boyd gaines" |
What was the position in 2010 with team notes? | SELECT position FROM table_name_90 WHERE year = 2010 AND notes = "team" |
How many failed the exam? | SELECT count ( * ) FROM Student_Tests_Taken where test_result = 'Fail' |
How many viewers tuned into the show directed by Matt Earl Beesley? | SELECT us_viewers__millions_ FROM table_10718525_2 WHERE directed_by = "Matt Earl Beesley" |
How about swimmers with no record? | SELECT count ( * ) FROM swimmer WHERE id NOT IN ( SELECT swimmer_id FROM record ) |
when province is monseñor nouel, what is the area (km²)? | SELECT area__km²_ FROM table_1888051_1 WHERE province = "Monseñor Nouel" |
Please indicate which writer has an episode star score greater than 5 in 2009. | SELECT T1.person FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE SUBSTR(T1.year, 1, 4) = '2009' AND T1.role = 'writer' AND T2.votes > 5; |
Which Opponent has a Record of 65-95? | SELECT opponent FROM table_name_12 WHERE record = "65-95" |
Tell me the reason for Lavelle Vandervort's encounter on 11/20/2013? | SELECT T2.REASONDESCRIPTION FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T2.DATE = '2013-11-20' AND T1.first = 'Lavelle' AND T1.last = 'Vandervort' |
What are the original names of the districts where the population in the 2010 census was 210450? | SELECT original_name FROM table_1104312_5 WHERE population_at_2010_census = 210450 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.