sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
Which tourist attractions are related to royal family? Tell me their details and how we can get there. | SELECT T1.Royal_Family_Details , T2.How_to_Get_There FROM ROYAL_FAMILY AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Royal_Family_ID = T2.Tourist_Attraction_ID |
What is the north with sb rosenheim as the south? | SELECT north FROM table_name_45 WHERE south = "sb rosenheim" |
Who won at the Barbagallo Raceway circuit? | SELECT winner FROM table_name_49 WHERE circuit = "barbagallo raceway" |
What is Minister, when Portfolio is "Minister of Pubblic Administration", and when Took Office is "14 November 2002"? | SELECT minister FROM table_name_97 WHERE portfolio = "minister of pubblic administration" AND took_office = "14 november 2002" |
What is the customer first, last name and id with least number of accounts. | SELECT T2.customer_first_name , T2.customer_last_name , T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) ASC LIMIT 1 |
Who is the home captain that won AUS by 245 runs? | SELECT home_captain FROM table_name_93 WHERE result = "aus by 245 runs" |
What is the number of the round in which Ron Hansen was drafted and the overall is greater than 332? | SELECT COUNT(round) FROM table_name_60 WHERE name = "ron hansen" AND overall > 332 |
Which Network has a Local name of moj tata je bolji od tvog tate? | SELECT network FROM table_name_56 WHERE local_name = "moj tata je bolji od tvog tate" |
Name the asian american population 2010 for kansas city-overland park-kansas city, mo-ks csa | SELECT MAX(asian_american_population__2010_) FROM table_18963843_1 WHERE combined_statistical_area = "Kansas City-Overland Park-Kansas City, MO-KS CSA" |
Name the segment c with episode less than 179 and segment b of s sticker | SELECT segment_c FROM table_name_63 WHERE episode < 179 AND segment_b = "s sticker" |
Among the products under grains/cereals category, provide the contact person and title of the supplier with one digit ID. | SELECT DISTINCT T1.ContactName, T1.ContactTitle FROM Suppliers AS T1 INNER JOIN Products AS T2 ON T1.SupplierID = T2.SupplierID INNER JOIN Categories AS T3 ON T2.CategoryID = T3.CategoryID WHERE T3.CategoryName = 'Grains/Cereals' AND T1.SupplierID BETWEEN 1 AND 10 LIMIT 1 |
What movies did director Jack Kinney direct? | SELECT name FROM director WHERE director = 'Jack Kinney' |
What is the gender of the student Linda Smith? | SELECT Sex FROM Student WHERE Fname = "Linda" AND Lname = "Smith" |
what is the address of Ahmed | SELECT customer_address FROM Customers WHERE customer_name = "Ahmed" |
What is the document date of project ID 105? | Do you mean Document ID 105 | yes | SELECT Document_Date FROM Documents where Document_ID = 105 |
What is the number of votes when Ron Paul is the candidate with less than 0 counties? | SELECT COUNT(votes) FROM table_name_28 WHERE candidate = "ron paul" AND counties < 0 |
What was the value in 1995 for A in 2000 at the Indian Wells tournament? | SELECT 1995 FROM table_name_95 WHERE 2000 = "a" AND tournament = "indian wells" |
Which head's name has the substring 'Ha'? List the id and name. | SELECT head_id , name FROM head WHERE name LIKE '%Ha%' |
What is the ab ripper x when the length is 92:24? | SELECT ab_ripper_x FROM table_27512025_1 WHERE length = "92:24" |
In what Year was Labyrinth nominated? | SELECT year__ceremony_ FROM table_name_46 WHERE film_title_used_in_nomination = "labyrinth" |
Which Lead has a Nation of switzerland? | SELECT lead FROM table_name_15 WHERE nation = "switzerland" |
And which has least? | SELECT Policy_Type_Code FROM Customer_Policies GROUP BY Policy_Type_Code ORDER BY count ( * ) LIMIT 1 |
Please list the precise location coordinates of all the crimes in Central Chicago. | SELECT T2.latitude, T2.longitude FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T1.district_name = 'Central' |
What is the total attendance of the game with Toronto as the visitor team? | SELECT COUNT(attendance) FROM table_name_82 WHERE visitor = "toronto" |
Find the university from which the professor who advised most undergraduate students graduated. | SELECT T1.graduate_from FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T3.type = 'UG' GROUP BY T1.prof_id ORDER BY COUNT(T2.student_id) DESC LIMIT 1 |
Who is the least aged person on the list? | SELECT name FROM Person order by age limit 1 |
Return the id of the document with the fewest paragraphs. | SELECT document_id FROM Paragraphs GROUP BY document_id ORDER BY count(*) ASC LIMIT 1 |
Provide all the transactions whereby the quantiy is more than 10,000 pieces. State the product name and the selling price. | SELECT DISTINCT T1.Name, T1.ListPrice FROM Product AS T1 INNER JOIN TransactionHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Quantity > 10000 |
What label shows an Album of cover version v? | SELECT label FROM table_name_24 WHERE album = "cover version v" |
What is the most recent season with a date of 27 October 1957? | SELECT MAX(season) FROM table_name_43 WHERE date = "27 october 1957" |
What are the cities that have more than 2 airports sorted by number of airports? | SELECT city FROM airports GROUP BY city HAVING count(*) > 2 ORDER BY count(*) |
Count the number of courses. | SELECT count(*) FROM COURSE |
What driver had the highest grid position with a time of +0.283? | SELECT MAX(grid) FROM table_name_90 WHERE time = "+0.283" |
What is the Date of the Event in Panama City? | SELECT date FROM table_name_37 WHERE city = "panama city" |
Return the the details of all products. | SELECT DISTINCT product_details FROM products |
What album is 4:53 long? | SELECT album FROM table_name_74 WHERE length = "4:53" |
Please list the social security numbers of all the employees who work in California. | SELECT T1.ssn FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T2.state = 'CA' |
What is the college/junior/club team name of player Mats Lindgren? | SELECT college_junior_club_team FROM table_2781227_1 WHERE player = "Mats Lindgren" |
List the main industry with highest total market value and its number of companies. | SELECT main_industry , count(*) FROM company GROUP BY main_industry ORDER BY sum(market_value) DESC LIMIT 1 |
List the open date of open year of the shop named "Apple". | SELECT Open_Date , Open_Year FROM shop WHERE Shop_Name = "Apple" |
State the name of teams ranked first five or more times and lost a league two or more times between 1980 and 2000? | SELECT T1.name FROM teams AS T1 INNER JOIN series_post AS T2 ON T1.tmID = T2.tmIDLoser AND T1.year = T2.year WHERE T1.rank < 5 AND T2.lgIDLoser > 2 AND T2.year BETWEEN 1980 AND 2000 |
Show me the rank of the team that has the largest average number of attendance? | SELECT T2.rank FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id GROUP BY T1.team_id ORDER BY avg ( T1.attendance ) DESC LIMIT 1 |
Which status is 75.35 km2 and is named sussex? | SELECT status FROM table_name_20 WHERE area_km_2 < 75.35 AND official_name = "sussex" |
How many more stars in percentage are there for the repository of solution "1" than solution "2"? | SELECT CAST(SUM(CASE WHEN T2.Id = 1 THEN T1.Stars ELSE 0 END) - SUM(CASE WHEN T2.Id = 2 THEN T1.Stars ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN T2.Id = 2 THEN T1.Stars ELSE 0 END) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId |
What is the Motor that has a Focuses bigger than 62, and a Participant of rebaque? | SELECT engine FROM table_name_73 WHERE points > 62 AND entrant = "rebaque" |
Show the flight number and distance of the flight with maximum price. | SELECT flno , distance FROM Flight ORDER BY price DESC LIMIT 1 |
what is the position for the player from university of alabama? | SELECT position FROM table_name_37 WHERE school = "university of alabama" |
What is the order number of the Billboard Hot 100 Hits theme and the original artist was Sixpence None the Richer? | SELECT order__number FROM table_26250155_1 WHERE theme = "Billboard Hot 100 Hits" AND original_artist = "Sixpence None the Richer" |
Which nominating festival nominated Iao Lethem's film? | SELECT nominating_festival FROM table_name_80 WHERE director_s_ = "iao lethem" |
Can you list all composers who wrote tracks with the letter B in their name? | SELECT composer FROM track where name like "%B%" |
Which record has a score of l 121–127? | SELECT record FROM table_name_93 WHERE score = "l 121–127" |
Among the legislators who will end in 2009, how many are from the Republican party? | SELECT `END`, party FROM `current-terms` WHERE STRFTIME('%Y', `END`) = '2009' AND party = 'Republican' |
For how many times has Aimee Bixby ordered the product Xerox 1952? | SELECT COUNT(DISTINCT T2.`Order ID`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Aimee Bixby' AND T3.`Product Name` = 'Xerox 1952' |
Find all the vocal types. | SELECT DISTINCT TYPE FROM vocals |
Which best 3-year period has a best 15-year period of smyslov; kasparov, and a Position of 5? | SELECT best_3_year_period FROM table_name_61 WHERE best_15_year_period = "smyslov; kasparov" AND position = 5 |
What was the competition when the score was 3-0? | SELECT competition FROM table_name_33 WHERE score = "3-0" |
Find the name of tracks which are in both Movies and music playlists. | SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' INTERSECT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music' |
Can you add to the table the name of the phones associated with each of the phone ids? | SELECT t2.market_id, t2.district,t1.phone_id,t3.name FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID |
Which college is the player from South Medford High School headed to? | SELECT college FROM table_name_67 WHERE school = "south medford high school" |
what is the circuit when the date is 16 april? | SELECT circuit FROM table_name_60 WHERE date = "16 april" |
What episode number is presented by Ben Okri ? | SELECT episode_no FROM table_15211468_3 WHERE presenter = "Ben Okri" |
What's the number of McCain votes in the county where Obama got 35.7% and others got 1.9% of the votes? | SELECT MIN(mccain_number) FROM table_20453681_1 WHERE obama_percentage = "35.7%" AND others_percentage = "1.9%" |
What is the date of the game where the NY Islanders are the home team? | SELECT date FROM table_name_2 WHERE home = "ny islanders" |
Please calculate the total value of Motorcycles orders. | SELECT SUM(T1.quantityOrdered * T1.priceEach) FROM orderdetails AS T1 INNER JOIN products AS T2 ON T1.productCode = T2.productCode WHERE T2.productLine = 'Motorcycles' |
Give me the descriptions of the service types that cost more than 100. | SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 |
What manufacturer won the race on November 2? | SELECT manufacturer FROM table_17801022_1 WHERE date = "November 2" |
What are the product assembly ID that come with unit measure code EA and BOM level of 2, at the same time have per assembly quantity of more than 10? | SELECT ProductAssemblyID FROM BillOfMaterials WHERE UnitMeasureCode = 'EA' AND BOMLevel = 2 AND PerAssemblyQty > 10 |
What is Country, when Class / Type is "Three masted full rigged ship"? | SELECT country FROM table_name_2 WHERE class___type = "three masted full rigged ship" |
What is the Burmese term for Thursday? | SELECT burmese FROM table_14850099_18 WHERE english = "Thursday" |
What is the county that produces the most wines scoring higher than 90? | SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T2.Score > 90 GROUP BY T1.County ORDER BY count(*) DESC LIMIT 1 |
Name the virtual for Fox | SELECT COUNT(virtual) FROM table_14623167_1 WHERE network = "Fox" |
What is the site for Florida? | SELECT listed FROM table_name_22 WHERE municipality = "florida" |
Which College/Junior/Club Team has a Nationality of Canada and Jeff brown? | SELECT college_junior_club_team__league_ FROM table_name_84 WHERE nationality = "canada" AND player = "jeff brown" |
On what date was the attendance a bye? | SELECT date FROM table_name_44 WHERE attendance = "bye" |
What genre is the game from the year 2007? | SELECT genre FROM table_name_29 WHERE year = 2007 |
More crimes happened in which community area in January, 2018, Woodlawn or Lincoln Square? | SELECT T1.community_area_name FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no WHERE T1.community_area_name IN ('Woodlawn', 'Lincoln Square') AND T2.date LIKE '%1/2018%' GROUP BY T1.community_area_name ORDER BY COUNT(T1.community_area_name) DESC LIMIT 1 |
Which Loss has a Name of bullock, chris, and a Long smaller than 36? | SELECT SUM(loss) FROM table_name_72 WHERE name = "bullock, chris" AND long < 36 |
What is the name of Rank 5? | SELECT name FROM table_name_89 WHERE rank = 5 |
How many railways are there? | SELECT count(*) FROM railway |
What is the name of the course with the highest satisfaction from students? | SELECT DISTINCT T2.name FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T1.sat = 5 |
The year 1972 has what written in Height column? | SELECT height FROM table_name_40 WHERE year = 1972 |
What are the distinct payment method codes in all the invoices? | SELECT DISTINCT payment_method_code FROM INVOICES |
How long has Sebastian Telfair played for Toronto? | SELECT years_in_toronto FROM table_name_83 WHERE player = "sebastian telfair" |
What is the crowd for away team of north melbourne? | SELECT crowd FROM table_name_16 WHERE away_team = "north melbourne" |
Who was the visiting team on May 7? | SELECT visitor FROM table_name_55 WHERE date = "may 7" |
Name the week number for the beatles | SELECT week__number FROM table_19508635_1 WHERE theme = "The Beatles" |
What is the date of the game when the Mavericks were the home team? | SELECT date FROM table_name_98 WHERE home = "mavericks" |
What is the least amount of Silver medals that have more than 3 Bronze? | SELECT MIN(silver) FROM table_name_39 WHERE bronze > 3 |
How many games can be played on the Wii platform? | SELECT COUNT(T1.id) FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id WHERE T2.platform_name = 'Wii' |
What are the line 1 of addresses shared by some students and some teachers? | SELECT T1.line_1 FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.address_id INTERSECT SELECT T1.line_1 FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id |
Who won bronze in Seoul? | SELECT bronze FROM table_name_20 WHERE location = "seoul" |
find the property type code and address for the property id 24 | SELECT property_type_code, property_address from properties where property_id = 24 |
List the number of invoices from the US, grouped by state. | SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state |
What is the Pinyin translation of the Wade-Giles of hsin-yüan-i-ma? | SELECT pinyin FROM table_name_4 WHERE wade_giles = "hsin-yüan-i-ma" |
What is the date of the post-week 2 game with a result of l 16–10? | SELECT date FROM table_name_58 WHERE week > 2 AND result = "l 16–10" |
What about the least number of records? | SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id GROUP BY t2.swimmer_id ORDER BY count ( * ) ASC LIMIT 1 |
How many actors have appeared in each musical? | SELECT T2.Name , COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID |
What To par has a Place of t2, and a Country of united states? | SELECT to_par FROM table_name_11 WHERE place = "t2" AND country = "united states" |
In how many games in which the batting team was the Delhi Daredevils were no runs scored? | SELECT COUNT(T1.Runs_Scored) FROM Batsman_Scored AS T1 INNER JOIN Ball_by_Ball AS T2 ON T1.Match_Id = T2.Match_Id INNER JOIN Match AS T3 ON T2.Match_Id = T3.Match_Id INNER JOIN Team AS T4 ON T3.Team_1 = T4.Team_Id WHERE T2.Team_Batting = 1 OR T2.Team_Batting = 2 AND T4.Team_Name = 'Delhi Daredevils' |
what is the name of customer id 2 | SELECT customer_name from Customers where customer_id = 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.