sentence
stringlengths
3
347
sql
stringlengths
18
804
HOW MANY CARS HAD A CAR # SMALLER THAN 7 AND STARTED ON 2010?
SELECT number_of_cars FROM table_name_38 WHERE car__number < 7 AND year_started = 2010
How many images have at least one pair of object samples with the relation "parked on"?
SELECT SUM(CASE WHEN T1.PRED_CLASS = 'parked on' THEN 1 ELSE 0 END) FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.OBJ1_SAMPLE_ID != T2.OBJ2_SAMPLE_ID
What is the city with the smallest GDP? Return the city and its GDP.
SELECT city , GDP FROM city ORDER BY GDP LIMIT 1
Among all the current female legislators, how many of them have attended in Senate roll call votes?
SELECT COUNT(lis_id) FROM current WHERE gender_bio = 'F' AND lis_id IS NOT NULL
Who was the candidate in the election in the California 8 district where the incumbent was first elected in 1932?
SELECT candidates FROM table_1342331_6 WHERE first_elected = 1932 AND district = "California 8"
Thank you. Can you provide the names of students taking classes in CIS?
SELECT T1.stu_fname, T1.STU_LNAME FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Computer Info. Systems'
List the supplier company names located in Germany.
SELECT CompanyName FROM Suppliers WHERE Country = 'Germany'
Tell me the horse when the faults are 9 and the total is 46.36
SELECT horse FROM table_name_11 WHERE faults = "9" AND total = 46.36
What year did Zone Rouge first air?
SELECT first_year_aired FROM table_name_79 WHERE name = "zone rouge"
what is the lowest value under the column series no.?
SELECT MIN(series_no) FROM table_21025437_3
How many weeks did a game happen on September 17, 2000?
SELECT COUNT(week) FROM table_name_57 WHERE date = "september 17, 2000"
What are the ids of all students who don't play sports?
SELECT StuID FROM Student EXCEPT SELECT StuID FROM Sportsinfo
Which payment method is used the most often?
SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY count(*) DESC LIMIT 1
What are the forenames and surnames of drivers who participated in the races named Australian Grand Prix but not the races named Chinese Grand Prix?
SELECT T3.forename , T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Australian Grand Prix" EXCEPT SELECT T3.forename , T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Chinese Grand Prix"
How many parts have a retail price of over 1900?
SELECT COUNT(p_partkey) FROM part WHERE p_retailprice > 1900
What NHL team does Denis Desgagnes play for?
SELECT nhl_team FROM table_1965650_8 WHERE player = "Denis Desgagnes"
Please list the phone numbers of the top 3 customers that have the highest credit limit and have Leslie Jennings as their sales representitive.
SELECT t1.phone FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t2.firstName = 'Leslie' AND t2.lastName = 'Jennings' ORDER BY t1.creditLimit DESC LIMIT 3
How many episodes in the season were directed by Jeremy Podeswa?
SELECT COUNT(no_in_season) FROM table_2182654_3 WHERE directed_by = "Jeremy Podeswa"
Name the lowest Wins which has Points of 28, and a Year smaller than 1972?
SELECT MIN(wins) FROM table_name_94 WHERE points = 28 AND year < 1972
Return the type of transaction with the highest total amount.
SELECT transaction_type FROM Financial_transactions GROUP BY transaction_type ORDER BY sum(transaction_amount) DESC LIMIT 1
How many outgoing managers were replaced by Bob Peeters?
SELECT COUNT(outgoing_manager) FROM table_27374004_3 WHERE replaced_by = "Bob Peeters"
What's the Result for the Competition of 1994 FIFA World Cup Qualification, with the Date of May 15, 1993?
SELECT result FROM table_name_14 WHERE competition = "1994 fifa world cup qualification" AND date = "may 15, 1993"
When did his appointment start and end?
SELECT t1.start,t1.end FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn GROUP BY T1.patient HAVING count ( * ) = 1
How many destinations have a weekly frequency and are named AC Express?
SELECT COUNT(destination) FROM table_21716139_1 WHERE frequency = "Weekly" AND train_name = "AC Express"
What is the common English for the Italian word san gallo?
SELECT common_english FROM table_name_50 WHERE italian = "san gallo"
What is every score with a record of 46-25?
SELECT score FROM table_23248910_9 WHERE record = "46-25"
Which position has L bats and Anderson as a surname?
SELECT position FROM table_name_14 WHERE bats = "l" AND surname = "anderson"
Which kind of policy type was chosen by the most customers?
SELECT Policy_Type_Code FROM Customer_Policies GROUP BY Policy_Type_Code ORDER BY count(*) DESC LIMIT 1
How many literate males are there in the taluka name nevasa?
SELECT MAX(Literate) AS male FROM table_28939145_2 WHERE taluka_name = "Nevasa"
Show the carriers of devices in stock at more than one shop.
SELECT T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID GROUP BY T1.Device_ID HAVING COUNT(*) > 1
Which keywords belong to the movie titles with the highest popularity?
SELECT T3.keyword_name FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id INNER JOIN keyword AS T3 ON T2.keyword_id = T3.keyword_id ORDER BY T1.popularity DESC LIMIT 1
Find the name of the project for which a scientist whose name contains ‘Smith’ is assigned to.
SELECT T2.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name LIKE '%Smith%'
Which show was sent to syndication for its new/returning/same network.
SELECT show FROM table_169766_13 WHERE new_returning_same_network = "Syndication"
Show me the name of the film with film id 1? | Do you mean the title in the table file | yes
SELECT title FROM film WHERE film_id = 1
What are the names of all instructors in the Comp. Sci. department?
SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.'
What is the greek national account when 1997 is 6.1?
SELECT greek_national_account FROM table_27146868_1 WHERE 1997 = "6.1"
Which employee manage most number of peoples? List employee's first and last name, and number of people report to that employee.
SELECT T2.first_name , T2.last_name , count(T1.reports_to) FROM employees AS T1 JOIN employees AS T2 ON T1.reports_to = T2.id GROUP BY T1.reports_to ORDER BY count(T1.reports_to) DESC LIMIT 1;
Hmm, please list the cities that no customer is living in.
SELECT city FROM addresses WHERE city not IN ( SELECT DISTINCT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id )
show all their names.
SELECT customer_name FROM customers
How many attended the game on 4 February 2003?
SELECT AVG(attendance) FROM table_name_81 WHERE date = "4 february 2003"
Name the winner for date of nov 5, 1987
SELECT winner FROM table_1594772_2 WHERE match_date = "Nov 5, 1987"
Find the name of bank branch that provided the greatest total amount of loans to customers with credit score is less than 100.
SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100 GROUP BY T2.bname ORDER BY SUM(T1.amount) DESC LIMIT 1
How many Goals have a Pct % larger than 0.557, a points value smaller than 90, and a games value larger than 68?
SELECT COUNT(goals_for) FROM table_name_6 WHERE pct__percentage > 0.557 AND points < 90 AND games > 68
What is the total number of Pl GP when the pick number is 199 and the Reg GP is bigger than 0?
SELECT SUM(pl_gp) FROM table_name_90 WHERE pick__number = 199 AND reg_gp > 0
Which Puchat Ligi has a UEFA Cup smaller than 2, and a Player of takesure chinyama?
SELECT MIN(puchat_ligi) FROM table_name_64 WHERE uefa_cup < 2 AND player = "takesure chinyama"
What is the 1st leg with Team 2 Lyon?
SELECT 1 AS st_leg FROM table_name_98 WHERE team_2 = "lyon"
what is the most episodes when the average ratings is 18.8%?
SELECT MAX(episodes) FROM table_name_52 WHERE average_ratings = "18.8%"
Show the number of customers for each gender.
SELECT gender , count(*) FROM Customers GROUP BY gender
How many points were there when tries for were 84?
SELECT points FROM table_17369472_2 WHERE tries_for = "84"
How many different colleges do attend the tryout test?
SELECT count(DISTINCT cName) FROM tryout
What is the name of the replacement manager for the Bolton Wanderers?
SELECT replaced_by FROM table_name_2 WHERE team = "bolton wanderers"
What is the most recent year with a finish in 2nd position?
SELECT MAX(season) FROM table_name_22 WHERE position = "2nd"
What is the type of the match with a win result and Michael Gomez as the opponent?
SELECT type FROM table_name_79 WHERE res = "win" AND opponent = "michael gomez"
What is the current tournament name for the event in Tampa?
SELECT also_currently_known_as FROM table_20630462_1 WHERE tournament = "Tampa"
Find the address and staff number of the shops that do not have any happy hour.
SELECT address, num_of_staff FROM shop WHERE NOT shop_id IN (SELECT shop_id FROM happy_hour)
Indicate, by region, which platform has sold the most games.
SELECT T.region_name FROM ( SELECT T1.platform_name, T4.region_name, SUM(T3.num_sales) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN region_sales AS T3 ON T1.id = T3.game_platform_id INNER JOIN region AS T4 ON T3.region_id = T4.id GROUP BY T1.platform_name, T4.region_name ORDER BY SUM(T3.num_sales) DESC LIMIT 1 ) t
When is Part 2, when Part 5 is on January 24, 2008?
SELECT part_2 FROM table_name_42 WHERE part_5 = "january 24, 2008"
What are all the week # where subject matter is auditioner's choice
SELECT week__number FROM table_26250227_1 WHERE theme = "Auditioner's Choice"
what is the score on february 16?
SELECT score FROM table_name_76 WHERE date = "february 16"
What are the names and arrival times of trains?
SELECT Name , Arrival FROM train
How many stories does the highest building have?
SELECT Stories FROM buildings ORDER BY Height DESC LIMIT 1
What is the Spanish word for cas [ˈkas]?
SELECT spanish FROM table_26614365_1 WHERE central = "cas [ˈkas]"
Find the marketing region description of China?
SELECT Marketing_Region_Descriptrion FROM Marketing_Regions WHERE Marketing_Region_Name = "China"
When 64 is the entries what is the winning boat?
SELECT winning_boat FROM table_24673710_1 WHERE entries = 64
What is the lowest total that has 1977 as the year (s) won?
SELECT MIN(total) FROM table_name_32 WHERE year_s__won = "1977"
How many methods in the same repository share a tokenized name that begins with "query language..."?
SELECT COUNT(T2.SolutionId) FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.NameTokenized LIKE 'query language%'
Find the first name of students who are living in the dorm that has most number of amenities.
SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T2.dormid FROM dorm AS T3 JOIN has_amenity AS T4 ON T3.dormid = T4.dormid JOIN dorm_amenity AS T5 ON T4.amenid = T5.amenid GROUP BY T3.dormid ORDER BY count(*) DESC LIMIT 1)
* I have left the chat *
SELECT T1.Title , T2.AlbumID , COUNT ( * ) FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId = T2.AlbumId GROUP BY T2.AlbumID
Show founder names that begin with letter "S" | Did you mean founder‘s name that begin with letter 'S'? | yes
SELECT founder FROM manufacturers WHERE Founder LIKE 'S%'
Show the dates, places, and names of events in descending order of the attendance.
SELECT Date , Name , venue FROM event ORDER BY Event_Attendance DESC
Where is it located?
SELECT location FROM university ORDER BY enrollment DESC LIMIT 1
How many marks are there when tackles are 3?
SELECT marks FROM table_2814720_1 WHERE tackles = 3
Among the technology items, what percentage of them are from Best Buy for Business? Provide the date of the project related to those items.
SELECT CAST(SUM(CASE WHEN T1.vendor_name = 'Best Buy for Business' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.projectid) FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.project_resource_type = 'Technology' UNION ALL SELECT DISTINCT T1.date_posted FROM projects AS T1 INNER JOIN resources AS T2 ON T1.projectid = T2.projectid WHERE T2.vendor_name = 'Best Buy for Business' AND T2.project_resource_type = 'Technology'
Among universities that score below 80 in 2015, what is the percentage of international students?
SELECT SUM(CAST(T1.num_students * T1.pct_international_students AS REAL) / 100) / COUNT(*) * 100 FROM university_year AS T1 INNER JOIN university_ranking_year AS T2 ON T1.university_id = T2.university_id WHERE T2.score < 80 AND T1.year = 2015
Show the name, role code, and date of birth for the employee with name 'Armani'.
SELECT employee_name , role_code , date_of_birth FROM Employees WHERE employee_Name = 'Armani'
List the service id and details for the events.
SELECT service_id, event_details FROM EVENTS
List the champion (team name) and year from year 1950 to 1960.
SELECT DISTINCT T1.name, T2.year FROM teams AS T1 JOIN series_post AS T2 ON T1.tmID = T2.tmIDWinner WHERE T2.round = 'F' AND T2.year BETWEEN 1950 AND 1960
How many weeks are shown for the champion of john mcenroe 6–2, 6–3?
SELECT COUNT(week_of) FROM table_21584646_10 WHERE champion = "John McEnroe 6–2, 6–3"
Name the maximum founded for blue hose
SELECT MAX(founded) FROM table_16168849_1 WHERE nickname = "Blue Hose"
How many customers pay by Credit card?
select count ( * ) from customers where payment_method = "Credit Card"
What is the top attendance for weeks past 2 on october 29, 1961?
SELECT MAX(attendance) FROM table_name_57 WHERE week > 2 AND date = "october 29, 1961"
What is the latitude when the diameter is 184.0?
SELECT latitude FROM table_16768245_2 WHERE diameter = "184.0"
And in which state is it located?
SELECT t3.state_province_county FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id GROUP BY t3.city ORDER BY count ( * ) LIMIT 1
Which Away team score has a Venue of kardinia park?
SELECT away_team AS score FROM table_name_42 WHERE venue = "kardinia park"
Give the full names of the countries that are located in more than one continent.
SELECT T3.Name FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T3.Code = T2.Country GROUP BY T3.Name HAVING COUNT(T3.Name) > 1
Show all template type codes that are not used by any document.
SELECT template_type_code FROM Templates EXCEPT SELECT template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id
what is the average lifespan of the representatives
SELECT avg ( lifespan ) FROM representative
Which Tournament has a Semi finalists of monica seles sandrine testud?
SELECT tournament FROM table_name_76 WHERE semi_finalists = "monica seles sandrine testud"
Name the teleplay for david simon & eric overmyer and tom piazza
SELECT teleplay_by FROM table_26914076_2 WHERE story_by = "David Simon & Eric Overmyer and Tom Piazza"
Select the name and price of all products with a price larger than or equal to $180, and sort first by price (in descending order), and then by name (in ascending order).
SELECT name , price FROM products WHERE price >= 180 ORDER BY price DESC , name ASC
Which game was a Platformer?
SELECT game FROM table_name_90 WHERE genre = "platformer"
How many touchdowns did the fullback score?
SELECT MIN(touchdowns) FROM table_25711913_8 WHERE position = "Fullback"
Show all date and share count of transactions.
SELECT date_of_transaction , share_count FROM TRANSACTIONS
What is the highest population for the
SELECT MAX(population), _august_15, _2002 FROM table_12496904_1
now show me the shops that have more than one device in stock
SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID HAVING COUNT ( * ) > 1
Provide the order ID of Frank Olsen of the South region.
SELECT T1.`Order ID` FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T2.Region = 'South' AND T2.`Customer Name` = 'Frank Olsen'
What was the maximum perigee on 1969-01-09?
SELECT MAX(perigee__km_) FROM table_12141496_1 WHERE decay_date = "1969-01-09"
Find the names of artists that do not have any albums.
SELECT Name FROM ARTIST EXCEPT SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId
Among the products, how many of them were discontinued in production?
SELECT COUNT(*) FROM Products WHERE Discontinued = 1
How many customers placed orders before George?
SELECT count ( T1.customer_name ) FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.date_order_placed < ( SELECT T2.date_order_placed FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = 'George' order by T2.date_order_placed LIMIT 1 )