sentence
stringlengths
3
347
sql
stringlengths
18
804
What is the minimum number of bypass ports listed?
SELECT MIN(bypass_ports) FROM table_16731248_1
What are the names and ages of every person who is a friend of both Dan and Alice?
SELECT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' INTERSECT SELECT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice'
How many matches were there in May, 2008?
SELECT COUNT(Match_Id) FROM `Match` WHERE SUBSTR(Match_Date, 1, 4) = '2008' AND SUBSTR(Match_Date, 7, 1) = '5'
Of all the divisions in the world, what percentage of them belong to England?
SELECT CAST(COUNT(CASE WHEN country = 'England' THEN division ELSE NULL END) AS REAL) * 100 / COUNT(division) FROM divisions
What is the birthday of the staff member with first name as Janessa and last name as Sawayn?
SELECT date_of_birth FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
Which cities have 2 to 4 parks?
SELECT city FROM park GROUP BY city HAVING COUNT(*) BETWEEN 2 AND 4
What is the shipping company for order number 10558?
SELECT T2.CompanyName FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T1.OrderID = 10558
whose source and destination airports are in the United States | Do you want the id of the routes whose source and destination airports are in the United States? | Yes
SELECT rid FROM routes WHERE dst_apid IN ( SELECT apid FROM airports WHERE country = 'United States' ) AND src_apid IN ( SELECT apid FROM airports WHERE country = 'United States' )
Give the air carrier description of the flights that have an earlier arrival and departure.
SELECT T1.Description FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T2.ARR_DELAY < 0 AND T2.DEP_DELAY < 0 GROUP BY T1.Description
How many stars on average does user no.3 give to Yelp_Business in Arizona?
SELECT AVG(T2.review_stars) FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.state LIKE 'AZ' AND T2.user_id = 3
What is the largest payment amount?
SELECT amount FROM payment ORDER BY amount DESC LIMIT 1
Which station has the greatest number of traims?
SELECT * FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id ORDER BY count ( * ) DESC LIMIT 1
Indicate the name of all adventure games.
SELECT T2.game_name FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id WHERE T1.genre_name = 'Adventure'
Who is the founder of Creative Labs?
SELECT Founder FROM manufacturers where name = "Creative Labs"
What is the q1+q2 time in which q1 is 1:18.574?
SELECT q1 + q2_time FROM table_1924975_1 WHERE q1_time = "1:18.574"
Which business ID has the most reviews?
SELECT business_id FROM Reviews GROUP BY business_id ORDER BY COUNT(user_id) DESC LIMIT 1
What is the Notes of the Frequency with Format of talk radio?
SELECT notes FROM table_name_63 WHERE format = "talk radio"
Show the type of school and the number of buses for each type.
SELECT T2.type , count(*) FROM school_bus AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T2.type
How many poker players are there?
SELECT count(*) FROM poker_player
What engine does Galles Racing use?
SELECT engine FROM table_15736385_1 WHERE team = "Galles Racing"
What are the profits (in billions) where the assets are 192.8 billion?
SELECT profits__billion_$_ FROM table_1682026_3 WHERE assets__billion_$_ = "192.8"
Show different locations of railways along with the corresponding number of railways at each location.
SELECT LOCATION , COUNT(*) FROM railway GROUP BY LOCATION
What are the last names of the author of the paper titled "Binders Unbound"?
SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title = "Binders Unbound"
What is the number of routes operated by the airline American Airlines whose destinations are in Italy?
SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid JOIN airlines AS T3 ON T1.alid = T3.alid WHERE T2.country = 'Italy' AND T3.name = 'American Airlines'
How large was the crowd when the away team was melbourne?
SELECT crowd FROM table_name_77 WHERE away_team = "melbourne"
Which are the male artists?
SELECT * FROM artist WHERE gender = "Male"
What is the lowest number in the Labour Party for the Fianna Fail higher than 5?
SELECT MIN(labour_party) FROM table_name_16 WHERE fianna_fáil > 5
What was the attendance and location on December 15?
SELECT location_attendance FROM table_17326036_6 WHERE date = "December 15"
Who is the incumbent first elected in 1944?
SELECT incumbent FROM table_1342013_20 WHERE first_elected = 1944
From the total amount of donation to projects, what is the percentage of the amount is for school projects located in the rural area?
SELECT CAST(SUM(CASE WHEN T2.school_metro = 'rural' THEN T1.donation_to_project ELSE 0 END) AS REAL) * 100 / SUM(donation_to_project) FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid
What is the team and starting year for each technician?
SELECT Team , Starting_Year FROM technician
Which allergy type is the least common?
SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) ASC LIMIT 1
What is the FSB / HT (MHz) when the Southbridge is amd-8131 amd-8132?
SELECT fsb___ht__mhz_ FROM table_name_50 WHERE southbridge = "amd-8131 amd-8132"
How many years does Team wal-mart / tide participate?
SELECT COUNT(year) FROM table_name_94 WHERE team = "wal-mart / tide"
What person was the runner-up skip when Julie Reddick was the winning skip?
SELECT runner_up_skip FROM table_name_61 WHERE winning_skip = "julie reddick"
If a married employee has a western name style, what is the probability of him or her working as a store contact?
SELECT CAST(COUNT(IIF(T1.PersonType = 'SC', T1.PersonType, NULL)) AS REAL) / COUNT(T1.PersonType) FROM Person AS T1 INNER JOIN Employee AS T2 WHERE T1.PersonType = 'SC' AND T1.NameStyle = 0 AND T2.MaritalStatus = 'M'
Which Date has a Partner of daniella dominikovic?
SELECT date FROM table_name_33 WHERE partner = "daniella dominikovic"
What Date did the Home team play in essendon?
SELECT date FROM table_name_48 WHERE home_team = "essendon"
what is the notes for the time 6:05.21?
SELECT notes FROM table_name_77 WHERE time = "6:05.21"
In which distinct years was the governor "Eliot Spitzer"?
SELECT DISTINCT YEAR FROM party WHERE Governor = "Eliot Spitzer"
What date did the episode with Andy Murray as Jamie and John's guest first broadcast?
SELECT first_broadcast FROM table_29141354_4 WHERE jamie_and_johns_guest = "Andy Murray"
What are the id and the amount of refund of the booking that incurred the most times of payments?
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 ORDER BY count(*) DESC LIMIT 1
How many gp-gs have 121.70 as an effic and an avg/g less than 218.7?
SELECT COUNT(gp_gs) FROM table_name_41 WHERE effic = "121.70" AND avg_g < 218.7
How many singles were released in 1979?
SELECT COUNT(releaseType) FROM torrents WHERE releaseType LIKE 'single' AND groupYear = 1979
What is the First elected of california 3?
SELECT first_elected FROM table_name_55 WHERE district = "california 3"
What's the sum of asts for boston college with a rebs over 63?
SELECT SUM(asts) FROM table_name_35 WHERE school_country = "boston college" AND rebs > 63
Show the denomination shared by schools founded before 1890 and schools founded after 1900
SELECT Denomination FROM school WHERE Founded < 1890 INTERSECT SELECT Denomination FROM school WHERE Founded > 1900
Who is the champion of the 1994 season?
SELECT champion FROM table_2527617_1 WHERE season = 1994
Which procedure has the highest cost? | Do you mean the name of the procedure that has the highest cost? | Yes. What is the name of the procedure that has the highest cost?
SELECT Name FROM procedures order by cost desc limit 1
From 1980 to 2000, which artist had the most disco releases?
SELECT T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.groupYear BETWEEN 1980 AND 2000 AND T2.tag LIKE 'disco' GROUP BY T1.artist ORDER BY COUNT(T2.tag) DESC LIMIT 1
When was Maat born?
SELECT dob FROM table_name_44 WHERE surname = "maat"
Find the titles of items that received both a rating higher than 8 and a rating below 5.
SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating > 8 INTERSECT SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating < 5
Which position has 45 picks?
SELECT position FROM table_name_54 WHERE pick__number = 45
How much in total has customer with first name as Carole and last name as Bernhard paid?
SELECT sum(T1.amount_payment) FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Carole" AND T2.last_name = "Bernhard"
What are the average and minimum age of captains in different class?
SELECT avg(age) , min(age) , CLASS FROM captain GROUP BY CLASS
What are the names of all the teams in the basketball competition, sorted by all home scores in descending order?
SELECT team_name FROM basketball_match ORDER BY All_Home DESC
What are the top 10 countries with the highest invoice size along with their amount?
SELECT billing_country , total FROM invoices ORDER BY total DESC LIMIT 10
What is Date, when Outcome is "Runner Up", and when Opponent is "Lu Jiaxiang"?
SELECT date FROM table_name_91 WHERE outcome = "runner up" AND opponent = "lu jiaxiang"
What was the lowest postion of ehc straubing ii when they played less than 10 games?
SELECT MIN(position) FROM table_name_70 WHERE name = "ehc straubing ii" AND played < 10
What is the largest gold when silver is less than 1 for Canada and bronze is less than 0?
SELECT MAX(gold) FROM table_name_48 WHERE silver < 1 AND nation = "canada" AND bronze < 0
List all the Catalan language wikipedia page title with less than 10 number of different words in these pages.
SELECT title FROM pages WHERE words < 10
How many 5K wins did Emily Chebet, who had more than 2 total, have?
SELECT COUNT(5 AS k_wins) FROM table_name_80 WHERE runner = "emily chebet" AND total > 2
Return each apartment type code along with the maximum and minimum number of rooms among each type.
SELECT apt_type_code , max(room_count) , min(room_count) FROM Apartments GROUP BY apt_type_code
What is the birthplace of Aaron Gagnon?
SELECT birthplace FROM PlayerInfo WHERE PlayerName = 'Aaron Gagnon'
How many donations does the project "Look, Look, We Need a Nook!" have?
SELECT SUM(T3.donation_total) FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid WHERE T1.title = 'Look, Look, We Need a Nook!'
How many movies were produced by "Eddie Murphy Productions"?
SELECT COUNT(T1.movie_id) FROM movie_company AS T1 INNER JOIN production_company AS T2 ON T1.company_id = T2.company_id WHERE T2.company_name = 'Eddie Murphy Productions'
Which region is the city Kabul located in?
SELECT Region FROM country AS T1 JOIN city AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = "Kabul"
What is the name of tracks whose genre is Rock?
SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "Rock";
Find the names of users who do not have a first notification of loss record.
SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id
How many years has Zach been friends with Alice?
SELECT year from personfriend where friend = "Alice" and name = "Zach"
For the team that Scotty Bowman coached in 1982, how many bench minor penalties did they have that year?
SELECT T2.BenchMinor FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID INNER JOIN Master AS T3 ON T1.coachID = T3.coachID WHERE T3.firstName = 'Scotty' AND T3.lastName = 'Bowman' AND T1.year = 1982
What is the D 46 √ with a D 43 √ with r 3?
SELECT d_46_√ FROM table_name_2 WHERE d_43_√ = "r 3"
What is the transaction ratio being made at Sac State American River Courtyard and Sac State Union?
SELECT CAST(COUNT(CASE WHEN T2.LocationName = 'Sac State American River Courtyard' THEN T1.TransactionID ELSE NULL END) AS REAL) * 100 / COUNT(CASE WHEN T2.LocationName = 'Sac State Union' THEN T1.TransactionID ELSE NULL END) FROM `transaction` AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID
Which Home team has a Score of 0–1, and an Away team of tottenham hotspur?
SELECT home_team FROM table_name_77 WHERE score = "0–1" AND away_team = "tottenham hotspur"
Which Player has a height of 6-10, and went to College at LSU?
SELECT player FROM table_name_66 WHERE height = "6-10" AND college = "lsu"
Find the titles of all the albums of the artist AC/DC?
SELECT Title FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = "AC/DC"
What percentage of the border does Angola share with each of the countries with which it borders?
SELECT SUM(CASE WHEN T2.Name = 'Angola' THEN T1.Length ELSE 0 END) * 100 / SUM(T1.Length) FROM borders AS T1 LEFT JOIN country AS T2 ON T1.Country1 = T2.Code
What was the rank when then time was 7:52.53?
SELECT MIN(rank) FROM table_name_10 WHERE time = "7:52.53"
what team has the qual 2 of 1:44.050?
SELECT best FROM table_name_9 WHERE qual_2 = "1:44.050"
How many farms are there?
SELECT count(*) FROM farm
How large was the crowd at Glenferrie Oval?
SELECT SUM(crowd) FROM table_name_98 WHERE venue = "glenferrie oval"
Show the ids for projects with at least 2 documents.
SELECT project_id FROM Documents GROUP BY project_id HAVING count(*) >= 2
Which 2006 has a 2007 of A?
SELECT 2006 FROM table_name_98 WHERE 2007 = "a"
How much longer in percentage is the screen time of the most important character in Batman than the least important one?
SELECT (MAX(CAST(SUBSTR(T2.screentime, 3, 2) AS REAL)) - MIN(CAST(SUBSTR(T2.screentime, 3, 2) AS REAL))) * 100 / MIN(CAST(SUBSTR(T2.screentime, 3, 2) AS REAL)) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T1.Title = 'Batman'
What is the average price of all hardware products?
SELECT avg ( product_price ) FROM products WHERE product_type_code = 'Hardware'
Among all the orders made by a customer in the household segment, what is the highest total price?
SELECT MAX(T1.o_totalprice) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_mktsegment = 'HOUSEHOLD'
What is the highest points gained of the match where fans took 907 and there were more than 44.9 miles one way?
SELECT MAX(points_gained) FROM table_name_57 WHERE fans_took = "907" AND miles_[one_way] > 44.9
Which district is the community area Lincoln Square grouped into?
SELECT side FROM Community_Area WHERE community_area_name = 'Lincoln Square'
What is the Socket when the Part Number(s) is rk80530pz001256?
SELECT socket FROM table_name_5 WHERE part_number_s_ = "rk80530pz001256"
What are the names of all the stores located in Khanewal District?
SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t3.district_name = "Khanewal District"
Among the car models introduced in the market in 1970, how many of them have the USA as their origin country?
SELECT COUNT(*) FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin WHERE T1.model_year = 1970 AND T2.country = 'USA'
How many ships ended up being 'Captured'?
SELECT count(*) FROM ship WHERE disposition_of_ship = 'Captured'
What is the most common company type, and how many are there?
SELECT TYPE , count(*) FROM operate_company GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1
WHEN has a Result of w 23–17?
SELECT date FROM table_name_96 WHERE result = "w 23–17"
What are the first names of all teachers who have taught a course and the corresponding course codes?
SELECT T2.emp_fname , T1.crs_code FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num
What is the population of African in 'Turks and Caicos Islands'?
SELECT T2.Percentage * T1.Population FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'African' AND T1.Name = 'Turks and Caicos Islands'
Name the record for kentucky
SELECT record FROM table_22847880_2 WHERE opponent = "Kentucky"
Which building has a room with highest capacity?
select building from classroom order by capacity desc limit 1
Find the personal name, family name, and author ID of the course author that teaches the most courses.
SELECT T1.personal_name , T1.family_name , T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id ORDER BY COUNT(*) DESC LIMIT 1
What was the playoff result for the team name of bay area seals
SELECT playoffs FROM table_1427998_1 WHERE team_name = "Bay Area Seals"