sentence
stringlengths
3
347
sql
stringlengths
18
804
Find the number of pets whose weight is heavier than 10.
SELECT count(*) FROM pets WHERE weight > 10
How many login names are in both authors and students?
SELECT login_name FROM Course_Authors_and_Tutors INTERSECT SELECT login_name FROM Students
What's the service number of the Jammu Duronto train?
SELECT MAX(service) FROM table_23477312_1 WHERE train_name = "Jammu Duronto"
College of san diego state, and a Pick # smaller than 30 is what lowest overall?
SELECT MIN(overall) FROM table_name_32 WHERE college = "san diego state" AND pick__number < 30
List the names of all the physicians who prescribe Thesisin as medication.
SELECT DISTINCT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.name = "Thesisin"
Among the coaches whose team has over 30 wins in a year, how many of them are born in the USA?
SELECT COUNT(T2.coachID) FROM Master AS T1 INNER JOIN Coaches AS T2 ON T1.coachID = T2.coachID WHERE T2.W > 30 AND T1.birthCountry = 'USA'
For each faculty rank, show the number of faculty members who have it.
SELECT rank , count(*) FROM Faculty GROUP BY rank
List the hardware model name and company name for all the phones that were launched in year 2002 or have RAM size greater than 32.
SELECT T2.Hardware_Model_name, T2.Company_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002 OR T1.RAM_MiB > 32
Find the average credit score of the customers who do not have any loan.
SELECT avg(credit_score) FROM customer WHERE cust_id NOT IN (SELECT cust_id FROM loan)
What are all locations of train stations?
SELECT DISTINCT LOCATION FROM station
Perfect, and can you do the same with 'King Book'?
SELECT document_type_code , document_name , document_description FROM Documents WHERE document_name = 'King Book'
What date did the executive office in Dover take office?
SELECT Took AS office FROM table_name_76 WHERE location = "dover" AND type = "executive"
How many times is the number of films Gina DeGeneres acted in than Penelope Guinness?
SELECT CAST(SUM(IIF(T2.first_name = 'GINA' AND T2.last_name = 'DEGENERES', 1, 0)) AS REAL) * 100 / SUM(IIF(T2.first_name = 'PENELOPE' AND T2.last_name = 'GUINESS', 1, 0)) FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id
Show the location code of the country "Canada".
SELECT location_code FROM Ref_locations WHERE location_name = "Canada"
Return the different names of cities that are in Asia and for which Chinese is the official language.
SELECT DISTINCT T3.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode JOIN city AS T3 ON T1.Code = T3.CountryCode WHERE T2.IsOfficial = 'T' AND T2.Language = 'Chinese' AND T1.Continent = "Asia"
Which ERP W is the lowest one that has a Frequency MHz of 91.3?
SELECT MIN(erp_w) FROM table_name_58 WHERE frequency_mhz = 91.3
Name the foochow for pingnan county
SELECT foochow FROM table_2013618_1 WHERE english_name = "Pingnan County"
What was the time of the race for Driver Jarno Trulli on a grid smaller than 13?
SELECT time_retired FROM table_name_59 WHERE grid < 13 AND driver = "jarno trulli"
What is the pick number of Penn State?
SELECT pick FROM table_name_2 WHERE school = "penn state"
Show the hometowns shared by people older than 23 and younger than 20.
SELECT Hometown FROM people WHERE Age > 23 INTERSECT SELECT Hometown FROM people WHERE Age < 20
Show the minister who took office after 1961 or before 1959.
SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959
SHOW ME THE hire date OF THE EMPLOYEE WHO HAS THE FIRST NAME AS JAMES
SELECT EMP_HIREDATE FROM EMPLOYEE WHERE EMP_FNAME = "James"
How many colors are there?
SELECT COUNT(*) FROM ref_colors
What is the minimum D (max) when the Morse Taper number is less than 0?
SELECT MIN(d__max_) FROM table_name_47 WHERE morse_taper_number < 0
What is population in the world when 788 (8.1%)?
SELECT MIN(world) FROM table_19017269_5 WHERE latin_america_caribbean = "788 (8.1%)"
how many schools are there?
SELECT count ( * ) from university
What % has 4 RLng?
SELECT int_percentage FROM table_name_80 WHERE rlng = "4"
When did Episode 29 (7) originally air?
SELECT original_airdate FROM table_name_65 WHERE episode__number = "29 (7)"
What is the last 1/4 for the QUA race with a finishing time of 2:03.1?
SELECT last_1_4 FROM table_name_22 WHERE race = "qua" AND fin_time = "2:03.1"
Which form of government has more countries that have completed the actual external debt reporting between the two types of government accounting concepts, budgetary central government vs. consolidated central government?
SELECT SUM(CASE WHEN GovernmentAccountingConcept = 'Budgetary central government' THEN 1 ELSE 0 END), SUM(CASE WHEN GovernmentAccountingConcept = 'Consolidated central government' THEN 1 ELSE 0 END) central_nums FROM country WHERE ExternalDebtReportingStatus = 'Actual'
What are the headquarters that have both a company in the banking and 'oil and gas' industries?
SELECT headquarters FROM company WHERE main_industry = 'Banking' INTERSECT SELECT headquarters FROM company WHERE main_industry = 'Oil and gas'
Name the number of barangay for 205.4 density
SELECT no_of_s_barangay FROM table_269888_1 WHERE pop_density__per_km²_ = "205.4"
What manuals have the opus of 135?
SELECT manuals FROM table_name_31 WHERE opus = "135"
Return the name of the youngest captain.
SELECT name FROM captain ORDER BY age LIMIT 1
Please show the names and descriptions of aircrafts associated with airports that have a total number of passengers bigger than 10000000.
SELECT T1.Aircraft , T1.Description FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Total_Passengers > 10000000
What is the Flagship of the Show Hosted by Rover (Shane French)?
SELECT flagship FROM table_name_33 WHERE host_s_ = "rover (shane french)"
what is the highest round when the player is troy creurer (d)?
SELECT MAX(round) FROM table_name_90 WHERE player = "troy creurer (d)"
How many entries have a speed of exactly 2.53 GHz?
SELECT COUNT(cores) FROM table_269920_16 WHERE speed__ghz_ = "2.53"
Ok.How many male employees have a salary lower than 50000?
SELECT count ( * ) FROM employee WHERE salary < 50000 and Sex = "M"
When 7 april 2001 to 29 september 2001 was aired in japan 2 how many titles were there?
SELECT COUNT(title) FROM table_1714685_1 WHERE aired_in_japan_3 = "7 April 2001 to 29 September 2001"
Show the average amount of transactions with type code "SALE".
SELECT avg(amount_of_transaction) FROM TRANSACTIONS WHERE transaction_type_code = "SALE"
Who read the unabridged book written by Gary Paulsen?
SELECT read_by FROM table_name_9 WHERE un__abridged = "unabridged" AND author = "gary paulsen"
State the number of students do not have payment due.
SELECT COUNT(name) FROM no_payment_due WHERE bool = 'neg'
What county has the highest population?
SELECT county_name FROM county order by population desc limit 1
Which unit has a Pennant Number of 82?
SELECT unit FROM table_name_27 WHERE pennant_number = 82
Okay that's fine. Do you know the stadium ID for games without injuries?
SELECT stadium_id FROM game WHERE id NOT IN ( SELECT game_id FROM injury_accident )
What is the name of the department that has the largest number of students enrolled?
SELECT T4.dept_name FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code GROUP BY T3.dept_code ORDER BY count ( * ) DESC LIMIT 1
What is the name of the young rider classification when Paolo Tiralongo won?
SELECT young_rider_classification FROM table_28538368_2 WHERE winner = "Paolo Tiralongo"
How many different phones are there?
select count ( distinct name ) from phone
what is the school that left in 1966?
SELECT school FROM table_name_18 WHERE year_left = 1966
Which country does Airline "JetBlue Airways" belong to?
SELECT Country FROM AIRLINES WHERE Airline = "JetBlue Airways"
List the full names of the employees who were responsible for inspecting Taqueria La Paz.
SELECT DISTINCT T3.first_name, T3.last_name FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no INNER JOIN employee AS T3 ON T2.employee_id = T3.employee_id WHERE T1.dba_name = 'TAQUERIA LA PAZ'
What was week 12's record?
SELECT record FROM table_name_57 WHERE week = "12"
How many of those 9 assets have 2 parts?
select count ( * ) from ( SELECT T1.asset_id , T1.asset_details FROM Assets AS T1 JOIN Asset_Parts AS T2 ON T1.asset_id = T2.asset_id GROUP BY T1.asset_id HAVING count ( * ) = 2 INTERSECT SELECT T1.asset_id , T1.asset_details FROM Assets AS T1 JOIN Fault_Log AS T2 ON T1.asset_id = T2.asset_id GROUP BY T1.asset_id HAVING count ( * ) > = 1 )
how many names in the event table
SELECT count ( Name ) from event
Among the businesses with average rating, how many business has attribute of full_bar.
SELECT COUNT(T1.business_id) FROM Business_Attributes AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id WHERE T1.attribute_value = 'full_bar'
What are the customer ids for customers who do not have an account?
SELECT customer_id FROM Customers EXCEPT SELECT customer_id FROM Accounts
What is the lowest poles of team comtec racing, which has a nc position?
SELECT MIN(poles) FROM table_name_84 WHERE position = "nc" AND team = "comtec racing"
Which college has a position of goaltender?
SELECT college_junior_club_team__league_ FROM table_name_92 WHERE position = "goaltender"
What was the time for the man who scored 1 point?
SELECT time FROM table_name_89 WHERE points = 1
On what date was the game with fewer than 6650 in attendance, that finished 0:1?
SELECT date FROM table_name_30 WHERE attendance < 6650 AND score = "0:1"
What year was S.A. Allward's theme that had an issue price of $16.95 released?
SELECT year FROM table_name_60 WHERE issue_price = "$16.95" AND artist = "s.a. allward"
Which nation won the boxing championship in 2012?
SELECT nation_represented FROM table_name_1 WHERE year = 2012
In the match as corio oval, who was the away team?
SELECT away_team FROM table_name_29 WHERE venue = "corio oval"
How many enrollment of school id 2?
SELECT enrollment FROM school where School_id = "2"
in which aircraft does John Williams have a certificate
SELECT T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T1.name = "John Williams"
What about for students who live in HKG?
SELECT min ( T2.gradepoint ) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T3.city_code = "HKG"
Among the biwords pairs with "àbac" as its first word, how many of them have an occurrence of over 10?
SELECT COUNT(T2.w2nd) FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st WHERE T1.word = 'àbac' AND T2.occurrences > 10
Find the name, headquarter and founder of the manufacturer that has the highest revenue.
SELECT name , headquarter , founder FROM manufacturers ORDER BY revenue DESC LIMIT 1
Who had the fastest lap for the circuit magione?
SELECT fastest_lap FROM table_26920192_5 WHERE circuit = "Magione"
Among the Yelp_Business in Arizona, how many of them closes at 12PM on Sundays?
SELECT COUNT(T1.business_id) FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id INNER JOIN Business AS T3 ON T1.business_id = T3.business_id WHERE T2.day_of_week LIKE 'Sunday' AND T1.closing_time LIKE '12PM' AND T3.state LIKE 'AZ'
What is the percentage whereby the away team scored 2 goals during the 2017 seasons?
SELECT CAST(SUM(CASE WHEN FTAG = 2 THEN 1 ELSE 0 END) / COUNT(FTAG) AS REAL) * 100 FROM matchs WHERE season = 2017
What is Opponent in Final, when Date is "13 January 1992"?
SELECT opponent_in_final FROM table_name_12 WHERE date = "13 january 1992"
What were all the salary values of players in 2010 and 2001?
SELECT salary FROM salary WHERE YEAR = 2010 UNION SELECT salary FROM salary WHERE YEAR = 2001
Show the police force shared by counties with location on the east and west.
SELECT Police_force FROM county_public_safety WHERE LOCATION = "East" INTERSECT SELECT Police_force FROM county_public_safety WHERE LOCATION = "West"
What was the score of the game with the Etobicoke Kangaroos as the home team?
SELECT score FROM table_name_55 WHERE home = "etobicoke kangaroos"
For each staff id, what is the description of the role that is involved with the most number of projects?
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 Staffel D in the season 1983-84 with a Staffel E of Motor Suhl?
SELECT staffel_d FROM table_name_51 WHERE staffel_e = "motor suhl" AND season = "1983-84"
What is Result, when Year is greater than 1999, when White is "Kramnik", and when Tournament is "Mainz CC Champions Duel (5)"?
SELECT result FROM table_name_77 WHERE year > 1999 AND white = "kramnik" AND tournament = "mainz cc champions duel (5)"
What date did the Fai Cup with Derry City F.C. as runners-up take place?
SELECT date FROM table_name_33 WHERE competition = "fai cup" AND runners_up = "derry city f.c."
What is the sum of total pounds of purchase in year 2018 for all branches in London?
SELECT sum(total_pounds) FROM purchase AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T2.city = 'London' AND T1.year = 2018
Which inning were the Minnesota Twins in on 06-07-1961?
SELECT inning FROM table_name_86 WHERE team = "minnesota twins" AND date = "06-07-1961"
Name the software with the latest stable date of 0.6.1
SELECT software FROM table_name_87 WHERE latest_stable_date__version_ = "0.6.1"
Which seasons were directed by Nelson McCormick?
SELECT title FROM table_17355933_1 WHERE directed_by = "Nelson McCormick"
List the ids of all the patients with condition that has a prevalence percentage of 18.8%.
SELECT DISTINCT T1.PATIENT FROM conditions AS T1 INNER JOIN all_prevalences AS T2 ON lower(T2.ITEM) = lower(T1.DESCRIPTION) WHERE T2."PREVALENCE PERCENTAGE" = CAST(18.8 AS float)
Which game took place on April 22?
SELECT game FROM table_name_8 WHERE date = "april 22"
What is the lowest area km2 of the member state of the Czech Republic and has a population in millions lesss than 10.3?
SELECT MIN(area_km_2) FROM table_name_61 WHERE member_state = "czech republic" AND population_in_millions < 10.3
How many points were there when there were less than 16 rebounds and 5 assists?
SELECT COUNT(points) FROM table_name_83 WHERE assists = 5 AND rebounds < 16
Show the institution type with an institution founded after 1990 and an institution with at least 1000 enrollment.
SELECT TYPE FROM institution WHERE founded > 1990 AND enrollment >= 1000
Find the number of checking accounts for each account name.
SELECT count(*), T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid GROUP BY T1.name
what is the transaction type code for the investor with id 18
SELECT transaction_type_code from transactions where investor_id = 18
what is the date when the site is memorial stadium • minneapolis, mn, and the Attendance is 53,192?
SELECT date FROM table_name_70 WHERE site = "memorial stadium • minneapolis, mn" AND attendance = "53,192"
Show the institution type with the largest number of institutions.
SELECT TYPE FROM institution GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1
Which years had a jersey number 55
SELECT years_for_rockets FROM table_11734041_18 WHERE no_s_ = "55"
Find the name of amenity that is most common in all dorms.
SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T1.amenid = T2.amenid GROUP BY T2.amenid ORDER BY COUNT(*) DESC LIMIT 1
Which Total has a Rank of 5, and a Bronze smaller than 0?
SELECT AVG(total) FROM table_name_67 WHERE rank = "5" AND bronze < 0
What place has manfred kokot as the athlete?
SELECT place FROM table_name_7 WHERE athlete = "manfred kokot"
What is the name and distance for aircraft with id 12?
SELECT name , distance FROM Aircraft WHERE aid = 12
What is the id and detail of the vehicle used in lessons for most of the times?
SELECT T1.vehicle_id , T1.vehicle_details FROM Vehicles AS T1 JOIN Lessons AS T2 ON T1.vehicle_id = T2.vehicle_id GROUP BY T1.vehicle_id ORDER BY count(*) DESC LIMIT 1
List the name and country of origin for all singers who have produced songs with rating above 9.
SELECT DISTINCT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.rating > 9