instruction
stringlengths
212
6.3k
output
stringlengths
6
2.03k
### Instruction: CREATE TABLE table_train_255 ( "id" int, "ldl_cholesterol" int, "hemoglobin_a1c_hba1c" float, "body_weight" float, "urine_albumin_to_creatinine_ratio_uacr" int, "hba1c" float, "body_mass_index_bmi" float, "triglyceride_tg" float, "age" float, "NOUSE" float ) --...
SELECT * FROM table_train_255 WHERE age >= 65 AND age <= 80
### Instruction: CREATE TABLE table_203_99 ( id number, "season" number, "date" text, "driver" text, "team" text, "chassis" text, "engine" text, "race distance\nlaps" number, "race distance\nmiles (km)" text, "race time" text, "average speed\n(mph)" number, "report" text ...
SELECT "team" FROM table_203_99 WHERE "season" = (SELECT "season" FROM table_203_99 WHERE "team" = 'rusport') - 1
### Instruction: CREATE TABLE table_203_234 ( id number, "description" text, "total" number, "poland" number, "baltic states(resettled in poland during war)" number, "resettled in poland during war(from ussr and romania)" number, "sudetendeutsch" number, "se europe\n(hungary, romania, yu...
SELECT SUM("total") FROM table_203_234 WHERE "description" IN ('in internment camps', 'during the wartime flight')
### Instruction: CREATE TABLE sportsinfo ( stuid number, sportname text, hoursperweek number, gamesplayed number, onscholarship text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) C...
SELECT COUNT(DISTINCT stuid) FROM plays_games
### Instruction: CREATE TABLE table_22374 ( "Mexico" text, "Ma\u00f1ana es para siempre" text, "El Canal de las Estrellas" text, "October 20, 2008" text, "June 14, 2009" text, "Monday to Friday" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- sta...
SELECT "El Canal de las Estrellas" FROM table_22374 WHERE "October 20, 2008" = 'June 5, 2009'
### Instruction: CREATE TABLE table_22664 ( "Doctor" text, "Season" text, "Story no." text, "Serial" text, "Number of episodes" text, "Total footage remaining from missing episodes (mm:ss)" text, "Missing episodes with recovered footage" text, "Country/Territory" text, "Source" text,...
SELECT "Serial" FROM table_22664 WHERE "Total footage (mm:ss)" = '00:21'
### 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 T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
### Instruction: CREATE TABLE table_57458 ( "Vaccine" text, "Minimum Age at 1st Dose" text, "Number of Doses" text, "Dose" text, "Minimum Interval Between Doses" text, "Route" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least interva...
SELECT "Minimum Interval Between Doses" FROM table_57458 WHERE "Minimum Age at 1st Dose" = '6 weeks old' AND "Vaccine" = 'diphtheria-pertussis-tetanus vaccine'
### Instruction: CREATE TABLE table_8871 ( "Name" text, "Nationality" text, "Position" text, "Crewe Alexandra career" text, "Appearances" real, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Goals with a natio...
SELECT COUNT("Goals") FROM table_8871 WHERE "Nationality" = 'england' AND "Position" = 'df' AND "Crewe Alexandra career" = '1958–1962' AND "Appearances" < '170'
### Instruction: CREATE TABLE table_204_978 ( id number, "position" number, "nation" number, "number" number, "name" text, "soproni liga" number, "uefa cup" number, "hungarian cup" number, "league cup" number, "total" number ) -- Using valid SQLite, answer the following questio...
SELECT (SELECT "total" FROM table_204_978 WHERE "name" = 'leandro de almeida') - (SELECT "total" FROM table_204_978 WHERE "name" = 'zsombor kerekes')
### Instruction: CREATE TABLE table_8974 ( "Name" text, "Seat" text, "Population (2011)" real, "Area (km 2 )" real, "Density (inhabitants/km 2 )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the area in km2 for the community that had a pop...
SELECT SUM("Area (km 2 )") FROM table_8974 WHERE "Population (2011)" > '35,916' AND "Density (inhabitants/km 2 )" < '47.1'
### Instruction: CREATE TABLE table_30493 ( "Name" text, "Corporate name" text, "Regional district" text, "Incorporation date (city)" text, "Population (2011)" real, "Population (2006)" real, "Change (%)" text, "Area (km\u00b2)" text, "Population density" text ) -- Using valid SQLi...
SELECT "Area (km\u00b2)" FROM table_30493 WHERE "Corporate name" = 'Powell River, The Corporation of the City of'
### Instruction: CREATE TABLE table_45082 ( "Match" real, "Date" text, "Round" text, "Home/Away" text, "Opponent team" text, "Score" text, "Scorers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opposing team when the scorers we...
SELECT "Opponent team" FROM table_45082 WHERE "Scorers" = 'jong-a-pin 19''( o.g. ) , gattuso 23'' , inzaghi 69'
### Instruction: CREATE TABLE table_26927 ( "Player" text, "Played" real, "Sets Won" real, "Sets Lost" real, "Legs Won" real, "Legs Lost" real, "LWAT" real, "100+" real, "140+" real, "180s" real, "High Checkout" real, "3-dart Average" text ) -- Using valid SQLite, answe...
SELECT MAX("Sets Lost") FROM table_26927 WHERE "3-dart Average" = '87.55'
### 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.Name, MAX(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY MAX(T1.Price)
### Instruction: CREATE TABLE table_38609 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "TV Time" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a TV Time o...
SELECT "Date" FROM table_38609 WHERE "TV Time" = 'cbs 1:00pm' AND "Game Site" = 'rca dome' AND "Opponent" = 'cincinnati bengals'
### Instruction: CREATE TABLE table_6411 ( "Feature" text, "GT Force" text, "Driving Force EX" text, "Driving Force Pro" text, "Driving Force GT" text, "G25 Racing Wheel" text, "G27 Racing Wheel" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -...
SELECT "G27 Racing Wheel" FROM table_6411 WHERE "Driving Force EX" = 'no' AND "Driving Force Pro" = 'no' AND "G25 Racing Wheel" = 'no'
### Instruction: CREATE TABLE county ( county_id number, county_name text, population number, zip_code text ) CREATE TABLE election ( election_id number, counties_represented text, district number, delegate text, party number, first_elected number, committee text ) CREATE T...
SELECT zip_code FROM county WHERE county_name = "Howard"
### Instruction: CREATE TABLE table_39044 ( "Model" text, "Processors Supported" text, "FSB/HT Frequency (MHz)" text, "Memory" text, "PCI-Express" text, "SATA" text, "PATA" text, "Sound" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Whi...
SELECT "Processors Supported" FROM table_39044 WHERE "PCI-Express" = 'x16: 1 slot x1: 4 slots' AND "Model" = 'nforce 550'
### Instruction: CREATE TABLE table_10311 ( "Round" real, "Grand Prix" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Winning Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- During the hung...
SELECT COUNT("Round") FROM table_10311 WHERE "Fastest Lap" = 'damon hill' AND "Pole Position" = 'michael schumacher' AND "Grand Prix" = 'hungarian grand prix'
### Instruction: CREATE TABLE table_49623 ( "Region (year)" text, "No. 1" text, "No. 2" text, "No. 3" text, "No. 4" text, "No. 5" text, "No. 6" text, "No. 7" text, "No. 8" text, "No. 9" text, "No. 10" text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT "No. 1" FROM table_49623 WHERE "Region (year)" = 'maryland (2008)'
### Instruction: CREATE TABLE table_203_349 ( id number, "no. in\nseries" number, "no. in\nseason" number, "title" text, "directed by" text, "written by" text, "original air date" text, "production\ncode" text, "u.s. viewers\n(millions)" number ) -- Using valid SQLite, answer the f...
SELECT "title" FROM table_203_349 WHERE "u.s. viewers\n(millions)" = (SELECT MAX("u.s. viewers\n(millions)") FROM table_203_349)
### Instruction: 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 numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decisio...
SELECT pPos, MIN(T2.HS) FROM Tryout AS T1 JOIN Player AS T2 ON T1.pID = T2.pID GROUP BY pPos
### Instruction: CREATE TABLE table_10368 ( "State" text, "Swimsuit" real, "Interview" real, "Evening Gown" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest interview for a contestant from North Carolina with a swims...
SELECT MIN("Interview") FROM table_10368 WHERE "Swimsuit" > '9.021' AND "Average" < '9.513' AND "State" = 'north carolina' AND "Evening Gown" > '9.5'
### Instruction: CREATE TABLE table_55925 ( "Position" real, "Club" text, "Played" real, "Points" text, "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 COUNT("Draws") FROM table_55925 WHERE "Goals for" = '58' AND "Losses" = '12' AND "Goal Difference" < '21'
### Instruction: CREATE TABLE table_train_280 ( "id" int, "fpg" float, "hemoglobin_a1c_hba1c" float, "heart_disease" bool, "renal_disease" bool, "hba1c" float, "body_mass_index_bmi" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT * FROM table_train_280 WHERE hba1c > 7 AND hemoglobin_a1c_hba1c <= 10.5
### Instruction: CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, ...
SELECT Year_Join, COUNT(Year_Join) FROM artist WHERE Country <> 'United States' GROUP BY Name ORDER BY COUNT(Year_Join) DESC
### Instruction: CREATE TABLE table_76584 ( "2006/ 07" text, "2008/ 09" text, "2010/ 11" text, "2011/ 12" text, "2012/ 13" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is 2006/07, when 2008/09 is LQ, and when 2010/11 is Not Held? ### Respon...
SELECT "2006/ 07" FROM table_76584 WHERE "2008/ 09" = 'lq' AND "2010/ 11" = 'not held'
### Instruction: CREATE TABLE table_train_111 ( "id" int, "mini_mental_state_examination_mmse" int, "liver_disease" bool, "geriatric_depression_scale_gds" int, "rosen_modified_hachinski_ischemic_score" int, "plasma_creatinine" float, "NOUSE" float ) -- Using valid SQLite, answer the follow...
SELECT * FROM table_train_111 WHERE mini_mental_state_examination_mmse >= 8 AND mini_mental_state_examination_mmse <= 20
### Instruction: CREATE TABLE table_4440 ( "Name" text, "Availability" text, "DMS/D2A Compatible" text, "D2B Compatible" text, "D2C Compatible" text, "D2C2 Compatible" text, "D2E Compatible" text, "D3 Compatible" text, "D3-2 / D4 Compatible" text ) -- Using valid SQLite, answer the...
SELECT "D3 Compatible" FROM table_4440 WHERE "Availability" = 'yes' AND "Name" = 'wode jukebox'
### Instruction: CREATE TABLE table_31608 ( "component 1" text, "b.p. comp. 1 (\u02daC)" text, "component 2" text, "b.p. comp. 2 (\u02daC)" text, "b.p. azeo. (\u02daC)" text, "% wt comp. 1" real, "% wt comp. 2" real ) -- Using valid SQLite, answer the following questions for the tables pro...
SELECT "b.p. comp. 2 (\u02daC)" FROM table_31608 WHERE "% wt comp. 1" = '76'
### Instruction: CREATE TABLE table_203_613 ( id number, "formula" text, "color" text, "symmetry" text, "space group" text, "no" number, "pearson symbol" text, "a (pm)" number, "b (pm)" number, "c (pm)" number, "z" number, "density, g/cm3" number ) -- Using valid SQLite...
SELECT "formula" FROM table_203_613 WHERE "density, g/cm3" = 3.74
### 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 Headquarter, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
### Instruction: CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_city_affected real ) CREATE TABLE region ( Region_id int, Region_code text, Region_name text ) CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions...
SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id
### 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 T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
### Instruction: CREATE TABLE table_34024 ( "Rank" text, "City" text, "Population" real, "Area (km 2 )" real, "Density (inhabitants/km 2 )" real, "Altitude (mslm)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest population of a...
SELECT MIN("Population") FROM table_34024 WHERE "Altitude (mslm)" < '197' AND "City" = 'alessandria' AND "Density (inhabitants/km 2 )" < '461.8'
### Instruction: CREATE TABLE table_dev_57 ( "id" int, "intra_aortic_balloon_pump_iabp" bool, "systolic_blood_pressure_sbp" int, "heart_disease" bool, "vasopressors" bool, "temperature" float, "creatinine_clearance_cl" float, "cardiogenic_shock" bool, "height" int, "serum_creatin...
SELECT * FROM table_dev_57 WHERE temperature < 35
### Instruction: CREATE TABLE region ( region_id number, region_code text, region_name text ) CREATE TABLE affected_region ( region_id number, storm_id number, number_city_affected number ) CREATE TABLE storm ( storm_id number, name text, dates_active text, max_speed number, ...
SELECT T1.region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id
### 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 cinema ( cinema_id number, name text, openning_year number, capacity number, location text ) CREATE TABLE schedule ( cinema_id number, film_id number, date text, show_times_per_day number, price number ) CREATE TABLE film ( film_id number, ...
SELECT name, location FROM cinema WHERE capacity > (SELECT AVG(capacity) FROM cinema)
### Instruction: CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) 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...
SELECT Carrier, AVG(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY AVG(Memory_in_G) DESC
### Instruction: CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, ...
SELECT Year_Join, COUNT(Year_Join) FROM artist WHERE Country <> 'United States' GROUP BY Year_Join ORDER BY COUNT(Year_Join) DESC
### Instruction: CREATE TABLE office_locations ( building_id number, company_id number, move_in_year number ) CREATE TABLE buildings ( id number, name text, city text, height number, stories number, status text ) CREATE TABLE companies ( id number, name text, headquarte...
SELECT name FROM buildings WHERE status = "on-hold" ORDER BY stories
### 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, COUNT(*) FROM Rooms GROUP BY bedType ORDER BY COUNT(*)
### Instruction: CREATE TABLE item ( i_id number, title text ) CREATE TABLE trust ( source_u_id number, target_u_id number, trust number ) CREATE TABLE review ( a_id number, u_id number, i_id number, rating number, rank number ) CREATE TABLE useracct ( u_id number, nam...
SELECT T1.name, AVG(T2.rating) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id
### Instruction: CREATE TABLE market ( market_id number, country text, number_cities number ) CREATE TABLE film_market_estimation ( estimation_id number, low_estimate number, high_estimate number, film_id number, type text, market_id number, year number ) CREATE TABLE film ( ...
SELECT studio FROM film GROUP BY studio HAVING AVG(gross_in_dollar) >= 4500000
### Instruction: CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREA...
SELECT Openning_year, AVG(Capacity) FROM cinema
### Instruction: CREATE TABLE table_50228 ( "Player" text, "Sacks" real, "Ints" real, "Int Yds" real, "Int LG" real, "Int TD" real, "Fumb R." real, "Fumb Yds" real, "Fumb LG" real, "Fumb TD" real, "Fumb F." real ) -- Using valid SQLite, answer the following questions for th...
SELECT MIN("Fumb TD") FROM table_50228 WHERE "Int TD" = '1' AND "Fumb F." < '1'
### Instruction: CREATE TABLE table_train_171 ( "id" int, "systolic_blood_pressure_sbp" int, "hiv_infection" bool, "hemoglobin_a1c_hba1c" float, "hepatitis_c" bool, "diastolic_blood_pressure_dbp" int, "body_mass_index_bmi" float, "triglyceride_tg" float, "NOUSE" float ) -- Using va...
SELECT * FROM table_train_171 WHERE hiv_infection = 1 OR hepatitis_c = 1
### Instruction: CREATE TABLE table_30695 ( "Reservoir" text, "Basin" text, "Location" text, "Type" text, "Height (m)" text, "Length along the top (m)" text, "Drainage basin (km\u00b2)" text, "Reservoir surface (ha)" text, "Volume (hm\u00b3)" text ) -- Using valid SQLite, answer th...
SELECT "Drainage basin (km\u00b2)" FROM table_30695 WHERE "Reservoir surface (ha)" = '6.14'
### Instruction: CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Movie ( mID int, title text, year int, director text ) -- Using valid SQLite, answer the following questions for the tables provided...
SELECT year, COUNT(year) FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title GROUP BY title ORDER BY year DESC
### Instruction: CREATE TABLE table_25604 ( "Star" text, "Stellar classification" text, "Distance from Earth ( ly )" text, "Constellation" text, "Dust (or Debris; Temperature (K)" text, "System" text, "Dust (or Debris) Location (AU)" text, "Cool Dust > 10 AU" text, "Stellar Age (Myr)...
SELECT COUNT("Stellar classification") FROM table_25604 WHERE "System" = '3 Neptune planets < 1 AU'
### Instruction: CREATE TABLE table_203_253 ( id number, "model" text, "frame" text, "years mfg'd" text, "caliber(s)" text, "production" text, "barrel" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- name the models that had...
SELECT "model" FROM table_203_253 WHERE "model" <> 'remington-beals navy model revolver' AND "caliber(s)" = (SELECT "caliber(s)" FROM table_203_253 WHERE "model" = 'remington-beals navy model revolver')
### Instruction: CREATE TABLE table_71277 ( "Rank" real, "Team" text, "Country" text, "Value ($M)" real, "Debt as %of value" real, "% change on year" text, "Revenue ($M)" real, "Operating income($m)" real ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT SUM("Value ($M)") FROM table_71277 WHERE "Revenue ($M)" < '307' AND "Team" = 'valencia' AND "Rank" < '19'
### Instruction: CREATE TABLE table_name_93 ( upper_index_kcal__nm_3 INTEGER, lower_index_mj__nm_3 VARCHAR, upper_index_mj__nm_3 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the entry for Upper index Kcal/ Nm 3 for the row with an entry that ha...
SELECT SUM(upper_index_kcal__nm_3) FROM table_name_93 WHERE lower_index_mj__nm_3 = 47.91 AND upper_index_mj__nm_3 > 53.28
### Instruction: CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_city_affected real ) CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Number_Deaths int ) CREATE TABLE region ( Region_id int, Region...
SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id
### Instruction: CREATE TABLE table_8586 ( "Year" real, "Network" text, "Play-by-play" text, "Color commentator" text, "Sideline reporters" text, "Pregame host" text, "Pregame analysts" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Joh...
SELECT "Sideline reporters" FROM table_8586 WHERE "Color commentator" = 'john harkes' AND "Pregame analysts" = 'alexi lalas and steve mcmanaman'
### Instruction: CREATE TABLE table_76663 ( "Season" text, "Series" text, "Team Name" text, "Races" text, "Wins" text, "Poles" text, "F.L." text, "Podiums" text, "Points" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above...
SELECT "Wins" FROM table_76663 WHERE "F.L." = '0' AND "Poles" = '0' AND "Position" = '7th' AND "Points" = '35'
### Instruction: CREATE TABLE table_62831 ( "World record" text, "Snatch" text, "Marcin Do\u0142\u0119ga ( POL )" text, "199kg" text, "W\u0142adys\u0142awowo , Poland" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What shows for Marcin Do ga ( POL ...
SELECT "Marcin Do\u0142\u0119ga ( POL )" FROM table_62831 WHERE "World record" = 'olympic record' AND "Snatch" = 'total'
### Instruction: CREATE TABLE film_market_estimation ( estimation_id number, low_estimate number, high_estimate number, film_id number, type text, market_id number, year number ) CREATE TABLE market ( market_id number, country text, number_cities number ) CREATE TABLE film ( ...
SELECT studio FROM film GROUP BY studio HAVING AVG(gross_in_dollar) >= 4500000
### Instruction: CREATE TABLE table_54071 ( "Breed [A ]" text, "Group" text, "2002 Registrations" real, "2005 Registrations" real, "2011 Registrations" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which group has a registration less than 75 in 201...
SELECT "Group" FROM table_54071 WHERE "2011 Registrations" > '75' AND "2005 Registrations" > '140' AND "2002 Registrations" < '148'
### 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 table_73731 ( "Country" text, "Annual CO2 emissions (in thousands of metric tons)" real, "GDP (current, in billions of US dollars)" text, "GDP per Emissions (in US dollars per ton)" real, "GDP (PPP, in billions of current international dollars)" text, "PPP GDP per E...
SELECT "Country" FROM table_73731 WHERE "Annual CO2 emissions (in thousands of metric tons)" = '1811'
### Instruction: CREATE TABLE table_204_812 ( id number, "#" number, "prime minister" text, "date of birth" text, "start date\nof (first) term" text, "age at beginning\nof (first) term" text, "end date\nof (final) term" text, "total time in\noffice" text, "date of death" text, "l...
SELECT COUNT("prime minister") FROM table_204_812 WHERE "age at beginning\nof (first) term" >= 50
### Instruction: CREATE TABLE wedding ( Church_ID int, Male_ID int, Female_ID int, Year int ) CREATE TABLE church ( Church_ID int, Name text, Organized_by text, Open_Date int, Continuation_of text ) CREATE TABLE people ( People_ID int, Name text, Country text, Is_Ma...
SELECT Country, COUNT(Country) FROM people WHERE Age < (SELECT AVG(Age) FROM people) GROUP BY Country ORDER BY COUNT(Country)
### Instruction: CREATE TABLE table_59167 ( "Model Number" text, "Clock Speed" text, "L1 Cache" text, "L2 Cache" text, "FSB Speed" text, "Clock Multiplier" text, "Idle Power" text, "Socket" text, "Cores" real, "Release Date" text ) -- Using valid SQLite, answer the following qu...
SELECT "L1 Cache" FROM table_59167 WHERE "FSB Speed" = '800mhz' AND "Clock Speed" = '1.2ghz'
### Instruction: CREATE TABLE city ( city_id number, county_id number, name text, white number, black number, amerindian number, asian number, multiracial number, hispanic number ) CREATE TABLE county_public_safety ( county_id number, name text, population number, po...
SELECT name FROM county_public_safety ORDER BY population DESC
### Instruction: CREATE TABLE table_name_58 ( bulls VARCHAR, total_horses VARCHAR, cows VARCHAR, oxen VARCHAR, sheep_and_goats VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of bulls that has oxen larger than 113.8, and a sheep...
SELECT bulls FROM table_name_58 WHERE oxen > 113.8 AND sheep_and_goats > 4533.4 AND cows < 3987 AND total_horses > 5056.5
### Instruction: CREATE TABLE table_12766 ( "Rank" real, "Name" text, "Birth date" text, "Death date" text, "Age (as of 1 February 2014)" text, "Place of death or residence" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Death date has a P...
SELECT "Death date" FROM table_12766 WHERE "Place of death or residence" = 'united states' AND "Age (as of 1 February 2014)" = '111 years, 61 days'
### Instruction: CREATE TABLE plays_games ( stuid number, gameid number, hours_played number ) CREATE TABLE video_games ( gameid number, gname text, gtype text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor...
SELECT COUNT(DISTINCT sportname) FROM sportsinfo
### 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.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name
### Instruction: CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Number_Deaths int ) CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_city_affected real ) CREATE TABLE region ( Region_id int, Region...
SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID
### Instruction: CREATE TABLE table_36706 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won men's singles when petya ...
SELECT "Men's singles" FROM table_36706 WHERE "Women's doubles" = 'petya nedelcheva diana dimova' AND "Men's doubles" = 'vladimir metodiev krasimir yankov'
### Instruction: CREATE TABLE table_62025 ( "Year" real, "Average" text, "High" real, "Sellouts" real, "Total for year" real, "WNBA game average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total for year average that less than 7,...
SELECT AVG("Total for year") FROM table_62025 WHERE "WNBA game average" < '7,742' AND "Average" = '7,625 (10th)' AND "Year" < '1999'
### Instruction: CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Aller...
SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType
### Instruction: CREATE TABLE table_60988 ( "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("Played") FROM table_60988 WHERE "Goals Against" < '63' AND "Team" = 'nelson' AND "Lost" > '16'
### Instruction: CREATE TABLE country ( Country_ID int, Name text, Population int, Area int, Languages text ) CREATE TABLE roller_coaster ( Roller_Coaster_ID int, Name text, Park text, Country_ID int, Length real, Height real, Speed text, Opened text, Status text...
SELECT T1.Name, AVG(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name
### Instruction: CREATE TABLE table_64881 ( "Stage" text, "Winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Intergiro classification" text, "Trofeo Fast Team" text, "Trofeo Super Team" text ) -- Using valid SQLite, answer the ...
SELECT "Stage" FROM table_64881 WHERE "Points classification" = 'danilo di luca' AND "Mountains classification" = 'josé rujano' AND "General classification" = 'danilo di luca'
### Instruction: CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy I...
SELECT bedType, COUNT(bedType) FROM Rooms WHERE decor = "traditional" GROUP BY bedType
### 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 decor, MIN(basePrice) FROM Rooms GROUP BY decor
### 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 T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
### Instruction: CREATE TABLE county_public_safety ( county_id number, name text, population number, police_officers number, residents_per_officer number, case_burden number, crime_rate number, police_force text, location text ) CREATE TABLE city ( city_id number, county_id ...
SELECT hispanic FROM city WHERE black > 10
### Instruction: CREATE TABLE table_61270 ( "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 COUNT("Goals against") FROM table_61270 WHERE "Wins" > '12' AND "Club" = 'ud las palmas' AND "Position" > '5'
### Instruction: CREATE TABLE table_26001 ( "Province" text, "Mahmoud Ahmadinejad" real, "Mehdi Karroubi" real, "Mir-Hossein Mousavi" real, "Mohsen Rezaee" real, "Spoiled ballots" real, "Total votes" real ) -- Using valid SQLite, answer the following questions for the tables provided above...
SELECT "Mahmoud Ahmadinejad" FROM table_26001 WHERE "Mir-Hossein Mousavi" = '218481'
### Instruction: CREATE TABLE region ( Region_id int, Region_code text, Region_name text ) CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_city_affected real ) CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions...
SELECT Name, Number_Deaths FROM storm WHERE Number_Deaths >= 1 ORDER BY Name DESC
### 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.Manufacturer, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
### Instruction: CREATE TABLE table_54667 ( "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 MAX("Goals against") FROM table_54667 WHERE "Wins" = '18' AND "Goal Difference" = '43' AND "Draws" < '6'
### Instruction: CREATE TABLE device ( device_id number, device text, carrier text, package_version text, applications text, software_platform text ) CREATE TABLE shop ( shop_id number, shop_name text, location text, open_date text, open_year number ) CREATE TABLE stock ( ...
SELECT location FROM shop WHERE open_year > 2012 INTERSECT SELECT location FROM shop WHERE open_year < 2008
### Instruction: CREATE TABLE table_204_651 ( id number, "date" text, "championship" text, "location" text, "category" text, "surface" text, "prev. result" text, "prev. points" number, "new points" number, "outcome" text ) -- Using valid SQLite, answer the following questions f...
SELECT (SELECT "prev. points" FROM table_204_651 WHERE "championship" = 'australian open') - (SELECT "prev. points" FROM table_204_651 WHERE "championship" = 'qatar total open')
### Instruction: CREATE TABLE table_50603 ( "Oklahoma vs." text, "Overall Record" text, "at Norman" text, "at Opponent's Venue" text, "at Neutral Site" text, "Last 5 Meetings" text, "Last 10 Meetings" text, "Current Streak" text, "Since Beginning of Big 12" text ) -- Using valid SQ...
SELECT "Overall Record" FROM table_50603 WHERE "Since Beginning of Big 12" = 'ou, 27-3'
### Instruction: CREATE TABLE table_46971 ( "Municipality" text, "Population" real, "Inhabitants per km\u00b2" real, "Area (in km\u00b2)" real, "Markatal" real, "Island" text, "Region" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is t...
SELECT SUM("Markatal") FROM table_46971 WHERE "Inhabitants per km\u00b2" < '13' AND "Area (in km\u00b2)" = '27'
### Instruction: CREATE TABLE table_55078 ( "NGC number" real, "Object type" text, "Constellation" text, "Right ascension ( J2000 )" text, "Declination ( J2000 )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the right ascension (j2000) wit...
SELECT "Right ascension ( J2000 )" FROM table_55078 WHERE "NGC number" < '3384' AND "Constellation" = 'hydra' AND "Object type" = 'spiral galaxy'
### Instruction: CREATE TABLE table_204_881 ( id number, "round" number, "date" text, "score" text, "opponent" text, "opponent's score" text, "result" text, "venue" text, "attendance" number, "best on ground" text, "team" text ) -- Using valid SQLite, answer the following q...
SELECT "opponent" FROM table_204_881 WHERE id = (SELECT id FROM table_204_881 WHERE "opponent" = 'hawthorn') + 1
### Instruction: CREATE TABLE follows ( f1 int(11), f2 int(11) ) CREATE TABLE tweets ( id bigint(20), uid int(11), text char(140), createdate datetime ) CREATE TABLE user_profiles ( uid int(11), name varchar(255), email varchar(255), partitionid int(11), followers int(11) )...
SELECT name, partitionid FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid
### Instruction: CREATE TABLE table_name_28 ( cultural_and_educational_panel INTEGER, agricultural_panel VARCHAR, university_of_dublin VARCHAR, industrial_and_commercial_panel VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number o...
SELECT MIN(cultural_and_educational_panel) FROM table_name_28 WHERE university_of_dublin < 3 AND industrial_and_commercial_panel > 0 AND agricultural_panel > 4
### 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 party FROM party WHERE NOT party_id IN (SELECT party FROM election)
### Instruction: CREATE TABLE table_78987 ( "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 COUNT("Goals For") FROM table_78987 WHERE "Drawn" < '7' AND "Lost" < '21' AND "Points 1" = '33'
### Instruction: CREATE TABLE table_56202 ( "Year" text, "Date" text, "Venue" text, "Winner" text, "Country" text, "Score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text, "Winner's share ( \u20ac )" text ) -- Using valid SQLite, answer the following question...
SELECT "Country" FROM table_56202 WHERE "Score" = '274' AND "Runner(s)-up" = 'virginie lagoutte-clément'
### Instruction: CREATE TABLE table_59977 ( "Player" text, "Played" real, "Legs Won" real, "Legs Lost" real, "LWAT" real, "100+" real, "140+" real, "180s" real, "High Checkout" real, "3-dart Average" real ) -- Using valid SQLite, answer the following questions for the tables pr...
SELECT SUM("140+") FROM table_59977 WHERE "High Checkout" = '74' AND "100+" > '17'
### 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 T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder