instruction
stringlengths
212
6.3k
output
stringlengths
6
2.03k
### Instruction: CREATE TABLE table_60357 ( "Tournament" text, "1988" text, "1990" text, "1991" text, "1992" text, "1993" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "Career SR" text, "Career Win-Loss" text ...
SELECT "1991" FROM table_60357 WHERE "1999" = '2r'
### 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, School_ID FROM basketball_match GROUP BY All_Road
### Instruction: CREATE TABLE bank ( branch_id number, bname text, no_of_customers number, city text, state text ) 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, a...
SELECT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname ORDER BY SUM(T2.amount) DESC LIMIT 1
### 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 Position, COUNT(*) FROM match_season GROUP BY Position 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 schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) ...
SELECT Name, SUM(T1.Show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.Cinema_ID = T2.Cinema_ID GROUP BY T1.Cinema_ID
### 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 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 Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY Title DESC
### Instruction: CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text ) ...
SELECT Season, COUNT(Season) FROM game GROUP BY Away_team ORDER BY 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 Team_ID, School_ID FROM basketball_match GROUP BY ACC_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 School_ID, All_Games_Percent FROM basketball_match GROUP BY All_Home
### Instruction: CREATE TABLE table_36042 ( "m/v ft/s" real, "Shell (lb)" real, "Time to ft (m) at 25\u00b0 (seconds)" text, "Time to ft (m) at 40\u00b0 (seconds)" real, "Time to ft (m) at 55\u00b0 (seconds)" real, "Max. height (ft)" real ) -- Using valid SQLite, answer the following questions...
SELECT AVG("Max. height (ft)") FROM table_36042 WHERE "Time to ft (m) at 25\u00b0 (seconds)" = '10.1' AND "Shell (lb)" < '12.5'
### Instruction: CREATE TABLE Student ( lname VARCHAR, sex VARCHAR, StuID VARCHAR ) CREATE TABLE Video_games ( GameID VARCHAR, Gname VARCHAR ) CREATE TABLE Plays_games ( StuID VARCHAR, GameID VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT lname, sex FROM Student WHERE StuID IN (SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID = T2.GameID WHERE T2.Gname = "Call of Destiny" INTERSECT SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID = T2.GameID WHERE T2.Gname = "Works of Widenius")
### 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 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 Team_Name, School_ID FROM basketball_match ORDER BY School_ID
### Instruction: CREATE TABLE table_4092 ( "Country" text, "Area (km 2 )" real, "Population(2012)" real, "Density (/km 2 )" real, "GDP (nominal), USD (2012)" text, "GDP (nominal) per capita, USD (2012)" text, "HDI (2012)" text, "Capital" text ) -- Using valid SQLite, answer the followi...
SELECT "Area (km 2 )" FROM table_4092 WHERE "GDP (nominal), USD (2012)" = '16,852,000,000'
### Instruction: CREATE TABLE table_train_252 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "fasting_plasma_glucose_fpg" float, "hemoglobin_a1c_hba1c" float, "hba1c" float, "serum_creatinine" float, "metformin" bool, "age" float, "NOUSE" float ) -- Using valid SQL...
SELECT * FROM table_train_252 WHERE hba1c > 6.5 AND hemoglobin_a1c_hba1c <= 9
### Instruction: CREATE TABLE discipline_enrollments ( campus number, discipline number, year number, undergraduate number, graduate number ) CREATE TABLE enrollments ( campus number, year number, totalenrollment_ay number, fte_ay number ) CREATE TABLE faculty ( campus number, ...
SELECT campus FROM campuses WHERE year = 1958
### Instruction: CREATE TABLE table_40320 ( "Party" text, "1985" real, "1987" real, "1990" real, "1995" real, "1999" real, "2003" real, "2007" real, "2011" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest 2007 value...
SELECT MAX("2007") FROM table_40320 WHERE "1985" > '52' AND "1987" > '130' AND "1990" < '1990'
### Instruction: 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, low_temperature int, precipitation real, wind_sp...
SELECT services, COUNT(services) FROM station GROUP BY services ORDER BY COUNT(services) DESC
### Instruction: CREATE TABLE table_52016 ( "D 40 \u221a" text, "D 41 \u221a" text, "D 42 \u221a" text, "D 43 \u221a" text, "D 44 \u221a" text, "D 45 O" text, "D 46 O" text, "R 53 +" text, "R 52 +" text, "R 51 +" text ) -- Using valid SQLite, answer the following questions for ...
SELECT "D 42 \u221a" FROM table_52016 WHERE "D 44 \u221a" = 'r 36 √'
### 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 Away_team, COUNT(Away_team) FROM game GROUP BY Away_team ORDER BY Away_team DESC
### 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 Minister, COUNT(Minister) FROM party GROUP BY Minister ORDER BY COUNT(Minister) 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 County, COUNT(County) FROM appellations GROUP BY County ORDER BY County
### Instruction: CREATE TABLE film_market_estimation ( Estimation_ID int, Low_Estimate real, High_Estimate real, Film_ID int, Type text, Market_ID int, Year int ) CREATE TABLE film ( Film_ID int, Title text, Studio text, Director text, Gross_in_dollar int ) CREATE TABLE...
SELECT Year, COUNT(Year) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = "Japan" ORDER BY T1.Year DESC
### Instruction: CREATE TABLE 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, ACC_Percent FROM basketball_match GROUP BY Team_Name
### 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, School_ID FROM basketball_match ORDER BY Team_Name DESC
### Instruction: CREATE TABLE table_65281 ( "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, "Total Apps" text, "Total Goals"...
SELECT AVG("FA Cup Goals") FROM table_65281 WHERE "League Cup Apps" = '2' AND "FA Cup Apps" = '3' AND "League Goals" = '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 Team_ID, School_ID FROM basketball_match GROUP BY All_Neutral
### Instruction: CREATE TABLE club ( clubid number, clubname text, clubdesc text, clublocation text ) CREATE TABLE member_of_club ( stuid number, clubid number, position text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major ...
SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t3.sex = "F"
### Instruction: CREATE TABLE table_39525 ( "Ethnic group" text, "Totora Municipality (%)" real, "Pojo Municipality (%)" real, "Pocona Municipality (%)" real, "Chimor\u00e9 Municipality (%)" real, "Puerto Villarroel Municipality (%)" real, "Entre R\u00edos Municipality (%)" real ) -- Using...
SELECT MIN("Puerto Villarroel Municipality (%)") FROM table_39525 WHERE "Ethnic group" = 'not indigenous' AND "Totora Municipality (%)" < '4.4'
### 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 T1.id, COUNT(*) FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id GROUP BY T1.id
### Instruction: CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text ) CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) ...
SELECT Season, COUNT(Season) FROM game GROUP BY Home_team ORDER BY Season DESC
### Instruction: CREATE TABLE table_62552 ( "Year" real, "Milan \u2013 San Remo" text, "Tour of Flanders" text, "Paris\u2013Roubaix" text, "Li\u00e8ge\u2013Bastogne\u2013Li\u00e8ge" text, "Giro di Lombardia" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT "Milan \u2013 San Remo" FROM table_62552 WHERE "Li\u00e8ge\u2013Bastogne\u2013Li\u00e8ge" = 'danilo di luca ( ita )'
### Instruction: CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE univ...
SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY All_Road
### Instruction: CREATE TABLE table_train_113 ( "id" int, "mini_mental_state_examination_mmse" int, "systolic_blood_pressure_sbp" int, "body_weight" float, "diastolic_blood_pressure_dbp" int, "body_mass_index_bmi" float, "triglyceride_tg" float, "NOUSE" float ) -- Using valid SQLite, a...
SELECT * FROM table_train_113 WHERE (body_mass_index_bmi >= 18 AND body_mass_index_bmi <= 33) AND body_weight > 50
### Instruction: CREATE TABLE table_train_138 ( "id" int, "mini_mental_state_examination_mmse" int, "stroke" bool, "body_weight" float, "cranial_neurosurgery" bool, "first_degree_relative" bool, "seizure_disorder" bool, "alcohol_abuse" bool, "body_mass_index_bmi" float, "aneurysm...
SELECT * FROM table_train_138 WHERE mini_mental_state_examination_mmse >= 16 AND mini_mental_state_examination_mmse <= 28
### 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
### Instruction: CREATE TABLE projects ( code text, name text, hours number ) CREATE TABLE assignedto ( scientist number, project text ) CREATE TABLE scientists ( ssn number, name text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the...
SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.ssn WHERE T2.name = 'Matter of Time' INTERSECT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.ssn WHERE T2.name = 'A Pu...
### 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(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY roomName
### 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 COUNT(*), SUM(Enrollment) FROM School GROUP 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 School_ID, ACC_Percent FROM basketball_match GROUP BY All_Games
### Instruction: CREATE TABLE budget ( School_id int, Year int, Budgeted int, total_budget_percent_budgeted real, Invested int, total_budget_percent_invested real, Budget_invested_percent text ) CREATE TABLE School ( School_id text, School_name text, Location text, Mascot te...
SELECT County, COUNT(*) FROM School GROUP BY County ORDER BY COUNT(*)
### Instruction: CREATE TABLE table_5848 ( "Year Ended" text, "Passengers Flown" real, "Passenger Load Factor (%)" real, "Revenue (\u20acm)" real, "Profit / (Loss) Before Tax (\u20acm)" text, "Net Profit / (Loss) (\u20acm)" text ) -- Using valid SQLite, answer the following questions for the t...
SELECT "Profit / (Loss) Before Tax (\u20acm)" FROM table_5848 WHERE "Revenue (\u20acm)" > '1,115.8' AND "Year Ended" = '31 december 2012'
### Instruction: CREATE TABLE election ( election_id number, counties_represented text, district number, delegate text, party number, first_elected number, committee text ) CREATE TABLE county ( county_id number, county_name text, population number, zip_code text ) CREATE T...
SELECT T2.delegate FROM county AS T1 JOIN election AS T2 ON T1.county_id = T2.district WHERE T1.population < 100000
### Instruction: CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) 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, ...
SELECT Minister, COUNT(Minister) FROM party GROUP BY Minister ORDER BY COUNT(Minister)
### 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, School_ID FROM basketball_match ORDER BY School_ID DESC
### Instruction: CREATE TABLE table_70314 ( "No.1" text, "No.2" text, "No.3" text, "No.4" text, "No.5" text, "No.6" text, "No.7" text, "No.8" text, "No.9" text, "No.10" text, "No.11" text, "No.12" text, "No.13" text, "No.14" text, "No.15" text, "FINAL" tex...
SELECT "No.10" FROM table_70314 WHERE "No.8" = 'diana'
### Instruction: CREATE TABLE table_10363 ( "Candidate" text, "Total Receipts" real, "Loans Received" real, "Receipts w/o Loans" real, "Money Spent" real, "Cash On Hand" real, "Total Debt" real, "Cash on Hand Minus Debt" real ) -- Using valid SQLite, answer the following questions for ...
SELECT AVG("Cash On Hand") FROM table_10363 WHERE "Receipts w/o Loans" = '19,951,290' AND "Money Spent" < '17,556,672'
### Instruction: CREATE TABLE culture_company ( Company_name text, Type text, Incorporated_in text, Group_Equity_Shareholding real, book_club_id text, movie_id text ) CREATE TABLE book_club ( book_club_id int, Year int, Author_or_Editor text, Book_Title text, Publisher text,...
SELECT Category, COUNT(*) FROM book_club GROUP BY Category ORDER BY COUNT(*) DESC
### Instruction: CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text ) CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) ...
SELECT Home_team, COUNT(Home_team) FROM game GROUP BY Home_team ORDER BY COUNT(Home_team) DESC
### Instruction: CREATE TABLE film ( Film_ID int, Title text, Studio text, Director text, Gross_in_dollar int ) CREATE TABLE market ( Market_ID int, Country text, Number_cities int ) CREATE TABLE film_market_estimation ( Estimation_ID int, Low_Estimate real, High_Estimate r...
SELECT Title, COUNT(Title) FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Type, Title ORDER BY COUNT(Title)
### Instruction: CREATE TABLE table_75419 ( "Rank" text, "City" text, "Population" real, "Area (km 2 )" real, "Density (inhabitants/km 2 )" real, "Altitude (mslm)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Altitude (mslm) is the highe...
SELECT MAX("Altitude (mslm)") FROM table_75419 WHERE "Area (km 2 )" < '13.01' AND "Population" = '74536' AND "Density (inhabitants/km 2 )" > '5869'
### Instruction: CREATE TABLE wine ( no number, grape text, winery text, appelation text, state text, name text, year number, price number, score number, cases number, drink text ) CREATE TABLE appellations ( no number, appelation text, county text, state tex...
SELECT T2.winery FROM grapes AS T1 JOIN wine AS T2 ON T1.grape = T2.grape WHERE T1.color = "White" GROUP BY T2.winery ORDER BY COUNT(*) DESC LIMIT 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 ACC_Regular_Season, ACC_Percent FROM basketball_match
### Instruction: CREATE TABLE table_13515 ( "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 "Part number(s)" FROM table_13515 WHERE "Turbo" = '9/11' AND "Frequency" = '1.5 ghz'
### 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 Year, AVG(Price) FROM wine GROUP BY Year ORDER BY Year DESC
### Instruction: CREATE TABLE campuses ( id number, campus text, location text, county text, year number ) CREATE TABLE csu_fees ( campus number, year number, campusfee number ) CREATE TABLE faculty ( campus number, year number, faculty number ) CREATE TABLE enrollments ( ...
SELECT campus FROM campuses WHERE location = "Chico"
### Instruction: CREATE TABLE volume ( Volume_ID int, Volume_Issue text, Issue_Date text, Weeks_on_Top real, Song text, Artist_ID int ) CREATE TABLE music_festival ( ID int, Music_Festival text, Date_of_ceremony text, Category text, Volume int, Result text ) CREATE TABL...
SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category ORDER BY Category
### Instruction: CREATE TABLE table_47185 ( "Name" text, "Year Began" text, "s Registered user" text, "Updated in past 30 days" text, "Registration" text, "Ability to syndicate off-site feeds" text, "Userpics Free" text, "Userpics Paid" text, "Monthly Cost for Paid Account" text, ...
SELECT "Userpics Free" FROM table_47185 WHERE "Monthly Cost for Paid Account" = 'unknown' AND "s Registered user" = '2340'
### 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, School_ID FROM basketball_match ORDER BY School_ID DESC
### Instruction: 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, low_temperature int, precipitation real, wind_sp...
SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority ORDER BY COUNT(local_authority)
### 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 Area, COUNT(Area) FROM appellations GROUP BY Area ORDER BY Area 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 destination, COUNT(*) FROM flight GROUP BY destination ORDER BY COUNT(*)
### Instruction: CREATE TABLE buildings ( id number, name text, city text, height number, stories number, status text ) CREATE TABLE companies ( id number, name text, headquarters text, industry text, sales_billion number, profits_billion number, assets_billion numbe...
SELECT T3.name, 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
### 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
### 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, School_ID FROM basketball_match
### Instruction: CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text ) CREATE TABLE stadium ( id int, name text, Home_Games int, Average_Attendance real, Total_Attendance real, Capacity_Percentage real ) CREA...
SELECT Season, COUNT(Season) FROM game GROUP BY Home_team, Season ORDER BY Season DESC
### Instruction: CREATE TABLE protein ( common_name text, protein_name text, divergence_from_human_lineage number, accession_number text, sequence_length number, sequence_identity_to_human_protein text, institution_id text ) CREATE TABLE institution ( institution_id text, institutio...
SELECT type FROM institution GROUP BY type ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: CREATE TABLE artist ( Artist_ID int, Artist text, Age int, Famous_Title text, Famous_Release_date text ) CREATE TABLE volume ( Volume_ID int, Volume_Issue text, Issue_Date text, Weeks_on_Top real, Song text, Artist_ID int ) CREATE TABLE music_festival ( ...
SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category ORDER BY COUNT(Category)
### Instruction: CREATE TABLE table_train_244 ( "id" int, "fasting_venous_plasma_glucose" int, "hemoglobin_a1c_hba1c" float, "diabetic" string, "capillary_glycated_hemoglobin" float, "fasting_capillary_glucose" int, "borderline_fasting_capillary_glucose_level" int, "body_mass_index_bmi" ...
SELECT * FROM table_train_244 WHERE diabetic = 'ii' AND hemoglobin_a1c_hba1c > 7
### 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 County, COUNT(County) FROM appellations GROUP BY County ORDER BY County DESC
### 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 Years_Played, COUNT(Years_Played) FROM player GROUP BY Years_Played
### Instruction: CREATE TABLE employee ( eid number(9,0), name varchar2(30), salary number(10,2) ) 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 numb...
SELECT name, distance FROM aircraft ORDER BY distance
### Instruction: CREATE TABLE city ( city_id number, county_id number, name text, white number, black number, amerindian number, asian number, multiracial number, hispanic number ) CREATE TABLE county_public_safety ( county_id number, name text, population number, po...
SELECT T1.white, T2.crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.county_id = T2.county_id
### Instruction: CREATE TABLE manager ( Manager_ID int, Name text, Country text, Working_year_starts text, Age int, Level int ) CREATE TABLE railway ( Railway_ID int, Railway text, Builder text, Built text, Wheels text, Location text, ObjectNumber text ) CREATE TABL...
SELECT Name, COUNT(Name) FROM train GROUP BY Name ORDER BY COUNT(Name) DESC
### 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, COUNT(Year) FROM wine WHERE Price > 100 GROUP BY Year ORDER BY Year
### Instruction: CREATE TABLE table_203_112 ( id number, "choke" text, "constriction (inch)" number, "percentage of lead shot in 30-inch circle at 40 yards" text, "identification (notches)" number, "identification (stars)\n(spanish shotguns)" number ) -- Using valid SQLite, answer the followin...
SELECT ABS((SELECT "percentage of lead shot in 30-inch circle at 40 yards" FROM table_203_112 WHERE "choke" = 'cylinder') - (SELECT "percentage of lead shot in 30-inch circle at 40 yards" FROM table_203_112 WHERE "choke" = 'skeet 1'))
### Instruction: CREATE TABLE channel ( Channel_ID int, Name text, Owner text, Share_in_percent real, Rating_in_percent real ) CREATE TABLE program ( Program_ID int, Name text, Origin text, Launch real, Owner text ) CREATE TABLE broadcast_share ( Channel_ID int, Program...
SELECT Owner, SUM(Rating_in_percent) FROM channel GROUP BY Owner ORDER BY SUM(Rating_in_percent) DESC
### Instruction: CREATE TABLE music_festival ( id number, music_festival text, date_of_ceremony text, category text, volume number, result text ) CREATE TABLE artist ( artist_id number, artist text, age number, famous_title text, famous_release_date text ) CREATE TABLE volu...
SELECT AVG(T2.weeks_on_top) FROM artist AS T1 JOIN volume AS T2 ON T1.artist_id = T2.artist_id WHERE T1.age <= 25
### 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 Affiliation, SUM(Enrollment) FROM university GROUP BY Affiliation
### Instruction: CREATE TABLE table_44134 ( "Poll" text, "Pre- season" text, "Mar 3" text, "Mar 17" text, "Mar 24" text, "Mar 31" text, "April 7" text, "April 14" text, "April 21" text, "April 28" text, "May 5" text, "May 12" text, "May 19" text, "May 26" text, ...
SELECT "Mar 17" FROM table_44134 WHERE "April 21" = '10'
### Instruction: CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Participants ( ...
SELECT Participant_Details, Participant_ID FROM Participants ORDER BY Participant_ID DESC
### Instruction: CREATE TABLE match ( match_id number, date text, venue text, score text, result text, competition text ) CREATE TABLE city ( city_id number, city text, hanzi text, hanyu_pinyin text, regional_population number, gdp number ) CREATE TABLE hosting_city ( ...
SELECT COUNT(*), competition FROM match GROUP BY competition
### Instruction: CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) CREATE TABLE stadium ( id int, name text, Home_Games int, Average_Attendance real, Total_Attendance real, Capacity_P...
SELECT Season, COUNT(Season) FROM game GROUP BY Away_team, Season ORDER BY Season DESC
### Instruction: CREATE TABLE table_79755 ( "Exam" text, "2006 First Time" text, "2006 All" text, "2007 First Time" text, "2007 All" text, "2008 First Time" text, "2008 All" text, "2009 First Time" text, "2009 All" text, "2010 First Time" text, "2011 First Time" text, "20...
SELECT "2011 First Time" FROM table_79755 WHERE "2009 All" = '68%'
### 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 Affiliation, SUM(Enrollment) FROM university GROUP BY Affiliation
### Instruction: CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season ...
SELECT All_Games, School_ID FROM basketball_match ORDER BY All_Games
### Instruction: CREATE TABLE gas_station ( station_id number, open_year number, location text, manager_name text, vice_manager_name text, representative_name text ) CREATE TABLE company ( company_id number, rank number, company text, headquarters text, main_industry text, ...
SELECT main_industry, COUNT(*) FROM company GROUP BY main_industry ORDER BY SUM(market_value) DESC LIMIT 1
### Instruction: CREATE TABLE movie ( movie_id int, Title text, Year int, Director text, Budget_million real, Gross_worldwide int ) CREATE TABLE culture_company ( Company_name text, Type text, Incorporated_in text, Group_Equity_Shareholding real, book_club_id text, movie...
SELECT Category, COUNT(*) FROM book_club GROUP BY Category ORDER BY COUNT(*)
### Instruction: CREATE TABLE artwork ( artwork_id number, type text, name text ) CREATE TABLE festival_detail ( festival_id number, festival_name text, chair_name text, location text, year number, num_of_audience number ) CREATE TABLE nomination ( artwork_id number, festiv...
SELECT T1.festival_id, T3.festival_name FROM nomination AS T1 JOIN artwork AS T2 ON T1.artwork_id = T2.artwork_id JOIN festival_detail AS T3 ON T1.festival_id = T3.festival_id GROUP BY T1.festival_id HAVING COUNT(*) >= 2
### 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 Grape, COUNT(*) FROM wine GROUP BY Grape ORDER BY COUNT(*)
### Instruction: CREATE TABLE member ( Member_ID text, Name text, Nationality text, Role text ) CREATE TABLE performance ( Performance_ID real, Date text, Host text, Location text, Attendance int ) CREATE TABLE member_attendance ( Member_ID int, Performance_ID int, Num_...
SELECT Date, COUNT(Date) FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID WHERE T2.Role = "Violin" GROUP BY Date ORDER BY Date DESC
### Instruction: CREATE TABLE table_62073 ( "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 ) -- Using valid SQLite, answer the following qu...
SELECT "2002" FROM table_62073 WHERE "2006" = 'a' AND "2010" = 'q1'
### Instruction: CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr ...
SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' ORDER BY enr
### Instruction: CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE appe...
SELECT Grape, COUNT(*) FROM wine GROUP BY Grape ORDER BY COUNT(*) DESC
### Instruction: CREATE TABLE enrollments ( campus number, year number, totalenrollment_ay number, fte_ay number ) CREATE TABLE campuses ( id number, campus text, location text, county text, year number ) CREATE TABLE faculty ( campus number, year number, faculty number...
SELECT campus FROM campuses WHERE county = "Los Angeles"
### Instruction: CREATE TABLE item ( i_id number, title text ) CREATE TABLE review ( a_id number, u_id number, i_id number, rating number, rank number ) CREATE TABLE trust ( source_u_id number, target_u_id number, trust number ) CREATE TABLE useracct ( u_id number, nam...
SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating > 8 INTERSECT SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating < 5
### Instruction: CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season ...
SELECT All_Neutral, All_Games_Percent FROM basketball_match
### Instruction: CREATE TABLE dorm_amenity ( amenid number, amenity_name text ) CREATE TABLE dorm ( dormid number, dorm_name text, student_capacity number, gender text ) CREATE TABLE lives_in ( stuid number, dormid number, room_number number ) CREATE TABLE student ( stuid numb...
SELECT COUNT(*), AVG(age), city_code FROM student WHERE sex = 'M' GROUP BY city_code
### Instruction: 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, genre_is text, rating number, languages text, releasedate time, resolution number ) CREATE TABLE files...
SELECT artist_name FROM artist WHERE country = "UK" INTERSECT SELECT artist_name FROM song WHERE languages = "english"