sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
What are the names of these mountains? | SELECT name FROM mountain WHERE Height > 5000 |
For the product No. S18_3482 in the Order No.10108, how much discount did the customer have? | SELECT (t1.MSRP - t2.priceEach) / t1.MSRP FROM products AS t1 INNER JOIN orderdetails AS t2 ON t1.productCode = t2.productCode WHERE t1.productCode = 'S18_3482' AND t2.orderNumber = '10108' |
How many different combinations of scores by individual judges were given to the contestant competing against Mukul Dev? | SELECT COUNT(scores_by_each_individual_judge) FROM table_18278508_6 WHERE co_contestant__yaar_vs_pyaar_ = "Mukul Dev" |
what district is Brooks Hays in | SELECT district FROM table_1342013_4 WHERE incumbent = "Brooks Hays" |
What are the different parties of representative? Show the party name and the number of representatives in each party. | SELECT Party, COUNT(*) FROM representative GROUP BY Party |
What are the first name and gender of the students who have allergy to milk but can put up with cats? | SELECT fname , sex FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Milk" EXCEPT SELECT StuID FROM Has_allergy WHERE Allergy = "Cat") |
Show the name of aircraft which fewest people have its certificate. | SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid GROUP BY T1.aid ORDER BY count(*) LIMIT 1 |
Which song released on heavenly (hvn152)? | SELECT song FROM table_name_86 WHERE release_info = "heavenly (hvn152)" |
Which Term expiration has an Appointing Governor of george pataki, republican, and an Appointed larger than 2004? | SELECT SUM(term_expiration) FROM table_name_22 WHERE appointing_governor = "george pataki, republican" AND appointed > 2004 |
Which visitor had a record of 7–5–3? | SELECT visitor FROM table_name_49 WHERE record = "7–5–3" |
What was the attendance when the result was a bye? | SELECT attendance FROM table_name_79 WHERE result = "bye" |
Which engineer has visited the most times? Show the engineer id, first name and last name. | SELECT T1.engineer_id , T1.first_name , T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 GROUP BY T1.engineer_id ORDER BY count(*) DESC LIMIT 1 |
What player went to montreal college? | SELECT player FROM table_20170644_5 WHERE college = "Montreal" |
What was the hottest temperature on the day of trip ID 4080? | SELECT MAX(T2.max_temperature_f) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code AND T2.date = SUBSTR(CAST(T1.start_date AS TEXT), 1, INSTR(T1.start_date, ' ') - 1) WHERE T1.id = 4080 |
Name the Region with a Mountain Peak of dillingham high point? | SELECT region FROM table_name_95 WHERE mountain_peak = "dillingham high point" |
What are the daily hire costs for the products with substring 'Book' in its name? | SELECT daily_hire_cost FROM Products_for_hire WHERE product_name LIKE '%Book%' |
When did the staff member with first name as Janessa and last name as Sawayn join the company? | SELECT date_joined_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn"; |
What were the themes of each of those competitions? | SELECT T1.Official_Name, T2.Theme FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID GROUP BY T2.Host_city_ID HAVING COUNT ( * ) = 1 |
Can you please also provide the manufacturer on these products? | SELECT name, price, manufacturer FROM products WHERE price > = 180 order by price asc |
What public team was founded prior to 1883? | SELECT team FROM table_name_45 WHERE founded < 1883 AND type = "public" |
What is the name and address of the department with the most students? | SELECT T2.dept_name , T2.dept_address FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 1 |
What is Score, when Tournament is "Tampere , Finland"? | SELECT score FROM table_name_24 WHERE tournament = "tampere , finland" |
What displacement has the code yd22ddt? | SELECT displacement FROM table_name_22 WHERE code = "yd22ddt" |
List the distinct hometowns that are not associated with any gymnast. | SELECT DISTINCT Hometown FROM people EXCEPT SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID |
List document type codes and the number of documents in each code. | SELECT document_type_code, COUNT(*) FROM Documents GROUP BY document_type_code |
What was the 6-4 score's maximum attendance? | SELECT MAX(attendance) FROM table_27537518_4 WHERE score = "6-4" |
What district was a republican first elected in 2000? | SELECT district FROM table_name_98 WHERE first_elected = 2000 AND party = "republican" |
Among the role playing game genre, how many are targeted to teens and what is their average sentiment polarity score? | SELECT COUNT(T1.App), AVG(T2.Sentiment_Polarity) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1."Content Rating" = 'Teen' AND T1.Genres = 'Role Playing' |
What is the average Total with a Gold that is larger than 4? | SELECT AVG(total) FROM table_name_77 WHERE gold > 4 |
Who was the visiting team that played on September 15? | SELECT visiting_team FROM table_name_41 WHERE date = "september 15" |
How many runs were there when the high score was 55 and there were more than 12 innings? | SELECT SUM(runs) FROM table_name_34 WHERE high_score = 55 AND innings > 12 |
How many times does Alice show up in the friend column? | SELECT count ( * ) FROM PersonFriend where friend = 'Alice' |
List the status for the operator Toronto transit commission. | SELECT status FROM table_22481967_1 WHERE operator = "Toronto Transit Commission" |
What is the average first elected year that has a district of 11 and a committee of environmental matters? | SELECT AVG(first_elected) FROM table_name_18 WHERE district = "11" AND committee = "environmental matters" |
how many courses did the student with id 121 register for? | SELECT count ( course_id ) FROM Student_Course_Registrations WHERE student_id = 121 |
What is the sum of Year(s), when Postion is 6th, and when Competition is Commonwealth Games? | SELECT SUM(year) FROM table_name_68 WHERE position = "6th" AND competition = "commonwealth games" |
List the East Asia & Pacific countries which are under the High income: nonOECD group. Please include their alpha code. | SELECT CountryCode, Alpha2Code FROM Country WHERE Region = 'East Asia & Pacific' AND IncomeGroup = 'High income: nonOECD' |
What player is from the Denver Broncos? | SELECT player FROM table_name_43 WHERE team = "denver broncos" |
Which company has the highest amount of assets? | SELECT name FROM Companies ORDER BY Assets_billion DESC LIMIT 1 |
How many different captain ranks are there? | SELECT count(DISTINCT rank) FROM captain |
What horse has the number 25? | SELECT name FROM table_20095300_1 WHERE number = 25 |
Where did Zimbabwe play? | SELECT venue FROM table_name_63 WHERE opponent = "zimbabwe" |
How many people are older than every engineer? | SELECT count(*) FROM Person WHERE age > (SELECT max(age) FROM person WHERE job = 'engineer') |
What are the dates of transactions with at least 100 share count or amount bigger than 100? | SELECT date_of_transaction FROM TRANSACTIONS WHERE share_count >= 100 OR amount_of_transaction >= 100 |
Find the name of the customers who use the most frequently used payment method. | SELECT customer_name FROM customers WHERE payment_method = (SELECT payment_method FROM customers GROUP BY payment_method ORDER BY count(*) DESC LIMIT 1) |
What percentage of people named Mary who wants Receive Email promotions of AdventureWorks and selected partners are store contacts? | SELECT CAST(SUM(CASE WHEN EmailPromotion = 2 THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN PersonType = 'SC' THEN 1 ELSE 0 END) FROM Person WHERE FirstName = 'Mary' |
What are the names of wines with scores higher than 90? | SELECT Name FROM WINE WHERE score > 90 |
What is the percentage of people who gave the "True North" episode a 1-star rating? | SELECT CAST(SUM(CASE WHEN T2.stars = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'True North' AND T1.episode_id = 'tt0629477' |
How many tries against were there when there was 961 points against? | SELECT tries_against FROM table_name_29 WHERE points_against = "961" |
Find the first names of teachers whose email address contains the word "man". | SELECT first_name FROM Teachers WHERE email_address LIKE '%man%' |
What year was the 146 total? | SELECT year_s__won FROM table_name_58 WHERE total = 146 |
Which of those courses has the most number of credits? | SELECT * FROM course WHERE course_id NOT IN ( SELECT course_id FROM prereq ) order by credits desc limit 1 |
Order that by amenity name please? | SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall' ORDER BY T3.amenity_name |
What is the total number of cuts made of tournaments with 2 Events? | SELECT COUNT(cuts_made) FROM table_name_81 WHERE events = 2 |
Who is the rider when the grid number is 3? | SELECT rider FROM table_name_28 WHERE grid = 3 |
Which song was picked that was originally performed by Marisa Monte? | SELECT song_choice FROM table_27616663_1 WHERE original_artist = "Marisa Monte" |
Find the id and address of the shops whose score is below the average score. | SELECT shop_id , address FROM shop WHERE score < (SELECT avg(score) FROM shop) |
How many silver medals had a rank of 3 with bronze larger than 0? | SELECT COUNT(silver) FROM table_name_90 WHERE rank = 3 AND bronze > 0 |
How tall is the contestant from Aruba? | SELECT height__ft_ FROM table_20669355_2 WHERE country = "Aruba" |
What were the scores when Jamie and Johns guest was Phillips Idowu? | SELECT scores FROM table_29141354_2 WHERE jamie_and_johns_guest = "Phillips Idowu" |
What event did Sjerstin Vermeulen receive a 66.452 result? | SELECT event FROM table_name_57 WHERE athlete = "sjerstin vermeulen" AND result = "66.452" |
What was the location attendance when High points was by Pierce (22)? | SELECT location_attendance FROM table_11959669_4 WHERE high_points = "Pierce (22)" |
What are department ids for departments with managers managing more than 3 employees? | SELECT DISTINCT department_id FROM employees GROUP BY department_id , manager_id HAVING COUNT(employee_id) >= 4 |
What types of domestic crimes have occurred the most in the North Lawndale community? | SELECT T2.domestic FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no WHERE T1.community_area_name = 'North Lawndale' AND T2.domestic = 'TRUE' GROUP BY T2.domestic ORDER BY COUNT(T2.domestic) DESC LIMIT 1 |
Please show me the names of employees that work for companies with sales bigger than 200 | SELECT T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID WHERE T3.Sales_in_Billion > 200 |
What score did Australia get? | SELECT score FROM table_name_85 WHERE country = "australia" |
details about paul hamm | Can you be more specific for what details do you need for Paul Hamm? | i want paul hamm's age | SELECT age FROM people WHERE name = "Paul Hamm" |
What year did player payne stewart win? | SELECT year_s__won FROM table_name_84 WHERE player = "payne stewart" |
What is the reviewer id of Daniel Lewis? | SELECT rID FROM Reviewer WHERE name = "Daniel Lewis" |
What's the score on january 5 with a hasek decision? | SELECT score FROM table_name_28 WHERE decision = "hasek" AND date = "january 5" |
What were the fewest amount of guns possessed by a frigate that served in 1815? | SELECT MIN(guns) FROM table_name_32 WHERE class = "frigate" AND year = "1815" |
what is transactions type code? | Did you want all of the transactions type code? | yes | select distinct transaction_type_code from Transactions |
Please provide full name of any two countries using special trade system. | SELECT LongName FROM Country WHERE SystemOfTrade = 'Special trade system' LIMIT 2 |
What is the lowest week that has September 19, 1965 as the date, with an attendance less than 46,941? | SELECT MIN(week) FROM table_name_70 WHERE date = "september 19, 1965" AND attendance < 46 OFFSET 941 |
How many students have been absent above 2 months? | SELECT COUNT(name) FROM longest_absense_from_school WHERE month > 2 |
How much is the salary of the employee who has the highest number of inspections done of all time? | SELECT T1.salary FROM employee AS T1 INNER JOIN ( SELECT employee_id, COUNT(inspection_id) FROM inspection GROUP BY employee_id ORDER BY COUNT(inspection_id) DESC LIMIT 1 ) AS T2 ON T1.employee_id = T2.employee_id |
Find the production code and channel of the most recently aired cartoon . | select production_code , channel from cartoon order by original_air_date desc limit 1 |
How many copies were sold where the position is lager than 1 in 1988? | SELECT copies_sold FROM table_name_85 WHERE oricon_position > 1 AND year = 1988 |
Calculate the total number of male tweet IDs. | SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T2.Gender = 'Male' |
the zip code 94107 what is the humidity? | SELECT ( mean_humidity ) from weather where zip_code = 94107 |
Which Producer(s) has a Track smaller than 8, and a Songwriter(s) of hadise açıkgöz, yves jongen, and a Length of 3:08? | SELECT producer_s_ FROM table_name_46 WHERE track < 8 AND songwriter_s_ = "hadise açıkgöz, yves jongen" AND length = "3:08" |
What are the names of perpetrators in country "China" or "Japan"? | SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country = "China" OR T2.Country = "Japan" |
How many different items were reviewed by some users? | SELECT count(DISTINCT i_id) FROM review |
What project has the longest time? List the name. | SELECT name FROM projects ORDER BY hours DESC LIMIT 1 |
Can you also give me all the delegate's name from Liberal party in Economic Matters committee. | SELECT T1.delegate FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Liberal" and T1.committee = "Economic Matters" |
Was Magoffin a starting player? | SELECT starter FROM table_25711913_8 WHERE player = "Magoffin" |
Which round is a lower score than 21.5? | SELECT round FROM table_name_46 WHERE score < 21.5 |
what are the actual delivery dates of orders with quantity 1? | SELECT T1.Actual_Delivery_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1 |
Which Doctor Who episode has a Episode # of 11? | SELECT doctor_who_episode FROM table_name_78 WHERE episode__number = "11" |
In how many counties di McCain win 41.62% of the vote? | SELECT COUNT(county) FROM table_20524090_1 WHERE mccain_percentage = "41.62%" |
What are the winnings for position 7? | SELECT MAX(winnings__) AS $_ FROM table_23239946_3 WHERE position = 7 |
What are the names of reviewers who had rated 3 star and 4 star? | SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 3 INTERSECT SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 4 |
List all of the two-star reviews and their categories. | SELECT T1.category FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.rating = 2 |
Which team picked a player(s) from South Carolina? | SELECT cfl_team FROM table_name_73 WHERE college = "south carolina" |
On which surface did Mathieu play against Antonio Veić? | SELECT surface FROM table_name_84 WHERE opponent_in_the_final = "antonio veić" |
How many bronzes are there for the total nation with 112 silver and a total of 72? | SELECT AVG(bronze) FROM table_name_39 WHERE "total" > 72 AND nation = "total" AND silver < 112 |
Which batting team had 624 runs? | SELECT batting_team FROM table_name_84 WHERE runs = "624" |
What are the first and last names of the customers with the 10 cheapest invoices? | SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY total LIMIT 10; |
What is the average price before discount of the top 10 orders with the highest total price? | SELECT SUM(T2.l_extendedprice) / 10 FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey ORDER BY T1.o_totalprice DESC LIMIT 10 |
What are the coordinates of the school with the project "Wiping Away Bad Grades"? | SELECT T1.school_longitude, T1.school_latitude FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T2.title LIKE 'Wiping Away Bad Grades' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.