instruction
stringlengths
212
6.3k
output
stringlengths
6
2.03k
### Instruction: CREATE TABLE table_45668 ( "Macedonian population in Vojvodina" text, "1961" real, "Number 1971" real, "1981" real, "1991" real, "2002" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest 1971 number of the Macedon...
SELECT MIN("Number 1971") FROM table_45668 WHERE "2002" > '133' AND "1991" < '171'
### Instruction: CREATE TABLE table_dev_3 ( "id" int, "bleeding" int, "hemoglobin_a1c_hba1c" float, "trauma" bool, "diabetic" string, "creatinine_clearance_cl" float, "surgery" bool, "autonomic_dysfunction" bool, "urine_protein" int, "proteinuria" int, "body_mass_index_bmi" f...
SELECT * FROM table_dev_3 WHERE autonomic_dysfunction = 0
### 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, AVG(Weight) FROM people GROUP BY Sex ORDER BY AVG(Weight) DESC
### Instruction: CREATE TABLE table_1803 ( "Year" text, "Governor" text, "Lieutenant Governor" text, "Secretary of State" text, "Attorney General" text, "Treasurer" text, "State Senate" text, "State Assembly" text, "U.S. Senator (Class I)" text, "U.S. Senator (Class III)" text, ...
SELECT "State Assembly" FROM table_1803 WHERE "Year" = '2008'
### Instruction: CREATE TABLE table_55481 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the categorization in 2010 when it was A in 2008 an...
SELECT "2010" FROM table_55481 WHERE "2008" = 'a' AND "2011" = 'a' AND "2012" = 'qf'
### Instruction: CREATE TABLE table_27498 ( "Year" real, "Population" real, "Index" real, "Violent" real, "Property" real, "Murder" real, "Forcible rape" real, "Robbery" real, "Aggravated assault" real, "Burglary" real, "Larceny Theft" real, "Vehicle Theft" real ) -- Us...
SELECT "Murder" FROM table_27498 WHERE "Forcible rape" = '166'
### Instruction: CREATE TABLE Employees ( employee_name VARCHAR, employee_id VARCHAR ) CREATE TABLE Documents_to_be_destroyed ( Destruction_Authorised_by_Employee_ID VARCHAR, Destroyed_by_Employee_ID VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT T2.employee_name, T3.employee_name FROM Documents_to_be_destroyed AS T1 JOIN Employees AS T2 ON T1.Destruction_Authorised_by_Employee_ID = T2.employee_id JOIN Employees AS T3 ON T1.Destroyed_by_Employee_ID = T3.employee_id
### Instruction: CREATE TABLE table_80295 ( "Track" real, "Recorded" text, "Catalogue" text, "Release Date" text, "Chart Peak" text, "Song Title" text, "Writer(s)" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On songs that...
SELECT "Chart Peak" FROM table_80295 WHERE "Release Date" = '6/17/61' AND "Track" > '20' AND "Writer(s)" = 'woody harris'
### Instruction: CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) 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), decisio...
SELECT pName, HS FROM Player WHERE HS < 1500
### Instruction: CREATE TABLE table_39087 ( "Election" real, "Labour" real, "Conservative" real, "Liberal" real, "Social Democratic Party" real, "Social and Liberal Democrats/ Liberal Democrats" real, "Independent" real, "Green" real, "Other" text, "Control" text ) -- Using val...
SELECT SUM("Social and Liberal Democrats/ Liberal Democrats") FROM table_39087 WHERE "Control" = 'labour hold' AND "Liberal" > '0'
### Instruction: CREATE TABLE table_64104 ( "School" text, "Location" text, "Mascot" text, "Size" real, "IHSAA Class" text, "# / County" text, "Year Joined" real, "Previous Conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What'...
SELECT "Size" FROM table_64104 WHERE "Year Joined" < '1974' AND "IHSAA Class" = 'aa' AND "# / County" = '89 wayne' AND "School" = 'centerville'
### Instruction: CREATE TABLE table_76527 ( "Poll Source" text, "Sample Size" real, "Margin of Error" real, "Date" text, "Democrat" text, "Republican" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sample size of the poll taken on De...
SELECT AVG("Sample Size") FROM table_76527 WHERE "Republican" = 'mike huckabee' AND "Margin of Error" > '4' AND "Date" = 'dec 13-15, 2007'
### Instruction: CREATE TABLE table_23317 ( "Verbs" text, "Yo" text, "T\u00fa" text, "Vos (*)" text, "\u00c9l / Ella / Usted" text, "Nosotros / Nosotras" text, "Vosotros / Vosotras" text, "Ellos / Ellas / Ustedes" text ) -- Using valid SQLite, answer the following questions for the tab...
SELECT "Vos (*)" FROM table_23317 WHERE "\u00c9l / Ella / Usted" = 'muela'
### Instruction: CREATE TABLE film_market_estimation ( Estimation_ID int, Low_Estimate real, High_Estimate real, Film_ID int, Type text, Market_ID int, Year int ) CREATE TABLE market ( Market_ID int, Country text, Number_cities int ) CREATE TABLE film ( Film_ID int, Tit...
SELECT Studio, COUNT(*) FROM film GROUP BY Studio ORDER BY COUNT(*)
### Instruction: CREATE TABLE table_67871 ( "Member countries" text, "Population" real, "Area (km\u00b2)" real, "GDP (billion US$)" real, "GDP per capita (US$)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the GDP of the place with over 54...
SELECT MIN("GDP (billion US$)") FROM table_67871 WHERE "Population" > '54,292,038' AND "Area (km\u00b2)" > '30,528'
### Instruction: CREATE TABLE table_39552 ( "Tournament" text, "1989" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "Career W\u2013L" text ) -- Using valid SQLite, answer the following questions for the tables ...
SELECT "1995" FROM table_39552 WHERE "Tournament" = 'french open'
### Instruction: CREATE TABLE table_51223 ( "Jurisdiction" text, "For Prohibition" real, "Percent For" real, "Against Prohibition" real, "Percent Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest percent supporting prohibit...
SELECT MAX("Percent For") FROM table_51223 WHERE "Against Prohibition" < '2,978' AND "Percent Against" < '31.2' AND "For Prohibition" < '9,461'
### Instruction: CREATE TABLE table_58781 ( "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 MAX("Lost") FROM table_58781 WHERE "Drawn" < '6' AND "Goals Against" < '44' AND "Points 1" = '27'
### 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.Manufacturer, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name
### Instruction: CREATE TABLE table_5872 ( "city" text, "area 1996 km\u00b2" real, "area 2006 km\u00b2" real, "pop. 1999" text, "pop. 2003" text, "pop. 2006" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which area 2006 km has an area 1996 km s...
SELECT MAX("area 2006 km\u00b2") FROM table_5872 WHERE "area 1996 km\u00b2" < '17.31'
### Instruction: CREATE TABLE table_204_105 ( id number, "#" number, "name" text, "height" text, "weight (lbs.)" number, "position" text, "class" text, "hometown" text, "previous team(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -...
SELECT "name" FROM table_204_105 WHERE "weight (lbs.)" < (SELECT "weight (lbs.)" FROM table_204_105 WHERE "name" = 'nedeljko golubovic') ORDER BY "weight (lbs.)" DESC LIMIT 1
### 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, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name
### Instruction: CREATE TABLE table_4572 ( "Commodity" text, "2001-02" text, "2002-03" text, "2003-04" text, "2004-05" text, "2005-06" text, "2006-07" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the production in 2002-03 for the ...
SELECT "2002-03" FROM table_4572 WHERE "2001-02" = '1,725'
### Instruction: CREATE TABLE dorm_amenity ( amenity_name VARCHAR, amenid VARCHAR ) CREATE TABLE has_amenity ( dormid VARCHAR, amenid VARCHAR ) CREATE TABLE dorm ( dormid VARCHAR, dorm_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Fin...
SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall' ORDER BY T3.amenity_name
### Instruction: CREATE TABLE table_train_199 ( "id" int, "t2dm" bool, "hemoglobin_a1c_hba1c" float, "renal_disease" bool, "diabetic" string, "hypoglycemia" bool, "diabetes" bool, "seizure_disorder" bool, "glaucoma" bool, "hypertension" bool, "age" float, "NOUSE" float ) ...
SELECT * FROM table_train_199 WHERE age >= 5 AND age <= 14
### Instruction: CREATE TABLE GRADECONVERSION ( gradepoint INTEGER, lettergrade VARCHAR ) CREATE TABLE ENROLLED_IN ( Grade VARCHAR, StuID VARCHAR ) CREATE TABLE STUDENT ( city_code VARCHAR, StuID VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT MAX(T2.gradepoint), MIN(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T3.city_code = "NYC"
### Instruction: CREATE TABLE table_67173 ( "Games" real, "Wins" real, "Draws" real, "Losses" real, "Goals For" real, "Goals Against" real, "Goal Differential" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the total win count for Gam...
SELECT COUNT("Wins") FROM table_67173 WHERE "Games" < '7' AND "Goals For" > '2' AND "Goals Against" < '6' AND "Draws" = '1'
### 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.Name, MAX(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY Name DESC
### Instruction: CREATE TABLE table_36301 ( "Distribution" text, "x86-64" text, "ia64" text, "ppc64" text, "sparc32" text, "hppa" text, "mips" text, "s390" text, "s390x" text, "alpha" text, "m68k" text ) -- Using valid SQLite, answer the following questions for the tables p...
SELECT "s390x" FROM table_36301 WHERE "ia64" = 'yes' AND "alpha" = 'no'
### Instruction: CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) -- 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 COUNT(title)
### Instruction: CREATE TABLE table_17838 ( "Colt model no." text, "Name" text, "Stock" text, "Fire control" text, "Rear sight" text, "Forward assist" text, "Barrel length" text, "Barrel profile" text, "Barrel twist" text, "Hand guards" text, "Bayonet Lug" text, "Muzzle d...
SELECT "Barrel length" FROM table_17838 WHERE "Colt model no." = 'LE6921SP'
### Instruction: CREATE TABLE table_25140 ( "Position" real, "2005\u20132006" text, "2006\u20132007" text, "2007\u20132008" text, "2008\u20132009" text, "2009\u20132010" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was position 3 in 2007-2...
SELECT "2007\u20132008" FROM table_25140 WHERE "Position" = '3'
### Instruction: CREATE TABLE table_73372 ( "Election" text, "Mayor" text, "Seat no 1" text, "Seat no 2" text, "Seat no 3" text, "Seat no 4" text, "Seat no 5" text, "Seat no 6" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which electio...
SELECT "Election" FROM table_73372 WHERE "Seat no 1" = 'Jacques Lachapelle' AND "Seat no 5" = 'G. Sanscartier'
### Instruction: CREATE TABLE table_200_22 ( id number, "year" number, "single" text, "peak chart positions\nger" number, "peak chart positions\nire" number, "peak chart positions\nuk" number, "peak chart positions\nus" number, "peak chart positions\nus\nmain" number, "peak chart pos...
SELECT "year" FROM table_200_22 WHERE "single" = '"hard woman"'
### Instruction: CREATE TABLE table_13836 ( "Rank" real, "Peak" text, "Country" text, "Island" text, "Elevation (m)" real, "Prominence (m)" real, "Col (m)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Rank has a Col (m) of 0, and a P...
SELECT SUM("Rank") FROM table_13836 WHERE "Col (m)" = '0' AND "Peak" = 'aoraki/mount cook' AND "Prominence (m)" > '3,755'
### Instruction: CREATE TABLE table_13014 ( "County" text, "Per capita income" text, "Median household income" text, "Median family income" text, "Population" real, "Number of households" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Coun...
SELECT "County" FROM table_13014 WHERE "Number of households" > '14,391' AND "Population" > '17,415' AND "Median household income" = '$32,700'
### Instruction: CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE plays_games ( stuid number, gameid number, hours_played number ) CREATE TABLE video_games ( gameid number, ...
SELECT DISTINCT gtype FROM video_games
### Instruction: CREATE TABLE table_14239 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" real, "Avg. Finish" real, "Winnings" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT COUNT("Wins") FROM table_14239 WHERE "Winnings" = '$184,190' AND "Top 10" > '1'
### 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(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
### Instruction: CREATE TABLE manufacturer ( manufacturer_id number, open_year number, name text, num_of_factories number, num_of_shops number ) CREATE TABLE furniture_manufacte ( manufacturer_id number, furniture_id number, price_in_dollar number ) CREATE TABLE furniture ( furnitu...
SELECT AVG(num_of_factories) FROM manufacturer WHERE num_of_shops > 20
### Instruction: CREATE TABLE table_19193 ( "s Car plate (starting 1937)" text, "Voivodeship or city" text, "Capital" text, "Area (1930) in 1,000skm 2" text, "Population (1931) in 1,000s" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the s car...
SELECT "s Car plate (starting 1937)" FROM table_19193 WHERE "Area (1930) in 1,000skm 2" = '16.5'
### 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 MAX(age), MIN(age) FROM student WHERE major = 600
### Instruction: CREATE TABLE table_8734 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest value for ...
SELECT MAX("Game") FROM table_8734 WHERE "Points" = '16' AND "Date" = 'november 11, 2008' AND "Attendance" > '19,289'
### Instruction: CREATE TABLE table_27319 ( "Region" text, "Enrolled men" real, "Enrolled women" real, "Enrolled total" real, "Men of voting age" real, "Women of voting age" real, "Voting age population" real, "E/VAP ratio Men" text, "E/VAP ratio Women" text, "E/VAP ratio Total" ...
SELECT "E/VAP ratio Total" FROM table_27319 WHERE "Men of voting age" = '123726'
### Instruction: CREATE TABLE table_60223 ( "Crude oil name \\Rightarrow Location \\Rightarrow" text, "Barrow Island Australia" real, "Mutineer-Exeter Australia" real, "CPC Blend Kazakhstan" real, "Draugen North Sea" real ) -- Using valid SQLite, answer the following questions for the tables provi...
SELECT MIN("Barrow Island Australia") FROM table_60223 WHERE "Crude oil name \\Rightarrow Location \\Rightarrow" = 'initial boiling point, °c' AND "Draugen North Sea" > '150'
### Instruction: CREATE TABLE table_10187 ( "Rank" real, "Gymnast" text, "Floor Exercise" real, "Pommel Horse" real, "Rings" real, "Vault" real, "Parallel Bars" real, "Horizontal Bar" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided...
SELECT MIN("Floor Exercise") FROM table_10187 WHERE "Pommel Horse" < '8.45' AND "Parallel Bars" > '9.687'
### Instruction: CREATE TABLE table_79908 ( "D 41 \u221a" text, "D 42 \u221a" text, "D 43 \u221a" text, "D 44 O" text, "D 45 O" text, "D 46 O" text, "D 47 O" text, "D 48 O" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the D 41 wit...
SELECT "D 41 \u221a" FROM table_79908 WHERE "D 44 O" = 'r 13'
### Instruction: CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text ) -- Using valid SQLite, answer the following questions for t...
SELECT Flag, COUNT(Flag) FROM Ship WHERE NOT Ship_ID IN (SELECT Ship_ID FROM captain WHERE Rank = 'Midshipman') GROUP BY Flag ORDER BY Flag DESC
### Instruction: CREATE TABLE table_43213 ( "Rank" real, "Name" text, "Span metres" real, "Span feet" real, "Material" text, "Year opened" text, "Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest amount of Span metre...
SELECT MIN("Span metres") FROM table_43213 WHERE "Year opened" = '2007' AND "Country" = 'china' AND "Rank" < '13' AND "Span feet" < '1378'
### Instruction: CREATE TABLE table_34034 ( "Team" text, "Average" real, "Points" real, "Played" real, "1986-87" text, "1987-88" text, "1988-89" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the total of 1988-89 that has a 1986-87 of...
SELECT SUM("1988-89") FROM table_34034 WHERE "1986-87" = '38' AND "Points" < '109'
### Instruction: CREATE TABLE table_45521 ( "Poll Source" text, "Dates administered" text, "Democrat: Tom Harkin" text, "Republican: Christopher Reed" text, "Lead Margin" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the dates administere...
SELECT "Dates administered" FROM table_45521 WHERE "Lead Margin" < '39' AND "Republican: Christopher Reed" = '37%' AND "Democrat: Tom Harkin" = '53%'
### Instruction: CREATE TABLE table_204_147 ( id number, "#" number, "date" text, "opponent" text, "score" text, "win" text, "loss" text, "save" text, "attendance" number, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- w...
SELECT ABS((SELECT "attendance" FROM table_204_147 WHERE "date" = 'july 7') - (SELECT "attendance" FROM table_204_147 WHERE "date" = 'july 8'))
### Instruction: CREATE TABLE train ( Train_ID int, Name text, Time text, Service text ) CREATE TABLE train_station ( Train_ID int, Station_ID int ) CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, ...
SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY Location
### Instruction: CREATE TABLE table_17824 ( "Year" real, "Starts" real, "Cuts made" real, "Wins" real, "2nd" real, "3rd" real, "Top 10" real, "Top 25" real, "Earnings (\u20ac)" real, "Money list rank" real ) -- Using valid SQLite, answer the following questions for the tables p...
SELECT "Earnings (\u20ac)" FROM table_17824 WHERE "Cuts made" = '19' AND "Money list rank" = '3'
### Instruction: CREATE TABLE employee ( eid number, name text, salary number ) CREATE TABLE aircraft ( aid number, name text, distance number ) CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, ...
SELECT T2.name FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99
### 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 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 DESC
### Instruction: CREATE TABLE table_44170 ( "Rank" real, "City" text, "Province" text, "Date of Official Foundation of Municipality" real, "2006" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Rank, when Province is G l n, when Da...
SELECT SUM("Rank") FROM table_44170 WHERE "Province" = 'gīlān' AND "Date of Official Foundation of Municipality" > '1922' AND "2006" > '557366'
### Instruction: CREATE TABLE table_train_276 ( "id" int, "hbv" bool, "systolic_blood_pressure_sbp" int, "hiv_infection" bool, "hcv" bool, "diastolic_blood_pressure_dbp" int, "body_mass_index_bmi" float, "hypertension" bool, "NOUSE" float ) -- Using valid SQLite, answer the followi...
SELECT * FROM table_train_276 WHERE hbv = 1 OR hcv = 1
### Instruction: CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text ) CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text ) -- Using valid SQ...
SELECT Author, COUNT(DISTINCT T1.Workshop_ID) FROM Acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY Author DESC
### Instruction: CREATE TABLE table_23511 ( "No." real, "Barangay" text, "Area (in km 2 )" text, "Rank" real, "Population (2000)" real, "Population (2007)" real, "Population (2010)" real, "Population Density (2010)" text ) -- Using valid SQLite, answer the following questions for the t...
SELECT MAX("Population (2000)") FROM table_23511 WHERE "Area (in km 2 )" = '1.2530'
### Instruction: CREATE TABLE table_77365 ( "Province" text, "Membership" real, "Population" real, "% LDS" text, "Branches" real, "Total Congregations" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the fewest number of branches with more...
SELECT MIN("Branches") FROM table_77365 WHERE "Total Congregations" > '1' AND "Population" = '1,033,381' AND "Membership" < '5,671'
### Instruction: CREATE TABLE table_7704 ( "Name/ designation" text, "Year of intro" real, "Country of origin" text, "Primary cartridge" text, "Type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Year of Intro(s), when C...
SELECT COUNT("Year of intro") FROM table_7704 WHERE "Country of origin" = 'soviet union' AND "Type" = 'reusable' AND "Primary cartridge" = '40mm' AND "Name/ designation" = 'rpg-29'
### Instruction: CREATE TABLE broadcast ( channel_id number, program_id number, time_of_day text ) CREATE TABLE broadcast_share ( channel_id number, program_id number, date text, share_in_percent number ) CREATE TABLE channel ( channel_id number, name text, owner text, shar...
SELECT name FROM channel WHERE owner <> 'CCTV'
### 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 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.Price, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
### Instruction: CREATE TABLE table_16934 ( "Date" text, "Tournament" text, "Location" text, "Purse( $ )" real, "Winner" text, "Score" text, "1st Prize( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the winner with purse( $ ) va...
SELECT "Winner" FROM table_16934 WHERE "Purse( $ )" > '964017.2297960471' AND "Date" = 'May 28'
### 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, COUNT(*) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC
### Instruction: CREATE TABLE table_51507 ( "Tournament" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the value for 2007...
SELECT "2007" FROM table_51507 WHERE "2011" = 'a' AND "2009" = 'q2'
### Instruction: CREATE TABLE table_76408 ( "Particle name" text, "Particle symbol" text, "Antiparticle symbol" text, "Quark content" text, "Rest mass ( MeV / c 2 )" text, "J P C" text, "Mean lifetime ( s )" text, "Commonly decays to (>5% of decays)" text ) -- Using valid SQLite, answe...
SELECT "Antiparticle symbol" FROM table_76408 WHERE "Rest mass ( MeV / c 2 )" = '.47 ± .33'
### 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 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
### Instruction: CREATE TABLE table_27217 ( "Round" text, "Opposition" text, "Time" text, "Date" text, "Home/Away" text, "Venue" text, "Score" text, "Result/Margin" text, "Broadcaster" text, "TV" text, "Ladder Position" text ) -- Using valid SQLite, answer the following que...
SELECT "Result/Margin" FROM table_27217 WHERE "Broadcaster" = 'Fox Sports 1' AND "Venue" = 'MCG'
### Instruction: 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 numeric(5,0) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr ...
SELECT cName, MIN(enr) FROM College GROUP BY state ORDER BY MIN(enr)
### Instruction: CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE train_station ( Train_ID int, Station_ID int ) CREATE TABLE trai...
SELECT Name, COUNT(Name) FROM train GROUP BY Name ORDER BY COUNT(Name) DESC
### Instruction: CREATE TABLE music_festival ( id number, music_festival text, date_of_ceremony text, category text, volume number, result text ) CREATE TABLE artist ( artist_id number, artist text, age number, famous_title text, famous_release_date text ) CREATE TABLE volu...
SELECT famous_title, age FROM artist ORDER BY age 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.Price, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name
### Instruction: CREATE TABLE table_74548 ( "Division" text, "League Apps" real, "League Goals" real, "FA Cup Apps" real, "FA Cup Goals" real, "Total Apps" real, "Total Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The total goals ha...
SELECT COUNT("Total Goals") FROM table_74548 WHERE "FA Cup Apps" > '1' AND "Total Apps" = '37' AND "League Apps" < '30'
### Instruction: CREATE TABLE table_59265 ( "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 MAX("Wins") FROM table_59265 WHERE "Draws" > '4' AND "Club" = 'cd orense' AND "Points" > '36'
### Instruction: CREATE TABLE table_64588 ( "Tournament" text, "2000" text, "1999" text, "1998" text, "1997" text, "1996" text, "1995" text, "1994" text, "1993" text, "1992" text, "1991" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "1996" FROM table_64588 WHERE "1997" = '3r'
### Instruction: CREATE TABLE table_14977 ( "Parameter" text, "N80 IEC1" text, "N90 IEC1" text, "N90 IEC2" text, "N100 IEC 2" text, "N100 IEC3" text, "N117/2400 IEC3" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the N117/2400 IEC3 ...
SELECT "N117/2400 IEC3" FROM table_14977 WHERE "N100 IEC3" = '25'
### Instruction: CREATE TABLE table_203_865 ( id number, "place" number, "athlete" text, "nation" text, "best mark" text, "throw 1" number, "throw 2" number, "throw 3" number, "throw 4" number, "throw 5" number, "throw 6" number ) -- Using valid SQLite, answer the following...
SELECT "athlete" FROM table_203_865 WHERE "best mark" > (SELECT "best mark" FROM table_203_865 WHERE "athlete" = 'renate culmberger')
### 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 county_name FROM county ORDER BY population DESC LIMIT 1
### Instruction: CREATE TABLE table_70001 ( "Unit" text, "Reactortype" text, "Net capacity" text, "Gross capacity" text, "Construction started" text, "Electricity Grid" text, "Commercial Operation" text, "Shutdown" text ) -- Using valid SQLite, answer the following questions for the ta...
SELECT "Reactortype" FROM table_70001 WHERE "Gross capacity" = '417 mw' AND "Electricity Grid" = '27.12.1971'
### Instruction: CREATE TABLE driver ( Driver_ID int, Name text, Party text, Home_city text, Age int ) CREATE TABLE school ( School_ID int, Grade text, School text, Location text, Type text ) CREATE TABLE school_bus ( School_ID int, Driver_ID int, Years_Working int,...
SELECT Type, COUNT(*) FROM school_bus AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T2.Type
### Instruction: CREATE TABLE table_74670 ( "Country" text, "Year (most recent)" real, "Adult (15+) Literacy Rate Total" text, "Adult Men" text, "Adult Women" text, "Youth (15-24) Literacy Rate Total" text, "Youth Men" text, "Youth Women" text ) -- Using valid SQLite, answer the follow...
SELECT "Country" FROM table_74670 WHERE "Year (most recent)" = '2005' AND "Adult Men" = '96%'
### Instruction: CREATE TABLE table_202_196 ( id number, "ethnicity" text, "1880" text, "1899" text, "1913" text, "19301" text, "1956" text, "1966" text, "1977" text, "1992" text, "2002" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "1966" FROM table_202_196 WHERE "ethnicity" = 'russian-lipovan'
### Instruction: CREATE TABLE table_40351 ( "From" real, "Goal" real, "Round 1" text, "Round 2" text, "Round 3" text, "Round 4" text, "Round 5" text, "Round 6+" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which round 1 has a from prio...
SELECT "Round 1" FROM table_40351 WHERE "From" < '1984' AND "Round 3" = 'double' AND "Goal" < '300'
### Instruction: CREATE TABLE table_name_98 ( hanyu_pinyin VARCHAR, gdp_2011__billion_yuan_ VARCHAR, regional_population_2010_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Hanyu Pinyin has a GDP in 2011 larger than 688.02 billion yuan and a regio...
SELECT hanyu_pinyin FROM table_name_98 WHERE gdp_2011__billion_yuan_ > 688.02 AND regional_population_2010_ = "8,700,400"
### Instruction: CREATE TABLE table_24984 ( "Year" text, "Chairman" text, "Artistic Director" text, "Performance Liaison" text, "Secretary" text, "Business manager" text, "Production Stagemanager" text, "Dramaturge" text, "Public Relations" text, "First/Second Year Rep." text, ...
SELECT "First/Second Year Rep." FROM table_24984 WHERE "Performance Liaison" = 'Kira Josephson'
### Instruction: CREATE TABLE table_40030 ( "Country" text, "Men's race" real, "Women's race" real, "Men's wheelchair" real, "Women's Wheelchair" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the highest Total when Women's ...
SELECT MAX("Total") FROM table_40030 WHERE "Women's Wheelchair" = '2' AND "Men's wheelchair" < '1' AND "Women's race" > '0'
### Instruction: CREATE TABLE table_41223 ( "Party" text, "Medium Gallup, March 2008" real, "Strategic Marketing, March 2008" real, "CeSID, May 2008" real, "Medium Gallup, May 2008" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of M...
SELECT SUM("Medium Gallup, March 2008") FROM table_41223 WHERE "Medium Gallup, May 2008" < '10'
### Instruction: CREATE TABLE table_45531 ( "Rank" real, "City" text, "Province" text, "Date of Official Foundation of Municipality" real, "2006" real, "1996" real, "1986" real, "1976" real, "1966" real, "1956" real ) -- Using valid SQLite, answer the following questions for th...
SELECT COUNT("2006") FROM table_45531 WHERE "Date of Official Foundation of Municipality" = '1918'
### Instruction: CREATE TABLE entrepreneur ( entrepreneur_id number, people_id number, company text, money_requested number, investor text ) CREATE TABLE people ( people_id number, name text, height number, weight number, date_of_birth text ) -- Using valid SQLite, answer the ...
SELECT T2.date_of_birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T1.investor = "Simon Woodroffe" OR T1.investor = "Peter Jones"
### Instruction: CREATE TABLE table_train_60 ( "id" int, "corticosteroid_therapy" bool, "radiotherapy" bool, "immune_suppression" bool, "hiv_infection" bool, "cd4_count" int, "sargramostim" bool, "chemotherapy" bool, "immune_deficiency_disorder" bool, "tumor" bool, "receiving...
SELECT * FROM table_train_60 WHERE immune_deficiency_disorder = 1
### Instruction: CREATE TABLE county ( county_id number, county_name text, population number, zip_code text ) CREATE TABLE party ( party_id number, year number, party text, governor text, lieutenant_governor text, comptroller text, attorney_general text, us_senate text )...
SELECT governor FROM party GROUP BY governor ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: CREATE TABLE table_18378 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the first elected when the party was republica...
SELECT MIN("First elected") FROM table_18378 WHERE "Party" = 'Republican' AND "Candidates" = 'Robert H. Michel (R) 66.1% Rosa Lee Fox (D) 33.9%'
### Instruction: CREATE TABLE table_2181 ( "Pitcher" text, "Starts" real, "Wins" real, "Losses" real, "No decisions" real, "Winning %" text, "Seasons" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the pitcher in seasons 1982, 1984, ...
SELECT "Pitcher" FROM table_2181 WHERE "Seasons" = '1982, 1984, 1985, 1987, 1988, 1989'
### Instruction: CREATE TABLE table_1345 ( "Num" real, "Team" text, "W" real, "L" real, "PCT" text, "PF" real, "PA" real, "Last appearance" real, "Last championship" real, "HOME games" real, "Home wins" real, "Home losses" real, "Home Win Pct." text, "ROAD games" ...
SELECT MIN("Road wins") FROM table_1345
### Instruction: CREATE TABLE table_6846 ( "Position" text, "Name" text, "Height (cm)" real, "Weight (kg)" real, "Birthdate" text, "Birthplace" text, "1997\u20131998 Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Position w...
SELECT "Position" FROM table_6846 WHERE "Height (cm)" < '183' AND "Weight (kg)" < '91' AND "Birthplace" = 'bloomington, minnesota'
### Instruction: CREATE TABLE table_203_151 ( id number, "no." number, "date" text, "tournament" text, "winning score" text, "margin of\nvictory" text, "runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many more strokes were ...
SELECT (SELECT "margin of\nvictory" FROM table_203_151 WHERE "tournament" = 'klm open') - (SELECT "margin of\nvictory" FROM table_203_151 WHERE "tournament" = 'barclays scottish open')
### Instruction: CREATE TABLE personfriend ( name text, friend text, year number ) CREATE TABLE person ( name text, age number, city text, gender text, job text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name of the person who h...
SELECT T1.name FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM person WHERE age > 40) EXCEPT SELECT T1.name FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM person WHERE age < 30)