instruction
stringlengths
212
6.3k
output
stringlengths
6
2.03k
### Instruction: CREATE TABLE employee ( eid number(9,0), name varchar2(30), salary number(10,2) ) 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), departur...
SELECT name, distance FROM aircraft ORDER BY distance DESC
### Instruction: CREATE TABLE table_21014 ( "Model number" text, "sSpec number" text, "Frequency" text, "GPU frequency" text, "L2 cache" text, "I/O bus" text, "Memory" text, "Voltage" text, "TDP" text, "Socket" text, "Release date" text, "Part number(s)" text, "Releas...
SELECT "GPU frequency" FROM table_21014 WHERE "TDP" = '3.6 W' AND "Part number(s)" = 'CY80632007221AB'
### 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 DESC
### Instruction: CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) ...
SELECT 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)
### 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_Home, All_Home
### 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, COUNT(Name) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Name
### Instruction: CREATE TABLE authorship ( authid number, instid number, paperid number, authorder number ) CREATE TABLE papers ( paperid number, title text ) CREATE TABLE authors ( authid number, lname text, fname text ) CREATE TABLE inst ( instid number, name text, c...
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = "USA" AND t2.authorder = 2 AND t1.lname = "Turon"
### Instruction: CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) 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, ACC_Percent FROM basketball_match GROUP BY ACC_Home
### 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, Team_ID FROM basketball_match ORDER BY All_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 Team_ID, All_Games_Percent FROM basketball_match GROUP BY ACC_Road
### Instruction: CREATE TABLE table_37819 ( "2005/ 06" text, "2006/ 07" text, "2007/ 08" text, "2008/ 09" text, "2009/ 10" text, "2010/ 11" text, "2011/ 12" text, "2012/ 13" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 2009/10 ha...
SELECT "2009/ 10" FROM table_37819 WHERE "2005/ 06" = 'not held' AND "2010/ 11" = 'not held'
### Instruction: CREATE TABLE match_season ( Season real, Player text, Position text, Country int, Team int, Draft_Pick_Number int, Draft_Class text, College text ) CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, ...
SELECT Draft_Class, Draft_Pick_Number FROM match_season WHERE Position = "Defender"
### 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 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_ID, All_Games_Percent FROM basketball_match GROUP BY All_Road
### 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 roomName, COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY COUNT(*)
### Instruction: CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season ...
SELECT ACC_Regular_Season, All_Games_Percent FROM basketball_match
### 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 "games" < 16
### Instruction: CREATE TABLE table_1790 ( "Country" text, "Population (2011)" real, "GDP (nominal) (2010, US$ millions)" real, "Military expenditures (2011, US$ millions)" real, "Military expenditures (2011, % of GDP)" text, "Defence expenditures, (2011, per capita)" real, "Deployable milit...
SELECT "GDP (nominal) (2010, US$ millions)" FROM table_1790 WHERE "Defence expenditures, (2011, per capita)" = '162'
### Instruction: CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE participates_in ( stuid number, actid numb...
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 Team_ID, ACC_Percent FROM basketball_match GROUP BY Team_Name
### Instruction: CREATE TABLE airports ( apid number, name text, city text, country text, x number, y number, elevation number, iata text, icao text ) CREATE TABLE routes ( rid number, dst_apid number, dst_ap text, src_apid number, src_ap text, alid number, ...
SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE country = 'Canada'
### Instruction: CREATE TABLE table_204_957 ( 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_204_957 WHERE "assisted tackles" = 1
### 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 COUNT(County) DESC
### Instruction: CREATE TABLE table_train_234 ( "id" int, "orthostatic_hypotension" bool, "systolic_blood_pressure_sbp" int, "estimated_glomerular_filtration_rate_egfr" int, "postural_fall_of_dbp" int, "diastolic_blood_pressure_dbp" int, "postural_fall_of_sbp" int, "allergy_to_sglt_2_inh...
SELECT * FROM table_train_234 WHERE body_mass_index_bmi >= 25 AND body_mass_index_bmi <= 35
### 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 School_ID 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, Team_ID FROM basketball_match ORDER BY Team_Name DESC
### Instruction: CREATE TABLE table_36165 ( "1950" real, "1960" real, "1970" real, "1980" real, "1990" real, "1996[2]" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 1960 larger than 196, and a 1996[2] smaller than 726, and a 1980 larger than 12...
SELECT MAX("1950") FROM table_36165 WHERE "1960" > '196' AND "1996[2]" < '726' AND "1980" > '125' AND "1990" > '848'
### 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
### Instruction: CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 r...
SELECT name, 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 ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road
### 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, Team_ID FROM basketball_match ORDER BY Team_ID 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 ACC_Percent
### Instruction: CREATE TABLE table_15713 ( "Tournament" text, "1996" text, "1997" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2009" text, "2010" text, "2011" text ) -- Using valid SQLite, answer the following qu...
SELECT "1999" FROM table_15713 WHERE "2003" = 'q1' AND "2002" = 'q3'
### 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 repair_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, value_points real, quality_rank int ) CREATE TABLE technician ( technicia...
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 music_festival ( ID int, Music_Festival text, Date_of_ceremony text, Category text, Volume int, Result text ) CREATE TABLE artist ( Artist_ID int, Artist text, Age int, Famous_Title text, Famous_Release_date text ) CREATE TABLE volume ( Vol...
SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category ORDER BY COUNT(Category) 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_Games, School_ID FROM basketball_match ORDER BY School_ID
### Instruction: CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid number(9,0) ) CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE ...
SELECT destination, COUNT(*) FROM flight GROUP BY destination ORDER BY destination 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, Team_ID FROM basketball_match ORDER 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, ACC_Percent FROM basketball_match GROUP BY All_Road
### 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_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_Road, ACC_Percent FROM basketball_match ORDER BY All_Road
### 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 name
### Instruction: CREATE TABLE gas_station ( Station_ID int, Open_Year int, Location text, Manager_Name text, Vice_Manager_Name text, Representative_Name text ) CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_bil...
SELECT Manager_Name, COUNT(Manager_Name) FROM gas_station GROUP BY Manager_Name ORDER BY Manager_Name DESC
### Instruction: CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_pres...
SELECT COUNT(*) FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = class_senator_vote WHERE T1.city_code = "NYC" AND T2.election_cycle = "Spring"
### Instruction: 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), departure_date date, arrival_date date, price number(7,2), aid number(9,0) ) CREATE TABLE ...
SELECT destination, COUNT(destination) FROM flight GROUP BY destination ORDER BY destination DESC
### Instruction: CREATE TABLE table_train_55 ( "id" int, "ejection_fraction_ef" int, "systolic_dysfunction" bool, "language" string, "valvular_dysfunction" bool, "consent" bool, "heart_disease" bool, "left_bundle_branch_block" bool, "trauma" bool, "pericardial_disease" bool, ...
SELECT * FROM table_train_55 WHERE complete_fluid_challenge = 0
### Instruction: CREATE TABLE discipline_enrollments ( campus number, discipline number, year number, undergraduate number, graduate number ) CREATE TABLE degrees ( year number, campus number, degrees number ) CREATE TABLE enrollments ( campus number, year number, totalenro...
SELECT year FROM degrees GROUP BY year ORDER BY SUM(degrees) DESC LIMIT 1
### Instruction: CREATE TABLE fires ( fire_year number, discovery_date number, discovery_doy number, discovery_time text, stat_cause_code number, stat_cause_descr text, cont_date text, cont_doy text, cont_time text, fire_size number, fire_size_class text, latitude number,...
SELECT SUM(fire_size), fire_year FROM fires WHERE state = "CA" AND fire_year BETWEEN 2000 AND 2005 GROUP BY fire_year
### Instruction: CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes...
SELECT Name, COUNT(Name) FROM technician WHERE Team <> "NYY" GROUP BY Name ORDER BY COUNT(Name) DESC
### Instruction: CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_billion real, Profits_billion real, Assets_billion real, Mar...
SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Headquarters ORDER BY COUNT(Headquarters) 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 appellations ( No INTEGER, Appelation TEXT, County TEXT, Sta...
SELECT County, COUNT(County) FROM appellations GROUP BY County ORDER BY COUNT(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 Team_Name, School_ID FROM basketball_match ORDER BY School_ID DESC
### Instruction: CREATE TABLE School ( School_id text, School_name text, Location text, Mascot text, Enrollment int, IHSAA_Class text, IHSAA_Football_Class text, County text ) CREATE TABLE endowment ( endowment_id int, School_id int, donator_name text, amount real ) CRE...
SELECT County, SUM(Enrollment) FROM School GROUP BY County ORDER BY County 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 Year, AVG(MAX(Score)) FROM wine ORDER BY AVG(MAX(Score)) DESC
### Instruction: CREATE TABLE table_25716 ( "#" real, "Importing Nation" text, "10 3 bbl/day (2011)" real, "10 3 m 3 /day (2011)" real, "10 3 bbl/day (2009)" real, "10 3 m 3 /day (2009)" real, "10 3 bbl/day (2006)" real, "10 3 m 3 /day (2006)" real ) -- Using valid SQLite, answer the f...
SELECT COUNT("Importing Nation") FROM table_25716 WHERE "10 3 m 3 /day (2006)" = '150'
### Instruction: CREATE TABLE table_train_157 ( "id" int, "gender" string, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "platelets" int, "renal_disease" bool, "c_reactive_protein" float, "creatinine_clearance_cl" float, "urine_protein" int, "serum_creatinine" ...
SELECT * FROM table_train_157 WHERE hemoglobin_a1c_hba1c < 10 OR platelets < 100
### Instruction: CREATE TABLE table_35585 ( "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 "% of popular vote" FROM table_35585 WHERE "Liberal leader" = 'laurier' AND "Popular vote" > '521,041' AND "Liberal candidates" = '213' AND "Seats in House" < '235'
### 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
### Instruction: CREATE TABLE furniture_manufacte ( Manufacturer_ID int, Furniture_ID int, Price_in_Dollar real ) CREATE TABLE furniture ( Furniture_ID int, Name text, Num_of_Component int, Market_Rate real ) CREATE TABLE manufacturer ( Manufacturer_ID int, Open_Year real, Name...
SELECT Name, COUNT(*) FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.Manufacturer_ID = t2.Manufacturer_ID GROUP BY t1.Manufacturer_ID ORDER BY Name
### Instruction: CREATE TABLE table_30827 ( "DrumSet Name" text, "Product Line" text, "Years Available" text, "Drum Module" text, "KickDrum Pad" text, "Snare Pad" text, "Tom-Tom Pads" text, "Hi-HatPad/ Controller" text, "CrashandRide CymbalPads" text, "DrumStand (oftenoptional)" ...
SELECT COUNT("DrumSet Name") FROM table_30827 WHERE "DrumStand (oftenoptional)" = 'HD-1/3Stand' AND "Tom-Tom Pads" = '3xCloth-Head'
### 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 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, Team_ID FROM basketball_match ORDER BY Team_Name
### 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 member ( member_id number...
SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959
### Instruction: CREATE TABLE table_61762 ( "7:30 am" text, "8:00 am" text, "9:00 am" text, "11:00 am" text, "noon" text, "12:30 pm" text, "1:00 pm" text, "1:30 pm" text, "2:00 pm" text, "3:00 pm" text, "3:30 pm" text, "5:00 pm" text, "6:30 pm" text ) -- Using valid...
SELECT "3:00 pm" FROM table_61762 WHERE "1:00 pm" = 'days of our lives'
### 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 All_Neutral
### 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 building FROM faculty WHERE rank = "Professor" GROUP BY building HAVING COUNT(*) >= 10
### 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(Grape) FROM wine GROUP BY Grape ORDER BY Grape DESC
### Instruction: CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor 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) DESC
### 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 local_authority, COUNT(local_authority) FROM station GROUP BY local_authority ORDER BY COUNT(local_authority) DESC
### 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 local_authority, COUNT(local_authority) FROM station GROUP BY local_authority ORDER BY local_authority DESC
### Instruction: CREATE TABLE table_19505 ( "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 COUNT("Obamacare: Fed/ State/ Partnership") FROM table_19505 WHERE "State" = 'Louisiana'
### Instruction: CREATE TABLE artist ( artist_id number, artist text, age number, famous_title text, famous_release_date text ) CREATE TABLE volume ( volume_id number, volume_issue text, issue_date text, weeks_on_top number, song text, artist_id number ) CREATE TABLE music_...
SELECT T1.date_of_ceremony FROM music_festival AS T1 JOIN volume AS T2 ON T1.volume = T2.volume_id WHERE T2.weeks_on_top > 2
### Instruction: CREATE TABLE table_48274 ( "Tournament" text, "1984" text, "1985" text, "1986" text, "1987" text, "1988" text, "1989" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "Career SR" text ) -- Usin...
SELECT "1991" FROM table_48274 WHERE "1990" = 'atp masters series'
### Instruction: CREATE TABLE broadcast ( channel_id number, program_id number, time_of_day text ) CREATE TABLE program ( program_id number, name text, origin text, launch number, owner text ) CREATE TABLE broadcast_share ( channel_id number, program_id number, date text, ...
SELECT name FROM program EXCEPT SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.time_of_day = "Morning"
### 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, School_ID FROM basketball_match ORDER BY School_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 Team_ID, School_ID FROM basketball_match GROUP BY ACC_Home
### 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 Date_of_Birth 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_Regular_Season, All_Games_Percent FROM basketball_match
### Instruction: CREATE TABLE School ( School_id text, School_name text, Location text, Mascot text, Enrollment int, IHSAA_Class text, IHSAA_Football_Class text, County text ) CREATE TABLE budget ( School_id int, Year int, Budgeted int, total_budget_percent_budgeted real...
SELECT County, COUNT(*) FROM School GROUP BY County ORDER BY COUNT(*)
### Instruction: CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor 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 Date_of_Birth
### 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 Home_team, Away_team
### Instruction: CREATE TABLE table_8665 ( "Province" text, "Capital" text, "Population at 2010 Census" real, "Area (km\u00b2)" real, "Density (2010)" real, "Geographical unit" text, "Number of Cities (kota)" real, "Number of Regencies (kabupaten)" real, "Number of Districts (kecamat...
SELECT MIN("Number of Districts (kecamatan)") FROM table_8665 WHERE "Province" = 'north sulawesi' AND "Villages" > '1,510'
### Instruction: CREATE TABLE protein ( common_name text, protein_name text, divergence_from_human_lineage real, accession_number text, sequence_length real, sequence_identity_to_human_protein text, Institution_id text ) CREATE TABLE building ( building_id text, Name text, Stree...
SELECT Type, COUNT(*) FROM Institution GROUP BY Type
### Instruction: CREATE TABLE operate_company ( id int, name text, Type text, Principal_activities text, Incorporated_in text, Group_Equity_Shareholding real ) CREATE TABLE airport ( id int, City text, Country text, IATA text, ICAO text, name text ) CREATE TABLE flight ...
SELECT Type, COUNT(Type) FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id GROUP BY Type
### Instruction: CREATE TABLE table_203_592 ( id number, "institution" text, "location" text, "athletic nickname" text, "undergraduate enrollment" number, "graduate enrollment" number, "total enrollment" number, "2013 endowment\n(and us rank)" text, "academic staff" number, "mott...
SELECT "institution" FROM table_203_592 WHERE "graduate enrollment" < (SELECT "graduate enrollment" FROM table_203_592 WHERE "institution" = 'columbia university') ORDER BY "graduate enrollment" DESC LIMIT 1
### Instruction: CREATE TABLE artist ( artist_name text, country text, gender text, preferred_genre 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 numb...
SELECT f_id FROM files WHERE formats = "mp4" UNION SELECT f_id FROM song WHERE resolution > 720
### Instruction: CREATE TABLE dorm ( dormid number, dorm_name text, student_capacity number, gender text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE dorm_amenity ( a...
SELECT fname, lname FROM student WHERE major <> (SELECT major FROM student GROUP BY major 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
### Instruction: CREATE TABLE table_59279 ( "7:30 am" text, "8:00 am" text, "9:00 am" text, "11:00 am" text, "noon" text, "12:30 pm" text, "1:00 pm" text, "1:30 pm" text, "2:00 pm" text, "3:00 pm" text, "3:30 pm" text, "5:00 pm" text, "6:30 pm" text ) -- Using valid...
SELECT "8:00 am" FROM table_59279 WHERE "3:00 pm" = 'local programs'
### Instruction: CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE activity ( actid number, activity_name tex...
SELECT facid FROM faculty EXCEPT SELECT facid FROM faculty_participates_in
### 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 destination
### Instruction: CREATE TABLE purchase ( member_id number, branch_id text, year text, total_pounds number ) CREATE TABLE membership_register_branch ( member_id number, branch_id text, register_year text ) CREATE TABLE member ( member_id number, card_number text, name text, ...
SELECT MIN(membership_amount), MAX(membership_amount) FROM branch WHERE open_year = 2011 OR city = 'London'
### 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
### Instruction: CREATE TABLE table_65267 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" real, "Water (sqmi)" real, "Latitude" real, "Longitude" real, "GEO ID" real, "ANSI code" real ) -- Using valid SQLite, answer the following questions for the tables provi...
SELECT MAX("Water (sqmi)") FROM table_65267 WHERE "Land ( sqmi )" > '33.576' AND "Township" = 'glenila' AND "Latitude" > '48.832189'
### 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 ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE TABLE repair_assignment ( tec...
SELECT Name, COUNT(Name) FROM technician WHERE Team <> "NYY" GROUP BY Name ORDER BY Name
### Instruction: CREATE TABLE train ( Train_ID int, Train_Num text, Name text, From text, Arrival text, Railway_ID int ) CREATE TABLE railway ( Railway_ID int, Railway text, Builder text, Built text, Wheels text, Location text, ObjectNumber text ) CREATE TABLE railw...
SELECT Arrival, COUNT(Arrival) FROM train GROUP BY Arrival ORDER BY COUNT(Arrival)
### 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 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 Area, COUNT(Area) FROM appellations GROUP BY Area ORDER BY COUNT(Area)