sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
What is the highest number of stories in homes with a height of 42 m.? | SELECT MAX(stories) FROM table_name_7 WHERE height = "42 m." |
What is the name of the episode told by Kiki and directed by Will Dixon? | SELECT title FROM table_10470082_6 WHERE storyteller = "Kiki" AND director = "Will Dixon" |
How many wrestlers are there? | SELECT count(*) FROM wrestler |
What is the Label name that has a Country of uk and the Catalog is bpg 62988? | SELECT label FROM table_name_73 WHERE country = "uk" AND catalog = "bpg 62988" |
In zip code 94107, on which day neither Fog nor Rain was observed? | SELECT date FROM weather WHERE zip_code = 94107 AND EVENTS != "Fog" AND EVENTS != "Rain" |
Among the employees in Adventure Works, calculate the percentage of them working as sales representatives. | SELECT CAST(SUM(CASE WHEN JobTitle = 'Sales Representative' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(BusinessEntityID) FROM Employee |
What was the end date when Alex Bodry was the minister? | SELECT end_date FROM table_name_11 WHERE minister = "alex bodry" |
Among the daylight savings areas in the Midwest region, how many postal points are there in Illinois? | SELECT COUNT(T2.zip_code) FROM state AS T1 INNER JOIN zip_data AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'Illinois' AND T2.daylight_savings = 'Yes' AND T2.region = 'Midwest' |
Show the manager name with most number of gas stations opened after 2000. | SELECT manager_name FROM gas_station WHERE open_year > 2000 GROUP BY manager_name ORDER BY COUNT(*) DESC LIMIT 1 |
What name has the role of midfielder for 1999-2003? | SELECT name FROM table_name_76 WHERE role = "midfielder" AND period = "1999-2003" |
what are the average revenues of all compaies? | SELECT avg ( revenue ) FROM manufacturers |
How many rounds did the IFL: Oakland event have? | SELECT SUM(round) FROM table_name_4 WHERE event = "ifl: oakland" |
What municipality has a 130.6 pupulation density? | SELECT municipality FROM table_255829_1 WHERE pop_density__per_km_2__ = "130.6" |
How many postal points are there under the congress representative in Puerto Rico? | SELECT COUNT(T2.zip_code) FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.state = 'Puerto Rico' |
Which documents have more than 1 draft copies? List document id and number of draft copies. | SELECT document_id , count(*) FROM Draft_Copies GROUP BY document_id HAVING count(*) > 1; |
Provide the most used keyword in the movies. | SELECT T1.keyword_name FROM keyword AS T1 INNER JOIN movie_keywords AS T2 ON T1.keyword_id = T2.keyword_id GROUP BY T1.keyword_name ORDER BY COUNT(T1.keyword_name) DESC LIMIT 1 |
How many students are attending English courses? | SELECT count(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "English" |
What is the coaster name that was opened in 1978, and have wooden track? | SELECT coaster_name FROM table_name_40 WHERE year_opened = "1978" AND track = "wooden" |
What date has a game smaller than 4, and a score of 116-114? | SELECT date FROM table_name_73 WHERE game < 4 AND score = "116-114" |
How many employees report to Andrew Fuller? | SELECT COUNT(EmployeeID) FROM Employees WHERE ReportsTo = ( SELECT EmployeeID FROM Employees WHERE LastName = 'Fuller' AND FirstName = 'Andrew' ) |
what is the highest goals against when the wins is less than 1? | SELECT MAX(goals_against) FROM table_name_54 WHERE wins < 1 |
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 |
What is the largest crowd when st kilda was the away team? | SELECT MAX(crowd) FROM table_name_60 WHERE away_team = "st kilda" |
What is the total prominence number in m of ethiopia, which has a col in m of 1728 and an elevation less than 3,358? | SELECT COUNT(prominence__m_) FROM table_name_27 WHERE country = "ethiopia" AND col__m_ = 1728 AND elevation__m_ < 3 OFFSET 358 |
How many foundeds have sousse as the city, with a capacity greater than 25,000? | SELECT COUNT(founded) FROM table_name_25 WHERE city = "sousse" AND capacity > 25 OFFSET 000 |
Return the number of music festivals of each category. | SELECT Category , COUNT(*) FROM music_festival GROUP BY Category |
What is the sum of Points, when Equipment was "Zabel-BSU", and when Position was 42? | SELECT SUM(points) FROM table_name_39 WHERE equipment = "zabel-bsu" AND position = 42 |
How many years have a final score of 6–3, 6–2? | SELECT COUNT(year) FROM table_22834834_3 WHERE score_in_the_final = "6–3, 6–2" |
What the round with the time 1:15? | SELECT AVG(round) FROM table_name_99 WHERE time = "1:15" |
What country has a rank of 3 and notes of r? | SELECT country FROM table_name_97 WHERE notes = "r" AND rank = 3 |
Which city in the Midwest region has the least number of clients? | SELECT T2.city FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN state AS T3 ON T2.state_abbrev = T3.StateCode WHERE T3.Region = 'Midwest' GROUP BY T2.city ORDER BY COUNT(T2.city) LIMIT 1 |
How many students took any course? | Did you mean how many students there are? | Yes, sorry! | SELECT count ( * ) from STUDENT |
What are the names of customers who have taken out more than one loan? | SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING count(*) > 1 |
List at least 5 students who have payment due and are enlisted in Peace Corps organization? | SELECT T1.name FROM no_payment_due AS T1 INNER JOIN enlist AS T2 ON T2.name = T1.name WHERE T2.organ = 'peace_corps' AND T1.bool = 'pos' LIMIT 5 |
What is the largest ethnic group in the settlement with a 2011 population of 5082? | SELECT COUNT(largest_ethnic_group__2002_) FROM table_2562572_44 WHERE population__2011_ = 5082 |
How many different addresses do the students currently live? | SELECT count(DISTINCT current_address_id) FROM Students |
Who won the silver medal in the games where Hong Chia-yuh took home bronze? | SELECT silver FROM table_name_5 WHERE bronze = "hong chia-yuh" |
Please show me the information of all students who are under 25 years old | SELECT * FROM student WHERE age < 25 |
Which Record has a Date of january 31? | SELECT record FROM table_name_18 WHERE date = "january 31" |
Tell me the tournament with a hard surface for 6–1, 6–2 | SELECT tournament FROM table_name_99 WHERE surface = "hard" AND score = "6–1, 6–2" |
What is the qual 1 when the qual 2 has no time and the best is 1:16.776? | SELECT qual_1 FROM table_name_94 WHERE qual_2 = "no time" AND best = "1:16.776" |
Show all company name and main industry without a gas station? | SELECT company , main_industry FROM company WHERE company_id not IN ( SELECT company_id FROM station_company ) |
List all goalies who played in the year 2005 season and shorter than 72 inches. List all the team names he play for. | SELECT DISTINCT T1.firstName, T1.lastName, T3.name FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID INNER JOIN Teams AS T3 ON T2.tmID = T3.tmID WHERE T2.year = 2005 AND T1.height < 72 |
What is the Status of primitive confuciusornithid .? | SELECT status FROM table_name_21 WHERE notes = "primitive confuciusornithid ." |
What's the mean week number for November 12, 1978? | SELECT AVG(week) FROM table_name_9 WHERE date = "november 12, 1978" |
Give me the name and year of opening of the manufacturers that have either less than 10 factories or more than 10 shops. | SELECT name , open_year FROM manufacturer WHERE num_of_shops > 10 OR Num_of_Factories < 10 |
What is the highest number of laps led with 16 points? | SELECT MAX(laps) AS Led FROM table_17319931_1 WHERE points = "16" |
Find all the locations whose names contain the word "film". | SELECT Location_Name FROM LOCATIONS WHERE Location_Name LIKE "%film%" |
What is Appearances, when Postion [F ] is "Defender", and when Date to [H ] is "1938"? | SELECT appearances FROM table_name_18 WHERE position_[f_] = "defender" AND date_to_[h_] = "1938" |
How many courses does the Biology department offer? | SELECT count ( * ) FROM department AS T1 JOIN course AS T2 ON T1.dept_code = T2.dept_code WHERE dept_name = "Biology" |
What is 17th c., when Australian is "i, ɪ, ə", and when Examples is "œsophagus"? | SELECT 17 AS th_c FROM table_name_25 WHERE australian = "i, ɪ, ə" AND examples = "œsophagus" |
What is the 1st leg of bp. honvéd team #2? | SELECT 1 AS st_leg FROM table_name_62 WHERE team__number2 = "bp. honvéd" |
What are the ids of all stations that have a latitude above 37.4 and have never had less than 7 bikes available? | SELECT id FROM station WHERE lat > 37.4 EXCEPT SELECT station_id FROM status GROUP BY station_id HAVING min(bikes_available) < 7 |
When was the station WLS-TV owned since? | SELECT owned_since FROM table_22329326_1 WHERE station = "WLS-TV" |
what is the GDP of the city with the largest population. | SELECT gdp FROM city ORDER BY Regional_Population DESC LIMIT 1 |
What are the names of courses without prerequisites? | SELECT title FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq) |
Please show the employee first names and ids of employees who serve at least 10 customers. | SELECT T1.FirstName , T1.SupportRepId FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) >= 10 |
What is the elevation of Goroka Airport | SELECT elevation FROM airports where name = 'Goroka Airport' |
What is the venue that has 34-18 as the score? | SELECT venue FROM table_21350934_2 WHERE score = "34-18" |
Find the product type whose average price is higher than the average price of all products. | SELECT product_type_code FROM products GROUP BY product_type_code HAVING avg ( product_price ) > ( SELECT avg ( product_price ) FROM products ) |
What are the full names of customers who do not have any accounts? | SELECT customer_first_name , customer_last_name FROM Customers EXCEPT SELECT T1.customer_first_name , T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id |
Count the number of likes for each student id. | SELECT student_id , count(*) FROM Likes GROUP BY student_id |
How many female customers permit the company to send regular emails to them? | SELECT COUNT(CustomerID) FROM customers WHERE Gender = 'F' AND SubscribedToEmailList = 'TRUE' |
What tonnage was built in 2007? | SELECT tonnage FROM table_name_75 WHERE built = 2007 |
What are the numbers of wines for different grapes? | SELECT count(*) , Grape FROM WINE GROUP BY Grape |
how many people are there whose weight is higher than 85 for each gender? | SELECT COUNT(*), sex FROM people WHERE weight > 85 GROUP BY sex |
Who is the person to contact to get Camembert Pierrot? | SELECT T2.ContactName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.ProductName = 'Camembert Pierrot' |
What player was moving from manchester united? | SELECT name FROM table_name_78 WHERE moving_from = "manchester united" |
Find the names of customers who have used both the service "Close a policy" and the service "New policy application". | SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = "Close a policy" INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = "New policy application" |
What was the winning team lmpc in rnd 3? | SELECT lmpc_winning_team FROM table_24037660_2 WHERE rnd = 3 |
How many rounds did the match last when his record was 6-6? | SELECT round FROM table_name_72 WHERE record = "6-6" |
How many times was Ford Maverick introduced to the market? | SELECT COUNT(T2.model_year) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'ford maverick' |
please list those languages | SELECT Official_native_language FROM country WHERE Official_native_language LIKE "%English%" |
Which final has a run of 1:19.49? | SELECT final FROM table_name_18 WHERE run_3 = "1:19.49" |
What was the cuts average in tournament totals in an event larger than 24? | SELECT AVG(cuts_made) FROM table_name_62 WHERE tournament = "totals" AND events > 24 |
Show the description of the transaction type that occurs most frequently. | SELECT T1.transaction_type_description FROM Ref_Transaction_Types AS T1 JOIN TRANSACTIONS AS T2 ON T1.transaction_type_code = T2.transaction_type_code GROUP BY T1.transaction_type_code ORDER BY COUNT(*) DESC LIMIT 1 |
What is the name of the home team that played against Collingwood? | SELECT home_team FROM table_name_17 WHERE away_team = "collingwood" |
Provide the price of the only Toyota Corona hardtop in the database. | SELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'toyota corona hardtop' |
What are the highest points for the team of marlboro brm with brm p180 as the chassis? | SELECT MAX(points) FROM table_name_43 WHERE team = "marlboro brm" AND chassis = "brm p180" |
WHat is the Homeland security distinguished service medal when the medal of honor is Coast guard Medal? | SELECT homeland_security_distinguished_service_medal FROM table_2104176_1 WHERE medal_of_honor = "Coast Guard Medal" |
What is the full name of the customer who rented movies for 7 consecutive days? | SELECT T1.first_name, T1.last_name FROM customer AS T1 INNER JOIN ( SELECT customer_id, COUNT(*) AS num_days FROM ( SELECT *, date(days, '-' || rn || ' day') AS results FROM ( SELECT customer_id, days, row_number() OVER (PARTITION BY customer_id ORDER BY days) AS rn FROM ( SELECT DISTINCT customer_id, date(rental_date) AS days FROM rental ) ) ) GROUP BY customer_id, results HAVING num_days = 7 ) AS T2 ON T1.customer_id = T2.customer_id |
Who built the car that went 53 laps with a Time/Retired of 1:17:09.672? | SELECT constructor FROM table_name_25 WHERE laps = 53 AND time_retired = "1:17:09.672" |
Which title is in Portuguese? | SELECT title FROM table_name_28 WHERE language = "portuguese" |
Which Lost is the highest one that has a Drawn smaller than 4, and a Played smaller than 9? | SELECT MAX(lost) FROM table_name_93 WHERE drawn < 4 AND played < 9 |
What Tournament was the 2010 Olympic Games? | SELECT tournament FROM table_name_58 WHERE 2010 = "olympic games" |
How many years does simon baker appear as a nominee? | SELECT COUNT(year) FROM table_name_84 WHERE nominee = "simon baker" |
What is the distance when brisbane is $4.80? | SELECT distance FROM table_2923917_4 WHERE brisbane = "$4.80" |
What is Score, when Player is "Brad Faxon"? | SELECT score FROM table_name_68 WHERE player = "brad faxon" |
Thank you! Can you filter this list ot show only the hometowns that have both people older than 23 years of age and people younger than 20 years of age? | SELECT Hometown FROM people WHERE Age > 23 INTERSECT SELECT Hometown FROM people WHERE Age < 20 |
In which district is the residence Dublin? | SELECT district FROM table_26131768_4 WHERE residence = "Dublin" |
Among the crimes reported to the ward located at 1958 N. Milwaukee Ave., list down the report number of the crimes happened inside the apartment. | SELECT T1.case_number FROM Crime AS T1 INNER JOIN Ward AS T2 ON T2.ward_no = T1.ward_no WHERE T1.location_description = 'APARTMENT' AND T2.ward_office_address = '1958 N. Milwaukee Ave.' |
What is the ID of Movies? | SELECT id from playlists WHERE name = "Movies" |
How many of those apartment building are managed by Kyle? | SELECT count ( * ) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_manager = "Kyle" |
List the names of all routes in alphabetic order. | SELECT route_name FROM Delivery_Routes ORDER BY route_name |
What are the names and prices of all products in the store? | SELECT name , price FROM products |
and what are the names of the projects requiring more than 300 hours | SELECT name FROM projects WHERE hours > 300 |
List all the name of customers who have orders that are still processing. | SELECT t2.customerName FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t1.status = 'In Process' |
What is the lowest quantity for GWR Nos. 696, 779, 93 5 from the manufacturer Peckett and Sons? | SELECT MIN(quantity) FROM table_name_72 WHERE manufacturer = "peckett and sons" AND gwr_nos = "696, 779, 93 5" |
Can you tell me the role of project id 1 ? | SELECT role_code FROM Project_Staff WHERE project_id = 1 |
Find the average credit score of the customers who do not have any loan. | SELECT AVG(credit_score) FROM customer WHERE NOT cust_id IN (SELECT cust_id FROM loan) |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.