sentence
stringlengths
3
347
sql
stringlengths
18
804
What are the codes of types of documents of which there are for or more?
SELECT document_type_code FROM documents GROUP BY document_type_code HAVING count(*) > 4
Please list the age and famous title of artists in descending order of age.
SELECT Famous_Title , Age FROM artist ORDER BY Age DESC
What is the most recent year with a mk.v type?
SELECT MAX(year) FROM table_name_62 WHERE type = "mk.v"
Of complaints with the type code "Product Failure", how many had each different status code?
SELECT complaint_status_code , count(*) FROM complaints WHERE complaint_type_code = "Product Failure" GROUP BY complaint_status_code
Find the names of the trains that do not pass any station located in London.
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")
Which network has model nForce Professional 3400 MCP?
SELECT network FROM table_name_29 WHERE model = "nforce professional 3400 mcp"
What is the detailed position of the store which has order SO - 000115?
SELECT T2.Latitude, T2.Longitude FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID WHERE T1.OrderNumber = 'SO - 000115'
How many institutions in this table?
SELECT count ( * ) from Institution
What was the mean humidity of a trip with id 4275?
SELECT T2.mean_humidity FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T1.id = 4275
What is the geographic ID and total income per year when the average income is above 3300 dollar.
SELECT GEOID, INHABITANTS_K * INCOME_K * 12 FROM Demog WHERE INCOME_K > 3300
Please list all the keywords of the episode Lost Verizon.
SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Lost Verizon';
Who were the operational owners during the construction date of April 1892?
SELECT operational_owner_s_ FROM table_1057316_1 WHERE build_date = "April 1892"
Show the names and genders of players with a coach starting after 2011.
SELECT T3.Player_name , T3.gender 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 WHERE T1.Starting_year > 2011
For all the movies which were produced by Cruel and Unusual Films, which one has the most popularity?
SELECT T3.title FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T1.company_name = 'Cruel and Unusual Films' ORDER BY T3.popularity DESC LIMIT 1
And the one with the least number of cards?
SELECT card_type_code FROM Customers_cards GROUP BY card_type_code ORDER BY count ( * ) LIMIT 1
find all first-grade students who are not taught by otha moyer. | Do you mean First or Last names? | first
SELECT DISTINCT T1.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 1 EXCEPT SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "OTHA" AND T2.lastname = "MOYER"
What is the phone number and postal code of the address 1031 Daugavpils Parkway?
SELECT phone, postal_code FROM address WHERE address = '1031 Daugavpils Parkway'
What are the departments managed by heads whose temporary acting value is "yes"? | The following table shows the names of departments managed by heads whose temporary acting value is "yes". | Show me the name and number of employees for the Treasury department.
SELECT name , num_employees FROM department where name = "Treasury"
What are the names of the artists from Bangladesh?
SELECT artist_name FROM artist WHERE country = "Bangladesh"
Where is the Hometown that the person who attended Camarillo High School is from?
SELECT hometown FROM table_name_40 WHERE school = "camarillo high school"
How many body builders are there?
SELECT count(*) FROM body_builder
What are the names of all games that were played for at least 1000 hours?
SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid HAVING sum ( hours_played ) > = 1000
Find the average and total capacity of dorms for the students with gender X.
SELECT avg(student_capacity) , sum(student_capacity) FROM dorm WHERE gender = 'X'
What is the original United States air date of the episode written by Mike Ferris?
SELECT united_states_original_airdate FROM table_29087004_2 WHERE written_by = "Mike Ferris"
For how many terms have the oldest current legislator served?
SELECT COUNT(T2.bioguide) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.birthday_bio = ( SELECT MIN(birthday_bio) FROM current )
How many millions of viewers did the episode directed by Jeffrey Blitz have?
SELECT us_viewers__million_ FROM table_25341765_1 WHERE directed_by = "Jeffrey Blitz"
How many total reason for change are listed corresponding to the successor Leonard B. Jordan (r)?
SELECT COUNT(reason_for_change) FROM table_1802522_3 WHERE successor = "Leonard B. Jordan (R)"
Who made the decisions in the game whose first star was V. Lecavalier?
SELECT decision FROM table_27537518_6 WHERE first_star = "V. Lecavalier"
What was the attendance on August 8?
SELECT attendance FROM table_name_47 WHERE date = "august 8"
what is the gold when silver is 1, event is 2000 summer paralympics and bronze is more than 3?
SELECT AVG(gold) FROM table_name_41 WHERE silver = 1 AND event = "2000 summer paralympics" AND bronze > 3
What are the fewest seats with fewer than 5.4% seats and more than -1 change?
SELECT MIN(seats) FROM table_name_12 WHERE _percentage_votes < 5.4 AND change > -1
List the amount and donor name for the largest amount of donation.
SELECT amount , donator_name FROM endowment ORDER BY amount DESC LIMIT 1
How many engine b5234 t3?
SELECT COUNT(model) FROM table_1147705_1 WHERE engine_type = "B5234 T3"
What are the arriving date and the departing date of the dogs who have gone through a treatment?
SELECT DISTINCT T1.date_arrived , T1.date_departed FROM Dogs AS T1 JOIN Treatments AS T2 ON T1.dog_id = T2.dog_id
find the country in the list? | What do you mean? | how many country in the list?
SELECT COUNT ( DISTINCT country ) FROM airports
What cities are in sweden on this list?
SELECT city FROM table_28005160_2 WHERE country = "Sweden"
Hmm, can you tell me the addresses that have the highest average monthly rental?
SELECT T2.address_id FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY AVG ( monthly_rental ) DESC LIMIT 1
how many total number of points margin when brive is the winners
SELECT COUNT(points_margin) FROM table_27987767_2 WHERE winners = "Brive"
How about the builder with the most trains?
SELECT T1.Builder FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID GROUP BY T2.Railway_ID order by count ( * ) desc limit 1
Find the names of programs that are never broadcasted in the morning.
SELECT name FROM program EXCEPT SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = "Morning"
WHAT IS THE WORLDWIDE BOX OFFICE FOR BRAVE?
SELECT worldwide FROM table_name_41 WHERE film = "brave"
How many matches did Mohammad Hafeez play?
SELECT SUM(CASE WHEN T2.Player_Name = 'Mohammad Hafeez' THEN 1 ELSE 0 END) FROM Player_Match AS T1 INNER JOIN Player AS T2 ON T1.Player_Id = T2.Player_Id
What are the citizenships that are shared by singers with a birth year before 1945 and after 1955?
SELECT Citizenship FROM singer WHERE Birth_Year < 1945 INTERSECT SELECT Citizenship FROM singer WHERE Birth_Year > 1955
Name the number of home town for number being 32
SELECT COUNT(home_town) FROM table_25360865_1 WHERE _number = 32
How many kinds of events does athletics have?
SELECT COUNT(T2.event_name) FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id WHERE T1.sport_name = 'Athletics'
Count the matches that were won by wickets in all season.
SELECT COUNT(T1.Match_Id) FROM Match AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id WHERE T2.Win_type = 'wickets'
What was the earliest year during which the winner was Matthew King, and during which the score was higher than 270?
SELECT MIN(year) FROM table_name_25 WHERE winner = "matthew king" AND score > 270
In which city was the Night of the Living Duck released?
SELECT city FROM table_name_75 WHERE title = "the night of the living duck"
Return the average, minimum, maximum, and total transaction amounts.
SELECT avg(transaction_amount) , min(transaction_amount) , max(transaction_amount) , sum(transaction_amount) FROM Financial_transactions
What are the names of the top 5 universities with the highest number of international students?
SELECT DISTINCT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id ORDER BY (CAST(T1.num_students * T1.pct_international_students AS REAL) / 100) DESC LIMIT 5
Name the party for 1998 first elected
SELECT party FROM table_25030512_24 WHERE first_elected = "1998"
How many different production codes are there for the episode with 4.69 million US viewers?
SELECT COUNT(production_code) FROM table_26429543_1 WHERE us_viewers__millions_ = "4.69"
Hello! Can you show me a list of all course IDs?
SELECT course_id FROM takes
How many viewers in the UK did episode 50 have?
SELECT uk_total_viewers FROM table_30139175_3 WHERE episode_no = 50
What was the score of Game 48?
SELECT score FROM table_name_33 WHERE game = 48
What is the socked when the turbo is 8/8/10/11?
SELECT socket FROM table_name_40 WHERE turbo = "8/8/10/11"
What was the final score for the game that was contested on February 1, 2009?
SELECT final_score FROM table_10548224_1 WHERE date_contested = "February 1, 2009"
How many innings for the player with an average of 22.61?
SELECT innings FROM table_28846752_12 WHERE average = "22.61"
How many order keys are not applied for the discount?
SELECT COUNT(l_orderkey) FROM lineitem WHERE l_discount = 0
Which Week 14 Nov 30 has a Week 6 Oct 5 of michigan state (5-1)?
SELECT week_14_nov_30 FROM table_name_1 WHERE week_6_oct_5 = "michigan state (5-1)"
What is a colt racing entrant engine?
SELECT engine FROM table_name_17 WHERE entrant = "colt racing"
Which Opponent has a Record of 45–21–4?
SELECT opponent FROM table_name_51 WHERE record = "45–21–4"
what's the result with candidates being charles edward bennett (d) unopposed
SELECT result FROM table_1342013_9 WHERE candidates = "Charles Edward Bennett (D) Unopposed"
What is Opponent In Final, when Surface is Hard, when Location is Wellington, New Zealand, and when Date is 6 February 2000?
SELECT opponent_in_final FROM table_name_72 WHERE surface = "hard" AND location = "wellington, new zealand" AND date = "6 february 2000"
What sea does the Baltic Sea converge with, and how deep is the Baltic Sea?
SELECT T2.Sea2, T1.Depth FROM sea AS T1 INNER JOIN mergesWith AS T2 ON T1.Name = T2.Sea1 WHERE T1.Name = 'Baltic Sea'
What are the unit of measure and category code for the 'chervil' product?
SELECT t2.unit_of_measure , t2.product_category_code FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = "chervil"
who owns that account?
SELECT T2.custid FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T2.balance LIMIT 1
What venue will hold the 2013 Concacaf Gold Cup competition?
SELECT venue FROM table_name_59 WHERE competition = "2013 concacaf gold cup"
Show the role description and the id of the project staff involved in most number of project outcomes?
SELECT T1.role_description, T2.staff_id FROM Staff_Roles AS T1 JOIN Project_Staff AS T2 ON T1.role_code = T2.role_code JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.staff_id ORDER BY COUNT(*) DESC LIMIT 1
What is the id and last name of the driver who participated in the most races after 2010?
SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid WHERE T3.year > 2010 GROUP BY T1.driverid ORDER BY COUNT(*) DESC LIMIT 1
how many female dependents are there?
SELECT COUNT(*) FROM dependent WHERE sex = 'F'
How many flights have a velocity larger than 200?
SELECT count(*) FROM flight WHERE velocity > 200
what is the location when the champion is brigham young-hawaii, defeated is western oregon and the score is 3-0 (15-5, 15-9, 15-6)?
SELECT location FROM table_name_72 WHERE champion = "brigham young-hawaii" AND defeated = "western oregon" AND score = "3-0 (15-5, 15-9, 15-6)"
How many women has got the first runner-up position in representation of Philippines?
SELECT 1 AS st_runner_up FROM table_29942205_1 WHERE country_territory = "Philippines"
Which competition was played on 13-11-2012?
SELECT competition FROM table_name_22 WHERE date = "13-11-2012"
Hello! Can you show me a list of the various product type codes?
SELECT Product_Type_Code FROM Products
what is the most laps for driver jackie stewart?
SELECT MAX(laps) FROM table_name_43 WHERE driver = "jackie stewart"
What percentage of voters chose McCain in the county where 2.1% of voters voted third party?
SELECT mccain__percentage FROM table_20278716_2 WHERE others__percentage = "2.1%"
How many fatalities were there in the crash described as crashed at take-off due to engine failure?
SELECT fatalities FROM table_229917_2 WHERE brief_description = "Crashed at take-off due to engine failure"
What are the number of episodes when the genre is modern drama and the highest average ratings points are 28?
SELECT AVG(number_of_episodes) FROM table_name_34 WHERE genre = "modern drama" AND highest_average_point_ratings = 28
What Nationality is the Iowa State team?
SELECT nationality FROM table_name_69 WHERE school_club_team = "iowa state"
Name the gold coast which has an auckland of no and melbourne of yes
SELECT gold_coast FROM table_name_88 WHERE auckland = "no" AND melbourne = "yes"
Name the pole position for belgian grand prix
SELECT pole_position FROM table_name_75 WHERE grand_prix = "belgian grand prix"
Who was the home team of the game on 26 February 2008?
SELECT home FROM table_name_5 WHERE date = "26 february 2008"
What is the total for danny allsopp?
SELECT total FROM table_name_98 WHERE name = "danny allsopp"
Find the number of characteristics that the product "flax" has.
SELECT count(*) 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 = "flax"
Which score has a record of 58–15–8?
SELECT score FROM table_name_80 WHERE record = "58–15–8"
How many object dates does episode #16 have?
SELECT COUNT(object_date) FROM table_29635868_1 WHERE episode_number = 16
what was Vincent Montmeat's support rate
SELECT t2.support_rate FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id where t1.name = "Vincent Montméat"
What is the Rank of the building that has a Highest floor larger than 50?
SELECT rank FROM table_name_57 WHERE highest_floor > 50
Who wrote the title that received 1.211 million total viewers?
SELECT written_by FROM table_12419515_4 WHERE total_viewers__in_millions_ = "1.211"
What are all the metropolis / municipality where mayor is helen c. De castro
SELECT city___municipality FROM table_255812_1 WHERE mayor = "Helen C. De Castro"
What is the percentage of Tukunga when La Crescenta-Montrose is 28%?
SELECT tujunga FROM table_name_33 WHERE la_crescenta__montrose = "28%"
Return the ids of the two department store chains with the most department stores.
SELECT dept_store_chain_id FROM department_stores GROUP BY dept_store_chain_id ORDER BY count(*) DESC LIMIT 2
What is the record when the time is 1:11?
SELECT record FROM table_name_91 WHERE time = "1:11"
For a venue of Rome on July 30, 2009, what are the notes?
SELECT notes FROM table_name_59 WHERE venue = "rome" AND date = "july 30, 2009"
Which Japanese Title has a TV Station of tbs, and a Romaji Title of hana yori dango?
SELECT japanese_title FROM table_name_58 WHERE tv_station = "tbs" AND romaji_title = "hana yori dango"
what is the date for catolog 88697185162 when the region is canada?
SELECT date FROM table_name_9 WHERE catalog = 88697185162 AND region = "canada"
What day in March is the game with a 48-13-11 record and a game number less than 72?
SELECT SUM(march) FROM table_name_12 WHERE record = "48-13-11" AND game < 72
List the names of companies by ascending number of sales.
SELECT Name FROM company ORDER BY Sales_in_Billion