template
stringclasses
5 values
data
stringlengths
0
3.49k
derivation_sql
stringlengths
0
264
source
stringclasses
4 values
output
stringlengths
0
645
input
stringlengths
0
3.72k
instruction
stringlengths
13
230
derivation_eval
stringlengths
0
369
script
{"header": ["Year", "Chassis", "Engine", "Tyres", "Points"], "rows": [["1957", "Cooper T43", "Climax L-4", "D", "n/a1"], ["1958", "Cooper T45", "Climax L4", "D", "n/a2"], ["1959", "JBW Type 1", "Maserati L4", "D", "0"], ["1960", "JBW Type 1", "Maserati L4", "D", "0"], ["1961", "JBW Type 2", "Climax L4", "D", "0"]], "types": ["real", "text", "text", "text", "text"], "caption": "Complete Formula One World Championship results"}
SELECT ([Tyres]) FROM data_table WHERE [Year] < 1961 AND LOWER([Engine]) = LOWER('climax l4')
wiki-sql
D
What is the tyres with a year earlier than 1961 for a climax l4 engine?
script
{"header": ["Year", "Driver", "Nation of citizenship", "Racing series", "Type of vehicle"], "rows": [["1993", "Nigel Mansell", "United Kingdom", "Formula One", "Open wheel"], ["1994", "Nigel Mansell", "United Kingdom", "CART", "Open wheel"], ["1995", "Al Unser, Jr.", "United States", "CART", "Open wheel"], ["1996", "Jeff Gordon", "United States", "NASCAR", "Stock car"], ["1997", "Jimmy Vasser", "United States", "CART", "Open wheel"], ["1998", "Jeff Gordon", "United States", "NASCAR", "Stock car"], ["1999", "Jeff Gordon", "United States", "NASCAR", "Stock car"], ["2000", "Dale Jarrett", "United States", "NASCAR", "Stock car"], ["2001", "Bobby Labonte", "United States", "NASCAR", "Stock car"], ["2002", "Michael Schumacher", "Germany", "Formula One", "Open wheel"], ["2003", "Tony Stewart", "United States", "NASCAR", "Stock car"], ["2004", "Dale Earnhardt, Jr.", "United States", "NASCAR", "Stock car"], ["2005", "Michael Schumacher", "Germany", "Formula One", "Open wheel"], ["2006", "Tony Stewart", "United States", "NASCAR", "Stock car"], ["2007", "Jeff Gordon", "United States", "NASCAR", "Stock car"], ["2008", "Jimmie Johnson", "United States", "NASCAR", "Stock car"], ["2009", "Jimmie Johnson", "United States", "NASCAR", "Stock car"], ["2010", "Jimmie Johnson", "United States", "NASCAR", "Stock car"], ["2011", "Jimmie Johnson", "United States", "NASCAR", "Stock car"], ["2012", "Tony Stewart", "United States", "NASCAR", "Stock car"], ["2013", "Ryan Hunter-Reay", "United States", "IndyCar Series", "Open wheel"]], "types": ["real", "text", "text", "text", "text"], "caption": "List of winners"}
SELECT ([Driver]) FROM data_table WHERE LOWER([Type of vehicle]) = LOWER('stock car') AND [Year] = 1999
wiki-sql
Jeff Gordon
What driver has a stock car vehicle with a year of 1999?
script
{"header": ["No. in series", "No. in season", "Title", "Directed by", "Written by", "Original air date", "U.S. viewers (million)"], "rows": [[14, 1, "\"Losing Patients\"", "Michael Engler", "Darlene Hunt", "June27,2011", "0.89"], [15, 2, "\"Musical Chairs\"", "Michael Engler", "Jenny Bicks", "July4,2011", "0.58"], [16, 3, "\"Sexual Healing\"", "Miguel Arteta", "Mark Kunerth", "July11,2011", "0.53"], [17, 4, "\"Boo!\"", "Miguel Arteta", "Cara DiPaolo", "July18,2011", "0.62"], [18, 5, "\"Cats and Dogs\"", "Jennifer Getzinger", "Melanie Marnich", "July25,2011", "0.51"], [19, 6, "\"The Little c\"", "Jennifer Getzinger", "Hilly Hicks, Jr.", "August1,2011", "0.57"], [20, 7, "\"Goldilocks and the Bears\"", "Michael Engler", "Cusi Cram", "August8,2011", "0.49"], [21, 8, "\"The Last Thanksgiving\"", "Michael Engler", "Darlene Hunt", "August15,2011", "0.53"], [22, 9, "\"A Little Death\"", "Ryan Fleck & Anna Boden", "Jenny Bicks", "August22,2011", "0.62"], [23, 10, "\"How Do You Feel?\"", "Anna Boden & Ryan Fleck", "Mark Kunerth", "August29,2011", "0.70"], [24, 11, "\"Fight or Flight\"", "Craig Zisk", "Cara DiPoalo & Melanie Marnich", "September12,2011", "0.54"], [25, 12, "\"The Darkest Day\"", "Craig Zisk", "Jenny Bicks", "September19,2011", "0.45"]], "types": ["real", "real", "text", "text", "text", "text", "text"]}
SELECT COUNT([Directed by]) FROM data_table WHERE LOWER([Title]) = LOWER('"A Little Death"')
wiki-sql
1
How many people directed "a little death"?
script
{"header": ["Outcome", "Year", "Championship", "Surface", "Opponent in the final", "Score in the final"], "rows": [["Winner", 1997, "Australian Open", "Hard", "Mary Pierce", "62, 62"], ["Runner-up", 1997, "French Open", "Clay", "Iva Majoli", "64, 62"], ["Winner", 1997, "Wimbledon", "Grass", "Jana Novotn", "26, 63, 63"], ["Winner", 1997, "US Open", "Hard", "Venus Williams", "60, 64"], ["Winner", 1998, "Australian Open (2)", "Hard", "Conchita Martnez", "63, 63"], ["Runner-up", 1998, "US Open", "Hard", "Lindsay Davenport", "63, 75"], ["Winner", 1999, "Australian Open (3)", "Hard", "Amlie Mauresmo", "62, 63"], ["Runner-up", 1999, "French Open (2)", "Clay", "Steffi Graf", "46, 75, 62"], ["Runner-up", 1999, "US Open (2)", "Hard", "Serena Williams", "63, 76(4)"], ["Runner-up", 2000, "Australian Open", "Hard", "Lindsay Davenport", "61, 75"], ["Runner-up", 2001, "Australian Open (2)", "Hard", "Jennifer Capriati", "64, 63"]], "types": ["text", "real", "text", "text", "text", "text"], "caption": "Grand Slam singles finals"}
SELECT ([Championship]) FROM data_table WHERE LOWER([Score in the final]) = LOWER('46, 75, 62')
wiki-sql
French Open (2)
What tournament did she win with a final score of 46, 75, 62?
script
{"header": ["D 50 ", "D 49 ", "D 48 ", "D 47 ", "D 46 ", "D 45 ", "D 44 ", "D 43 ", "D 42 ", "D 41 "], "rows": [["D 11", "D 12", "D 13", "D 14", "D 15", "D 16", "D 17", "D 18", "D 19", "D 20"], ["D 30", "D 29", "D 28", "D 27", "D 26", "D 25", "D 24", "D 23", "D 22", "D 21"], ["D 31", "D 32", "D 33", "D 34", "D 35", "D 36", "D 37", "D 38", "D 39", "D 40"], ["D 50 ", "D 49 ", "D 48 ", "D 47 ", "D 46 ", "D 45 ", "D 44 ", "D 43 ", "D 42 ", "D 41 "], ["D 51 ", " Majority", " Majority", " Majority", " Majority", " Majority", " Majority", " Majority", " Majority", " Majority"], ["D 51 ", "D 52 ", "D 53 ", "D 54 ", "D 55 ", "D 56 ", "D 57 ", "D 58 ", "D 59 ", "D 60 "], ["R 31 O", "R 32 +", "D 68 +", "D 67 +", "D 66 +", "D 65 O", "D 64 O", "D 63 ", "D 62 ", "D 61 "], ["R 30 ", "R 29 ", "R 28 ", "R 27 ", "R 26 ", "R 25", "R 24", "R 23", "R 22", "R 21"], ["R 11", "R 12", "R 13", "R 14", "R 15", "R 16", "R 17", "R 18", "R 19", "R 20"], ["R 10", "R 9", "R 8", "R 7", "R 6", "R 5", "R 4", "R 3", "R 2", "R 1"]], "types": ["text", "text", "text", "text", "text", "text", "text", "text", "text", "text"], "caption": "Senate composition as a result of the elections"}
SELECT ([D 42 ]) FROM data_table WHERE LOWER([D 45 ]) = LOWER('r 16')
wiki-sql
R 19
What is the D 42 number when the D 45 is r 16?
script
{"header": ["Player", "Position", "Date of Birth (Age)", "Caps", "Province / Club"], "rows": [["Curtis Wolstenholme", "Prop", "Example", "4", "Example"], ["Sam Walters", "Prop", "Example", "Example", "Example"], ["Aaron Salmon", "Prop", "Example", "Example", "Example"], ["Darshan Goonetilleke", "Prop", "Example", "Example", "Example"], ["Aaron Palmer", "Lock", "19 August", "6", "DRFC"], ["Shane Kelly", "Hooker", "Example", "Example", "Example"], ["Luke Godley", "Hooker", "Example", "Example", "Example"], ["Gavin Piek", "Lock", "13 January 1975", "6", "DRFC"], ["Mark Spencer", "Lock", "Example", "Example", "Example"], ["Trent Webb", "Backrow", "Example", "Example", "Example"], ["Wade Quinn", "Backrow", "Example", "Example", "Example"], ["Tom Featherstone", "Backrow", "12 March 1990", "6", "DRFC"], ["Mark Hibbs", "Backrow", "14 July", "4", "DRFC"], ["Duncan Fairley", "Scrumhlaf", "Example", "Example", "Example"], ["Dave Burness", "Scrumhalf", "Example", "Example", "Example"], ["Paul Beard", "Flyhalf", "4", "Example", "Example"], ["Liam Frost", "Center (C)", "3 May", "4", "DRFC"], ["Lilian Cance", "Center", "27 September 1984", "4", "DRFC"], ["Daniel Liddell", "Center", "Example", "Example", "Example"], ["Jaco De Jager", "Wing", "Example", "Example", "Example"], ["Mubarak Al Malik", "Wing", "4", "Example", "Example"], ["Abdulkareem Al Muhannadi", "Wing", "Example", "Example", "Example"], ["Jim Hamilton", "Fullback", "Example", "Example", "Example"], ["Adam Beadon", "Fullback", "3 April 1984", "Example", "DRFC"], ["Michael Elumeze", "Backrow", "Example", "Example", "Example"], ["Jamie Frost", "Backrow", "Example", "2", "DRFC"]], "types": ["text", "text", "text", "text", "text"], "caption": "Players"}
SELECT ([Position]) FROM data_table WHERE LOWER([Date of Birth (Age)]) = LOWER('example') AND LOWER([Player]) = LOWER('mark spencer')
wiki-sql
Lock
What is Postition, when Date of Birth (Age) is Example, and when Player is Mark Spencer?
script
{"header": ["Date", "Venue", "Score", "Result", "Competition"], "rows": [["2 June 2008", "King Fahd Stadium , Riyadh , Saudi Arabia", "4-1", "Win", "2010 FIFA World Cup Qual."], ["29 May 2010", "Tivoli Neu , Innsbruck , Austria", "2-3", "Lost", "Friendly"], ["31 December 2010", "Manama , Bahrain , Bahrain", "1-0", "Win", "Friendly"], ["28 July 2011", "Siu Sai Wan Sports Ground , Hong Kong , Hong Kong", "5-0", "Win", "2014 FIFA World Cup Qual."], ["20 February 2012", "Australia", "3-0", "Win", "Friendly"], ["Correct as of 29 May 2010", "Correct as of 29 May 2010", "Correct as of 29 May 2010", "Correct as of 29 May 2010", "Correct as of 29 May 2010"]], "types": ["text", "text", "text", "text", "text"], "caption": "International goals"}
SELECT ([Competition]) FROM data_table WHERE LOWER([Result]) = LOWER('win') AND LOWER([Score]) = LOWER('1-0')
wiki-sql
Friendly
What is the Competition with a Result of win with a Score that is 1-0?
script
{"header": ["1973 Democratic run-off primary", "Manhattan", "The Bronx", "Brooklyn", "Queens", "Richmond Staten Is.", "Total"], "rows": [["Abraham Beame", "77,928", "97,415", "201,866", "153,415", "17,999", "548,623"], ["Abraham Beame", "41%", "53%", "68%", "73%", "78%", "548,623"], ["Herman Badillo", "112,482", "86,482", "93,140", "57,658", "4,819", "354,581"], ["Herman Badillo", "59%", "47%", "32%", "27%", "21%", "354,581"], ["T O T A L", "190,410", "183,897", "295,006", "211,073", "22,818", "903,204"]], "types": ["text", "text", "text", "text", "text", "text", "real"], "caption": "1973"}
SELECT ([Queens]) FROM data_table WHERE LOWER([1973 Democratic run-off primary]) = LOWER('herman badillo') AND LOWER([The Bronx]) = LOWER('47%')
wiki-sql
27%
Which Queens number in the 1973 Democratic run-off primary involved Herman Badillo and where the Bronx's percentage was 47%?
script
{"header": ["Place", "Player", "Country", "Score", "To par"], "rows": [["T1", "Harvie Ward (a)", "United States", "74-70=144", "+4"], ["T1", "Tommy Bolt", "United States", "67-77=144", "+4"], ["T3", "Julius Boros", "United States", "76-69=145", "+5"], ["T3", "Jack Fleck", "United States", "76-69=145", "+5"], ["T3", "Ben Hogan", "United States", "72-73=145", "+5"], ["T3", "Walker Inman, Jr.", "United States", "70-75=145", "+5"], ["T7", "Sam Snead", "United States", "79-69=148", "+8"], ["T7", "Bob Harris", "United States", "79-69=148", "+8"], ["T7", "Jack Burke, Jr.", "United States", "71-77=148", "+8"], ["10", "Gene Littler", "United States", "76-73=149", "+9"]], "types": ["text", "text", "text", "text", "real"], "caption": "Second round"}
SELECT AVG([To par]) FROM data_table WHERE LOWER([Player]) = LOWER('julius boros')
wiki-sql
5.0
What is the average To Par, when Player is "Julius Boros"?
script
{"header": ["Rd #", "Pick #", "Player", "Team (League)", "Reg GP", "Pl GP"], "rows": [["1", "4", "Jere Gillis", "Sherbrooke Beavers ( QMJHL )", "235", "1"], ["2", "22", "Jeff Bandura", "Portland Winterhawks ( WCHL )", "0", "0"], ["3", "40", "Glen Hanlon", "Brandon Wheat Kings ( WCHL )", "137", "2"], ["4", "56", "Dave Morrow", "Calgary Centennials ( WCHL )", "0", "0"], ["4", "58", "Murray Bannerman", "Victoria Cougars ( WCHL )", "1", "0"], ["5", "76", "Steve Hazlett", "St. Catharines Fincups ( OHA )", "1", "0"], ["6", "94", "Brian Drumm", "Peterborough Petes ( OHA )", "0", "0"], ["7", "112", "Ray Creasy", "New Westminster Bruins ( WCHL )", "0", "0"]], "types": ["real", "real", "text", "text", "real", "real"], "caption": ""}
SELECT ([Player]) FROM data_table WHERE [Pl GP] > 0 AND [Rd #] = 1
wiki-sql
Jere Gillis
Which Player has a PI GP over 0 and a Rd # of 1?
script
{"header": ["Year", "Entrant", "Chassis", "Engine", "Pts."], "rows": [["1972", "Motor Racing Developments", "Brabham BT33", "Ford Cosworth DFV V8", "0"], ["1972", "Motor Racing Developments", "Brabham BT34", "Ford Cosworth DFV V8", "0"], ["1973", "Motor Racing Developments", "Brabham BT37", "Ford Cosworth DFV V8", "3"], ["1973", "Motor Racing Developments", "Brabham BT42", "Ford Cosworth DFV V8", "3"], ["1975", "Copersucar", "Fittipaldi FD01", "Ford Cosworth DFV V8", "0"], ["1975", "Copersucar", "Fittipaldi FD02", "Ford Cosworth DFV V8", "0"], ["1975", "Copersucar", "Fittipaldi FD03", "Ford Cosworth DFV V8", "0"]], "types": ["real", "text", "text", "text", "real"], "caption": "Complete Formula One results"}
SELECT ([Engine]) FROM data_table WHERE [Year] = 1973 AND LOWER([Chassis]) = LOWER('brabham bt37')
wiki-sql
Ford Cosworth DFV V8
Which engine from 1973 has a Brabham bt37 chassis?
script
{"header": ["meas. num", "passed", "YES votes", "NO votes", "% YES", "Const. Amd.?", "type", "description"], "rows": [[1, "YES", 184031, 48645, "79.09%", "Yes", "LEG", "Voters' Literacy Amendment"], [2, "YES", 134071, 65133, "67.30%", "Yes", "LEG", "Public Use and Welfare Amendment"], [3, "YES", 131199, 92446, "58.66%", "Yes", "LEG", "Bonus Amendment"], [4, "No", 91597, 157324, "36.80%", "No", "Ref", "Oleomargarine Condensed Milk Bill"], [5, "No", 75159, 122839, "37.96%", "No", "Init", "Naturopath Bill"]], "types": ["real", "text", "real", "real", "text", "text", "text", "text"], "caption": "1924 General Election"}
SELECT ([meas. num]) FROM data_table WHERE LOWER([type]) = LOWER('Init')
wiki-sql
5
what is the measure number for the init type?
script
{"header": ["Rank", "Runs", "Opponent", "Venue", "Season"], "rows": [["1", "50", "Victoria", "Launceston Cricket Club Ground, Launceston", "1853/54"], ["2", "53", "New South Wales", "Bellerive Oval , Hobart", "2006/07"], ["3", "55", "South Australia", "Bellerive Oval , Hobart", "2010/11"], ["4", "57", "Victoria", "Launceston Cricket Club Ground, Launceston", "1850/51"], ["5", "62", "Queensland", "Gabba , Brisbane", "2008/09"], ["Source: . Last updated: 30 September 2013.", "Source: . Last updated: 30 September 2013.", "Source: . Last updated: 30 September 2013.", "Source: . Last updated: 30 September 2013.", "Source: . Last updated: 30 September 2013."]], "types": ["text", "text", "text", "text", "text"], "caption": "Lowest team totals against"}
SELECT ([Rank]) FROM data_table WHERE LOWER([Season]) = LOWER('2006/07')
wiki-sql
2
What was the rank of the team during season 2006/07?
script
{"header": ["Name or route", "type", "elevation groundstation", "elevation mountainstation", "slope length", "capacity in persons/hour", "construction year(s)"], "rows": [["Betten Betten Village", "aerial tramway", 832, 1199, 872, 350, "1950 1965"], ["Betten Village Bettmeralp", "aerial tramway", 1199, 1931, 1610, 500, "1951 1967 1979"], ["Betten Bettmeralp", "aerial tramway", 832, 1933, 2446, 970, "1974"], ["Bettmeralp Bettmerhorn", "gondola", 1991, 2652, 2324, 2400, "1975 1995"], ["Wurzenbord", "chairlift", 1966, 2224, 1075, 2000, "2003"], ["Schnbiel", "chairlift", 1956, 2296, 1669, 2800, "1998"], ["Alpmatten 1", "surface lift", 1861, 1951, 294, 650, "1971"], ["Alpmatten 2", "surface lift", 1861, 1951, 294, 650, "1971"], ["Bettmeralp 1", "surface lift", 1940, 2067, 640, 1000, "1972 1955"], ["Bettmeralp 2", "surface lift", 1940, 2067, 640, 1000, "1971"], ["Tanzbode", "surface lift", 1985, 2016, 488, 720, "1995 1992:Temporary lift"], ["Trainerlift", "surface lift", 1974, 2026, 303, 820, "1983 1st trainer:1969"], ["Lager 1", "surface lift", 1974, 2035, 336, 1000, "1983"]], "types": ["text", "text", "real", "real", "real", "real", "text"], "caption": "Skilift system"}
SELECT MIN([slope length]) FROM data_table WHERE LOWER([type]) = LOWER('gondola')
wiki-sql
2324
Name the slope length for gondola
script
{"header": ["Home team", "Home team score", "Away team", "Away team score", "Venue", "Crowd", "Date"], "rows": [["North Melbourne", "8.11 (59)", "St Kilda", "8.13 (61)", "Arden Street Oval", "8,000", "26 April 1947"], ["Fitzroy", "13.22 (100)", "Richmond", "11.11 (77)", "Brunswick Street Oval", "22,000", "26 April 1947"], ["Melbourne", "14.25 (109)", "Geelong", "11.7 (73)", "MCG", "12,000", "26 April 1947"], ["Footscray", "15.13 (103)", "Essendon", "13.11 (89)", "Western Oval", "22,000", "26 April 1947"], ["Hawthorn", "13.9 (87)", "Collingwood", "19.20 (134)", "Glenferrie Oval", "15,000", "26 April 1947"], ["South Melbourne", "12.12 (84)", "Carlton", "9.16 (70)", "Lake Oval", "30,000", "26 April 1947"]], "types": ["text", "text", "text", "text", "text", "real", "text"], "caption": "Round 2"}
SELECT SUM([Crowd]) FROM data_table WHERE LOWER([Home team score]) = LOWER('12.12 (84)')
wiki-sql
30000.0
What was the crowd total on the day the home team scored 12.12 (84)?