instruction
stringlengths
212
6.3k
output
stringlengths
6
2.03k
### Instruction: CREATE TABLE table_35074 ( "Player" text, "Played" real, "Sets Won" real, "Sets Lost" real, "Legs Won" real, "Legs Lost" real, "100+" real, "140+" real, "180s" real, "High Checkout" real, "3-dart Average" real ) -- Using valid SQLite, answer the following q...
SELECT COUNT("Legs Lost") FROM table_35074 WHERE "Player" = 'trina gulliver' AND "Played" > '3'
### Instruction: CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following ...
SELECT T1.Code, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
### Instruction: CREATE TABLE table_628 ( "Tag ID" text, "Application" text, "Torque Rating" real, "1st" text, "2nd" text, "3rd" text, "4th" text, "5th" text, "6th" text, "Rev" text, "Input Splines" real, "Output Splines" real ) -- Using valid SQLite, answer the followi...
SELECT "2nd" FROM table_628 WHERE "Application" = '1996-2002 Dodge Viper'
### Instruction: CREATE TABLE table_4413 ( "Country" text, "Sales (X1000)" text, "No. of stores" real, "Sales area (m\u00b2)" real, "Sales per area" text, "Average store size (m\u00b2)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ...
SELECT MIN("Sales area (m\u00b2)") FROM table_4413 WHERE "Sales per area" = '€4,094/m²' AND "No. of stores" > '2'
### Instruction: CREATE TABLE table_204_173 ( id number, "rank" number, "group" text, "name" text, "nationality" text, "2.05" text, "2.15" text, "2.19" text, "2.23" text, "2.26" text, "result" text, "notes" text ) -- Using valid SQLite, answer the following questions fo...
SELECT "name" FROM table_204_173 WHERE id = (SELECT id FROM table_204_173 WHERE "name" = 'martyn bernard') - 1
### Instruction: CREATE TABLE table_36108 ( "Year" real, "Player" text, "Country" text, "Score" text, "Margin of victory" text, "Winner's share ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a Year larger than 1980, and a ...
SELECT "Score" FROM table_36108 WHERE "Year" > '1980' AND "Margin of victory" = '2 strokes' AND "Country" = 'united states' AND "Player" = 'jim furyk'
### Instruction: CREATE TABLE table_train_35 ( "id" int, "pregnancy_or_lactation" bool, "glucocorticoid_history" bool, "impaired_consciousness" bool, "hematologic_disease" bool, "glasgow_come_score_gcs" int, "liver_disease" bool, "NOUSE" float ) -- Using valid SQLite, answer the follow...
SELECT * FROM table_train_35 WHERE impaired_consciousness = 1 OR glasgow_come_score_gcs < 7
### Instruction: CREATE TABLE table_27713 ( "User" text, "Unit (kWh)/Time range" text, "Tariff ( Rs. /kWh)" text, "Fixed Charge ( Rs. /kWh)" text, "Fuel Adjustment Charge (% of Total Energy Charge)" text, "Max. Demand Charge ( Rs. /kVA)" text ) -- Using valid SQLite, answer the following quest...
SELECT "Fixed Charge ( Rs. /kWh)" FROM table_27713 WHERE "Tariff ( Rs. /kWh)" = '11.30'
### Instruction: CREATE TABLE table_22310 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "Canadian air date" text, "U.S. air date" text, "Production code" real, "Canadian viewers (million)" text ) -- Using valid SQLite, answer the following questions f...
SELECT "No." FROM table_22310 WHERE "Directed by" = 'Kelly Makin' AND "Written by" = 'Mark Ellis & Stephanie Morgenstern'
### Instruction: CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS ...
SELECT cName, MIN(enr) FROM College GROUP BY state ORDER BY cName DESC
### Instruction: CREATE TABLE table_21468 ( "Athlete" text, "Event" text, "Round of 64" text, "Round of 32" text, "Round of 16" text, "Quarterfinals" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was round of 64 of the singles event when t...
SELECT "Round of 64" FROM table_21468 WHERE "Event" = 'Singles' AND "Round of 16" = 'Did not advance' AND "Athlete" = 'Iveta Benešová'
### Instruction: CREATE TABLE table_53662 ( "Entrant" text, "Constructor" text, "Chassis" text, "Tyre" text, "Driver" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you say what was the entrant of maserati built item with a Ty...
SELECT "Entrant" FROM table_53662 WHERE "Constructor" = 'maserati' AND "Tyre" = 'p' AND "Chassis" = '250f a6gcm' AND "Driver" = 'luigi villoresi'
### Instruction: CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following ...
SELECT Price, Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
### Instruction: CREATE TABLE table_79451 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "Total Apps" text, "Total Goals" real ) -- Using valid SQLite, answer the...
SELECT MAX("Total Goals") FROM table_79451 WHERE "FA Cup Goals" = '0' AND "League Apps" = '41'
### Instruction: CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following ...
SELECT Founder, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
### Instruction: CREATE TABLE table_68366 ( "Year" real, "Population (Region total)" real, "Population (Maryborough)" real, "Population (Hervey Bay)" real, "Population (Woocoo)" real, "Population (Tiaro)" real ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT MAX("Population (Hervey Bay)") FROM table_68366 WHERE "Population (Maryborough)" = '22,977' AND "Population (Tiaro)" < '3,287'
### Instruction: CREATE TABLE table_203_94 ( id number, "year" number, "player" text, "country" text, "score" text, "to par" number, "margin\nof victory" text, "course" text, "location" text, "purse ($)" number, "winner's\nshare ($)" number ) -- Using valid SQLite, answer t...
SELECT "player" FROM table_203_94 WHERE "year" > (SELECT "year" FROM table_203_94 WHERE "player" = 'justin rose') ORDER BY "year" LIMIT 1
### Instruction: CREATE TABLE table_48189 ( "Release Title" text, "Series" text, "No. of DVDs" text, "No. of Blu-ray Discs" text, "Release Date" text, "Episode No." text, "Region No." real, "Released by" text ) -- Using valid SQLite, answer the following questions for the tables provid...
SELECT "Series" FROM table_48189 WHERE "Released by" = 'itv studios' AND "Release Date" = 'august 15, 2012'
### Instruction: CREATE TABLE table_37180 ( "Year(s)" real, "Grand Final Television Commentator" text, "Grand Final Dual Television Commentator" text, "Spokesperson" text, "Semi Final Television Commentator" text, "Semi Final Dual Television Commentator" text ) -- Using valid SQLite, answer th...
SELECT "Semi Final Dual Television Commentator" FROM table_37180 WHERE "Grand Final Television Commentator" = 'pierre tchernia' AND "Spokesperson" = 'unknown'
### Instruction: CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_pres...
SELECT advisor FROM student WHERE city_code = "BAL"
### Instruction: CREATE TABLE table_73642 ( "Year" real, "Oscars" text, "Noms" real, "Wins" real, "Film" text, "Leading Actor" text, "Leading Actress" text, "Supporting Actor" text, "Supporting Actress" text ) -- Using valid SQLite, answer the following questions for the tables pro...
SELECT "Leading Actress" FROM table_73642 WHERE "Leading Actor" = 'Warren Beatty' AND "Oscars" = '40th'
### Instruction: CREATE TABLE table_50186 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" real, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text ) -- Using valid SQLite, answer the following questions fo...
SELECT "Wins" FROM table_50186 WHERE "Starts" > '1' AND "Top 5" = '3'
### Instruction: CREATE TABLE table_29193 ( "Rank" real, "Rider" text, "Sat 21 Aug" text, "Mon 23 Aug" text, "Tues 24 Aug" text, "Wed 25 Aug" text, "Thurs 26 Aug" text, "Fri 27 Aug" text, "Sat 29 Aug" text ) -- Using valid SQLite, answer the following questions for the tables provi...
SELECT "Mon 23 Aug" FROM table_29193 WHERE "Rider" = 'Tom Snow 250cc Honda'
### Instruction: CREATE TABLE table_27666 ( "GB" text, "ISO \u2116" text, "Province" text, "Chinese Name" text, "Capital" text, "Population\u00b9" real, "Density\u00b2" text, "Area\u00b3" real, "Abbreviation/Symbol" text ) -- Using valid SQLite, answer the following questions for t...
SELECT COUNT("ISO \u2116") FROM table_27666 WHERE "Density\u00b2" = '165.81'
### Instruction: CREATE TABLE table_69359 ( "Engine" text, "Displacement" text, "Power" text, "Torque" text, "Redline" real, "Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Displacement of 4.4l (4423cc/269in ) and a Power of 220kw (299hp) ...
SELECT "Engine" FROM table_69359 WHERE "Displacement" = '4.4l (4423cc/269in³)' AND "Power" = '220kw (299hp) @ 4000'
### Instruction: CREATE TABLE table_64986 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" real, "FA Cup Goals" real, "League Cup Apps" real, "League Cup Goals" real, "Total Apps" text, "Total Goals" real ) -- Using valid SQLite, answer the...
SELECT MAX("League Cup Apps") FROM table_64986 WHERE "League Cup Goals" = '0' AND "Name" = 'jimmy lawson'
### Instruction: CREATE TABLE table_77001 ( "Squad No." real, "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "Total Apps" text, "Total Goals" real ) -- Using va...
SELECT SUM("FA Cup Goals") FROM table_77001 WHERE "League Cup Goals" > '0'
### Instruction: CREATE TABLE table_30842 ( "Age" real, "Date" text, "Track" text, "Race" text, "Distance (miles)" text, "Jockey" text, "Handicap" text, "Field (No. horses)" text, "Place" text, "Time" text, "Prize Money" text, "+ Sweepstake" text, "Archer\u2019s winni...
SELECT "Date" FROM table_30842 WHERE "Track" = 'Ballarat'
### Instruction: CREATE TABLE table_203_296 ( id number, "country" text, "total gdp (nominal)\n(billion us$)" text, "gdp per capita\n(us$, ppp)" text, "gdp growth,\n2007-2011\n(in %)" number, "hdi" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- ...
SELECT "country" FROM table_203_296 WHERE "country" IN ('angola', 'ethiopia') ORDER BY "gdp growth,\n2007-2011\n(in %)" DESC LIMIT 1
### Instruction: CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE location ( restaurant_id int, house_number int, street_name va...
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'san francisco' AND restaurant.id = location.restaurant_id AND restaurant.name = 'jamerican cuisine'
### Instruction: CREATE TABLE volume ( volume_id number, volume_issue text, issue_date text, weeks_on_top number, song text, artist_id number ) CREATE TABLE music_festival ( id number, music_festival text, date_of_ceremony text, category text, volume number, result text ...
SELECT date_of_ceremony, result FROM music_festival
### Instruction: CREATE TABLE table_36266 ( "Date" text, "Episode" real, "Performer 1" text, "Performer 2" text, "Performer 3" text, "Performer 4" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Performer 1 of Stephen Frost, and a Performer 2 of ...
SELECT "Performer 3" FROM table_36266 WHERE "Performer 1" = 'stephen frost' AND "Performer 2" = 'josie lawrence' AND "Date" = '15 september 1995'
### Instruction: CREATE TABLE table_67359 ( "Image" real, "Smith" text, "Ashmolean" real, "Foster" real, "Hahland" real, "Dinsmoor" text, "Hofkes-Brukker" text, "Harrison" text, "Cooper" text, "BM/Corbett" text ) -- Using valid SQLite, answer the following questions for the tab...
SELECT "Cooper" FROM table_67359 WHERE "Ashmolean" < '21' AND "Hahland" < '4'
### Instruction: CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following ...
SELECT T1.Code, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name
### Instruction: CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following ...
SELECT T1.Code, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name
### Instruction: CREATE TABLE table_21328 ( "Rank" real, "Team" text, "Played" real, "Win" real, "Loss" real, "Last 5" text, "Streak" text, "PF per game" text, "PA per game" text, "PD per game" text, "Winning %" text ) -- Using valid SQLite, answer the following questions f...
SELECT "Winning %" FROM table_21328 WHERE "Last 5" = '3-2' AND "Streak" = 'L1'
### Instruction: CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text ) -- Using valid SQLite, answer the following questions for the tables provided...
SELECT T2.title, SUM(MIN(T1.stars)) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.title ORDER BY SUM(MIN(T1.stars)) DESC
### Instruction: CREATE TABLE table_train_103 ( "id" int, "systolic_blood_pressure_sbp" int, "epilepsy" bool, "diastolic_blood_pressure_dbp" int, "heart_rate" int, "seizure_disorder" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables...
SELECT * FROM table_train_103 WHERE systolic_blood_pressure_sbp >= 200 OR diastolic_blood_pressure_dbp >= 120
### Instruction: CREATE TABLE table_38690 ( "Career Card" text, "Starting career/salary" text, "2nd career/salary" text, "3rd career/salary" text, "4th career/salary" text, "5th career/salary" text, "6th career/salary" text ) -- Using valid SQLite, answer the following questions for the ta...
SELECT "Career Card" FROM table_38690 WHERE "5th career/salary" = 'automotive designer ($350,000-degree)'
### Instruction: CREATE TABLE table_69878 ( "Tournament" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "Career SR" text ) -- Using valid SQLite, answer the following questions for the tables provid...
SELECT "Career SR" FROM table_69878 WHERE "Tournament" = 'masters series sr'
### Instruction: CREATE TABLE table_41885 ( "Month, year" text, "Sunk by U-Boat" real, "Sunk by aircraft" real, "Sunk by warship or raider" real, "Sunk by mines" real, "German submarines lost" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What ...
SELECT COUNT("Sunk by warship or raider") FROM table_41885 WHERE "German submarines lost" = '20' AND "Sunk by aircraft" > '21616'
### Instruction: CREATE TABLE table_204_43 ( id number, "name" text, "rural\nmunicipality (rm)" text, "population\n(2011)" number, "population\n(2006)" number, "change\n(%)" number, "land\narea\n(km2)" number, "population\ndensity\n(per km2)" number ) -- Using valid SQLite, answer the ...
SELECT SUM("population\n(2011)") FROM table_204_43 WHERE "name" IN ('battleford', 'oxbow')
### Instruction: CREATE TABLE table_58789 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Raiders points" real, "Opponents" real, "Raiders first downs" real, "Record" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT COUNT("Raiders first downs") FROM table_58789 WHERE "Date" = 'nov. 2' AND "Raiders points" > '42'
### Instruction: CREATE TABLE table_72633 ( "Rank" real, "Country/Territory" text, "Miss World" real, "1st Runner-up" real, "2nd Runner-up" real, "3rd Runner-up" real, "4th Runner-up" real, "5th Runner-up" real, "6th Runner-up" real, "Semifinalists" real, "Total" real ) -- ...
SELECT COUNT("Rank") FROM table_72633 WHERE "Country/Territory" = 'United States'
### Instruction: CREATE TABLE table_42040 ( "Date" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Set 4" text, "Set 5" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is set 3 when set 5 is na, set 1 is ...
SELECT "Set 3" FROM table_42040 WHERE "Set 5" = 'na' AND "Set 1" = '21-25' AND "Set 2" = '25-16'
### Instruction: CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstNa...
SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType
### Instruction: CREATE TABLE bank ( branch_id number, bname text, no_of_customers number, city text, state text ) CREATE TABLE loan ( loan_id text, loan_type text, cust_id text, branch_id text, amount number ) CREATE TABLE customer ( cust_id text, cust_name text, a...
SELECT COUNT(DISTINCT state) FROM bank
### Instruction: CREATE TABLE table_16040 ( "Character" text, "1954 Broadway" text, "1955 broadcast" text, "1960 broadcast" text, "1979 Broadway" text, "1990 Broadway" text, "1991 Broadway" text, "1998 Broadway" text, "1999 Broadway" text ) -- Using valid SQLite, answer the followi...
SELECT "1990 Broadway" FROM table_16040 WHERE "1955 broadcast" = 'Tom Halloran'
### Instruction: CREATE TABLE TRANSACTIONS_LOTS ( transaction_id VARCHAR ) CREATE TABLE LOTS ( lot_details VARCHAR, lot_id VARCHAR ) CREATE TABLE TRANSACTIONS ( transaction_id VARCHAR, share_count INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- ...
SELECT T1.lot_details FROM LOTS AS T1 JOIN TRANSACTIONS_LOTS AS T2 ON T1.lot_id = T2.transaction_id JOIN TRANSACTIONS AS T3 ON T2.transaction_id = T3.transaction_id WHERE T3.share_count < 50
### Instruction: CREATE TABLE loan ( loan_id text, loan_type text, cust_id text, branch_id text, amount number ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, acc_bal number, no_of_loans number, credit_score number, branch_id number, state text...
SELECT COUNT(DISTINCT city) FROM bank
### Instruction: CREATE TABLE table_79158 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" text ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT AVG("Lost") FROM table_79158 WHERE "Position" > '5' AND "Points 1" = '37' AND "Goals Against" < '63'
### Instruction: CREATE TABLE head ( head_ID int, name text, born_state text, age real ) CREATE TABLE management ( department_ID int, head_ID int, temporary_acting text ) CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billi...
SELECT Creation, AVG(Budget_in_Billions) FROM department GROUP BY Creation ORDER BY Creation DESC
### Instruction: CREATE TABLE companies ( id number, name text, headquarters text, industry text, sales_billion number, profits_billion number, assets_billion number, market_value_billion text ) CREATE TABLE office_locations ( building_id number, company_id number, move_in_y...
SELECT name FROM buildings WHERE NOT id IN (SELECT building_id FROM office_locations)
### Instruction: CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num_Employees real ) CREATE TABLE management ( department_ID int, head_ID int, temporary_acting text ) CREATE TABLE head ( head_ID int, name text, ...
SELECT Creation, SUM(Budget_in_Billions) FROM department GROUP BY Creation ORDER BY Creation
### Instruction: CREATE TABLE table_67628 ( "Club" text, "Sport" text, "League" text, "Venue" text, "Championships (Years)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Venue has a Sport of baseball, Championships (Years) of 0, a League of m...
SELECT "Venue" FROM table_67628 WHERE "Sport" = 'baseball' AND "Championships (Years)" = '0' AND "League" = 'milb, florida state league' AND "Club" = 'jupiter hammerheads'
### Instruction: CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height re...
SELECT Date_of_Birth, Weight FROM people ORDER BY Date_of_Birth DESC
### Instruction: CREATE TABLE table_train_233 ( "id" int, "serum_bicarbonate" int, "language" string, "hemoglobin_a1c_hba1c" float, "creatinine_clearance_cl" float, "admission_blood_glucose" int, "urine_albumin" int, "ketoacidosis" bool, "age" float, "NOUSE" float ) -- Using va...
SELECT * FROM table_train_233 WHERE language = 'english' OR language = 'spanish'
### Instruction: CREATE TABLE photos ( id int, camera_lens_id int, mountain_id int, color text, name text ) CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE mountain ( id int, name text, Height real, ...
SELECT color, COUNT(color) FROM photos GROUP BY color ORDER BY color
### Instruction: CREATE TABLE table_203_237 ( id number, "n" number, "p" text, "nat." text, "name" text, "age" number, "moving from" text, "type" text, "transfer\nwindow" text, "ends" number, "transfer\nfee" text ) -- Using valid SQLite, answer the following questions for t...
SELECT "name" FROM table_203_237 WHERE "name" <> 'henning berg' AND "transfer\nwindow" = 'summer' AND "ends" = 2004
### Instruction: CREATE TABLE table_7276 ( "Rank" real, "Airport" text, "Location" text, "Code" text, "Total passengers" real, "% Change 2011-2012" real, "Aircraft movements" real, "Cargo traffic" real ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT MAX("Cargo traffic") FROM table_7276 WHERE "Airport" = 'barcelona airport' AND "Aircraft movements" < '290,004'
### Instruction: CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int ) -- Using valid SQLite, answer the fol...
SELECT T2.Name, COUNT(T2.Name) FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID GROUP BY T2.Name ORDER BY COUNT(T2.Name) DESC
### Instruction: CREATE TABLE table_3212 ( "Region" text, "HDI" text, "Life expectancy at birth (2001-2002)" text, "Adult literacy rate (2009)" text, "Combined gross enrollment ratio (2009)" text, "GDP (PPP) per capita (2008)" real ) -- Using valid SQLite, answer the following questions for th...
SELECT "Region" FROM table_3212 WHERE "Life expectancy at birth (2001-2002)" = '77.9'
### Instruction: CREATE TABLE table_75963 ( "Tournament" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text, "Win %" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT "2013" FROM table_75963 WHERE "2009" = '3r'
### Instruction: CREATE TABLE employees ( first_name VARCHAR, last_name VARCHAR, department_id VARCHAR ) CREATE TABLE departments ( department_id VARCHAR, location_id VARCHAR ) CREATE TABLE locations ( city VARCHAR, location_id VARCHAR ) -- Using valid SQLite, answer the following questi...
SELECT T1.first_name, T1.last_name, T3.city FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id WHERE T1.first_name LIKE '%z%'
### Instruction: CREATE TABLE table_57049 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the table...
SELECT "Club" FROM table_57049 WHERE "Goals against" > '46' AND "Wins" = '10' AND "Goal Difference" = '-24'
### Instruction: CREATE TABLE table_1108 ( "Rank" real, "Country" text, "International tourist arrivals (2011)" text, "International tourist arrivals (2010)" text, "Change (2010 to 2011)" text, "Change (2009 to 2010)" text ) -- Using valid SQLite, answer the following questions for the tables ...
SELECT "Change (2009 to 2010)" FROM table_1108 WHERE "International tourist arrivals (2011)" = '9.4 million'
### Instruction: CREATE TABLE photos ( id int, camera_lens_id int, mountain_id int, color text, name text ) CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE mountain ( id int, name text, Height real, ...
SELECT brand, COUNT(brand) FROM camera_lens GROUP BY brand ORDER BY COUNT(brand)
### Instruction: CREATE TABLE train_station ( Train_ID int, Station_ID int ) CREATE TABLE train ( Train_ID int, Name text, Time text, Service text ) CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, ...
SELECT Location, AVG(Number_of_Platforms) FROM station GROUP BY Location ORDER BY Location DESC
### Instruction: CREATE TABLE table_train_223 ( "id" int, "anemia" bool, "diabetic" string, "eye_disease" bool, "hgb" int, "retinal_pigmentation_abnormalities" bool, "glucose_6_phosphate_dehydrogenase_deficiency_g6pd" int, "age" float, "NOUSE" float ) -- Using valid SQLite, answer ...
SELECT * FROM table_train_223 WHERE eye_disease = 1 AND retinal_pigmentation_abnormalities = 1
### Instruction: CREATE TABLE medicine ( id number, name text, trade_name text, fda_approved text ) CREATE TABLE medicine_enzyme_interaction ( enzyme_id number, medicine_id number, interaction_type text ) CREATE TABLE enzyme ( id number, name text, location text, product te...
SELECT interaction_type, COUNT(*) FROM medicine_enzyme_interaction GROUP BY interaction_type ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: CREATE TABLE table_train_100 ( "id" int, "systolic_blood_pressure_sbp" int, "stroke" bool, "body_weight" float, "diastolic_blood_pressure_dbp" int, "rosen_modified_hachinski_ischemic_score" int, "body_mass_index_bmi" float, "age" float, "NOUSE" float ) -- Using val...
SELECT * FROM table_train_100 WHERE rosen_modified_hachinski_ischemic_score < 4
### Instruction: CREATE TABLE reviewer ( rid number, name text ) CREATE TABLE movie ( mid number, title text, year number, director text ) CREATE TABLE rating ( rid number, mid number, stars number, ratingdate time ) -- Using valid SQLite, answer the following questions for t...
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
### Instruction: CREATE TABLE table_21782 ( "Level" real, "Shuttles" real, "Cumulative Shuttles" real, "Speed (km/h)" text, "Shuttle Time (seconds)" text, "Total level time (s)" text, "Distance (m)" real, "Cumulative Distance (m)" real, "Cumulative Time (min and seconds)" text ) --...
SELECT "Shuttle Time (seconds)" FROM table_21782 WHERE "Speed (km/h)" = '15.5'
### Instruction: CREATE TABLE table_204_481 ( id number, "poll source" text, "date(s)\nadministered" text, "sample\nsize" number, "margin of\nerror" text, "andrew\ncuomo (d)" text, "rob\nastorino (r)" text, "other" text, "undecided" text ) -- Using valid SQLite, answer the followin...
SELECT COUNT("poll source") FROM table_204_481 WHERE "undecided" > 12
### Instruction: CREATE TABLE table_35639 ( "State" text, "1990\u201395" real, "1996-00" real, "2001\u201305" real, "2006\u201310" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 1990 95 is the average one that has a 2001 05 larger than 0.55? ...
SELECT AVG("1990\u201395") FROM table_35639 WHERE "2001\u201305" > '0.55'
### Instruction: CREATE TABLE endowment ( donator_name VARCHAR, school_id VARCHAR ) CREATE TABLE school ( school_id VARCHAR, school_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the names of donors who donated to both school 'Glenn' and '...
SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Glenn' INTERSECT SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Triton'
### Instruction: CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrie...
SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY Carrier DESC
### Instruction: CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following ...
SELECT T1.Code, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
### Instruction: CREATE TABLE table_22513 ( "Number" real, "Sanskrit" text, "International Alphabet of Sanskrit Transliteration" text, "Sanskrit gloss" text, "Western name" text, "Greek" text, "Gloss" text, "Tattva (Element)" text, "Quality" text, "Ruling Planet" text ) -- Usin...
SELECT "Ruling Planet" FROM table_22513 WHERE "International Alphabet of Sanskrit Transliteration" = 'Mithuna'
### Instruction: CREATE TABLE table_60060 ( "Position" real, "Club" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Points" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the table...
SELECT COUNT("Wins") FROM table_60060 WHERE "Points" > '51' AND "Goals against" > '23' AND "Losses" = '5'
### Instruction: CREATE TABLE table_train_202 ( "id" int, "systolic_blood_pressure_sbp" int, "body_weight" float, "diabetic" string, "qtc" int, "diastolic_blood_pressure_dbp" int, "body_mass_index_bmi" float, "clinical_diagnosis" bool, "NOUSE" float ) -- Using valid SQLite, answer ...
SELECT * FROM table_train_202 WHERE diabetic = 'i' AND clinical_diagnosis = 1
### Instruction: CREATE TABLE table_27518 ( "Supply sector (% of GDP in current prices)" text, "1993-2001" text, "2002-2005" text, "2006-2009" text, "2010-2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The sector that had a 8.7 GDP for 2006-20...
SELECT "1993-2001" FROM table_27518 WHERE "2006-2009" = '8.7'
### Instruction: CREATE TABLE table_64621 ( "Country" text, "Seasons" text, "Championship Titles" text, "Race entries (Starts)" text, "Poles" real, "Wins" real, "Podiums" real, "Fastest Laps" real, "Points" text ) -- Using valid SQLite, answer the following questions for the tables...
SELECT SUM("Fastest Laps") FROM table_64621 WHERE "Poles" = '0' AND "Podiums" = '0' AND "Seasons" = '1995'
### Instruction: CREATE TABLE purchase ( member_id number, branch_id text, year text, total_pounds number ) CREATE TABLE membership_register_branch ( member_id number, branch_id text, register_year text ) CREATE TABLE member ( member_id number, card_number text, name text, ...
SELECT COUNT(DISTINCT level) FROM member
### Instruction: CREATE TABLE table_43221 ( "Year" real, "Gross domestic product" real, "US dollar exchange" text, "Nominal per-capita GDP (as % of USA)" real, "PPP capita GDP (as % of USA)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many ye...
SELECT COUNT("Year") FROM table_43221 WHERE "US dollar exchange" = '¥225.82' AND "Gross domestic product" > '240,707,315'
### Instruction: CREATE TABLE election ( election_id number, counties_represented text, district number, delegate text, party number, first_elected number, committee text ) CREATE TABLE party ( party_id number, year number, party text, governor text, lieutenant_governor ...
SELECT delegate FROM election WHERE district = 1
### Instruction: CREATE TABLE table_28994 ( "Dibrugarh" text, "Kanyakumari" text, "Vivek Express /15905/15906" text, "Indian Railways" text, "4286km" text, "55" real, "Weekly" text, "82.30 hrs(~3.5 days)" text ) -- Using valid SQLite, answer the following questions for the tables provi...
SELECT "82.30 hrs(~3.5 days)" FROM table_28994 WHERE "4286km" = '2579km'
### Instruction: CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int ) CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text ) -- Using valid SQLite, answer ...
SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID ORDER BY T2.Name DESC
### Instruction: CREATE TABLE table_34256 ( "Abbr." text, "Name" text, "Picture Coding Types" text, "Chroma Format" text, "Aspect Ratios" text, "Scalable modes" text, "Intra DC Precision" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What P...
SELECT "Picture Coding Types" FROM table_34256 WHERE "Chroma Format" = '4:2:2 or 4:2:0' AND "Name" = '4:2:2 profile'
### Instruction: CREATE TABLE management ( department_ID int, head_ID int, temporary_acting text ) CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num_Employees real ) CREATE TABLE head ( head_ID int, name text, ...
SELECT Creation, SUM(Budget_in_Billions) FROM department GROUP BY Creation ORDER BY Creation DESC
### Instruction: CREATE TABLE table_73423 ( "Year" real, "Date" text, "Driver" text, "Team" text, "Manufacturer" text, "Laps" text, "Miles (km)" text, "Race Time" text, "Average Speed (mph)" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tab...
SELECT COUNT("Race Time") FROM table_73423 WHERE "Driver" = 'Cale Yarborough' AND "Average Speed (mph)" = '88.924'
### Instruction: CREATE TABLE table_204_675 ( id number, "year" number, "game of the year" text, "abstract strategy" text, "advanced strategy" text, "family" text, "family card" text, "family strategy" text, "party" text, "puzzle" text, "word" text, "historical simulation...
SELECT "game of the year" FROM table_204_675 WHERE "year" = 2014
### Instruction: CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS ...
SELECT state, MIN(enr) FROM College GROUP BY state ORDER BY MIN(enr)
### Instruction: CREATE TABLE table_65673 ( "Country" text, "Matches" real, "Wins" real, "Wins %" text, "Draws" real, "Draws %" text, "Loses" real, "Loses %" text, "Against" real, "For & Against Ratio" text ) -- Using valid SQLite, answer the following questions for the tables ...
SELECT COUNT("Wins") FROM table_65673 WHERE "Wins %" = '62.5%' AND "Matches" < '8'
### Instruction: CREATE TABLE table_27667 ( "GB" text, "ISO \u2116" text, "Province" text, "Chinese Name" text, "Capital" text, "Population\u00b9" real, "Density\u00b2" text, "Area\u00b3" real, "Abbreviation/Symbol" text ) -- Using valid SQLite, answer the following questions for t...
SELECT "Abbreviation/Symbol" FROM table_27667 WHERE "Chinese Name" = '辽宁省 Liáoníng Shěng'
### Instruction: CREATE TABLE table_63361 ( "Name" text, "Network" text, "Owner" text, "Launch date" text, "Channel ( BKK )" text, "Broadcasting area" text, "Transmitted area" text, "Broadcasting hours" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT "Owner" FROM table_63361 WHERE "Broadcasting hours" = '24-hours' AND "Channel ( BKK )" = '3/32 (vhf/uhf)'
### Instruction: CREATE TABLE elimination ( elimination_id text, wrestler_id text, team text, eliminated_by text, elimination_move text, time text ) CREATE TABLE wrestler ( wrestler_id number, name text, reign text, days_held text, location text, event text ) -- Using ...
SELECT T2.name, T1.team FROM elimination AS T1 JOIN wrestler AS T2 ON T1.wrestler_id = T2.wrestler_id ORDER BY T2.days_held DESC
### Instruction: CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Reviewer ( rID int, name text ) -- Using valid SQLite, answer the following questions for the tables provided...
SELECT title, COUNT(title) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5 GROUP BY title ORDER BY title
### Instruction: CREATE TABLE table_19037 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite,...
SELECT "Losing bonus" FROM table_19037 WHERE "Played" = '22' AND "Tries against" = '38'
### Instruction: CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, ...
SELECT Sex, SUM(Height) FROM people GROUP BY Sex ORDER BY SUM(Height)