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 All_Road, School_ID FROM basketball_match ORDER BY School_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_Neutral, Team_ID FROM basketball_match ORDER BY All_Neutral
### Instruction: CREATE TABLE table_203_258 ( id number, "year" number, "team" text, "games" number, "combined tackles" number, "tackles" number, "assisted tackles" number, "sacks" number, "forced fumbles" number, "fumble recoveries" number, "fumble return yards" number, ...
SELECT "year" FROM table_203_258 WHERE "sacks" >= 15
### Instruction: 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_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Participants ( ...
SELECT Participant_Type_Code, COUNT(Participant_Type_Code) FROM Participants GROUP BY Participant_Type_Code ORDER BY Participant_Type_Code
### Instruction: CREATE TABLE table_70546 ( "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 SUM("2006") FROM table_70546 WHERE "2011" > '4113' AND "2008" < '7181'
### Instruction: CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) 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 appe...
SELECT Year, COUNT(Year) FROM wine ORDER BY COUNT(Year)
### 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, School_ID FROM basketball_match ORDER BY All_Neutral DESC
### Instruction: CREATE TABLE table_train_204 ( "id" int, "systolic_blood_pressure_sbp" int, "plasma_glucose_concentration" int, "fasting_plasma_glucose_fpg" float, "increase_risk_of_intervention" bool, "diastolic_blood_pressure_dbp" int, "life_span" bool, "body_mass_index_bmi" float, ...
SELECT * FROM table_train_204 WHERE systolic_blood_pressure_sbp > 180 OR diastolic_blood_pressure_dbp > 105
### 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_Road, School_ID FROM basketball_match ORDER BY All_Road DESC
### Instruction: CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE employee ( eid number(9,0), name varchar2(30), salary number(10,2) ) CREATE TABLE flight ( flno number(4,0...
SELECT destination, COUNT(destination) FROM flight GROUP BY destination ORDER BY COUNT(destination)
### Instruction: CREATE TABLE happy_hour_member ( hh_id number, member_id number, total_amount number ) CREATE TABLE shop ( shop_id number, address text, num_of_staff text, score number, open_year text ) CREATE TABLE member ( member_id number, name text, membership_card tex...
SELECT address FROM member WHERE age < 30 INTERSECT SELECT address FROM member WHERE age > 40
### Instruction: CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE faculty ( facid number, lname text, fname text, rank text, sex text, phone number, room text, b...
SELECT phone, room, building FROM faculty WHERE fname = "Jerry" AND lname = "Prince"
### Instruction: CREATE TABLE table_43250 ( "Tournament" 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 ) -- Using valid SQLite, answer...
SELECT "Tournament" FROM table_43250 WHERE "2001" = '1r' AND "2011" = 'a'
### 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 systolic_blood_pressure_sbp > 160 AND diastolic_blood_pressure_dbp > 100
### Instruction: CREATE TABLE flight ( id number, vehicle_flight_number text, date text, pilot text, velocity number, altitude number, airport_id number, company_id number ) CREATE TABLE operate_company ( id number, name text, type text, principal_activities text, in...
SELECT DISTINCT T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T2.velocity < 200
### Instruction: CREATE TABLE table_7150 ( "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_7150 WHERE "2009\u201310" = 'dnp'
### Instruction: CREATE TABLE happy_hour_member ( hh_id number, member_id number, total_amount number ) CREATE TABLE happy_hour ( hh_id number, shop_id number, month text, num_of_shaff_in_charge number ) CREATE TABLE member ( member_id number, name text, membership_card text, ...
SELECT name, member_id FROM member WHERE membership_card = 'Black' OR age < 30
### Instruction: CREATE TABLE table_70539 ( "Frame size" text, "Width" real, "Height" real, "Mpix" real, "Aspect Ratio" text, "Maximum fps" real, "Maximum fps HDRx" real, "least compression at 24 fps" text, "least compression at maximum fps" text ) -- Using valid SQLite, answer the...
SELECT "Maximum fps HDRx" FROM table_70539 WHERE "Height" > '1080' AND "least compression at 24 fps" = '6:1' AND "least compression at maximum fps" = '7:1'
### 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, AVG(MAX(Score)) FROM wine ORDER BY AVG(MAX(Score))
### 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
### Instruction: CREATE TABLE table_68367 ( "Year" real, "Population (Region total)" real, "Population (Maryborough)" real, "Population (Hervey Bay)" real, "Population (Woocoo)" real, "Population (Tiaro)" real ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT MIN("Year") FROM table_68367 WHERE "Population (Woocoo)" > '750' AND "Population (Region total)" > '74,210' AND "Population (Tiaro)" = '4,449' AND "Population (Maryborough)" < '24,465'
### 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 ORDER BY All_Road DESC
### Instruction: CREATE TABLE table_11251601_2 ( carbon_dioxide_emissions_per_year__10_6_tons___2006_ VARCHAR, carbon_dioxide_emissions_per_year__tons_per_person___2007_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT WAS THE AMOUNT OF CARBON DIOXIDE EMI...
SELECT carbon_dioxide_emissions_per_year__10_6_tons___2006_ FROM table_11251601_2 WHERE carbon_dioxide_emissions_per_year__tons_per_person___2007_ = "1.4"
### Instruction: CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE weekly_weather ( station_id int, ...
SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week ORDER BY day_of_week
### Instruction: CREATE TABLE table_58834 ( "7:00 am" text, "9:00 am" text, "10: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, "2:30 pm" text, "3:30 pm" text, "4:30 pm" text, "5:00 pm" text, "6:30 pm" te...
SELECT "6:30 pm" FROM table_58834 WHERE "2:00 pm" = 'local programs'
### Instruction: CREATE TABLE club ( club_id number, name text, region text, start_year text ) CREATE TABLE competition_result ( competition_id number, club_id_1 number, club_id_2 number, score text ) CREATE TABLE competition ( competition_id number, year number, competitio...
SELECT name FROM club ORDER BY start_year
### 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 County_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District GROUP BY T1.County_Id
### Instruction: CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code 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
### 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 stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CR...
SELECT meter_300, ID FROM swimmer
### 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
### Instruction: CREATE TABLE participates_in ( stuid number, actid number ) 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 TAB...
SELECT facid FROM faculty_participates_in INTERSECT SELECT advisor FROM student
### 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, All_Games_Percent FROM basketball_match GROUP BY All_Road
### 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 station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) CREATE TABLE company ( Company_I...
SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry ORDER BY Main_Industry
### Instruction: CREATE TABLE table_73313 ( "School District" text, "Headquarters" text, "Sector" text, "Enrollment (2011-12)" real, "Teachers (2008-09" real, "Student-Teacher ratio (2008-09)" text, "French enrollment (2011-12)" text, "Graduation rate (2011-12)" text, "Withdrawal rat...
SELECT "Withdrawal rate (2010-11)" FROM table_73313 WHERE "Graduation rate (2011-12)" = '89.3%'
### Instruction: CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state varchar(20) ) CREATE TABLE loan ( loan_ID varchar(3), loan_type varchar(15), cust_ID varchar(3), branch_ID varchar(3), amount int ) CREATE TABLE customer ( cu...
SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%'
### Instruction: CREATE TABLE table_27712 ( "User" text, "Unit (kWh)/Time range" text, "Tariff ( Rs. /kWh)" text, "Fixed Charge ( Rs. /kWh)" text, "Fuel Adjustment Charge (% of Total Energy Charge)" text, "Max. Demand Charge ( Rs. /kVA)" text ) -- Using valid SQLite, answer the following quest...
SELECT "User" FROM table_27712 WHERE "Max. Demand Charge ( Rs. /kVA)" = '1,100' AND "Unit (kWh)/Time range" = 'H-2: Off-peak (22:30-05:30)'
### 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_Percent, All_Games_Percent FROM basketball_match GROUP BY ACC_Home
### Instruction: CREATE TABLE happy_hour ( HH_ID int, Shop_ID int, Month text, Num_of_shaff_in_charge int ) CREATE TABLE shop ( Shop_ID int, Address text, Num_of_staff text, Score real, Open_Year text ) CREATE TABLE member ( Member_ID int, Name text, Membership_card tex...
SELECT Address, COUNT(*) FROM member GROUP BY Address ORDER BY COUNT(*) 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_Neutral, ACC_Percent FROM basketball_match ORDER BY ACC_Percent
### Instruction: CREATE TABLE member ( member_id number, member_name text, party_id text, in_office text ) CREATE TABLE region ( region_id number, region_name text, date text, label text, format text, catalogue text ) CREATE TABLE party_events ( event_id number, event_n...
SELECT T2.party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id
### Instruction: CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number, secretary_vote number, treasurer_vote number, class_president_vote number, class_senator_vote number ) CREATE TABLE student ( ...
SELECT DISTINCT T1.fname FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = T2.vice_president_vote EXCEPT SELECT DISTINCT fname FROM student WHERE city_code = "PIT"
### Instruction: CREATE TABLE table_44357 ( "Tournament" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "Career SR" text, "Career win-loss" text ...
SELECT "2001" FROM table_44357 WHERE "1996" = '0 / 2'
### Instruction: CREATE TABLE table_train_63 ( "id" int, "immune_suppression" bool, "leukocyte_count" int, "need_hemodialysis" bool, "head_injury" bool, "periodic_paralysis" bool, "renal_disease" bool, "glasgow_come_score_gcs" int, "sepsis" bool, "pancreatitis" bool, "enteral...
SELECT * FROM table_train_63 WHERE renal_disease = 1 AND (need_hemodialysis = 1 OR periodic_paralysis = 1)
### 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_Road, School_ID FROM basketball_match ORDER BY School_ID DESC
### Instruction: CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) 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_Det...
SELECT Event_Details, COUNT(Event_Details) FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY Event_Details
### Instruction: CREATE TABLE member ( Member_ID int, Member_Name text, Party_ID text, In_office text ) CREATE TABLE party ( Party_ID int, Minister text, Took_office text, Left_office text, Region_ID int, Party_name text ) CREATE TABLE party_events ( Event_ID int, Event...
SELECT Took_office, COUNT(Took_office) FROM party ORDER BY COUNT(Took_office) 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, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road
### Instruction: CREATE TABLE endowment ( endowment_id int, School_id int, donator_name text, amount real ) CREATE TABLE School ( School_id text, School_name text, Location text, Mascot text, Enrollment int, IHSAA_Class text, IHSAA_Football_Class text, County text ) CRE...
SELECT County, SUM(Enrollment) FROM School GROUP BY County ORDER BY SUM(Enrollment)
### 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_Games, Team_ID FROM basketball_match ORDER BY Team_ID DESC
### Instruction: CREATE TABLE basketball_match ( team_id number, school_id number, team_name text, acc_regular_season text, acc_percent text, acc_home text, acc_road text, all_games text, all_games_percent number, all_home text, all_road text, all_neutral text ) CREATE T...
SELECT t1.primary_conference FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t2.acc_percent LIMIT 1
### 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 meter_400, ID FROM swimmer
### Instruction: CREATE TABLE table_204_756 ( id number, "year" number, "team" text, "games" number, "combined tackles" number, "tackles" number, "assisted tackles" number, "sacks" number, "forced fumbles" number, "fumble recoveries" number, "fumble return yards" number, ...
SELECT COUNT("year") FROM table_204_756 WHERE "fumble recoveries" = 0
### Instruction: CREATE TABLE table_46113 ( "Model" text, "1998" text, "1999" 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 ) -- Using valid SQ...
SELECT "2005" FROM table_46113 WHERE "2006" = '126,511'
### Instruction: CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255) ) ...
SELECT Participant_Type_Code, COUNT(Participant_Type_Code) FROM Participants GROUP BY Participant_Type_Code ORDER BY Participant_Type_Code
### 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 appellations ( No INTEGER, Appelation TEXT, County TEXT, Sta...
SELECT Appelation, COUNT(Appelation) FROM wine WHERE Score > 93 GROUP BY Appelation ORDER BY Name
### Instruction: CREATE TABLE city ( city_id number, city text, hanzi text, hanyu_pinyin text, regional_population number, gdp number ) CREATE TABLE match ( match_id number, date text, venue text, score text, result text, competition text ) CREATE TABLE temperature ( ...
SELECT venue FROM match ORDER BY date DESC
### 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 Grape, COUNT(Grape) FROM wine WHERE Score > 93 GROUP BY Grape ORDER BY Name
### Instruction: CREATE TABLE table_52303 ( "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 following questions for...
SELECT "D 48 \u221a" FROM table_52303 WHERE "D 49 \u221a" = 'r 9'
### 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 ORDER BY AVG(MAX(Score))
### 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, ACC_Percent FROM basketball_match ORDER BY ACC_Percent
### 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 serum_calcium >= 10 OR phosphate > 6
### 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
### 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, SUM(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC
### Instruction: CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num_Employees real ) CREATE TABLE head ( head_ID int, name text, born_state text, age real ) CREATE TABLE management ( department_ID int, head_I...
SELECT Name, AVG(Num_Employees) FROM department AS T1 JOIN management AS T2 ON T1.department_ID = T2.department_ID WHERE T2.temporary_acting = 'Yes' GROUP BY Name ORDER BY AVG(Num_Employees)
### Instruction: CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departu...
SELECT origin, COUNT(*) FROM flight GROUP BY origin ORDER BY COUNT(*)
### Instruction: CREATE TABLE table_35586 ( "Year" text, "Seats in House" real, "Liberal candidates" real, "Seats won" real, "Seat Change" text, "Popular vote" real, "% of popular vote" text, "Result" text, "Liberal leader" text ) -- Using valid SQLite, answer the following questio...
SELECT COUNT("Liberal candidates") FROM table_35586 WHERE "Seats in House" < '245' AND "Popular vote" > '350,512' AND "Seats won" < '139' AND "Seat Change" = '+28'
### Instruction: CREATE TABLE railway_manage ( Railway_ID int, Manager_ID int, From_Year text ) CREATE TABLE manager ( Manager_ID int, Name text, Country text, Working_year_starts text, Age int, Level int ) CREATE TABLE train ( Train_ID int, Train_Num text, Name text, ...
SELECT Builder, COUNT(*) FROM railway GROUP BY Builder ORDER BY Builder
### Instruction: 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_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE TABLE repair ( repair_ID int...
SELECT Name, COUNT(Name) FROM technician WHERE Team <> "NYY" GROUP BY Name ORDER BY COUNT(Name)
### 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 GROUP BY Team_Name
### 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 Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY MAX(T1.Price) DESC
### 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, distance FROM aircraft ORDER BY distance
### 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
### Instruction: CREATE TABLE table_39110 ( "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, "2013" text...
SELECT "Tournament" FROM table_39110 WHERE "2001" = '2–4'
### Instruction: CREATE TABLE loan ( loan_id text, loan_type text, cust_id text, branch_id text, amount number ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, acc_bal number, no_of_loans number, credit_score number, branch_id number, state text...
SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY SUM(T2.amount) DESC LIMIT 1
### Instruction: CREATE TABLE operate_company ( id int, name text, Type text, Principal_activities text, Incorporated_in text, Group_Equity_Shareholding real ) CREATE TABLE flight ( id int, Vehicle_Flight_number text, Date text, Pilot text, Velocity real, Altitude real, ...
SELECT T1.name, T1.id FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id
### Instruction: CREATE TABLE affected_region ( region_id VARCHAR, storm_id VARCHAR ) CREATE TABLE storm ( Name VARCHAR, storm_id VARCHAR ) CREATE TABLE region ( region_id VARCHAR, Region_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- ...
SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.Region_name = 'Afghanistan' INTERSECT SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id...
### Instruction: CREATE TABLE manufacturer ( Manufacturer_ID int, Open_Year real, Name text, Num_of_Factories int, Num_of_Shops int ) CREATE TABLE furniture ( Furniture_ID int, Name text, Num_of_Component int, Market_Rate real ) CREATE TABLE furniture_manufacte ( Manufacturer_I...
SELECT Name, Price_in_Dollar FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID ORDER BY Price_in_Dollar 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 Team_Name, ACC_Percent FROM basketball_match ORDER BY Team_Name
### Instruction: CREATE TABLE table_36586 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What happened in the Men's double...
SELECT "Men's doubles" FROM table_36586 WHERE "Men's singles" = 'marco vasconcelos' AND "Year" > '2000' AND "Mixed doubles" = 'alexandre paixão filipa lamy' AND "Women's singles" = 'telma santos'
### Instruction: CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstNa...
SELECT Room, COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY COUNT(*)
### Instruction: CREATE TABLE table_test_11 ( "id" int, "left_ventricular_ejection_fraction_lvef" int, "systolic_blood_pressure_sbp" int, "tachycardia" int, "bradycardia" int, "renal_disease" bool, "allergy_to_aspirin" bool, "temperature" float, "creatinine_clearance_cl" float, "...
SELECT * FROM table_test_11 WHERE allergy_to_aspirin = 1
### 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_Road, ACC_Percent FROM basketball_match ORDER BY All_Road DESC
### Instruction: CREATE TABLE party_events ( event_id number, event_name text, party_id number, member_in_charge_id number ) CREATE TABLE region ( region_id number, region_name text, date text, label text, format text, catalogue text ) CREATE TABLE party ( party_id number, ...
SELECT T1.party_name, T2.region_name FROM party AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id
### Instruction: CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, value_points real, quality_rank int ) CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE repa...
SELECT Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_id = T2.technician_id GROUP BY T2.Name
### Instruction: CREATE TABLE table_66145 ( "Model number" text, "sSpec number" text, "Cores" text, "Frequency" text, "Turbo" text, "L2 cache" text, "L3 cache" text, "GPU model" text, "GPU frequency" text, "Socket" text, "I/O bus" text, "Release date" text, "Part numb...
SELECT "GPU frequency" FROM table_66145 WHERE "Release date" = 'june 2013' AND "sSpec number" = 'sr17l(c0)'
### 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 AllergyType, COUNT(*) FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy GROUP BY T2.AllergyType ORDER BY COUNT(*) DESC
### Instruction: CREATE TABLE table_19508 ( "Rank" real, "State" text, "Revenue (millions)" text, "Population" real, "Revenue per capita" text, "Spending (millions)" text, "Spending per capita" text, "Net contribution per capita" text, "Presidential majority 2000/2004" text, "Pre...
SELECT "Spending per capita" FROM table_19508 WHERE "Revenue per capita" = '$7,755'
### Instruction: CREATE TABLE shop ( Shop_ID int, Address text, Num_of_staff text, Score real, Open_Year text ) CREATE TABLE happy_hour ( HH_ID int, Shop_ID int, Month text, Num_of_shaff_in_charge int ) CREATE TABLE member ( Member_ID int, Name text, Membership_card tex...
SELECT Address, COUNT(*) FROM member GROUP BY Address ORDER BY Address
### Instruction: CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth 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" ORDER BY COUNT(Date_of_Birth)
### Instruction: CREATE TABLE table_12193 ( "Rank 2014" real, "Rank 2013" text, "2009\u201310" text, "2010\u201311" text, "2011\u201312" text, "2012\u201313" text, "2013\u201314" text, "Coeff." text, "Teams" text, "CL places" real, "EL places" real, "Total" real ) -- Us...
SELECT MAX("EL places") FROM table_12193 WHERE "Rank 2013" = '15'
### 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, School_ID FROM basketball_match ORDER BY School_ID DESC
### 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 AllergyType, COUNT(*) FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy GROUP BY T2.AllergyType ORDER BY AllergyType
### 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, All_Games_Percent FROM basketball_match GROUP BY All_Games
### Instruction: CREATE TABLE events ( event_id number, service_id number, event_details text ) CREATE TABLE services ( service_id number, service_type_code text ) CREATE TABLE participants_in_events ( event_id number, participant_id number ) CREATE TABLE participants ( participant_id...
SELECT T1.service_type_code FROM services AS T1 JOIN events AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Success' INTERSECT SELECT T1.service_type_code FROM services AS T1 JOIN events AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Fail'
### Instruction: CREATE TABLE table_23429 ( "Colt model no." text, "Military designation" text, "Barrel Length" text, "Barrel" text, "Handguard type" text, "Buttstock type" text, "Pistol grip type" text, "Lower receiver type" text, "Upper receiver type" text, "Rear sight type" te...
SELECT COUNT("Case deflector?") FROM table_23429 WHERE "Colt model no." = '646'
### Instruction: CREATE TABLE table_920 ( "Num" real, "Team" text, "W" real, "L" real, "PCT" text, "PF" real, "PA" real, "Last appearance" real, "Last championship" text, "HOME games" real, "Home wins" real, "Home losses" real, "Home Win Pct." text, "ROAD games" r...
SELECT "Home wins" FROM table_920 WHERE "Road Win Pct." = '.000' AND "ROAD games" > '3.0'
### Instruction: CREATE TABLE device ( Device_ID int, Device text, Carrier text, Package_Version text, Applications text, Software_Platform text ) CREATE TABLE stock ( Shop_ID int, Device_ID int, Quantity int ) CREATE TABLE shop ( Shop_ID int, Shop_Name text, Location t...
SELECT Shop_Name, COUNT(Shop_Name) FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID GROUP BY Shop_Name ORDER BY COUNT(Shop_Name)
### 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_Road, School_ID FROM basketball_match ORDER BY School_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 School_ID, ACC_Percent FROM basketball_match GROUP BY All_Neutral
### 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, All_Games_Percent FROM basketball_match GROUP BY ACC_Home