instruction
stringlengths
212
6.3k
output
stringlengths
6
2.03k
### 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, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Code
### Instruction: CREATE TABLE genre ( g_name text, rating text, most_popular_in text ) CREATE TABLE files ( f_id number, artist_name text, file_size text, duration text, formats text ) CREATE TABLE artist ( artist_name text, country text, gender text, preferred_genre te...
SELECT song_name, releasedate FROM song ORDER BY releasedate DESC LIMIT 1
### 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.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name DESC
### Instruction: CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) 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, ...
SELECT T1.Date, T1.Attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.Exhibition_ID = T2.Exhibition_ID WHERE T2.Year = 2004
### Instruction: CREATE TABLE table_67184 ( "Poll source" text, "Dates administered" text, "Dianne Feinstein *" text, "Jerry Brown" text, "Antonio Villaraigosa*" text, "Gavin Newsom*" text, "John Garamendi*" text, "Jack O'Connell*" text, "Steve Westly*" text, "Bill Lockyer*" text...
SELECT "Antonio Villaraigosa*" FROM table_67184 WHERE "Steve Westly*" = '––' AND "Jerry Brown" = '47%'
### 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 ORDER BY COUNT(*) DESC
### Instruction: CREATE TABLE table_63242 ( "Country/Territory" text, "Established" real, "Degree" text, "Regional/Offshore" text, "IMED/Avicenna Listed" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the imed/avicenna listed for a medical s...
SELECT "IMED/Avicenna Listed" FROM table_63242 WHERE "Regional/Offshore" = 'offshore' AND "Country/Territory" = 'saint kitts and nevis' AND "Degree" = 'md' AND "Established" < '2000'
### Instruction: CREATE TABLE table_50723 ( "Line" text, "Operator" text, "Line length (kilometres)" real, "Number of stations" real, "Annual ridership (1998)" real, "Annual ridership (2008)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which ...
SELECT MIN("Annual ridership (2008)") FROM table_50723 WHERE "Number of stations" > '70' AND "Annual ridership (1998)" < '451,971,849'
### Instruction: CREATE TABLE table_73307 ( "Region" text, "Population" text, "Country" text, "Language" text, "N" real, "Total%" text, "R1b1c (R-V88)" text, "R1b1a2 (R-M269)" text, "R1b1c* (R-V88*)" text, "R1b1c4 (R-V69)" text ) -- Using valid SQLite, answer the following ques...
SELECT MAX("N") FROM table_73307 WHERE "R1b1c4 (R-V69)" = '55.6%'
### 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 Directed_by, COUNT(*) FROM film GROUP BY Directed_by ORDER BY COUNT(*) 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.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code
### 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, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY AVG(Price) 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.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name 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.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name
### Instruction: CREATE TABLE lives_in ( stuid number, dormid number, room_number number ) CREATE TABLE dorm_amenity ( amenid number, amenity_name text ) CREATE TABLE has_amenity ( dormid number, amenid number ) CREATE TABLE student ( stuid number, lname text, fname text, ...
SELECT SUM(student_capacity) FROM dorm
### Instruction: CREATE TABLE routes ( rid number, dst_apid number, dst_ap text, src_apid number, src_ap text, alid number, airline text, codeshare text ) CREATE TABLE airlines ( alid number, name text, iata text, icao text, callsign text, country text, activ...
SELECT COUNT(*) FROM airlines WHERE country = 'Russia'
### Instruction: CREATE TABLE table_train_194 ( "id" int, "organ_transplantation" bool, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "substance_dependence" bool, "diastolic_blood_pressure_dbp" int, "alcohol_abuse" bool, "age" float, "NOUSE" float ) -- Using vali...
SELECT * FROM table_train_194 WHERE hemoglobin_a1c_hba1c <= 10
### 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 ORDER BY AllergyType
### 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.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name
### Instruction: CREATE TABLE pilot_record ( Record_ID int, Pilot_ID int, Aircraft_ID int, Date text ) CREATE TABLE pilot ( Pilot_ID int, Pilot_name text, Rank int, Age int, Nationality text, Position text, Join_Year int, Team text ) CREATE TABLE aircraft ( Aircraft...
SELECT Nationality, COUNT(*) FROM pilot GROUP BY Nationality ORDER BY Nationality DESC
### Instruction: CREATE TABLE mountain ( id int, name text, Height real, Prominence real, Range text, Country text ) 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 te...
SELECT T1.name, T1.id FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id ORDER BY T1.id 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 T2.Name, T1.Code 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_65075 ( "Model number" text, "sSpec number" text, "Frequency" text, "Turbo" text, "Cores" text, "L2 cache" text, "L3 cache" text, "I/O bus" text, "Mult." text, "Memory" text, "Voltage" text, "Socket" text, "Release date" text, "...
SELECT "Turbo" FROM table_65075 WHERE "Release price ( USD )" = '$583'
### 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 T1.Name ORDER BY T1.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.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code
### 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, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name
### Instruction: CREATE TABLE table_72312 ( "DS Division" text, "Main Town" text, "Divisional Secretary" text, "GN Divisions" real, "Area (km 2 )" real, "Sri Lankan Tamil" real, "Sri Lankan Moors" real, "Sinhalese" real, "Burgher" real, "Other" real, "Total" real, "Popula...
SELECT "DS Division" FROM table_72312 WHERE "Divisional Secretary" = 'S. L. M. Haneefa'
### 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 Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy (...
SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType ORDER BY COUNT(*) 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.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code
### Instruction: CREATE TABLE table_45954 ( "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. 3" FROM table_45954 WHERE "No. 7" = 'abigail' AND "No. 4" = 'ava'
### Instruction: CREATE TABLE ndecoreexcel_math_grade8 ( year number, state text, all_students text, average_scale_score number ) CREATE TABLE finrev_fed_key_17 ( state_code number, state text, #_records text ) CREATE TABLE finrev_fed_17 ( state_code number, idcensus number, sc...
SELECT average_scale_score FROM ndecoreexcel_math_grade8 WHERE state = "California"
### Instruction: 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_USD real, Number_Deaths int ) CREATE TABLE affected_region ( Region_id int, Storm_ID in...
SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID ORDER BY COUNT(*)
### Instruction: CREATE TABLE table_26085 ( "Rank" real, "Rider" text, "Mon 24 Aug" text, "Tues 25 Aug" text, "Wed 26 Aug" text, "Thurs 27 Aug" text, "Fri 28 Aug" text, "Sat 29 Aug" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tim...
SELECT "Sat 29 Aug" FROM table_26085 WHERE "Mon 24 Aug" = '24'' 17.26 93.208mph'
### 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, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Revenue
### Instruction: CREATE TABLE table_204_206 ( id number, "saros" number, "member" number, "date" text, "time\n(greatest)\nutc" text, "type" text, "location\nlat,long" text, "gamma" number, "mag." number, "width\n(km)" number, "duration\n(min:sec)" text, "ref" number ) -...
SELECT COUNT("member") FROM table_204_206 WHERE "type" = 'partial' AND "date" < (SELECT MIN("date") FROM table_204_206 WHERE "type" = 'annular')
### Instruction: CREATE TABLE table_69411 ( "Installation" text, "Cluj" real, "Oradea" real, "Baia Mare" real, "Bistrita" real, "Satu Mare" real, "Zalau" real, "Electrica North Transylvania" real ) -- Using valid SQLite, answer the following questions for the tables provided above. --...
SELECT COUNT("Baia Mare") FROM table_69411 WHERE "Electrica North Transylvania" < '14.476' AND "Bistrita" = '643' AND "Zalau" < '737'
### Instruction: CREATE TABLE table_60871 ( "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("Goals against") FROM table_60871 WHERE "Points" > '31' AND "Goal Difference" < '9' AND "Wins" = '13' AND "Draws" > '6'
### 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, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.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.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name
### Instruction: CREATE TABLE table_69318 ( "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 AVG("Played") FROM table_69318 WHERE "Goals for" < '43' AND "Draws" > '9' AND "Position" > '17' AND "Points" = '30-8'
### Instruction: CREATE TABLE table_21958 ( "Name" text, "Map colour" text, "First operated" real, "Type" text, "Length" text, "No. Sta" real, "Current Stock" text, "Future Stock" text, "Trips per annum (\u00d71000)" real, "Avg. trips per mile (\u00d71000)" real ) -- Using vali...
SELECT COUNT("Avg. trips per mile (\u00d71000)") FROM table_21958 WHERE "Map colour" = 'Turquoise'
### Instruction: CREATE TABLE table_73473 ( "States" text, "No. of MLA/MPs" real, "Value of each Vote" real, "K.R. Narayanan (Votes)" real, "K.R. Narayanan (Values)" real, "T.N. Seshan (Votes)" real, "T.N. Seshan (Values)" real, "Invalid (Votes)" real, "Invalid (Values)" real ) -- ...
SELECT COUNT("T.N. Seshan (Values)") FROM table_73473 WHERE "K.R. Narayanan (Values)" = '478608'
### Instruction: CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) -- Using valid SQLite, answer the following quest...
SELECT Date_of_Birth, COUNT(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 railway ( railway_id number, railway text, builder text, built text, wheels text, location text, objectnumber text ) CREATE TABLE manager ( manager_id number, name text, country text, working_year_starts text, age number, level number ) ...
SELECT location FROM railway GROUP BY location HAVING COUNT(*) > 1
### Instruction: CREATE TABLE table_49438 ( "Borough" text, "1970" real, "1980" real, "1990" real, "2000" real, "2006" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the percentage in 1980 that had less than 37.8% in 2006, more than 29....
SELECT MIN("1980") FROM table_49438 WHERE "2006" < '37.8' AND "2000" > '29.4' AND "1970" > '18.2'
### Instruction: CREATE TABLE table_train_34 ( "id" int, "gender" string, "allergy_to_adhesive" bool, "contraception" bool, "use_of_cyclosporin" bool, "use_of_digoxin" bool, "liver_disease" bool, "rhabomyolysis" bool, "allergy_to_hydrocortisone" bool, "use_of_statins" bool, "...
SELECT * FROM table_train_34 WHERE use_of_cyclosporin = 1 OR use_of_digoxin = 1 OR use_of_statins = 1
### 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, COUNT(T2.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY COUNT(T2.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 Headquarter, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC
### Instruction: CREATE TABLE table_train_242 ( "id" int, "macroalbuminuria" bool, "hyperlipidemia" bool, "fasting_serum_triglycerides" int, "fasting_ldl_cholesterol" int, "panel_reactive_antibodies" int, "serum_creatinine" float, "albumin" float, "body_mass_index_bmi" float, "fa...
SELECT * FROM table_train_242 WHERE panel_reactive_antibodies > 20
### Instruction: CREATE TABLE table_54187 ( "! Late 1941" text, "Late 1942" real, "Sept. 1943" real, "Late 1943" real, "Late 1944" real, "1978 Veteran membership" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest late 1943 numbe...
SELECT MAX("Late 1943") FROM table_54187 WHERE "! Late 1941" = 'vojvodina' AND "1978 Veteran membership" < '40,000'
### Instruction: CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) 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 ) CREA...
SELECT Openning_year, AVG(Capacity) FROM cinema ORDER BY Openning_year
### 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, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name DESC
### Instruction: CREATE TABLE table_73305 ( "Region" text, "Population" text, "Country" text, "Language" text, "N" real, "Total%" text, "R1b1c (R-V88)" text, "R1b1a2 (R-M269)" text, "R1b1c* (R-V88*)" text, "R1b1c4 (R-V69)" text ) -- Using valid SQLite, answer the following ques...
SELECT COUNT("N") FROM table_73305 WHERE "R1b1a2 (R-M269)" = '0.6%'
### Instruction: CREATE TABLE table_964 ( "IN No." real, "County Name" text, "Establishment Date (SW Indiana) (History) (Statehood)" text, "County Seat" text, "Time Zone" text, "Population (2010) (Rank)" text, "Area sq mi (km 2 ) (Rank)" text, "Twps" real, "ZIP code Prefix(es)" text,...
SELECT COUNT("ZIP code Prefix(es)") FROM table_964 WHERE "% of Boundary by water" = '63%'
### Instruction: CREATE TABLE table_3213 ( "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 MAX("GDP (PPP) per capita (2008)") FROM table_3213 WHERE "Combined gross enrollment ratio (2009)" = '86.6'
### Instruction: CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State ...
SELECT Year, AVG(MAX(Score)) FROM wine
### Instruction: CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_I...
SELECT Name, COUNT(Name) FROM technician GROUP BY Name ORDER BY Age
### Instruction: CREATE TABLE member ( member_id number, member_name text, party_id text, in_office text ) CREATE TABLE party ( party_id number, minister text, took_office text, left_office text, region_id number, party_name text ) CREATE TABLE party_events ( event_id numbe...
SELECT minister FROM party ORDER BY left_office DESC LIMIT 1
### Instruction: CREATE TABLE table_26748 ( "Position" text, "Name" text, "Nationality" text, "Event 1 Medley" text, "Event 2 Truck Pull" text, "Event 3 Dead Lift" text, "Event 4 Fingals Fingers" text, "Event 5 Keg Toss" text, "Event 6 Atlas Stones" text ) -- Using valid SQLite, an...
SELECT COUNT("Event 6 Atlas Stones") FROM table_26748 WHERE "Event 3 Dead Lift" = '2 (6 in 30.89s)'
### Instruction: CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) 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 Allergy_Type ( Aller...
SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType ORDER BY COUNT(*)
### Instruction: CREATE TABLE tags ( index number, id number, tag text ) CREATE TABLE torrents ( groupname text, totalsnatched number, artist text, groupyear number, releasetype text, groupid number, id number ) -- Using valid SQLite, answer the following questions for the tab...
SELECT groupname FROM torrents WHERE artist = "lasean camry" AND totalsnatched = (SELECT MAX(totalsnatched) FROM torrents WHERE artist = "lasean camry") UNION SELECT groupname FROM torrents WHERE artist = "lasean camry" AND totalsnatched = (SELECT MIN(totalsnatched) FROM torrents WHERE artist = "lasean camry")
### Instruction: CREATE TABLE table_7271 ( "Year" real, "Pass Rate" text, "% 'A' Aggregates" text, "% 'B' Aggregates" text, "% 'A' or 'B' Aggregates" text, "Average A's per learner" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Years h...
SELECT COUNT("Year") FROM table_7271 WHERE "% 'B' Aggregates" = '28%' AND "Average A's per learner" < '3.2800000000000002'
### Instruction: CREATE TABLE table_7482 ( "Year" real, "Events played" real, "Cuts made" real, "Wins" real, "2nds" real, "Top 10s" real, "Best finish" text, "Earnings ($)" real, "Rank" text, "Scoring average" real, "Scoring rank" text ) -- Using valid SQLite, answer the fo...
SELECT "Scoring rank" FROM table_7482 WHERE "Events played" < '21' AND "Rank" = 'n/a' AND "Year" < '2011'
### 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 T1.Name, T1.Name ORDER BY T1.Name DESC
### Instruction: CREATE TABLE table_203_171 ( id number, "place\n(posicion)" number, "team\n(equipo)" text, "played\n(pj)" number, "won\n(pg)" number, "draw\n(pe)" number, "lost\n(pp)" number, "goals scored\n(gf)" number, "goals conceded\n(gc)" number, "+/-\n(dif.)" number, "...
SELECT COUNT("team\n(equipo)") FROM table_203_171 WHERE "goals scored\n(gf)" >= 17
### 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 decor, COUNT(*) FROM Rooms WHERE bedType = "King" GROUP BY decor ORDER BY decor
### Instruction: CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text ) CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College 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 COUNT(DISTINCT T1.Workshop_ID) DESC
### Instruction: CREATE TABLE table_47183 ( "Name" text, "Year Began" text, "s Registered user" text, "Updated in past 30 days" text, "Registration" text, "Ability to syndicate off-site feeds" text, "Userpics Free" text, "Userpics Paid" text, "Monthly Cost for Paid Account" text, ...
SELECT "Permanent Account" FROM table_47183 WHERE "Updated in past 30 days" = '10324'
### Instruction: CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, ...
SELECT LName, COUNT(LName) FROM Student WHERE Sex = 'F' GROUP BY LName ORDER BY LName DESC
### Instruction: CREATE TABLE table_54188 ( "! Late 1941" text, "Late 1942" real, "Sept. 1943" real, "Late 1943" real, "Late 1944" real, "1978 Veteran membership" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1978 Veteran membership...
SELECT SUM("1978 Veteran membership") FROM table_54188 WHERE "! Late 1941" = 'macedonia' AND "Late 1943" < '10,000'
### 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.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.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.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name DESC
### 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 decor, COUNT(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor ORDER BY decor
### 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 Founder, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY SUM(Revenue) 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 T2.Name, T1.Code 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 VISITORS ( Tourist_ID VARCHAR, Tourist_Details VARCHAR ) CREATE TABLE Tourist_Attractions ( Name VARCHAR, Tourist_Attraction_ID VARCHAR ) CREATE TABLE VISITS ( Tourist_Attraction_ID VARCHAR, Tourist_ID VARCHAR ) -- Using valid SQLite, answer the following questi...
SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID JOIN VISITORS AS T3 ON T2.Tourist_ID = T3.Tourist_ID WHERE T3.Tourist_Details = "Vincent"
### Instruction: CREATE TABLE book_club ( book_club_id int, Year int, Author_or_Editor text, Book_Title text, Publisher text, Category text, Result text ) CREATE TABLE culture_company ( Company_name text, Type text, Incorporated_in text, Group_Equity_Shareholding real, b...
SELECT Category, COUNT(*) FROM book_club GROUP BY Category
### 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 ORDER BY T2.Founder
### 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 ORDER BY SUM(Price)
### 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 ORDER BY T1.Code 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.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name
### Instruction: CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE geographic ( city_name varchar, county...
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE restaurant.city_name IN (SELECT GEOGRAPHICalias0.city_name FROM geographic AS GEOGRAPHICalias0 WHERE GEOGRAPHICalias0.region = 'bay area') AND restaurant.id = location.restaurant_id
### Instruction: CREATE TABLE table_64957 ( "Year" real, "League Champion" text, "Best Blocker" text, "Rookie of the Year" text, "C.A.N.T.S.L.E.E.P. Award" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the best blocker for the year that has...
SELECT "Best Blocker" FROM table_64957 WHERE "League Champion" = 'queens of pain' AND "C.A.N.T.S.L.E.E.P. Award" = 'chassis crass (brooklyn)'
### Instruction: CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, wind_speed_mph int ) CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, in...
SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority
### Instruction: CREATE TABLE table_16603 ( "Date" text, "Founder" text, "Extroversion Scales" text, "People-task orientation scale" text, "Introverted, Task-Oriented" text, "Extroverted, Task-Oriented" text, "Extroverted, Relationship-Oriented" text, "Introverted, Relationship Oriented"...
SELECT "Extroverted, Relationship-Oriented" FROM table_16603 WHERE "Extroverted, Task-Oriented" = 'Director'
### 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, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name DESC
### Instruction: 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, hometown text, level number ) CREATE TABLE purchase ( member_id number, branch_id text, yea...
SELECT COUNT(*) FROM branch WHERE membership_amount > (SELECT AVG(membership_amount) FROM branch)
### 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(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY SUM(Manufacturer)
### Instruction: CREATE TABLE game ( stadium_id number, id number, season number, date text, home_team text, away_team text, score text, competition text ) CREATE TABLE stadium ( id number, name text, home_games number, average_attendance number, total_attendance num...
SELECT average_attendance FROM stadium WHERE capacity_percentage > 100
### Instruction: CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE appe...
SELECT Grape, COUNT(*) FROM wine GROUP BY Grape
### 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 Headquarter, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter
### Instruction: CREATE TABLE ndecoreexcel_math_grade8 ( year number, state text, all_students text, average_scale_score number ) CREATE TABLE finrev_fed_17 ( state_code number, idcensus number, school_district text, nces_id text, yr_data number, t_fed_rev number, c14 number...
SELECT COUNT(*) FROM finrev_fed_17 WHERE school_district LIKE "%Wisconsin%"
### Instruction: CREATE TABLE table_8287 ( "Player" text, "PL Apps" real, "PL G" real, "CL Apps" real, "CL G" real, "FAC / LC Apps" real, "FAC / LC G" real, "Total Apps" real, "Total G" real, "FA YC" real, "UEFA YC" real ) -- Using valid SQLite, answer the following questio...
SELECT SUM("Total Apps") FROM table_8287 WHERE "PL G" > '0' AND "Player" = 'benayoun' AND "CL Apps" > '9'
### Instruction: CREATE TABLE table_49351 ( "Average population (x 1000)" text, "Live births 1" text, "Deaths 1" text, "Natural change 1" text, "Crude birth rate (per 1000)" real, "Crude death rate (per 1000)" real, "Natural change (per 1000)" real ) -- Using valid SQLite, answer the follo...
SELECT SUM("Crude birth rate (per 1000)") FROM table_49351 WHERE "Live births 1" = '356 013'
### Instruction: CREATE TABLE table_19146 ( "Season" real, "Class" text, "Team" text, "Motorcycle" text, "Type" text, "Races" real, "Wins" real, "Podiums" real, "Poles" real, "Fastest Laps" real, "Pts" text, "Position" text ) -- Using valid SQLite, answer the following ...
SELECT "Pts" FROM table_19146 WHERE "Poles" < '1.0' AND "Motorcycle" = 'Aprilia' AND "Class" = '250cc'
### 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 ORDER BY T2.Name DESC
### Instruction: CREATE TABLE county_public_safety ( County_ID int, Name text, Population int, Police_officers int, Residents_per_officer int, Case_burden int, Crime_rate real, Police_force text, Location text ) CREATE TABLE city ( City_ID int, County_ID int, Name text, ...
SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force ORDER BY Police_force 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.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code
### Instruction: CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) 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 Allergy_Type ( Aller...
SELECT AllergyType, COUNT(AllergyType) FROM Allergy_Type GROUP BY AllergyType ORDER BY AllergyType DESC
### Instruction: CREATE TABLE table_245 ( "Model" text, "Engine make/Capacity" text, "Power kW@rpm" text, "Torque Nm@rpm" text, "Transmission Make/Type/Speed" text, "GVM (kg) Technical Capacity" text, "GCM (kg) Technical Capacity" text ) -- Using valid SQLite, answer the following question...
SELECT "GCM (kg) Technical Capacity" FROM table_245 WHERE "Transmission Make/Type/Speed" = 'Eaton FS 5306-A Manual Synchromesh 6 Speed'