instruction
stringlengths
212
6.3k
output
stringlengths
6
2.03k
### 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 LName, COUNT(LName) FROM Student WHERE NOT StuID IN (SELECT T1.StuID FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.AllergyType = "food") GROUP BY LName
### Instruction: CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Participants ( ...
SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details ORDER BY T1.Event_Details
### Instruction: CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTE...
SELECT County, COUNT(County) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation GROUP BY County ORDER BY County
### 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 ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road DESC
### Instruction: CREATE TABLE table_203_530 ( id number, "country" text, "gdp (usd bln, 2012)" number, "gdp (usd bln, 2017)" number, "gdp (usd ppp bln, 2012)" number, "gdp (usd ppp bln, 2017)" number, "per capita (usd, 2012)" number, "per capita (usd, 2017)" number, "per capita (usd ...
SELECT "country" FROM table_203_530 ORDER BY "per capita (usd, 2012)" LIMIT 1
### Instruction: CREATE TABLE table_8667 ( "Province" text, "Capital" text, "Population at 2010 Census" real, "Area (km\u00b2)" real, "Density (2010)" real, "Geographical unit" text, "Number of Cities (kota)" real, "Number of Regencies (kabupaten)" real, "Number of Districts (kecamat...
SELECT AVG("Number of Regencies (kabupaten)") FROM table_8667 WHERE "Villages" > '331' AND "Population at 2010 Census" = '12,982,204'
### Instruction: CREATE TABLE table_41568 ( "Year" real, "January" real, "February" real, "March" real, "April" real, "June" real, "July" real, "August" real, "September" real, "October" real, "November" real, "December" real, "Annual Additions(in millions)" real, ...
SELECT SUM("December") FROM table_41568 WHERE "July" = '0.36' AND "February" > '0.35000000000000003'
### Instruction: CREATE TABLE table_10345 ( "D 50 \u221a" text, "D 49 \u221a" text, "D 48 \u221a" text, "D 47 \u221a" text, "D 46 \u221a" text, "D 45 \u221a" text, "D 44 \u221a" text, "D 43 \u221a" text, "D 42 \u221a" text, "D 41 \u221a" text ) -- Using valid SQLite, answer the...
SELECT "D 46 \u221a" FROM table_10345 WHERE "D 50 \u221a" = 'd 50 √'
### Instruction: CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) CREATE TABLE party ( Party_ID int, Minister text, Took_office text, Left_office text, Region_ID int, Party_name text ) CREATE TABLE region ( Region_ID int, ...
SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY Party_name
### Instruction: CREATE TABLE plays_games ( stuid number, gameid number, hours_played number ) 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, s...
SELECT gname FROM plays_games AS T1 JOIN video_games AS T2 ON T1.gameid = T2.gameid JOIN student AS T3 ON T3.stuid = T1.stuid WHERE T3.lname = "Smith" AND T3.fname = "Linda"
### Instruction: CREATE TABLE Institution ( Institution_id text, Institution text, Location text, Founded real, Type text, Enrollment int, Team text, Primary_Conference text, building_id text ) CREATE TABLE building ( building_id text, Name text, Street_address text, ...
SELECT Type, SUM(Enrollment) FROM Institution GROUP BY Type ORDER BY SUM(Enrollment) DESC
### Instruction: CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptr...
SELECT T2.Party, AVG(COUNT(*)) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY AVG(COUNT(*)) DESC
### Instruction: CREATE TABLE product ( product_id number, product text, dimensions text, dpi number, pages_per_minute_color number, max_page_size text, interface text ) CREATE TABLE store ( store_id number, store_name text, type text, area_size number, number_of_product...
SELECT SUM(city_population) FROM district ORDER BY city_area DESC LIMIT 3
### Instruction: CREATE TABLE table_70544 ( "Production year" text, "2001" real, "2002" real, "2003" real, "2004" real, "2005" real, "2006" real, "2007" real, "2008" real, "2009" real, "2010" real, "2011" real ) -- Using valid SQLite, answer the following questions for ...
SELECT AVG("2002") FROM table_70544 WHERE "2010" < '5587' AND "Production year" = 'sunflower' AND "2007" > '546'
### Instruction: CREATE TABLE table_32082 ( "All Children ('000s)" real, "Economically Active Children ('000s)" real, "Economically Active Children (%)" real, "Child Labour ('000s)" real, "Child Labour (%)" real, "Children In Hazardous Work ('000s)" real, "Children In Hazardous Work (%)" rea...
SELECT MIN("All Children ('000s)") FROM table_32082 WHERE "Child Labour (%)" > '15.2' AND "Economically Active Children (%)" < '23.4' AND "Economically Active Children ('000s)" = '210,800'
### Instruction: CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 r...
SELECT meter_600, ID FROM swimmer ORDER BY ID DESC
### Instruction: CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL text, Team int ) CREATE TABLE match_season ( Season real, Player text, Position text, Country int, Team int, Draft_Pick_Number int, Dr...
SELECT Draft_Class, Draft_Pick_Number FROM match_season WHERE Position = "Defender" ORDER BY Draft_Pick_Number
### Instruction: CREATE TABLE school_performance ( School_Id int, School_Year text, Class_A text, Class_AA text ) CREATE TABLE school_details ( School_ID int, Nickname text, Colors text, League text, Class text, Division text ) CREATE TABLE school ( School_ID int, Schoo...
SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination
### 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_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY SUM(School_ID)
### Instruction: CREATE TABLE table_66191 ( "Celestial Stem" text, "Chinese Mandarin Pinyin" text, "Cantonese Jyutping" text, "Wuu Wuupin" text, "Japanese kunyomi" text, "Japanese on'yomi" text, "Korean ( RR )" text, "Manchu ( M\u00f6llendorff )" text, "Vietnamese" text, "Yin and...
SELECT "Japanese on'yomi" FROM table_66191 WHERE "Vietnamese" = 'mậu'
### Instruction: CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, me...
SELECT meter_500, ID FROM swimmer ORDER BY ID 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 All_Home, School_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY School_ID DESC
### Instruction: CREATE TABLE table_31524 ( "Economy" text, "1980" real, "Gap from Thailand as of 1980 (times)" text, "1985" real, "1990" real, "1995" real, "2000" real, "2005" real, "2010" real, "2012" real, "Gap from Thailand as of 2012 (times)" text, "GDP as of 2012 af...
SELECT MAX("2010") FROM table_31524 WHERE "Economy" = 'China'
### Instruction: CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Ye...
SELECT Country, COUNT(*) FROM stadium GROUP BY Country ORDER BY Country 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 ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY Team_ID
### Instruction: CREATE TABLE resultsdata15 ( sample_pk number, commod text, commtype text, lab text, pestcode text, testclass text, concen number, lod number, conunit text, confmethod text, confmethod2 text, annotate text, quantitate text, mean text, extract ...
SELECT MAX(extract) FROM resultsdata15
### Instruction: CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 t...
SELECT meter_400, ID FROM swimmer ORDER BY meter_400 DESC
### Instruction: CREATE TABLE region ( Region_ID int, Region_name text, Date text, Label text, Format text, Catalogue text ) CREATE TABLE member ( Member_ID int, Member_Name text, Party_ID text, In_office text ) CREATE TABLE party_events ( Event_ID int, Event_Name text,...
SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY Party_name DESC
### Instruction: CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_billion real, Profits_billion real, Assets_billion real, Mar...
SELECT Main_Industry, COUNT(Main_Industry) FROM company WHERE Headquarters <> 'USA' GROUP BY Main_Industry ORDER BY COUNT(Main_Industry)
### Instruction: CREATE TABLE table_47046 ( "Squad No." real, "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "FLT Apps" text, "FLT Goals" real, "Playoff Apps"...
SELECT SUM("Total Goals") FROM table_47046 WHERE "Playoff Apps" = '2' AND "FA Cup Apps" = '2' AND "League Cup Goals" < '0'
### Instruction: CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, Attorney_General text, US_Senate text ) CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE T...
SELECT Committee, COUNT(Committee) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Democratic" GROUP BY Committee ORDER BY Committee DESC
### Instruction: CREATE TABLE competition_result ( competition_id number, club_id_1 number, club_id_2 number, score text ) CREATE TABLE player ( player_id number, name text, position text, club_id number, apps number, tries number, goals text, points number ) CREATE TAB...
SELECT position FROM player GROUP BY name HAVING AVG(points) >= 20
### Instruction: CREATE TABLE table_35146 ( "Tournament" text, "1998" text, "2000" 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, "Career SR"...
SELECT "2012" FROM table_35146 WHERE "2007" = '0 / 4'
### Instruction: CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, ...
SELECT meter_300, ID FROM swimmer ORDER BY ID
### Instruction: CREATE TABLE gas_station ( Station_ID int, Open_Year int, Location text, Manager_Name text, Vice_Manager_Name text, Representative_Name text ) CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_bil...
SELECT Company, COUNT(*) FROM station_company AS T1 JOIN company AS T2 ON T1.Company_ID = T2.Company_ID GROUP BY T1.Company_ID ORDER BY Company
### Instruction: CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, Attorney_General text, US_Senate text ) CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE T...
SELECT T2.Party, SUM(COUNT(*)) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY SUM(COUNT(*))
### Instruction: CREATE TABLE match ( Match_ID int, Date text, Venue text, Score text, Result text, Competition text ) CREATE TABLE hosting_city ( Year int, Match_ID int, Host_City text ) CREATE TABLE city ( City_ID int, City text, Hanzi text, Hanyu_Pinyin text, ...
SELECT Venue, COUNT(Venue) FROM match GROUP BY Venue ORDER BY Date DESC
### Instruction: CREATE TABLE table_60570 ( "Measure" text, "Bombali" real, "Bonthe" real, "Kailahun" real, "Kambia" text, "Kenema" real, "Koinadugu" real, "Kono" real, "Moyamba" text, "Port Loko" text, "Pujehun" real, "Tonkolili" real ) -- Using valid SQLite, answer th...
SELECT MAX("Pujehun") FROM table_60570 WHERE "Kenema" > '559' AND "Kambia" = '45,653' AND "Tonkolili" > '113,926'
### Instruction: CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CR...
SELECT meter_300, ID FROM swimmer ORDER BY ID DESC
### Instruction: CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 r...
SELECT meter_400, ID FROM swimmer ORDER BY meter_400
### Instruction: 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 text ) CREATE TABLE song ( song_name text, artist_name text, country tex...
SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE "4:%" UNION SELECT song_name FROM song WHERE languages = "english"
### Instruction: CREATE TABLE investors ( investor_id number, investor_details text ) CREATE TABLE transactions ( transaction_id number, investor_id number, transaction_type_code text, date_of_transaction time, amount_of_transaction number, share_count text, other_details text ) CR...
SELECT MAX(amount_of_transaction) FROM transactions
### Instruction: CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE party ( ...
SELECT T2.Party, SUM(COUNT(*)) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY T2.Party DESC
### Instruction: CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTE...
SELECT Winery, COUNT(Winery) FROM wine WHERE Price > 100 GROUP BY Grape, Winery
### Instruction: CREATE TABLE budget ( school_id number, year number, budgeted number, total_budget_percent_budgeted number, invested number, total_budget_percent_invested number, budget_invested_percent text ) CREATE TABLE endowment ( endowment_id number, school_id number, dona...
SELECT SUM(T1.budgeted) FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Glenn'
### 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_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home
### 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_Home, SUM(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home
### Instruction: CREATE TABLE Companies ( id int, name text, Headquarters text, Industry text, Sales_billion real, Profits_billion real, Assets_billion real, Market_Value_billion text ) CREATE TABLE buildings ( id int, name text, City text, Height int, Stories int, ...
SELECT T2.name, COUNT(T2.name) FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T2.name ORDER BY T2.name 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 ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY School_ID DESC
### Instruction: CREATE TABLE district ( district_id number, district_name text, headquartered_city text, city_population number, city_area number ) CREATE TABLE store_product ( store_id number, product_id number ) CREATE TABLE store_district ( store_id number, district_id number )...
SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: CREATE TABLE table_203_834 ( id number, "rank" number, "census subdivision" text, "province" text, "type" text, "land area\n(km2, 2011)" number, "population 2011" number, "population 2006" number, "population 2001" number, "population 1996" number, "change in...
SELECT "census subdivision" FROM table_203_834 ORDER BY "change in % 2006-2011" DESC LIMIT 1
### Instruction: CREATE TABLE airport ( id int, City text, Country text, IATA text, ICAO text, name text ) CREATE TABLE flight ( id int, Vehicle_Flight_number text, Date text, Pilot text, Velocity real, Altitude real, airport_id int, company_id int ) CREATE TABL...
SELECT T1.name, T1.id FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id ORDER BY T1.id DESC
### 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 schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) ...
SELECT Date, SUM(Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Date ORDER BY SUM(Price)
### Instruction: CREATE TABLE table_train_59 ( "id" int, "bone_marrow_transplant" bool, "nephrolithiasis_history" bool, "taking_vitamin_c" bool, "immune_suppression" bool, "neutrophil_count" int, "monoclonal_antibodies_mab" int, "sepsis" bool, "glucose_6_phosphate_dehydrogenase_defic...
SELECT * FROM table_train_59 WHERE sepsis = 1 AND (immune_suppression = 1 OR monoclonal_antibodies_mab < 8000)
### Instruction: CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid number(9,0) ) CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE ...
SELECT destination, COUNT(destination) FROM flight WHERE price > 300 GROUP BY destination ORDER BY COUNT(destination) DESC
### Instruction: CREATE TABLE player ( player_id number, player text, team text, age number, position text, school_id number ) CREATE TABLE school_performance ( school_id number, school_year text, class_a text, class_aa text ) CREATE TABLE school_details ( school_id number,...
SELECT location FROM school WHERE NOT school_id IN (SELECT school_id FROM player)
### Instruction: CREATE TABLE country ( Country_id int, Country_name text, Capital text, Official_native_language text ) CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL text, Team int ) CREATE TABLE match_seaso...
SELECT Draft_Class, Draft_Pick_Number FROM match_season WHERE Position = "Defender" ORDER BY Draft_Class DESC
### Instruction: CREATE TABLE table_54081 ( "D 39 \u221a" text, "D 40 \u221a" text, "D 41 \u221a" text, "D 42 \u221a" text, "D 43 \u221a" text, "D 44 \u221a" text, "D 45 \u221a" text, "D 46 \u221a" text, "D 47 \u221a" text, "D 48 \u221a" text ) -- Using valid SQLite, answer the...
SELECT "D 40 \u221a" FROM table_54081 WHERE "D 43 \u221a" = 'd 14'
### Instruction: CREATE TABLE table_10347 ( "D 50 \u221a" text, "D 49 \u221a" text, "D 48 \u221a" text, "D 47 \u221a" text, "D 46 \u221a" text, "D 45 \u221a" text, "D 44 \u221a" text, "D 43 \u221a" text, "D 42 \u221a" text, "D 41 \u221a" text ) -- Using valid SQLite, answer the...
SELECT "D 44 \u221a" FROM table_10347 WHERE "D 46 \u221a" = 'r 26'
### Instruction: CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid num...
SELECT name, COUNT(*) FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid
### 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_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC
### Instruction: CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, ...
SELECT meter_600, ID FROM swimmer ORDER BY ID
### Instruction: CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 t...
SELECT Nationality, SUM(ID) FROM swimmer GROUP BY Nationality
### Instruction: CREATE TABLE protein ( common_name text, protein_name text, divergence_from_human_lineage real, accession_number text, sequence_length real, sequence_identity_to_human_protein text, Institution_id text ) CREATE TABLE building ( building_id text, Name text, Stree...
SELECT Type, COUNT(*) FROM Institution GROUP BY Type ORDER BY Type
### Instruction: CREATE TABLE member ( Member_ID int, Member_Name text, Party_ID text, In_office text ) CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) CREATE TABLE region ( Region_ID int, Region_name text, Date text, L...
SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY COUNT(*) DESC
### Instruction: CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABL...
SELECT gender, COUNT(*) FROM Dorm GROUP BY gender
### Instruction: CREATE TABLE sampledata15 ( sample_pk number, state text, year text, month text, day text, site text, commod text, source_id text, variety text, origin text, country text, disttype text, commtype text, claim text, quantity number, growst t...
SELECT MAX(country) FROM sampledata15
### Instruction: CREATE TABLE country ( country_id number, country_name text, capital text, official_native_language text ) CREATE TABLE match_season ( season number, player text, position text, country number, team number, draft_pick_number number, draft_class text, col...
SELECT COUNT(DISTINCT T1.college) FROM match_season AS T1 JOIN team AS T2 ON T1.team = T2.team_id WHERE T2.name = "Columbus Crew"
### Instruction: CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_ser...
SELECT Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_id = T2.technician_id GROUP BY T2.Name ORDER BY COUNT(*) DESC
### 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 participates_in ( stuid number, actid number ) CREATE TAB...
SELECT T1.facid FROM faculty AS T1 JOIN student AS T2 ON T1.facid = T2.advisor GROUP BY T1.facid HAVING COUNT(*) >= 2
### Instruction: CREATE TABLE table_name_99 ( tourism_receipts__2011___us INTEGER, tourism_receipts__2003___as__percentage_of_gdp_ VARCHAR, tourism_receipts__2011___us$_per_arrival_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest numbe...
SELECT MAX(tourism_receipts__2011___us) AS $_per_capita_ FROM table_name_99 WHERE tourism_receipts__2003___as__percentage_of_gdp_ = "19.4" AND tourism_receipts__2011___us$_per_arrival_ < 655
### Instruction: CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, ...
SELECT meter_500, ID FROM swimmer ORDER BY ID
### 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_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY Team_ID DESC
### Instruction: CREATE TABLE loan ( loan_ID varchar(3), loan_type varchar(15), cust_ID varchar(3), branch_ID varchar(3), amount int ) CREATE TABLE customer ( cust_ID varchar(3), cust_name varchar(20), acc_type char(1), acc_bal int, no_of_loans int, credit_score int, bra...
SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%' ORDER BY acc_bal
### Instruction: CREATE TABLE club ( Club_ID int, name text, Region text, Start_year text ) CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Score text ) CREATE TABLE club_rank ( Rank real, Club_ID int, Gold real, Silver real, Bron...
SELECT Competition_type, COUNT(Competition_type) FROM competition GROUP BY Competition_type
### Instruction: CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Ye...
SELECT meter_500, meter_100 FROM swimmer
### 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 ACC_Regular_Season, ACC_Percent FROM basketball_match ORDER BY ACC_Regular_Season
### 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_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY Team_ID DESC
### Instruction: CREATE TABLE table_5323 ( "Bullet weight gram (grain)" text, "8.23 g (127 gr)" real, "9.72 g (150 gr)" real, "11.34 g (175 gr)" real, "12.96 g (200 gr)" real, "14.26 g (220 gr)" real, "Case capacity (%)" real ) -- Using valid SQLite, answer the following questions for the ...
SELECT MIN("Case capacity (%)") FROM table_5323 WHERE "8.23 g (127 gr)" = '102.7' AND "9.72 g (150 gr)" < '102.7'
### Instruction: CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) 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, ...
SELECT Date, AVG(Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Date ORDER BY Date DESC
### Instruction: CREATE TABLE table_58616 ( "Rank 2014" real, "Rank 2013" real, "Mvmt" text, "Club" text, "Country" text, "2009\u201310" real, "2010\u201311" real, "2011\u201312" real, "2012\u201313" real, "2013\u201314" real, "Coeff." real ) -- Using valid SQLite, answer t...
SELECT AVG("Rank 2014") FROM table_58616 WHERE "2009\u201310" = '21.233'
### Instruction: CREATE TABLE table_203_510 ( id number, "township" text, "fips" number, "population\ncenter" text, "population" number, "population\ndensity\n(/mi2)" number, "population\ndensity\n(/km2)" number, "land area\n(mi2)" number, "land area\n(km2)" number, "water area\n...
SELECT "township" FROM table_203_510 WHERE "land area\n(mi2)" > (SELECT "land area\n(mi2)" FROM table_203_510 WHERE "township" = 'smyrna')
### Instruction: CREATE TABLE table_train_42 ( "id" int, "taking_vitamin_c" bool, "do_not_resuscitate_dnr" bool, "allergy_to_thiamine" bool, "taking_thiamine" bool, "receiving_vasopressor" bool, "sepsis" bool, "hypotension" bool, "allergy_to_vitamin_c" bool, "glucose_6_phosphate_...
SELECT * FROM table_train_42 WHERE allergy_to_vitamin_c = 1 OR allergy_to_thiamine = 1
### Instruction: CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE stadium ( ID int, name text, Capacity int, Ci...
SELECT Time, ID FROM swimmer ORDER BY Time 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 ACC_Road, Team_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY Team_ID
### Instruction: CREATE TABLE table_13613 ( "Model number" text, "sSpec number" text, "Frequency" text, "Turbo" text, "GPU frequency" text, "Cores" text, "L2 cache" text, "L3 cache" text, "I/O bus" text, "Mult." text, "Memory" text, "Voltage" text, "Socket" text, ...
SELECT "Voltage" FROM table_13613 WHERE "Cores" = '2' AND "Release date" = 'september 2010' AND "Turbo" = '5/8'
### 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 Name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.Branch_ID = T2.Branch_ID WHERE T1.Register_Year > 2015 GROUP BY T2.Branch_ID
### Instruction: CREATE TABLE Video_Games ( GameID INTEGER, GName VARCHAR(40), GType VARCHAR(40) ) 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 Pl...
SELECT AVG(Age), MIN(Age) FROM Student GROUP BY Major
### Instruction: CREATE TABLE table_train_104 ( "id" int, "migraines" bool, "depression" bool, "mini_mental_state_examination_mmse" int, "systolic_blood_pressure_sbp" int, "renal_disease" bool, "alzheimer" bool, "estimated_glomerular_filtration_rate_egfr" int, "diastolic_blood_pressu...
SELECT * FROM table_train_104 WHERE systolic_blood_pressure_sbp >= 160 OR diastolic_blood_pressure_dbp >= 100
### Instruction: CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_ID 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 repair ( repair_ID int...
SELECT Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_id = T2.technician_id GROUP BY T2.Name ORDER BY Name DESC
### Instruction: CREATE TABLE files ( f_id number, artist_name text, file_size text, duration text, formats text ) CREATE TABLE genre ( g_name text, rating text, most_popular_in text ) CREATE TABLE song ( song_name text, artist_name text, country text, f_id number, ...
SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE "4:%" UNION SELECT song_name FROM song WHERE languages = "english"
### 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_Home, SUM(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY SUM(Team_ID)
### Instruction: CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CR...
SELECT meter_300, meter_100 FROM swimmer
### Instruction: CREATE TABLE train ( Train_ID int, Train_Num text, Name text, From text, Arrival text, Railway_ID int ) CREATE TABLE railway_manage ( Railway_ID int, Manager_ID int, From_Year text ) CREATE TABLE railway ( Railway_ID int, Railway text, Builder text, ...
SELECT Country, COUNT(Country) FROM manager WHERE Age > 50 OR Age < 46 GROUP BY Country ORDER BY COUNT(Country) DESC
### Instruction: CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, Attorney_General text, US_Senate text ) CREATE T...
SELECT T2.Party, COUNT(T2.Party) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY T2.Party 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 ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY Team_ID DESC
### Instruction: CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255) ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Parti...
SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details ORDER BY T1.Event_ID DESC
### Instruction: CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) 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 ) ...
SELECT Name, AVG(Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Name ORDER BY AVG(Price)
### 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 ACC_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY ACC_Regular_Season
### Instruction: CREATE TABLE table_12244 ( "7:00 am" text, "8:00 am" text, "9:00 am" text, "11:00 am" text, "noon" text, "12:30 pm" text, "1:00 pm" text, "1:30 pm" text, "2:00 pm" text, "3:00 pm" text, "3:30 pm" text, "4:00 pm" text, "4:30 pm" text, "5:00 pm" tex...
SELECT "1:30 pm" FROM table_12244 WHERE "2:00 pm" = 'one life to live'