instruction
stringlengths
212
6.3k
output
stringlengths
6
2.03k
### 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 Years_Played, COUNT(Years_Played) FROM player GROUP BY Years_Played ORDER BY Years_Played
### 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, All_Games_Percent FROM basketball_match ORDER BY All_Road DESC
### Instruction: CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) 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 ...
SELECT Winery, COUNT(Winery) FROM wine WHERE Price > 100 GROUP BY Winery ORDER BY Winery DESC
### 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 name, meter_100 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_Games, All_Games_Percent FROM basketball_match ORDER BY All_Games DESC
### Instruction: CREATE TABLE table_2058 ( "Driver" text, "AAA (1902\u20131955)" real, "USAC (1956\u20131995)" real, "CART (1979\u20132003)" real, "Champ Car World Series (2004\u20132007)" real, "IZOD IndyCar Series (1996\u2013present)" real, "Combined Total" real ) -- Using valid SQLite, ...
SELECT MAX("Champ Car World Series (2004\u20132007)") FROM table_2058 WHERE "USAC (1956\u20131995)" = '2'
### 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 team ( Team_id int, Name text ) CREATE TABLE match_season ( Season real, Player text, Position text, Countr...
SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name
### Instruction: CREATE TABLE team ( Team_id int, Name text ) 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 player ( Player_ID int, Player text, Years_...
SELECT Years_Played, COUNT(Years_Played) FROM player GROUP BY Years_Played ORDER BY COUNT(Years_Played) DESC
### Instruction: CREATE TABLE table_64981 ( "Tournament" text, "1986" text, "1988" text, "1989" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text ) -- Using valid SQLite, answer...
SELECT "1986" FROM table_64981 WHERE "1991" = 'qf' AND "1998" = '3r'
### 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, ACC_Percent FROM basketball_match ORDER BY ACC_Percent DESC
### Instruction: CREATE TABLE table_42282 ( "Tournament" 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, "2012" text...
SELECT "2002" FROM table_42282 WHERE "2008" = 'career statistics'
### 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 All_Home DESC
### Instruction: CREATE TABLE table_58835 ( "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 "3:30 pm" FROM table_58835 WHERE "1:30 pm" = 'the bold and the beautiful'
### Instruction: CREATE TABLE table_203_532 ( id number, "rebounds" number, "off" number, "def" number, "player" text, "team" text, "date" text, "opponent" text, "score" text, "minutes played" text, "points" number, "assists" number, "steals" number, "blocks" numb...
SELECT (SELECT "minutes played" FROM table_203_532 WHERE "player" = 'charles oakley') > (SELECT "minutes played" FROM table_203_532 WHERE "player" = 'robert parish')
### Instruction: CREATE TABLE table_21155 ( "Player" text, "GP" real, "K. Ret." real, "KR Yds" real, "KR Avg." text, "KR TD" real, "KR LG" real, "P. Ret." real, "PR Yds" real, "PR Avg." text, "PR TD" real, "PR LG" real, "MFG Ret." real, "MFG Yds" real, "MFG Av...
SELECT COUNT("P. Ret.") FROM table_21155 WHERE "KR Avg." = '11.3'
### 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
### Instruction: CREATE TABLE table_12824 ( "Rank" real, "Family" text, "Abbre\u00adviation" text, "Constellation" text, "Area (sq.deg.)" real, "Area (msr)" real, "Per\u00adcent\u00adage" text, "Right ascension (hm)" real, "Decli\u00adnation (dm)" text, "Quad" text ) -- Using v...
SELECT MAX("Area (msr)") FROM table_12824 WHERE "Area (sq.deg.)" < '291.045' AND "Family" = 'per' AND "Rank" > '78'
### Instruction: CREATE TABLE table_16629 ( "Crew" real, "Open 1st VIII" text, "Open 2nd VIII" text, "Open 3rd VIII" text, "U16 1st VIII" text, "U16 2nd VIII" text, "U16 3rd VIII" text, "U15 1st IV" text, "U15 2nd IV" text, "U15 3rd IV" text, "U15 4th IV" text, "U15 5th I...
SELECT COUNT("Open 2nd VIII") FROM table_16629 WHERE "U15 3rd IV" = 'GT'
### Instruction: CREATE TABLE table_dev_54 ( "id" int, "ogtt" int, "anemia" bool, "gender" string, "c_peptide_level" float, "hemoglobin_a1c_hba1c" float, "hematocrit_hct" float, "body_mass_index_bmi" float, "igt" bool, "fasting_glucose" int, "age" float, "NOUSE" float ) ...
SELECT * FROM table_dev_54 WHERE (hemoglobin_a1c_hba1c < 12 AND gender = 'male') OR (hemoglobin_a1c_hba1c < 11 AND gender = 'female')
### 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 cinema ( cinema_id number, name text, openning_year number, capacity number, loc...
SELECT T3.name, T2.title, T1.date, T1.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
### Instruction: CREATE TABLE building ( building_id text, Name text, Street_address text, Years_as_tallest text, Height_feet int, Floors int ) CREATE TABLE Institution ( Institution_id text, Institution text, Location text, Founded real, Type text, Enrollment int, T...
SELECT Type, COUNT(*) FROM Institution GROUP BY Type ORDER BY COUNT(*) DESC
### Instruction: CREATE TABLE vocals ( songid number, bandmate number, type text ) CREATE TABLE albums ( aid number, title text, year number, label text, type text ) CREATE TABLE performance ( songid number, bandmate number, stageposition text ) CREATE TABLE tracklists ( ...
SELECT title FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid GROUP BY T1.songid ORDER BY COUNT(*) DESC LIMIT 1
### 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_600, ID FROM swimmer
### Instruction: CREATE TABLE song ( song_name text, artist_name text, country text, f_id number, genre_is text, rating number, languages text, releasedate time, resolution number ) CREATE TABLE artist ( artist_name text, country text, gender text, preferred_genre te...
SELECT AVG(T2.rating) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = "Female"
### Instruction: CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitat...
SELECT local_authority, COUNT(local_authority) FROM station GROUP BY services, local_authority ORDER BY local_authority DESC
### 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 COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport'
### Instruction: CREATE TABLE table_train_9 ( "id" int, "pregnancy_or_lactation" bool, "intention_to_arterial_catheter" bool, "intention_to_central_venous_catheter" bool, "surgery" bool, "hypotension" bool, "chest_trauma" bool, "burn_injury" int, "impossible_transthoracic_echocardiog...
SELECT * FROM table_train_9 WHERE impossible_transthoracic_echocardiogram_tte = 1 OR burn_injury > 0 OR chest_trauma = 1
### Instruction: CREATE TABLE table_34488 ( "Week 1 Sept 2" text, "Week 2 Sept 7" text, "Week 3 Sept 14" text, "Week 5 Sept 28" text, "Week 6 Oct 5" text, "Week 7 Oct 12" text, "Week 10 Nov 2" text, "Week 13 Nov 23" text, "Week 14 Nov 30" text, "Week 15 Dec 7" text, "Week 16 ...
SELECT "Week 1 Sept 2" FROM table_34488 WHERE "Week 3 Sept 14" = 'south florida (3-0)'
### Instruction: 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 ) CREATE TABLE loan ( loan_id text, loan_type text, cust_id text, branch_id text, amount number...
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)
### Instruction: CREATE TABLE discipline_enrollments ( campus number, discipline number, year number, undergraduate number, graduate number ) CREATE TABLE faculty ( campus number, year number, faculty number ) CREATE TABLE enrollments ( campus number, year number, totalenro...
SELECT AVG(campusfee) FROM csu_fees WHERE year = 1996
### Instruction: CREATE TABLE school_details ( school_id number, nickname text, colors text, league text, class text, division text ) CREATE TABLE school_performance ( school_id number, school_year text, class_a text, class_aa text ) CREATE TABLE player ( player_id number, ...
SELECT team FROM player ORDER BY age DESC LIMIT 1
### 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 T2.company_name FROM movie AS T1 JOIN culture_company AS T2 ON T1.movie_id = T2.movie_id WHERE T1.year = 1999
### Instruction: CREATE TABLE faculty ( campus number, year number, faculty number ) CREATE TABLE campuses ( id number, campus text, location text, county text, year number ) CREATE TABLE degrees ( year number, campus number, degrees number ) CREATE TABLE csu_fees ( ca...
SELECT campus FROM campuses WHERE year >= 1935 AND year <= 1939
### Instruction: CREATE TABLE movie ( movie_id number, title text, year number, director text, budget_million number, gross_worldwide number ) CREATE TABLE culture_company ( company_name text, type text, incorporated_in text, group_equity_shareholding number, book_club_id te...
SELECT T1.company_name FROM culture_company AS T1 JOIN book_club AS T2 ON T1.book_club_id = T2.book_club_id WHERE T2.publisher = 'Alyson'
### Instruction: CREATE TABLE table_51818 ( "Tournament" text, "1968" text, "1969" text, "1970" text, "1971" text, "1972" text, "1973" text, "1974" text, "1975" text, "1976" text, "1977" text, "1978" text, "1979" text, "Career SR" text, "Career W\u2013L" text,...
SELECT "1977" FROM table_51818 WHERE "Tournament" = 'us open'
### 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, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent
### 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 All_Games
### 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, COUNT(All_Home) FROM basketball_match GROUP BY All_Home ORDER BY All_Home
### Instruction: CREATE TABLE table_34224 ( "Tournament" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "Career SR" text, "Career Win-Loss" text ) -- Using valid SQLite, answer the following que...
SELECT "1998" FROM table_34224 WHERE "1995" = 'a' AND "1993" = 'a' AND "1996" = '1r'
### Instruction: CREATE TABLE table_26349 ( "equation:" text, "k_{\\mathrm{H,pc}} = \\frac{p}{c_\\mathrm{aq}}" text, "k_{\\mathrm{H,cp}} = \\frac{c_\\mathrm{aq}}{p}" text, "k_{\\mathrm{H,px}} = \\frac{p}{x}" text, "k_{\\mathrm{H,cc}} = \\frac{c_{\\mathrm{aq}}}{c_{\\mathrm{gas}}}" text ) -- Using v...
SELECT "k_{\\mathrm{H,cc}} = \\frac{c_{\\mathrm{aq}}}{c_{\\mathrm{gas}}}" FROM table_26349 WHERE "equation:" = 'CO 2'
### Instruction: CREATE TABLE store_district ( store_id number, district_id number ) 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 district ( district_id numb...
SELECT district_name FROM district ORDER BY city_population DESC LIMIT 1
### Instruction: CREATE TABLE building ( building_id text, Name text, Street_address text, Years_as_tallest text, Height_feet int, Floors int ) CREATE TABLE protein ( common_name text, protein_name text, divergence_from_human_lineage real, accession_number text, sequence_len...
SELECT Type, COUNT(*) FROM Institution GROUP BY Type ORDER BY Type
### Instruction: CREATE TABLE table_dev_14 ( "id" int, "anemia" bool, "pulmonary_disease" bool, "c_peptide_level" float, "hemoglobin_a1c_hba1c" float, "renal_disease" bool, "cardiovascular_disease" bool, "estimated_glomerular_filtration_rate_egfr" int, "fasting_c_peptide" float, ...
SELECT * FROM table_dev_14 WHERE fasting_c_peptide >= 0.8
### 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, All_Games_Percent FROM basketball_match GROUP BY ACC_Regular_Season
### Instruction: CREATE TABLE stadium ( id number, name text, capacity number, city text, country text, opening_year number ) CREATE TABLE swimmer ( id number, name text, nationality text, meter_100 number, meter_200 text, meter_300 text, meter_400 text, meter_50...
SELECT name FROM event ORDER BY year DESC LIMIT 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 Team_ID, School_ID FROM basketball_match GROUP BY ACC_Regular_Season
### Instruction: CREATE TABLE swimmer ( id number, name text, nationality text, meter_100 number, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, time text ) CREATE TABLE record ( id number, result text, swimmer_id ...
SELECT country FROM stadium GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy I...
SELECT roomName, COUNT(roomName) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE FirstName LIKE '%ROY%' GROUP BY roomName ORDER BY roomName 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, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road
### Instruction: CREATE TABLE table_name_5 ( total_freshwater_withdrawal__km_3__yr_ INTEGER, industrial_use__m_3__p_yr__in__percentage_ VARCHAR, per_capita_withdrawal__m_3__p_yr_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Total Fr...
SELECT AVG(total_freshwater_withdrawal__km_3__yr_) FROM table_name_5 WHERE industrial_use__m_3__p_yr__in__percentage_ = "337(63%)" AND per_capita_withdrawal__m_3__p_yr_ > 535
### 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 All_Neutral
### 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 Year, COUNT(Year) FROM wine WHERE Price > 100 GROUP BY Year ORDER BY Year
### 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 All_Games
### 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, All_Games_Percent FROM basketball_match ORDER BY Team_Name 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, All_Games_Percent FROM basketball_match ORDER BY Team_Name DESC
### Instruction: 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, Label text, Format text, Catalogue text ) CREATE TABLE member ( Member_ID int, Member_Na...
SELECT Took_office, COUNT(Took_office) FROM party GROUP BY Minister ORDER BY COUNT(Took_office)
### 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 County, COUNT(County) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation GROUP BY County
### Instruction: CREATE TABLE table_40234 ( "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 Ta...
SELECT SUM("Cultural and Educational Panel") FROM table_40234 WHERE "Administrative Panel" > '1' AND "Agricultural Panel" = '11' AND "University of Dublin" < '3'
### 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_Home, All_Home ORDER BY All_Home
### Instruction: CREATE TABLE table_train_279 ( "id" int, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "estimated_glomerular_filtration_rate_egfr" int, "fasting_plasma_glucose" int, "diastolic_blood_pressure_dbp" int, "body_mass_index_bmi" float, "NOUSE" float ) -- ...
SELECT * FROM table_train_279 WHERE hemoglobin_a1c_hba1c >= 6.5 AND hemoglobin_a1c_hba1c <= 10.5
### Instruction: CREATE TABLE countries ( country_name VARCHAR, country_id VARCHAR ) CREATE TABLE locations ( location_id VARCHAR, country_id VARCHAR ) CREATE TABLE departments ( department_id VARCHAR, location_id VARCHAR ) CREATE TABLE employees ( first_name VARCHAR, last_name VARCHA...
SELECT T1.first_name, T1.last_name, T1.employee_id, T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id
### Instruction: CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitat...
SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week ORDER BY AVG(high_temperature) 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 Team_ID, All_Games_Percent FROM basketball_match GROUP BY ACC_Home
### Instruction: CREATE TABLE airlines ( alid number, name text, iata text, icao text, callsign text, country text, active text ) CREATE TABLE routes ( rid number, dst_apid number, dst_ap text, src_apid number, src_ap text, alid number, airline text, codeshar...
SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport'
### Instruction: CREATE TABLE files ( f_id number, artist_name text, file_size text, duration text, formats text ) CREATE TABLE song ( song_name text, artist_name text, country text, f_id number, genre_is text, rating number, languages text, releasedate time, res...
SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY COUNT(*) LIMIT 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 ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY ACC_Road
### 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, ACC_Percent FROM basketball_match ORDER BY All_Neutral
### 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 Governor, COUNT(Governor) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 GROUP BY Governor
### 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, Team_ID FROM basketball_match ORDER BY Team_ID DESC
### Instruction: CREATE TABLE table_69847 ( "Team" text, "Car No." text, "MNZ SPR" text, "MNZ FEA" text, "SPA SPR" text, "SPA FEA" text, "MON FEA" text, "SIL SPR" text, "SIL FEA" text, "HUN SPR" text, "HUN FEA" text, "LMS SPR" text, "LMS FEA" text, "CAT SPR" text,...
SELECT "MNZ FEA" FROM table_69847 WHERE "SIL SPR" = '18'
### Instruction: CREATE TABLE table_name_24 ( month VARCHAR, _year VARCHAR, sunk_by_u_boat VARCHAR, sunk_by_aircraft VARCHAR, german_submarines_lost VARCHAR, sunk_by_warship_or_raider VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the...
SELECT month, _year FROM table_name_24 WHERE german_submarines_lost < 5 AND sunk_by_warship_or_raider < 6893 AND sunk_by_aircraft < 133746 AND sunk_by_u_boat > 111263
### 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 table_46115 ( "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 "2007" FROM table_46115 WHERE "2011" = '191,183'
### Instruction: 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, From text, Arrival text, Railway_ID int ) CREATE TABLE railway ( Railway_ID ...
SELECT Builder, COUNT(*) FROM railway GROUP BY Builder ORDER BY COUNT(*) 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 cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREA...
SELECT Name, 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 Title, Name
### Instruction: CREATE TABLE shop ( shop_id number, address text, num_of_staff text, score number, open_year text ) CREATE TABLE happy_hour_member ( hh_id number, member_id number, total_amount number ) CREATE TABLE member ( member_id number, name text, membership_card tex...
SELECT address, num_of_staff FROM shop WHERE NOT shop_id IN (SELECT shop_id FROM happy_hour)
### 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_Percent, All_Games_Percent FROM basketball_match GROUP BY All_Neutral
### Instruction: CREATE TABLE table_53882 ( "Episode" text, "Air Date" text, "Timeslot" text, "Rating" real, "Share" real, "18-49 (Rating/Share)" text, "Viewers (m)" real, "Rank (Timeslot)" real, "Rank (Night)" text, "Rank (Overall)" real ) -- Using valid SQLite, answer the fol...
SELECT SUM("Share") FROM table_53882 WHERE "Timeslot" = '8:30 p.m.' AND "Air Date" = 'march 27, 2008' AND "Rank (Overall)" > '65'
### 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 COUNT(*), SUM(Enrollment) FROM Institution GROUP BY Type
### Instruction: CREATE TABLE stadium ( id int, name text, Home_Games int, Average_Attendance real, Total_Attendance real, Capacity_Percentage real ) CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text ) CREA...
SELECT Home_team, COUNT(Home_team) FROM game GROUP BY Away_team, Home_team ORDER BY Home_team 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(*) FROM flight GROUP BY destination ORDER BY COUNT(*)
### 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 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
### 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 COUNT(*), T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name
### Instruction: CREATE TABLE temperature ( city_id number, jan number, feb number, mar number, apr number, jun number, jul number, aug number, sep number, oct number, nov number, dec number ) CREATE TABLE match ( match_id number, date text, venue text, s...
SELECT city, gdp FROM city ORDER BY gdp LIMIT 1
### 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 ID, meter_100 FROM swimmer
### 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, COUNT(Main_Industry) FROM company WHERE NOT Company_ID IN (SELECT Company_ID FROM station_company) GROUP BY Main_Industry
### Instruction: CREATE TABLE table_52304 ( "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 46 \u221a" FROM table_52304 WHERE "D 41 \u221a" = 'd 38 √'
### 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 destination, COUNT(destination) FROM flight GROUP BY destination ORDER BY destination
### 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, Team_ID FROM basketball_match ORDER BY Team_ID DESC
### Instruction: CREATE TABLE company ( company_id number, rank number, company text, headquarters text, main_industry text, sales_billion number, profits_billion number, assets_billion number, market_value number ) CREATE TABLE gas_station ( station_id number, open_year num...
SELECT rank, company, market_value FROM company WHERE main_industry = 'Banking' ORDER BY sales_billion, profits_billion
### 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 All_Neutral DESC
### Instruction: CREATE TABLE table_203_516 ( id number, "year" text, "team" text, "games" number, "punt return attempts" number, "punt return yards" number, "punts returned for touchdown" number, "punts fair caught" number, "longest punt return" number, "kickoff attempts" number...
SELECT "longest punt return" FROM table_203_516 WHERE "year" = 2008
### Instruction: CREATE TABLE table_13039 ( "Average population (x 1000)" real, "Live births" text, "Deaths" text, "Natural change" text, "Crude birth rate (per 1000)" real, "Crude death rate (per 1000)" real, "Natural change (per 1000)" real ) -- Using valid SQLite, answer the following q...
SELECT "Live births" FROM table_13039 WHERE "Crude birth rate (per 1000)" > '15.7' AND "Average population (x 1000)" < '297' AND "Deaths" = '4 686'
### 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, All_Games_Percent FROM basketball_match ORDER BY All_Games
### Instruction: CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255) ) CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code...
SELECT Participant_Type_Code, COUNT(Participant_Type_Code) FROM Participants GROUP BY Participant_Type_Code ORDER BY COUNT(Participant_Type_Code) DESC
### Instruction: CREATE TABLE tracklists ( albumid number, position number, songid number ) CREATE TABLE instruments ( songid number, bandmateid number, instrument text ) CREATE TABLE vocals ( songid number, bandmate number, type text ) CREATE TABLE performance ( songid number...
SELECT COUNT(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Le Pop"
### Instruction: CREATE TABLE campuses ( id number, campus text, location text, county text, year number ) CREATE TABLE discipline_enrollments ( campus number, discipline number, year number, undergraduate number, graduate number ) CREATE TABLE enrollments ( campus number, ...
SELECT SUM(faculty) FROM faculty WHERE year = 2002
### Instruction: CREATE TABLE store ( store_id number, store_name text, type text, area_size number, number_of_product_category number, ranking number ) CREATE TABLE district ( district_id number, district_name text, headquartered_city text, city_population number, city_area...
SELECT district_name FROM district ORDER BY city_area LIMIT 1
### Instruction: CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int,...
SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week ORDER BY day_of_week 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_Road, ACC_Percent FROM basketball_match ORDER BY All_Road DESC