instruction
stringlengths
212
6.3k
output
stringlengths
6
2.03k
### Instruction: CREATE TABLE train ( id number, train_number number, name text, origin text, destination text, time text, interval text ) CREATE TABLE station ( id number, network_name text, services text, local_authority text ) CREATE TABLE weekly_weather ( station_id...
SELECT local_authority, services FROM station
### Instruction: CREATE TABLE table_56532 ( "Year" text, "Starts" real, "Cuts made" real, "Wins" real, "Top 10" real, "Top 25" real, "Earnings ($)" real, "Money list rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Starts th...
SELECT COUNT("Starts") FROM table_56532 WHERE "Cuts made" = '2' AND "Top 25" > '0' AND "Earnings ($)" < '338,067'
### Instruction: CREATE TABLE table_203_215 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- did ito take 1st in the 10,000 m before or after ...
SELECT (SELECT "year" FROM table_203_215 WHERE "position" = 1 AND "event" = '10,000m') < (SELECT "year" FROM table_203_215 WHERE "position" = 28 AND "event" = '10,000m')
### Instruction: CREATE TABLE culture_company ( company_name text, type text, incorporated_in text, group_equity_shareholding number, book_club_id text, movie_id text ) CREATE TABLE movie ( movie_id number, title text, year number, director text, budget_million number, g...
SELECT DISTINCT publisher FROM book_club
### Instruction: CREATE TABLE table_203_385 ( id number, "material" text, "formula" text, "refractive\nindex(es)\n589.3 nm" text, "dispersion\n431 - 687 nm" number, "hardness\n(mohs'\nscale)" text, "density\n(g/cm3)" text, "thermal\ncond." text, "state of\nthe art" text ) -- Using ...
SELECT "hardness\n(mohs'\nscale)" FROM table_203_385 WHERE "material" = 'diamond'
### Instruction: CREATE TABLE employment ( company_id number, people_id number, year_working number ) CREATE TABLE people ( people_id number, age number, name text, nationality text, graduation_college text ) CREATE TABLE company ( company_id number, name text, headquarters...
SELECT name FROM people WHERE NOT people_id IN (SELECT people_id FROM employment)
### 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 decor, COUNT(*) FROM Rooms WHERE bedType = "King" GROUP BY decor
### Instruction: CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, ...
SELECT Allergy, COUNT(*) FROM Has_Allergy GROUP BY Allergy ORDER BY Allergy DESC
### Instruction: CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following ...
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name
### Instruction: CREATE TABLE table_204_549 ( id number, "series\nnumber" text, "key" text, "composed" text, "published" text, "opus no." text, "brown" text, "kobylanska" text, "chominski" text, "dedication" text, "notes" text ) -- Using valid SQLite, answer the following q...
SELECT "published" FROM table_204_549 WHERE id = (SELECT id FROM table_204_549 WHERE "series\nnumber" = '14-17') - 1
### Instruction: CREATE TABLE table_204_859 ( id number, "year" number, "seniors (trood award & rodda medal)" text, "reserves (rex hartley medal)" text, "under 18's (bruce wilkinson medal)" text, "under 16's (shaw/carter medal)" text ) -- Using valid SQLite, answer the following questions for ...
SELECT COUNT(DISTINCT "reserves (rex hartley medal)") FROM table_204_859 WHERE "year" < (SELECT "year" FROM table_204_859 WHERE "reserves (rex hartley medal)" = 'tom hart')
### Instruction: CREATE TABLE sportsinfo ( stuid number, sportname text, hoursperweek number, gamesplayed number, onscholarship text ) CREATE TABLE video_games ( gameid number, gname text, gtype text ) CREATE TABLE student ( stuid number, lname text, fname text, age num...
SELECT advisor FROM student GROUP BY advisor HAVING COUNT(*) >= 2
### Instruction: CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text ) CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text ) -- Using valid SQ...
SELECT Author, COUNT(DISTINCT T1.Workshop_ID) FROM Acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY COUNT(DISTINCT T1.Workshop_ID)
### Instruction: CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE film ( Film_ID int, Rank_in_series int, ...
SELECT Location, COUNT(*) FROM cinema GROUP BY Location ORDER BY COUNT(*)
### Instruction: CREATE TABLE table_64052 ( "Rank\u2003" real, "Largest U.S. City\u2003" text, "Total" real, "Partners\u2003" real, "Other" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of partners for the firm with a ran...
SELECT AVG("Partners\u2003") FROM table_64052 WHERE "Rank\u2003" < '71' AND "Largest U.S. City\u2003" = 'philadelphia' AND "Other" > '77'
### Instruction: CREATE TABLE table_train_278 ( "id" int, "gender" string, "supine" bool, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "estimated_glomerular_filtration_rate_egfr" int, "diastolic_blood_pressure_dbp" int, "serum_creatinine" float, "bilirubin" float,...
SELECT * FROM table_train_278 WHERE bilirubin >= 2
### Instruction: CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, ...
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY city_code
### Instruction: CREATE TABLE table_66919 ( "Colt model no." text, "Name" text, "Stock" text, "Fire control" text, "Rear sight" text, "Forward assist" text, "Case deflector" text, "Barrel length" text, "Barrel profile" text, "Barrel twist" text, "Hand guards" text, "Bayon...
SELECT "Barrel length" FROM table_66919 WHERE "Barrel twist" = '1:7'
### 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 decor, COUNT(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor
### Instruction: CREATE TABLE table_train_217 ( "id" int, "gender" string, "c_peptide_level" float, "hemoglobin_a1c_hba1c" float, "hematocrit_hct" float, "insulin_requirement" float, "serum_creatinine" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the...
SELECT * FROM table_train_217 WHERE (hematocrit_hct < 36 AND gender = 'female') OR (hematocrit_hct < 38 AND gender = 'male')
### Instruction: CREATE TABLE table_44982 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" real, "Avg. Finish" real, "Winnings" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT "Winnings" FROM table_44982 WHERE "Starts" > '34' AND "Poles" < '1' AND "Top 10" = '5'
### Instruction: CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, ...
SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY Sex
### Instruction: CREATE TABLE table_7087 ( "Rank" real, "Name" text, "Population 1991" real, "Population 2001" real, "Population 2007" real, "State" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the sum of the population in 2007, from ...
SELECT SUM("Population 2007") FROM table_7087 WHERE "State" = 'tyrol' AND "Population 1991" < '10,179' AND "Rank" > '52'
### Instruction: CREATE TABLE employment ( company_id number, people_id number, year_working number ) CREATE TABLE people ( people_id number, age number, name text, nationality text, graduation_college text ) CREATE TABLE company ( company_id number, name text, headquarters...
SELECT headquarters FROM company ORDER BY sales_in_billion DESC LIMIT 1
### Instruction: CREATE TABLE table_58797 ( "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, "Total Apps" text, "Total Goals" real ) -- Using valid SQLite, answer the...
SELECT MIN("League Goals") FROM table_58797 WHERE "FA Cup Apps" = '0' AND "Total Apps" = '1 (3)'
### Instruction: CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following ...
SELECT T1.Name, MAX(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY MAX(T1.Price)
### Instruction: CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text ) -- Using valid SQLite, answer the following questions for the tables provided...
SELECT year, COUNT(year) FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title ORDER BY year
### Instruction: CREATE TABLE table_43442 ( "Position" real, "Club" text, "Games played" real, "Wins" real, "Draws" real, "Loses" real, "Goals scored" real, "Goals conceded" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT SUM("Points") FROM table_43442 WHERE "Goals conceded" < '51' AND "Position" > '1' AND "Draws" = '7' AND "Loses" > '5'
### Instruction: CREATE TABLE table_204_363 ( id number, "res." text, "record" text, "opponent" text, "method" text, "event" text, "date" text, "round" number, "time" text, "location" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables ...
SELECT "event" FROM table_204_363 WHERE "res." = 'win' AND "date" < (SELECT "date" FROM table_204_363 WHERE "event" = 'ufc 87') ORDER BY "date" DESC LIMIT 1
### Instruction: CREATE TABLE table_12547 ( "Tournament" text, "1973" text, "1974" text, "1975" text, "1976" text, "1977" text, "1978" text, "1979" text, "1983" text, "1984" text, "1985" text, "1986" text ) -- Using valid SQLite, answer the following questions for the t...
SELECT "1976" FROM table_12547 WHERE "Tournament" = 'overall win – loss'
### Instruction: CREATE TABLE table_train_254 ( "id" int, "gender" string, "systolic_blood_pressure_sbp" int, "heart_disease" bool, "hgba1c" float, "renal_disease" bool, "creatinine_clearance_cl" float, "diastolic_blood_pressure_dbp" int, "diabetes" bool, "hypertension" bool, ...
SELECT * FROM table_train_254 WHERE heart_disease = 1
### Instruction: CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, ...
SELECT Name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID ORDER BY Name DESC
### Instruction: CREATE TABLE table_204_704 ( id number, "province" text, "map #" number, "iso 3166-2:af" text, "centers" text, "population" number, "area (km2)" number, "language" text, "notes" text, "u.n. region" text ) -- Using valid SQLite, answer the following questions fo...
SELECT COUNT("province") FROM table_204_704 WHERE "province" <> 'kabul' AND "notes" = (SELECT "notes" FROM table_204_704 WHERE "province" = 'kabul')
### Instruction: CREATE TABLE table_49611 ( "Region (year)" text, "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 ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT "No. 7" FROM table_49611 WHERE "Region (year)" = 'arizona (2010)'
### Instruction: CREATE TABLE table_66663 ( "Position" real, "Sail Number" text, "Yacht" text, "State/Country" text, "Yacht Type" text, "LOA (Metres)" real, "Skipper" text, "Elapsed Time d:hh:mm:ss" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "Yacht Type" FROM table_66663 WHERE "LOA (Metres)" < '16.5' AND "Elapsed Time d:hh:mm:ss" = '3:14:41:28'
### Instruction: CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, aid number ) CREATE TABLE employee ( eid number, name text, salary number ) CREATE TABLE aircraft ( aid number, ...
SELECT T2.name FROM certificate AS T1 JOIN aircraft AS T2 ON T2.aid = T1.aid GROUP BY T1.aid ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: CREATE TABLE table_203_364 ( id number, "year" number, "driver" text, "nation of citizenship" text, "racing series" text, "type of vehicle" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- out of these drivers : nigel mansell , al...
SELECT "driver" FROM table_203_364 WHERE "driver" IN ('nigel mansell', 'al unser, jr', 'michael schumacher', 'jeff gordon') GROUP BY "driver" HAVING COUNT(*) = 1
### Instruction: CREATE TABLE branch ( branch_id number, name text, open_year text, address_road text, city text, membership_amount text ) CREATE TABLE member ( member_id number, card_number text, name text, hometown text, level number ) CREATE TABLE purchase ( member_i...
SELECT name FROM branch ORDER BY membership_amount DESC LIMIT 3
### Instruction: CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, ...
SELECT LName, COUNT(LName) FROM Student WHERE Sex = 'F' GROUP BY LName
### Instruction: CREATE TABLE table_73336 ( "Administrative division" text, "Area (km\u00b2) 2005" text, "Population 2010 Census" real, "Population 2011 SIAK Database" text, "Population density (/km\u00b2 2010)" real ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT "Population density (/km\u00b2 2010)" FROM table_73336 WHERE "Population 2010 Census" = '264170'
### Instruction: CREATE TABLE table_name_21 ( geo_id INTEGER, water__sqmi_ VARCHAR, township VARCHAR, land___sqmi__ VARCHAR, latitude VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the geo id when the land (sqmi) is less than 36.112, the ...
SELECT SUM(geo_id) FROM table_name_21 WHERE land___sqmi__ < 36.112 AND latitude > 47.536618 AND township = "west bay" AND water__sqmi_ > 0.209
### Instruction: CREATE TABLE table_28371 ( "Name" text, "GP" real, "Solo" real, "Ast" real, "Total" real, "TFL-Yds" text, "No-Yds" text, "BrUp" real, "No.-Yds" text, "Avg" text, "TD" real, "Long" real, "Rcv-Yds" text, "FF" real, "Blkd Kick" real ) -- Using ...
SELECT MAX("FF") FROM table_28371 WHERE "Solo" = '56'
### 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 Openning_year, SUM(Capacity) FROM cinema GROUP BY Openning_year
### Instruction: CREATE TABLE table_name_5 ( lower_index_kcal__nm_3 INTEGER, lower_index_mj__nm_3 VARCHAR, upper_index_kcal__nm_3 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Lower index Kcal/ Nm 3 entry, for the row with entries of an Uppe...
SELECT AVG(lower_index_kcal__nm_3) FROM table_name_5 WHERE lower_index_mj__nm_3 = 74.54 AND upper_index_kcal__nm_3 < 19 OFFSET 376
### Instruction: CREATE TABLE table_train_59 ( "id" int, "bone_marrow_transplant" bool, "nephrolithiasis_history" bool, "taking_vitamin_c" bool, "immune_suppression" bool, "neutrophil_count" int, "monoclonal_antibodies_mab" int, "sepsis" bool, "glucose_6_phosphate_dehydrogenase_defic...
SELECT * FROM table_train_59 WHERE nephrolithiasis_history = 1
### Instruction: CREATE TABLE table_42006 ( "Member State" text, "Population in millions" real, "Population % of EU" text, "Area km 2" real, "Area % of EU" text, "Pop. density People/km 2" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is t...
SELECT SUM("Area km 2") FROM table_42006 WHERE "Pop. density People/km 2" > '91' AND "Member State" = 'italy' AND "Population in millions" < '58.8'
### Instruction: CREATE TABLE university ( school_id number, school text, location text, founded number, affiliation text, enrollment number, nickname text, primary_conference text ) CREATE TABLE basketball_match ( team_id number, school_id number, team_name text, acc_re...
SELECT MAX(enrollment) FROM university
### Instruction: CREATE TABLE table_70913 ( "Year" real, "Total Region" real, "Belyando" real, "Broadsound" real, "Nebo" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Total Region that has a Broadsound greater than 1,590, a Year...
SELECT MAX("Total Region") FROM table_70913 WHERE "Broadsound" > '1,590' AND "Year" > '1966' AND "Belyando" > '11,362' AND "Nebo" = '914'
### Instruction: CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following ...
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name
### Instruction: CREATE TABLE train_station ( train_id number, station_id number ) CREATE TABLE station ( station_id number, name text, annual_entry_exit number, annual_interchanges number, total_passengers number, location text, main_services text, number_of_platforms number ) ...
SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, ...
SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType
### Instruction: CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following ...
SELECT T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
### Instruction: CREATE TABLE table_76599 ( "Year" real, "Starts" real, "Wins" real, "Top 10" real, "Avg. Start" real, "Avg. Finish" real, "Winnings" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average top...
SELECT AVG("Top 10") FROM table_76599 WHERE "Starts" = '2' AND "Winnings" = '$135,984' AND "Avg. Finish" > '43'
### Instruction: CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following ...
SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
### Instruction: CREATE TABLE phone ( screen_mode VARCHAR, Accreditation_type VARCHAR ) CREATE TABLE screen_mode ( pixels VARCHAR, Graphics_mode VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the pixels of the screen modes that are used by both...
SELECT t1.pixels FROM screen_mode AS t1 JOIN phone AS t2 ON t1.Graphics_mode = t2.screen_mode WHERE t2.Accreditation_type = 'Provisional' INTERSECT SELECT t1.pixels FROM screen_mode AS t1 JOIN phone AS t2 ON t1.Graphics_mode = t2.screen_mode WHERE t2.Accreditation_type = 'Full'
### Instruction: CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Allergy_Type ( Aller...
SELECT AllergyType, COUNT(AllergyType) FROM Allergy_Type GROUP BY AllergyType
### Instruction: CREATE TABLE problem_log ( problem_id VARCHAR, problem_log_id VARCHAR, assigned_to_staff_id VARCHAR ) CREATE TABLE staff ( staff_id VARCHAR, staff_first_name VARCHAR, staff_last_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above...
SELECT DISTINCT T2.problem_id, T2.problem_log_id FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T1.staff_first_name = "Rylan" AND T1.staff_last_name = "Homenick"
### Instruction: CREATE TABLE table_59082 ( "Season" text, "GP/MP" text, "Kills" real, "K/Game" real, "Errors" real, "Total Attempts" real, "Percentage" real, "Assists" real, "Service Aces" real, "Digs" real, "Solo Blocks" real, "Block Assists" real, "Total Blocks" re...
SELECT MAX("Percentage") FROM table_59082 WHERE "Total Blocks" > '361'
### Instruction: CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following ...
SELECT Founder, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
### Instruction: CREATE TABLE aircraft ( aid number, name text, distance number ) CREATE TABLE certificate ( eid number, aid number ) CREATE TABLE employee ( eid number, name text, salary number ) CREATE TABLE flight ( flno number, origin text, destination text, distan...
SELECT T2.name FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING COUNT(*) >= 2
### Instruction: CREATE TABLE table_204_828 ( id number, "whitworth size (in)" number, "core diameter (in)" number, "threads per inch" number, "pitch (in)" number, "tapping drill size" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many more...
SELECT (SELECT "threads per inch" FROM table_204_828 WHERE "whitworth size (in)" = '1/16') - (SELECT "threads per inch" FROM table_204_828 WHERE "whitworth size (in)" = '1/8')
### Instruction: CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following ...
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name
### Instruction: CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following ...
SELECT T1.Code, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
### Instruction: CREATE TABLE table_203_222 ( id number, "category" text, "#" number, "name" text, "hanzi" text, "hanyu pinyin" text, "population (2010 census)" number, "area (km2)" number, "density (/km2)" number ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT ABS((SELECT "population (2010 census)" FROM table_203_222 WHERE "name" = 'enping') - (SELECT "population (2010 census)" FROM table_203_222 WHERE "name" = 'heshan'))
### Instruction: CREATE TABLE table_55211 ( "Average population" text, "Live births" real, "Deaths" real, "Natural change" real, "Crude birth rate (per 1000)" real, "Crude death rate (per 1000)" real, "Natural change (per 1000)" real ) -- Using valid SQLite, answer the following questions ...
SELECT "Natural change" FROM table_55211 WHERE "Crude death rate (per 1000)" = '8.7' AND "Live births" < '472'
### Instruction: CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following ...
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name
### 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 County_name, Population FROM county
### Instruction: CREATE TABLE table_train_155 ( "id" int, "cholesterol" float, "bleeding" int, "systolic_blood_pressure_sbp" int, "diabetic" string, "hyperlipidemia" bool, "creatinine_clearance_cl" float, "platelet_count" float, "hypertension" bool, "NOUSE" float ) -- Using val...
SELECT * FROM table_train_155 WHERE hypertension = 1 OR systolic_blood_pressure_sbp > 150
### Instruction: CREATE TABLE table_27459 ( "Rank" real, "Rider" text, "Sat 29 May" text, "Mon 31 May" text, "Tues 1 June" text, "Wed 2 June" text, "Thurs 3 June" text, "Fri 4 June" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If Tuesd...
SELECT MAX("Rank") FROM table_27459 WHERE "Tues 1 June" = '20'' 59.60 107.834mph'
### Instruction: CREATE TABLE table_15383 ( "Position" real, "Club" text, "Played" real, "Points" text, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the table...
SELECT SUM("Losses") FROM table_15383 WHERE "Wins" = '12' AND "Points" = '40-4' AND "Goals for" > '57'
### Instruction: CREATE TABLE table_12400 ( "Athlete" text, "Country" text, "Run 1" real, "Run 2" real, "Run 3" real, "Run 4" real, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Run 4 has a Country of united states, and an Ath...
SELECT SUM("Run 4") FROM table_12400 WHERE "Country" = 'united states' AND "Athlete" = 'bree schaaf emily azevedo' AND "Run 3" < '58.04'
### Instruction: CREATE TABLE table_72515 ( "Rank" real, "Rider" text, "Mon 26 May" text, "Tues 27 May" text, "Wed 28 May" text, "Thurs 29 May" text, "Fri 30 May" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the numbr for fri may 3...
SELECT "Fri 30 May" FROM table_72515 WHERE "Mon 26 May" = '19'' 02.890 118.847mph'
### Instruction: CREATE TABLE table_24458 ( "Country" text, "Area (km\u00b2)" text, "Population (millions, 2011)" text, "GDP (PPP) (USD, per capita)" real, "GDP (nominal) (billions USD)" text, "HDI (2011)" text ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT "Population (millions, 2011)" FROM table_24458 WHERE "GDP (nominal) (billions USD)" = '4'
### Instruction: CREATE TABLE table_7137 ( "Rank" text, "Belarusian (BGN/PCGN)" text, "Russian (BGN/PCGN)" text, "Status" text, "Obtaining" text, "Foundation" text, "Population (2010)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Bela...
SELECT "Belarusian (BGN/PCGN)" FROM table_7137 WHERE "Status" = 'raion' AND "Foundation" = '1514' AND "Population (2010)" = '8100'
### Instruction: CREATE TABLE table_68153 ( "Race" text, "Dist (f)" real, "Course" text, "Class" text, "Prize (\u00a3K)" real, "Odds" text, "Runners" real, "Placing" real, "Margin" real, "Time" text, "Jockey" text, "Trainer" text ) -- Using valid SQLite, answer the foll...
SELECT "Course" FROM table_68153 WHERE "Jockey" = 'fergal lynch' AND "Odds" = '5/1'
### Instruction: CREATE TABLE grapes ( id number, grape text, color text ) 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 appellatio...
SELECT grape, appelation, name FROM wine WHERE score > 93 ORDER BY name
### Instruction: CREATE TABLE broadcast_share ( channel_id number, program_id number, date text, share_in_percent number ) CREATE TABLE program ( program_id number, name text, origin text, launch number, owner text ) CREATE TABLE channel ( channel_id number, name text, ...
SELECT name FROM program WHERE origin <> 'Beijing'
### 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 result, COUNT(*) FROM music_festival GROUP BY result ORDER BY COUNT(*) DESC
### Instruction: CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text...
SELECT Carrier, AVG(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY AVG(Memory_in_G) DESC
### Instruction: CREATE TABLE table_203_320 ( id number, "rank in\n2011" number, "name of\nconcern" text, "location of\nheadquarters" text, "revenue\n(thou.\npln)" number, "profit\n(thou.\npln)" number, "employees" number ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT "name of\nconcern" FROM table_203_320 WHERE "revenue\n(thou.\npln)" > 75000000
### Instruction: CREATE TABLE table_train_54 ( "id" int, "organ_transplantation" bool, "severe_sepsis" bool, "systolic_blood_pressure_sbp" int, "hiv_infection" bool, "thrombocytopenia" float, "sepsis" bool, "hypotension" bool, "burn_injury" int, "septic_shock" bool, "age" flo...
SELECT * FROM table_train_54 WHERE burn_injury > 10
### Instruction: CREATE TABLE branch ( branch_id number, name text, open_year text, address_road text, city text, membership_amount text ) CREATE TABLE purchase ( member_id number, branch_id text, year text, total_pounds number ) CREATE TABLE membership_register_branch ( me...
SELECT level FROM member GROUP BY level ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following ...
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name
### Instruction: CREATE TABLE table_71448 ( "Tournament" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is ...
SELECT "2007" FROM table_71448 WHERE "2009" = '1r' AND "Tournament" = 'us open'
### Instruction: CREATE TABLE table_12373 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the table...
SELECT AVG("Goals against") FROM table_12373 WHERE "Wins" = '13' AND "Goals for" > '42' AND "Losses" > '9'
### Instruction: CREATE TABLE table_67936 ( "Tournament" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the 2009 result ...
SELECT "2009" FROM table_67936 WHERE "2012" = '1r' AND "2007" = '2r'
### Instruction: CREATE TABLE artist ( Artist_ID int, Artist text, Age int, Famous_Title text, Famous_Release_date text ) CREATE TABLE music_festival ( ID int, Music_Festival text, Date_of_ceremony text, Category text, Volume int, Result text ) CREATE TABLE volume ( Vol...
SELECT Result, COUNT(Result) FROM music_festival GROUP BY Result
### Instruction: CREATE TABLE table_40770 ( "Club" text, "Wins" real, "Losses" real, "Points For" real, "Points Against" real, "Percentage" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Percentage when the...
SELECT AVG("Percentage") FROM table_40770 WHERE "Wins" > '0' AND "Points Against" > '481' AND "Losses" = '8' AND "Points For" > '826'
### Instruction: CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, Attorney_General text, US_Senate text ) CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE T...
SELECT County_name, Population FROM county
### Instruction: CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following ...
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name
### Instruction: CREATE TABLE table_train_93 ( "id" int, "mini_mental_state_examination_mmse" int, "creatinine_clearance_cl" float, "cornell_scale_for_depression_in_dementia_csdd" int, "clinical_dementia_rating_cdr" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions f...
SELECT * FROM table_train_93 WHERE cornell_scale_for_depression_in_dementia_csdd > 10
### Instruction: CREATE TABLE people ( people_id number, sex text, name text, date_of_birth text, height number, weight number ) CREATE TABLE candidate ( candidate_id number, people_id number, poll_source text, date text, support_rate number, consider_rate number, op...
SELECT t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex ORDER BY AVG(t2.unsure_rate) DESC LIMIT 1
### Instruction: CREATE TABLE table_204_44 ( id number, "face value" number, "\u20ac0.01" number, "\u20ac0.02" number, "\u20ac0.05" number, "\u20ac0.10" number, "\u20ac0.20" number, "\u20ac0.50" number, "\u20ac1.00" number, "\u20ac2.00" number ) -- Using valid SQLite, answer th...
SELECT SUM("\u20ac0.01") FROM table_204_44
### Instruction: CREATE TABLE table_42617 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many cuts made when the Top-10 is larger th...
SELECT COUNT("Cuts made") FROM table_42617 WHERE "Top-10" > '1' AND "Wins" > '0' AND "Top-5" > '2' AND "Events" > '18'
### Instruction: CREATE TABLE gymnast ( gymnast_id number, floor_exercise_points number, pommel_horse_points number, rings_points number, vault_points number, parallel_bars_points number, horizontal_bar_points number, total_points number ) CREATE TABLE people ( people_id number, ...
SELECT T2.age FROM gymnast AS T1 JOIN people AS T2 ON T1.gymnast_id = T2.people_id ORDER BY T1.total_points DESC
### Instruction: CREATE TABLE table_57576 ( "Ward" text, "Bello" text, "Ben-Tahir" text, "Doucet" text, "Furtenbacher" text, "Gauthier" text, "Haydon" text, "Larter" text, "Lawrance" text, "Libweshya" text, "Liscumb" text ) -- Using valid SQLite, answer the following questi...
SELECT "Bello" FROM table_57576 WHERE "Liscumb" = '27' AND "Libweshya" = '6539'
### Instruction: CREATE TABLE table_60288 ( "Year to April" real, "Revenue (US $million)" real, "EBIT (US $m)" real, "Net profit (US $m)" real, "Earnings per share (\u00a2)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- COunt the EBIT (US $m) which...
SELECT COUNT("EBIT (US $m)") FROM table_60288 WHERE "Revenue (US $million)" > '434.8' AND "Net profit (US $m)" > '96.4'
### Instruction: CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decisio...
SELECT cName, MIN(enr) FROM College GROUP BY state ORDER BY MIN(enr)
### Instruction: CREATE TABLE table_dev_57 ( "id" int, "intra_aortic_balloon_pump_iabp" bool, "systolic_blood_pressure_sbp" int, "heart_disease" bool, "vasopressors" bool, "temperature" float, "creatinine_clearance_cl" float, "cardiogenic_shock" bool, "height" int, "serum_creatin...
SELECT * FROM table_dev_57 WHERE heart_disease = 1
### Instruction: CREATE TABLE table_44529 ( "Team" text, "Average" real, "Points" real, "Played" real, "1991-92" text, "1992-93" text, "1993-94" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Total average with less than 105 points, 1993-199...
SELECT SUM("Average") FROM table_44529 WHERE "Points" < '105' AND "Team" = 'gimnasia y tiro' AND "1993-94" < '30'