instruction
stringlengths
212
6.3k
output
stringlengths
6
2.03k
### Instruction: CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season ...
SELECT Team_ID, All_Games_Percent FROM basketball_match
### Instruction: CREATE TABLE book_club ( book_club_id number, year number, 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 numbe...
SELECT director FROM movie WHERE year = 1999 OR year = 2000
### 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 T1.year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id = T2.market_id WHERE T2.country = "Japan" ORDER BY T1.year DESC
### Instruction: CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE univ...
SELECT All_Road, ACC_Percent FROM basketball_match
### Instruction: CREATE TABLE program ( program_id number, name text, origin text, launch number, owner text ) CREATE TABLE broadcast_share ( channel_id number, program_id number, date text, share_in_percent number ) CREATE TABLE broadcast ( channel_id number, program_id nu...
SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id GROUP BY t2.program_id ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: CREATE TABLE plays_games ( stuid number, gameid number, hours_played number ) CREATE TABLE sportsinfo ( stuid number, sportname text, hoursperweek number, gamesplayed number, onscholarship text ) CREATE TABLE video_games ( gameid number, gname text, gtype t...
SELECT stuid FROM student WHERE major = 600 INTERSECT SELECT stuid FROM sportsinfo WHERE onscholarship = 'Y'
### Instruction: 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_ID int, Order_Year int, Manufacturer text, Model text, Fleet_Series text, Powertra...
SELECT Position, COUNT(Position) FROM pilot GROUP BY Position ORDER BY COUNT(Position) DESC
### Instruction: CREATE TABLE movie ( movie_id number, title text, year number, director text, budget_million number, gross_worldwide number ) CREATE TABLE book_club ( book_club_id number, year number, author_or_editor text, book_title text, publisher text, category text...
SELECT book_title, author_or_editor FROM book_club WHERE year > 1989
### Instruction: CREATE TABLE table_203_854 ( id number, "position" number, "driver" text, "no." text, "car" text, "entrant" text, "rd 1" number, "rd 2" number, "rd 3" number, "rd 4" number, "rd 5" number, "rd 6" number, "rd 7" number, "rd 8" number, "total" n...
SELECT "driver" FROM table_203_854 WHERE "total" < (SELECT "total" FROM table_203_854 WHERE "driver" = 'max twigg') ORDER BY "total" DESC LIMIT 1
### Instruction: CREATE TABLE people ( People_ID int, Name text, Age real, Height real, Hometown text ) CREATE TABLE gymnast ( Gymnast_ID int, Floor_Exercise_Points real, Pommel_Horse_Points real, Rings_Points real, Vault_Points real, Parallel_Bars_Points real, Horizonta...
SELECT Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown ORDER BY COUNT(*) 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.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter
### Instruction: CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season ...
SELECT All_Neutral, Team_ID FROM basketball_match
### Instruction: CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE geographic ( city_name varchar, county...
SELECT location.house_number, restaurant.name FROM geographic, location, restaurant WHERE geographic.region = 'yosemite and mono lake area' AND restaurant.city_name = geographic.city_name AND restaurant.food_type = 'french' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
### Instruction: CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season ...
SELECT All_Games, Team_ID FROM basketball_match
### Instruction: CREATE TABLE mountain ( id int, name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE photos ( id int, camera_lens_id int,...
SELECT T1.name, COUNT(*) FROM camera_lens AS T1 JOIN photos AS T2 ON T1.id = T2.camera_lens_id GROUP BY T1.id ORDER BY COUNT(*)
### 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 T1.Name, T1.Name ORDER BY T1.Manufacturer DESC
### Instruction: CREATE TABLE match_season ( Season real, Player text, Position text, Country int, Team int, Draft_Pick_Number int, Draft_Class text, College text ) CREATE TABLE team ( Team_id int, Name text ) CREATE TABLE player ( Player_ID int, Player text, Years_...
SELECT Position, COUNT(*) FROM match_season GROUP BY Position
### Instruction: CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season ...
SELECT All_Games, School_ID FROM basketball_match
### Instruction: CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE member_of_club ( stuid number, clubid number, position text ) CREATE TABLE club ( clubid number, clubname ...
SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t3.age > 18
### Instruction: CREATE TABLE table_train_172 ( "id" int, "systolic_blood_pressure_sbp" int, "c_peptide_level" float, "hemoglobin_a1c_hba1c" float, "peak_stimulated_c_peptide" float, "diastolic_blood_pressure_dbp" int, "mixed_meal_tolerance_test_mmtt" bool, "vitamin_d" int, "NOUSE" f...
SELECT * FROM table_train_172 WHERE vitamin_d < 32
### Instruction: CREATE TABLE table_name_94 ( model VARCHAR, engine_make_capacity VARCHAR, gcm__kg__technical_capacity VARCHAR, gvm__kg__technical_capacity VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Model has a GCM (kg) Technical Capacity o...
SELECT model FROM table_name_94 WHERE gcm__kg__technical_capacity = "35000" AND gvm__kg__technical_capacity = "16000" AND engine_make_capacity = "cummins interact 6.0-euro iii (turbo intercooler)"
### Instruction: CREATE TABLE table_79673 ( "Rank" real, "Name" text, "Tenure" text, "Leagues" text, "Attempts" real, "Completions" real, "Comp %" real, "Touchdowns" real, "Interceptions" real, "Yardage" real, "QB Rating" real ) -- Using valid SQLite, answer the following q...
SELECT MIN("Comp %") FROM table_79673 WHERE "Yardage" < '44,611' AND "Touchdowns" > '254' AND "Rank" > '24'
### 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, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY AVG(Revenue) DESC
### Instruction: CREATE TABLE table_203_385 ( id number, "material" text, "formula" text, "refractive\nindex(es)\n589.3 nm" text, "dispersion\n431 - 687 nm" number, "hardness\n(mohs'\nscale)" text, "density\n(g/cm3)" text, "thermal\ncond." text, "state of\nthe art" text ) -- Using ...
SELECT "material" FROM table_203_385 WHERE NOT "thermal\ncond." IS NULL AND "thermal\ncond." <> 'excellent' AND "thermal\ncond." <> 'poor'
### Instruction: CREATE TABLE people ( People_ID int, Name text, Age real, Height real, Hometown text ) CREATE TABLE gymnast ( Gymnast_ID int, Floor_Exercise_Points real, Pommel_Horse_Points real, Rings_Points real, Vault_Points real, Parallel_Bars_Points real, Horizonta...
SELECT Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown ORDER BY Hometown
### Instruction: CREATE TABLE branch ( Branch_ID int, Name text, Open_year text, Address_road text, City text, membership_amount text ) CREATE TABLE member ( Member_ID int, Card_Number text, Name text, Hometown text, Level int ) CREATE TABLE membership_register_branch ( ...
SELECT Hometown, COUNT(Hometown) FROM member GROUP BY Hometown ORDER BY Hometown
### 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 surgery = 1 OR (trauma = 1 AND bleeding > 500)
### Instruction: CREATE TABLE table_test_18 ( "id" int, "bleeding" int, "dialysis" bool, "hct" int, "hepatic_disease" bool, "anaemia" bool, "creatinine_clearance_cl" float, "polycytaemia" bool, "thrombocytopenia" float, "kidney_disease" bool, "body_mass_index_bmi" float, ...
SELECT * FROM table_test_18 WHERE thrombocytopenia < 100000
### Instruction: CREATE TABLE table_dev_8 ( "id" int, "systolic_blood_pressure_sbp" int, "heart_disease" bool, "diastolic_blood_pressure_dbp" int, "coronary_artery_disease_cad" bool, "triglyceride_tg" float, "hypertension" bool, "NOUSE" float ) -- Using valid SQLite, answer the followi...
SELECT * FROM table_dev_8 WHERE hypertension = 1 OR systolic_blood_pressure_sbp > 160 OR diastolic_blood_pressure_dbp > 100
### Instruction: CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text ) CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int ) CREATE TABLE editor ( Editor_ID int, Name text, Age real ) -- Using valid SQLite, answer the following q...
SELECT Name, COUNT(Name) FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID WHERE T3.Sales > 3000 GROUP BY Name ORDER BY Name DESC
### Instruction: CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS ...
SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' ORDER BY state DESC
### Instruction: CREATE TABLE manufacturer ( Manufacturer_ID int, Open_Year real, Name text, Num_of_Factories int, Num_of_Shops int ) CREATE TABLE furniture_manufacte ( Manufacturer_ID int, Furniture_ID int, Price_in_Dollar real ) CREATE TABLE furniture ( Furniture_ID int, Name...
SELECT Name, COUNT(*) FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.Manufacturer_ID = t2.Manufacturer_ID GROUP BY t1.Manufacturer_ID
### Instruction: CREATE TABLE party ( party_id number, year number, party text, governor text, lieutenant_governor text, comptroller text, attorney_general text, us_senate text ) CREATE TABLE county ( county_id number, county_name text, population number, zip_code text )...
SELECT T2.party FROM election AS T1 JOIN party AS T2 ON T1.party = T2.party_id GROUP BY T1.party ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE activity ( actid number, activity_name text ) CREATE TABLE participates_in ( stuid number, actid number ) CRE...
SELECT rank, fname, lname FROM faculty
### Instruction: CREATE TABLE party ( party_id number, minister text, took_office text, left_office text, region_id number, party_name text ) CREATE TABLE region ( region_id number, region_name text, date text, label text, format text, catalogue text ) CREATE TABLE memb...
SELECT minister, party_name FROM party ORDER BY took_office DESC
### Instruction: CREATE TABLE table_65584 ( "Party" text, "Burnley" real, "Chorley" real, "Fylde" real, "Hyndburn" real, "Lancaster" real, "Pendle" real, "Preston" real, "Ribble Valley" real, "Rossendale" real, "South Ribble" real, "West Lancashire" real, "Wyre" real,...
SELECT SUM("Burnley") FROM table_65584 WHERE "Fylde" < '1' AND "Rossendale" > '0'
### Instruction: CREATE TABLE table_19989 ( "Condition/Parameter" text, "Coordinate velocity v dx/dt in units of c" text, "Velocity angle \u03b7 in i-radians" text, "Proper velocity w dx/d\u03c4 in units of c" text, "Lorentz factor \u03b3 dt/d\u03c4 = E/mc 2" text ) -- Using valid SQLite, answer t...
SELECT "Condition/Parameter" FROM table_19989 WHERE "Velocity angle \u03b7 in i-radians" = 'ln[(1 + √5)/2] ≅ 0.481'
### Instruction: CREATE TABLE instruments ( songid number, bandmateid number, instrument text ) CREATE TABLE band ( id number, firstname text, lastname text ) CREATE TABLE tracklists ( albumid number, position number, songid number ) CREATE TABLE albums ( aid number, title...
SELECT COUNT(*) FROM instruments WHERE instrument = "drums"
### Instruction: CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_hosts int ) CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge bool ) CREATE TABLE host ( Host_ID int, Name text, National...
SELECT Last_year, COUNT(Last_year) FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology" GROUP BY Last_year ORDER BY COUNT(Last_year) DESC
### Instruction: CREATE TABLE broadcast_share ( channel_id number, program_id number, date text, share_in_percent number ) CREATE TABLE program ( program_id number, name text, origin text, launch number, owner text ) CREATE TABLE channel ( channel_id number, name text, ...
SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Morning'
### Instruction: CREATE TABLE film ( film_id number, rank_in_series number, number_in_season number, title text, directed_by text, original_air_date text, production_code text ) CREATE TABLE schedule ( cinema_id number, film_id number, date text, show_times_per_day number, ...
SELECT location FROM cinema WHERE openning_year = 2010 INTERSECT SELECT location FROM cinema WHERE openning_year = 2011
### Instruction: 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 number, city_code text ) CREATE TABLE sportsinfo ( stuid number, sportname te...
SELECT stuid FROM sportsinfo GROUP BY stuid HAVING SUM(hoursperweek) > 10
### Instruction: CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance 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 ORDER BY Date DESC
### Instruction: CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season ...
SELECT School_ID, ACC_Percent FROM basketball_match
### Instruction: CREATE TABLE airports ( apid number, name text, city text, country text, x number, y number, elevation number, iata text, icao text ) CREATE TABLE airlines ( alid number, name text, iata text, icao text, callsign text, country text, activ...
SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina'
### Instruction: CREATE TABLE table_75897 ( "Team" text, "Year 2007" real, "Year 2006" real, "Year 2005" real, "Change 06/07" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Team, when the Year 2007 is greater than 15,710, when the Year 2...
SELECT "Team" FROM table_75897 WHERE "Year 2007" > '15,710' AND "Year 2006" > '17,666' AND "Year 2005" > '22,532'
### Instruction: CREATE TABLE table_45711 ( "Year" real, "Games played" real, "Games won" real, "Games drawn" real, "Games lost" real, "Points for" real, "Points against" real, "Points difference" real, "Bonus points" real, "Table points" real ) -- Using valid SQLite, answer th...
SELECT COUNT("Games won") FROM table_45711 WHERE "Bonus points" > '1' AND "Points difference" < '50' AND "Points against" = '106' AND "Points for" < '152'
### 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.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter
### Instruction: CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, value_points real, quality_rank int ) CREATE TABLE repa...
SELECT Team, COUNT(*) FROM technician GROUP BY Team ORDER BY COUNT(*)
### Instruction: CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, ...
SELECT Work_Type, AVG(Years_working) FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_ID = t2.journalist_ID GROUP BY t2.Work_Type ORDER BY AVG(Years_working)
### Instruction: CREATE TABLE broadcast ( Channel_ID int, Program_ID int, Time_of_day text ) CREATE TABLE broadcast_share ( Channel_ID int, Program_ID int, Date text, Share_in_percent real ) CREATE TABLE program ( Program_ID int, Name text, Origin text, Launch real, Own...
SELECT Time_of_day, COUNT(*) FROM broadcast GROUP BY Time_of_day ORDER BY Time_of_day DESC
### Instruction: CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, value_points real, quality_rank int ) CREATE TABLE repa...
SELECT Team, COUNT(*) FROM technician GROUP BY Team ORDER BY Team
### Instruction: CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE univ...
SELECT School_ID, ACC_Percent FROM basketball_match
### 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.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter DESC
### Instruction: CREATE TABLE table_train_47 ( "id" int, "bone_marrow_transplant" bool, "organ_transplantation" bool, "allergy_to_calcitriol" bool, "serum_calcium" float, "taking_vitamin_d" bool, "intention_to_central_venous_catheter" bool, "sarcoidosis" bool, "metabolic_bone_disease...
SELECT * FROM table_train_47 WHERE intention_to_central_venous_catheter = 1
### Instruction: CREATE TABLE table_12153 ( "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("Losses") FROM table_12153 WHERE "Goals against" > '31' AND "Goals for" = '38' AND "Club" = 'cf calvo sotelo' AND "Played" < '30'
### Instruction: CREATE TABLE tracklists ( albumid number, position number, songid number ) CREATE TABLE vocals ( songid number, bandmate number, type text ) CREATE TABLE songs ( songid number, title text ) CREATE TABLE performance ( songid number, bandmate number, stagepo...
SELECT * FROM albums WHERE year = 2010
### Instruction: CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType 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 Has_Allergy (...
SELECT Fname, AVG(Age) FROM Student WHERE Sex = 'F' GROUP BY Fname ORDER BY AVG(Age) DESC
### Instruction: CREATE TABLE mountain ( id number, name text, height number, prominence number, range text, country text ) CREATE TABLE photos ( id number, camera_lens_id number, mountain_id number, color text, name text ) CREATE TABLE camera_lens ( id number, bran...
SELECT COUNT(DISTINCT T2.camera_lens_id) FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id WHERE T1.country = 'Ethiopia'
### Instruction: CREATE TABLE member ( Member_ID int, Card_Number text, Name text, Hometown text, Level int ) CREATE TABLE purchase ( Member_ID int, Branch_ID text, Year text, Total_pounds real ) CREATE TABLE branch ( Branch_ID int, Name text, Open_year text, Addres...
SELECT Hometown, COUNT(Hometown) FROM member GROUP BY Hometown ORDER BY COUNT(Hometown)
### Instruction: CREATE TABLE table_train_151 ( "id" int, "gender" string, "renal_disease" bool, "estimated_glomerular_filtration_rate_egfr" int, "fasting_c_peptide" float, "stenosis_of_coronary" int, "serum_creatinine" float, "esrd" bool, "age" float, "NOUSE" float ) -- Using ...
SELECT * FROM table_train_151 WHERE fasting_c_peptide < 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 Headquarter, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter
### Instruction: CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge bool ) CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_hosts int ) CREATE TABLE host ( Host_ID int, Name text, National...
SELECT Last_year, COUNT(Last_year) FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology" GROUP BY Last_year ORDER BY COUNT(Last_year)
### Instruction: CREATE TABLE table_14089 ( "Year(s)" real, "Tournament or series" text, "Played in" text, "Games played ( Tests )" text, "Games won ( Tests )" text, "Games lost ( Tests )" text, "Games drawn ( Tests )" text, "Points for ( Tests )" text, "Points against ( Tests )" tex...
SELECT "Tournament or series" FROM table_14089 WHERE "Played in" = 'england' AND "Games played ( Tests )" = '4' AND "Points for ( Tests )" = '121'
### 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, COUNT(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid ORDER BY COUNT(*)
### Instruction: CREATE TABLE table_55666 ( "Tournament" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text ) -- Using valid SQLite, answer...
SELECT "2007" FROM table_55666 WHERE "2010" = 'olympic games'
### Instruction: CREATE TABLE table_79594 ( "Rank" real, "Total Population (2010)" real, "Indian American Population (2010)" real, "% Indian American" real, "Asian American Population (2010)" real, "% Asian American" real ) -- Using valid SQLite, answer the following questions for the tables p...
SELECT SUM("Total Population (2010)") FROM table_79594 WHERE "Asian American Population (2010)" < '60,072' AND "Indian American Population (2010)" > '14,696' AND "% Indian American" = '4.2'
### Instruction: CREATE TABLE table_17785 ( "Day" text, "Sunday Surya (the Sun)" text, "Monday Soma (the Moon)" text, "Tuesday Mangala (Mars)" text, "Wednesday Budha (Mercury)" text, "Thursday Guru (Jupiter)" text, "Friday Shukra (Venus)" text, "Saturday Shani (Saturn)" text ) -- Using...
SELECT "Tuesday Mangala (Mars)" FROM table_17785 WHERE "Saturday Shani (Saturn)" = 'සෙනසුරාදා Senasuraadaa'
### 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.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code DESC
### Instruction: CREATE TABLE table_8284 ( "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("FAC / LC G") FROM table_8284 WHERE "CL G" < '2' AND "Total Apps" < '5' AND "UEFA YC" > '0'
### 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 MAX(Price), MAX(Score) FROM wine GROUP BY MAX(Price)
### Instruction: CREATE TABLE table_52015 ( "D 40 \u221a" text, "D 41 \u221a" text, "D 42 \u221a" text, "D 43 \u221a" text, "D 44 \u221a" text, "D 45 O" text, "D 46 O" text, "R 53 +" text, "R 52 +" text, "R 51 +" text ) -- Using valid SQLite, answer the following questions for ...
SELECT "D 45 O" FROM table_52015 WHERE "R 51 +" = 'd 30'
### Instruction: CREATE TABLE table_22665 ( "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 "Country/Territory" FROM table_22665 WHERE "Story no." = '032' AND "Missing episodes with recovered footage" = 'Episode 4'
### Instruction: CREATE TABLE table_7417 ( "Administrative Panel" real, "Agricultural Panel" real, "Cultural and Educational Panel" real, "Industrial and Commercial Panel" real, "Labour Panel" real, "National University of Ireland" real, "University of Dublin" real, "Nominated by the Tao...
SELECT SUM("Cultural and Educational Panel") FROM table_7417 WHERE "Labour Panel" < '7' AND "Agricultural Panel" < '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 Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY COUNT(Headquarter) DESC
### Instruction: CREATE TABLE fires ( fire_year number, discovery_date number, discovery_doy number, discovery_time text, stat_cause_code number, stat_cause_descr text, cont_date text, cont_doy text, cont_time text, fire_size number, fire_size_class text, latitude number,...
SELECT AVG(discovery_date) FROM fires WHERE fire_year BETWEEN 2000 AND 2004
### 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 Headquarter, T1.Name ORDER BY T2.Revenue DESC
### Instruction: CREATE TABLE table_42565 ( "1861" real, "1866" real, "1872" real, "1876" real, "1881" real, "1886" real, "1891" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of 1872(s), when 1866 is greater than 856, when 1...
SELECT SUM("1872") FROM table_42565 WHERE "1866" > '856' AND "1861" > '1906' AND "1876" > '1990'
### Instruction: CREATE TABLE table_11001 ( "1910" real, "1920" real, "1930" real, "1940" real, "1950" real, "1960" real, "1970" real, "1980" real, "1990" real, "2000" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the mi...
SELECT MIN("1930") FROM table_11001 WHERE "1990" = '6,883' AND "1920" > '6,215'
### Instruction: CREATE TABLE station_company ( station_id number, company_id number, rank_of_the_year number ) CREATE TABLE gas_station ( station_id number, open_year number, location text, manager_name text, vice_manager_name text, representative_name text ) CREATE TABLE company ...
SELECT headquarters FROM company WHERE main_industry = 'Banking' GROUP BY headquarters HAVING COUNT(*) >= 2
### 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 airports ( apid number, name text, city text, country text, x number, y number, elevation n...
SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina'
### Instruction: CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season ...
SELECT All_Games, All_Games_Percent FROM basketball_match
### Instruction: CREATE TABLE table_dev_13 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "heart_disease" bool, "dyslipidemia" bool, "allergy_to_egg" bool, "high_density_lipoprotein_cholesterol_hdl_c" int, "hba1c" float, "coronary_artery_disease_cad" bool, "fasting_t...
SELECT * FROM table_dev_13 WHERE heart_disease = 1 OR coronary_artery_disease_cad = 1
### Instruction: CREATE TABLE activity ( actid number, activity_name text ) CREATE TABLE faculty ( facid number, lname text, fname text, rank text, sex text, phone number, room text, building text ) CREATE TABLE faculty_participates_in ( facid number, actid number ) CR...
SELECT facid FROM faculty WHERE sex = 'M'
### Instruction: CREATE TABLE people ( People_ID int, Name text, Age real, Height real, Hometown text ) CREATE TABLE gymnast ( Gymnast_ID int, Floor_Exercise_Points real, Pommel_Horse_Points real, Rings_Points real, Vault_Points real, Parallel_Bars_Points real, Horizonta...
SELECT Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown ORDER BY Hometown
### 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 Year, MAX(Price) FROM wine GROUP BY Year ORDER BY Year 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, T2.Revenue 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_train_173 ( "id" int, "hiv_infection" bool, "hemoglobin_a1c_hba1c" float, "hepatitis_c" bool, "hepatitis_b" bool, "cirrhosis" bool, "renal_disease" bool, "hepatic_disease" bool, "allergy_to_egg" bool, "estimated_glomerular_filtration_rate_egfr"...
SELECT * FROM table_train_173 WHERE hepatic_disease = 1 OR cirrhosis = 1
### Instruction: CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE univ...
SELECT Team_ID, ACC_Percent FROM basketball_match
### Instruction: CREATE TABLE table_train_259 ( "id" int, "systolic_blood_pressure_sbp" int, "hiv_infection" bool, "hemoglobin_a1c_hba1c" float, "hearing_problem" bool, "heart_disease" bool, "high_blood_pressure" bool, "diabetic" string, "immune_deficiency_disorder" bool, "visual...
SELECT * FROM table_train_259 WHERE visual_impairment = 1 OR hearing_problem = 1
### Instruction: CREATE TABLE table_7152 ( "Event" text, "2006\u201307" text, "2007\u201308" text, "2008\u201309" text, "2009\u201310" text, "2010\u201311" text, "2011\u201312" text, "2012\u201313" text ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT "2008\u201309" FROM table_7152 WHERE "Event" = 'autumn gold'
### Instruction: CREATE TABLE gas_station ( station_id number, open_year number, location text, manager_name text, vice_manager_name text, representative_name text ) CREATE TABLE company ( company_id number, rank number, company text, headquarters text, main_industry text, ...
SELECT station_id, location, manager_name FROM gas_station ORDER BY open_year
### Instruction: CREATE TABLE table_65922 ( "Rank" real, "Lane" real, "Athlete" text, "Nationality" text, "Time" real, "React" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Lane has a Rank larger than 3, and a Time larger than 45.63, and ...
SELECT MAX("Lane") FROM table_65922 WHERE "Rank" > '3' AND "Time" > '45.63' AND "React" < '0.28800000000000003' AND "Athlete" = 'geiner mosquera'
### Instruction: CREATE TABLE table_55667 ( "Tournament" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text ) -- Using valid SQLite, answer...
SELECT "2004" FROM table_55667 WHERE "2012" = '21'
### Instruction: CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text ) ...
SELECT Home_team, COUNT(Home_team) FROM game GROUP BY Away_team, Home_team
### Instruction: CREATE TABLE performance ( songid number, bandmate number, stageposition text ) CREATE TABLE vocals ( songid number, bandmate number, type text ) CREATE TABLE band ( id number, firstname text, lastname text ) CREATE TABLE songs ( songid number, title text ...
SELECT label FROM albums GROUP BY label ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, ...
SELECT Work_Type, AVG(Years_working) FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_ID = t2.journalist_ID GROUP BY t2.Work_Type ORDER BY AVG(Years_working)
### Instruction: CREATE TABLE enzyme ( id int, name text, Location text, Product text, Chromosome text, OMIM int, Porphyria text ) CREATE TABLE medicine_enzyme_interaction ( enzyme_id int, medicine_id int, interaction_type text ) CREATE TABLE medicine ( id int, name tex...
SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY Trade_Name DESC
### Instruction: CREATE TABLE organizations ( uk_vat_number INTEGER ) CREATE TABLE individuals ( individual_last_name VARCHAR, individual_id VARCHAR ) CREATE TABLE organization_contact_individuals ( organization_id VARCHAR, individual_id VARCHAR, date_contact_to VARCHAR ) -- Using valid SQLi...
SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.uk_vat_number = (SELECT MAX(uk_vat_number) FROM organizations) ORDER BY t2.date_contact_to LIMIT 1
### Instruction: CREATE TABLE table_21911 ( "Rank" real, "Family" text, "Abbre\u00adviation" text, "Constellation" text, "Area (sq.deg.)" text, "Area (msr)" text, "Per\u00adcent\u00adage" text, "Right ascension (hm)" text, "Decli\u00adnation (dm)" text, "Quad" text ) -- Using v...
SELECT "Per\u00adcent\u00adage" FROM table_21911 WHERE "Area (sq.deg.)" = '248.885'