instruction
stringlengths
212
6.3k
output
stringlengths
6
2.03k
### Instruction: CREATE TABLE table_204_39 ( id number, "number" number, "symbol" text, "name" text, "21st" number, "22nd" number, "23rd" number, "24th" number, "25th" number, "26th" number, "27th" number, "28th" number, "29th" number, "30th" number ) -- Using v...
SELECT "name" FROM table_204_39 WHERE "name" IN ('titanium', 'iron') AND "symbol" = 'fe'
### 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
### Instruction: CREATE TABLE table_72091 ( "District" text, "Total amount of trees" real, "Prevailing types, %" text, "Amount of old trees" text, "Amount of trees, that require replacement" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the...
SELECT "District" FROM table_72091 WHERE "Total amount of trees" < '150817.6878461314' AND "Amount of old trees" = '1,928 (1.89%)'
### Instruction: CREATE TABLE table_9693 ( "Year" real, "Lansing (LAN)" text, "Detroit (DTW)" text, "Grand Rapids (GRR)" text, "Flint (FNT)" text, "Kalamazoo (AZO)" text, "Saginaw (MBS)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Before ...
SELECT "Detroit (DTW)" FROM table_9693 WHERE "Year" < '2010' AND "Kalamazoo (AZO)" = '$517.32'
### Instruction: CREATE TABLE table_name_20 ( co_2_g_km VARCHAR, mpg_uk_combined VARCHAR, l_100km_urban__cold_ VARCHAR, fuel_type VARCHAR, manufacturer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the CO2 g/km of a Fiat running on diesel...
SELECT COUNT(co_2_g_km) FROM table_name_20 WHERE fuel_type = "diesel" AND manufacturer = "fiat" AND l_100km_urban__cold_ > 6.3 AND mpg_uk_combined = 43.5
### 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.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name
### Instruction: CREATE TABLE people ( People_ID int, Age int, Name text, Nationality text, Graduation_College text ) CREATE TABLE employment ( Company_ID int, People_ID int, Year_working int ) CREATE TABLE company ( Company_ID real, Name text, Headquarters text, Indust...
SELECT Industry, COUNT(Industry) FROM company GROUP BY Industry
### Instruction: CREATE TABLE table_64658 ( "English" text, "German" text, "Dutch" text, "Latin" text, "Romanian" text, "Portuguese" text, "Spanish" text, "Italian" text, "French" text, "Greek (Modern)" text, "Bulgarian" text, "Macedonian" text, "Polish (extinct)" tex...
SELECT "German" FROM table_64658 WHERE "Macedonian" = 'беше слушнал/-а/-о'
### 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.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name
### 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 DISTINCT year FROM party WHERE governor = "Eliot Spitzer"
### 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, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
### Instruction: CREATE TABLE has_allergy ( stuid number, allergy text ) CREATE TABLE allergy_type ( allergy text, allergytype text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) -- U...
SELECT COUNT(*) FROM student WHERE sex = "M" AND stuid IN (SELECT stuid FROM has_allergy AS T1 JOIN allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "food")
### Instruction: CREATE TABLE table_69490 ( "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 AVG("Wins") FROM table_69490 WHERE "Draws" > '13' AND "Goal Difference" = '-14' AND "Losses" < '14'
### Instruction: CREATE TABLE people ( People_ID int, District text, Name text, Party text, Age int ) CREATE TABLE debate ( Debate_ID int, Date text, Venue text, Num_of_Audience int ) CREATE TABLE debate_people ( Debate_ID int, Affirmative int, Negative int, If_Affi...
SELECT Name, COUNT(*) FROM debate_people AS T1 JOIN people AS T2 ON T1.Affirmative = T2.People_ID GROUP BY T2.Name
### Instruction: CREATE TABLE table_69203 ( "2003/ 04" text, "2004/ 05" text, "2007/ 08" 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. -- What was held in 2009/10 with Former ...
SELECT "2009/ 10" FROM table_69203 WHERE "2003/ 04" = 'former ranking tournaments'
### Instruction: CREATE TABLE table_train_112 ( "id" int, "systolic_blood_pressure_sbp" int, "modified_geriatric_depression_scale_gds" int, "diastolic_blood_pressure_dbp" int, "rosen_modified_hachinski_ischemic_score" int, "body_mass_index_bmi" float, "hypertension" bool, "NOUSE" float )...
SELECT * FROM table_train_112 WHERE body_mass_index_bmi >= 20 AND body_mass_index_bmi <= 35
### Instruction: CREATE TABLE table_27497 ( "Year" real, "Population" real, "Index" real, "Violent" real, "Property" real, "Murder" real, "Forcible rape" real, "Robbery" real, "Aggravated assault" real, "Burglary" real, "Larceny Theft" real, "Vehicle Theft" real ) -- Us...
SELECT MAX("Aggravated assault") FROM table_27497 WHERE "Robbery" = '3811'
### Instruction: CREATE TABLE table_train_242 ( "id" int, "macroalbuminuria" bool, "hyperlipidemia" bool, "fasting_serum_triglycerides" int, "fasting_ldl_cholesterol" int, "panel_reactive_antibodies" int, "serum_creatinine" float, "albumin" float, "body_mass_index_bmi" float, "fa...
SELECT * FROM table_train_242 WHERE body_mass_index_bmi > 26
### Instruction: CREATE TABLE table_58673 ( "Place (Posici\u00f3n)" real, "Team (Equipo)" text, "Played (PJ)" real, "Won (PG)" real, "Draw (PE)" real, "Lost (PP)" real, "Goals Scored (GF)" real, "Goals Conceded (GC)" real, "+/- (Dif.)" real, "Points (Pts.)" real ) -- Using vali...
SELECT AVG("Points (Pts.)") FROM table_58673 WHERE "Won (PG)" > '17'
### Instruction: CREATE TABLE stadium ( id number, name text, home_games number, average_attendance number, total_attendance number, capacity_percentage number ) CREATE TABLE injury_accident ( game_id number, id number, player text, injury text, number_of_matches text, s...
SELECT COUNT(DISTINCT source) FROM injury_accident
### Instruction: CREATE TABLE branch ( Branch_ID int, Name text, Open_year text, Address_road text, City text, membership_amount text ) CREATE TABLE purchase ( Member_ID int, Branch_ID text, Year text, Total_pounds real ) CREATE TABLE member ( Member_ID int, Card_Number...
SELECT Hometown, COUNT(Hometown) FROM member GROUP BY Hometown
### Instruction: CREATE TABLE table_10467 ( "Independent" text, "Lost" real, "Tied" real, "Pct." real, "Years" real, "Total Games" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number lost when the number tied is more than 4...
SELECT MAX("Lost") FROM table_10467 WHERE "Tied" > '42' AND "Years" < '132' AND "Pct." < '0.5729000000000001'
### Instruction: CREATE TABLE bridge ( architect_id int, id int, name text, location text, length_meters real, length_feet real ) CREATE TABLE architect ( id text, name text, nationality text, gender text ) CREATE TABLE mill ( architect_id int, id int, location text...
SELECT T1.name, T1.id FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id
### Instruction: CREATE TABLE table_29052 ( "District" real, "Region" text, "Communes" text, "Population (2002 census)" real, "% of total population" text, "VAP" real, "Enrolled" real, "Total votes" real, "Valid votes" real, "Turnout" text, "E/VAP" text, "T/VAP" text, ...
SELECT "E/VAP" FROM table_29052 WHERE "Turnout" = '85.7%'
### 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.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name
### Instruction: CREATE TABLE table_76317 ( "Tournament" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "Career SR" text, "Career Win-Loss" text ) -- Using valid SQLite, answer the following questions for the ta...
SELECT "1996" FROM table_76317 WHERE "1992" = 'atp masters series'
### Instruction: CREATE TABLE table_77583 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine \u2020" text, "Tyre" text, "Driver" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the chassis when the tyre is b,...
SELECT "Chassis" FROM table_77583 WHERE "Tyre" = 'b' AND "Engine \u2020" = 'ferrari 050 ferrari 051' AND "Driver" = 'rubens barrichello'
### 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 COUNT(DISTINCT stat_cause_descr) FROM fires
### Instruction: CREATE TABLE Office_locations ( building_id int, company_id int, move_in_year int ) CREATE TABLE Companies ( id int, name text, Headquarters text, Industry text, Sales_billion real, Profits_billion real, Assets_billion real, Market_Value_billion text ) CREA...
SELECT name, Assets_billion FROM Companies ORDER BY name
### Instruction: CREATE TABLE table_11103 ( "Suburb" text, "Population (in 2008)" real, "Median age (in 2006)" text, "Mean household size (in 2006)" text, "Area (km\u00b2)" real, "Density (/km\u00b2)" real, "Date first settled as a suburb" real, "Gazetted as a Division Name" text ) -- ...
SELECT "Suburb" FROM table_11103 WHERE "Date first settled as a suburb" = '1962'
### Instruction: CREATE TABLE table_25718 ( "#" real, "Producing Nation" text, "10 3 bbl/d (2006)" text, "10 3 bbl/d (2007)" real, "10 3 bbl/d (2008)" real, "10 3 bbl/d (2009)" real, "Present Share" text ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT MAX("10 3 bbl/d (2008)") FROM table_25718 WHERE "Present Share" = '1.7%'
### Instruction: CREATE TABLE inst ( instid number, name text, country text ) CREATE TABLE authors ( authid number, lname text, fname text ) CREATE TABLE papers ( paperid number, title text ) CREATE TABLE authorship ( authid number, instid number, paperid number, autho...
SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title = "Binders Unbound"
### Instruction: CREATE TABLE photos ( id int, camera_lens_id int, mountain_id int, color text, name text ) CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE mountain ( id int, name text, Height real, ...
SELECT T1.name, T1.id FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_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
### Instruction: CREATE TABLE basketball_match ( team_id number, school_id number, team_name text, acc_regular_season text, acc_percent text, acc_home text, acc_road text, all_games text, all_games_percent number, all_home text, all_road text, all_neutral text ) CREATE T...
SELECT school, location FROM university WHERE affiliation = 'Public'
### 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 ORDER BY decor DESC
### Instruction: CREATE TABLE table_49472 ( "Tongan" text, "Niuean" text, "S\u0101moan" text, "Takuu" text, "Tahitian" text, "Rarotongan" text, "M\u0101ori" text, "North Marquesan" text, "South Marquesan" text, "Hawai'ian" text, "Mangarevan" text ) -- Using valid SQLite, an...
SELECT "Tongan" FROM table_49472 WHERE "North Marquesan" = '/haʔe/'
### Instruction: CREATE TABLE school_bus ( school_id number, driver_id number, years_working number, if_full_time others ) CREATE TABLE school ( school_id number, grade text, school text, location text, type text ) CREATE TABLE driver ( driver_id number, name text, part...
SELECT T2.school, T3.name FROM school_bus AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id JOIN driver AS T3 ON T1.driver_id = T3.driver_id
### Instruction: CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE news_report ( journalist_ID int, Event_ID in...
SELECT Work_Type, AVG(Years_working) FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_ID = t2.journalist_ID GROUP BY t2.Work_Type
### Instruction: CREATE TABLE review ( a_id number, u_id number, i_id number, rating number, rank number ) CREATE TABLE useracct ( u_id number, name text ) CREATE TABLE item ( i_id number, title text ) CREATE TABLE trust ( source_u_id number, target_u_id number, trust ...
SELECT T1.name FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.source_u_id GROUP BY T2.source_u_id ORDER BY AVG(trust) DESC LIMIT 1
### Instruction: CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) 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 ...
SELECT state, MIN(enr) FROM College GROUP BY state ORDER BY MIN(enr)
### Instruction: CREATE TABLE table_name_82 ( county VARCHAR, rank VARCHAR, _percentage__1960_ VARCHAR, _percentage__2040_ VARCHAR, _percentage__2000_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which county has a % (2040) larger than 1.8, a %...
SELECT county FROM table_name_82 WHERE _percentage__2040_ > 1.8 AND _percentage__2000_ < 4.1 AND _percentage__1960_ < 3.2 AND rank = "13"
### Instruction: CREATE TABLE school ( School_ID int, Grade text, School text, Location text, Type text ) CREATE TABLE driver ( Driver_ID int, Name text, Party text, Home_city text, Age int ) CREATE TABLE school_bus ( School_ID int, Driver_ID int, Years_Working int,...
SELECT Type, COUNT(*) FROM school_bus AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T2.Type ORDER BY COUNT(*)
### Instruction: CREATE TABLE services ( service_id VARCHAR, service_name VARCHAR ) CREATE TABLE customers ( customer_name VARCHAR, customer_id VARCHAR ) CREATE TABLE first_notification_of_loss ( customer_id VARCHAR, service_id VARCHAR ) -- Using valid SQLite, answer the following questions ...
SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = "Close a policy" OR t3.service_name = "Upgrade a policy"
### Instruction: CREATE TABLE table_204_135 ( id number, "position" number, "club" text, "played" number, "points" number, "wins" number, "draws" number, "losses" number, "goals for" number, "goals against" number, "goal difference" number ) -- Using valid SQLite, answer th...
SELECT "club" FROM table_204_135 WHERE "club" <> 'granada cf' AND "goals against" = (SELECT "goals for" FROM table_204_135 WHERE "club" = 'granada cf')
### Instruction: CREATE TABLE table_1382 ( "Year" real, "January" text, "February" text, "March" text, "April" text, "May" text, "June" text, "July" text, "August" text, "September" text, "October" text, "November" text, "December" text, "Annual Additions(in milli...
SELECT "July" FROM table_1382 WHERE "March" = '0.41'
### Instruction: CREATE TABLE table_42119 ( "Position" real, "Channel" text, "Launch date" real, "Owner" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013 (p)" real ) -- Using valid SQLite, answer the...
SELECT "Channel" FROM table_42119 WHERE "2011" = '8.5'
### Instruction: CREATE TABLE table_78139 ( "D 41 O" text, "D 42 O" text, "D 43 O" text, "D 44 O" text, "D 45 +" text, "R 55 +" text, "R 54 +" text, "R 53 +" text, "R 52 O" text, "R 51 O" text ) -- Using valid SQLite, answer the following questions for the tables provided above...
SELECT "D 42 O" FROM table_78139 WHERE "R 53 +" = 'r 8'
### Instruction: CREATE TABLE table_26202 ( "Country" text, "% of all immigrants 2008" text, "% of all immigrants 2007" text, "% of all immigrants 2006" text, "% of all immigrants 2005" text, "% of all immigrants 2004" text ) -- Using valid SQLite, answer the following questions for the tables...
SELECT "% of all immigrants 2007" FROM table_26202 WHERE "% of all immigrants 2008" = '1.7%'
### 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 pregnancy_or_lactation = 1 AND (age >= 18 AND age <= 40)
### 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 bedType, COUNT(*) FROM Rooms GROUP BY bedType ORDER BY bedType
### Instruction: CREATE TABLE station ( id number, network_name text, services text, local_authority text ) CREATE TABLE route ( train_id number, station_id number ) CREATE TABLE weekly_weather ( station_id number, day_of_week text, high_temperature number, low_temperature numb...
SELECT origin, COUNT(*) FROM train GROUP BY origin
### Instruction: CREATE TABLE table_3609 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the incumbent(s) in the election featuring john...
SELECT "Incumbent" FROM table_3609 WHERE "Candidates" = 'John Murray (DR) 50.4% George Denison (DR) 49.6%' AND "Result" = 'Retired Democratic-Republican hold'
### Instruction: CREATE TABLE table_57095 ( "car plates (since 1937)" text, "Voivodeship Separate city" text, "Capital" text, "Area in 1000km\u00b2 (1930)" text, "Population in 1000 (1931)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- tell me the ...
SELECT "Population in 1000 (1931)" FROM table_57095 WHERE "car plates (since 1937)" = '35-39'
### 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 Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Aller...
SELECT Allergy, COUNT(*) FROM Has_Allergy GROUP BY Allergy ORDER BY Allergy
### 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, COUNT(T2.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
### Instruction: CREATE TABLE table_70998 ( "Condition" text, "Prothrombin time" text, "Partial thromboplastin time" text, "Bleeding time" text, "Platelet count" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the condition with platelet count o...
SELECT "Condition" FROM table_70998 WHERE "Platelet count" = 'unaffected' AND "Bleeding time" = 'unaffected' AND "Prothrombin time" = 'prolonged' AND "Partial thromboplastin time" = 'prolonged'
### Instruction: CREATE TABLE operate_company ( id number, name text, type text, principal_activities text, incorporated_in text, group_equity_shareholding number ) CREATE TABLE flight ( id number, vehicle_flight_number text, date text, pilot text, velocity number, altit...
SELECT name FROM airport WHERE name LIKE '%international%'
### Instruction: CREATE TABLE table_name_41 ( evaluation_average__before_april_2009_ VARCHAR, _percentage_of_negative_evaluations VARCHAR, evaluation_average__from_april_2009_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the mean Evaluation num...
SELECT evaluation_average__before_april_2009_ FROM table_name_41 WHERE _percentage_of_negative_evaluations = "0.8%" AND evaluation_average__from_april_2009_ = "4.2"
### Instruction: CREATE TABLE table_26749 ( "Position" text, "Name" text, "Nationality" text, "Event 1 Medley" text, "Event 2 Truck Pull" text, "Event 3 Dead Lift" text, "Event 4 Fingals Fingers" text, "Event 5 Keg Toss" text, "Event 6 Atlas Stones" text ) -- Using valid SQLite, an...
SELECT "Position" FROM table_26749 WHERE "Event 6 Atlas Stones" = '5 (4 in 32.66s)'
### Instruction: CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Reviewer ( rID int, name text ) -- Using valid SQLite, answer the following questions for the tables provided...
SELECT director, MAX(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" GROUP BY director ORDER BY director
### Instruction: CREATE TABLE table_55605 ( "Season" real, "Series" text, "Team Name" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" text, "Final Placing" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT SUM("Podiums") FROM table_55605 WHERE "Final Placing" = '14th' AND "Season" > '2008' AND "Races" < '1'
### Instruction: CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) 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
### Instruction: CREATE TABLE table_35166 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "76ers points" real, "Opponent points" real, "Record" text, "Streak" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Re...
SELECT "Date" FROM table_35166 WHERE "Result" = 'win' AND "Streak" = 'won 2' AND "76ers points" = '96' AND "Record" = '20-50'
### Instruction: CREATE TABLE authors ( authid number, lname text, fname text ) CREATE TABLE inst ( instid number, name text, country text ) CREATE TABLE papers ( paperid number, title text ) CREATE TABLE authorship ( authid number, instid number, paperid number, autho...
SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title LIKE "%Monadic%"
### 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 Directed_by, COUNT(*) FROM film GROUP BY Directed_by
### Instruction: CREATE TABLE table_7525 ( "Event" text, "2006\u201307" text, "2007\u201308" text, "2008\u201309" text, "2010\u201311" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what kind of 2006 07 has a 2010 11 of n/a, and an Event of masters?...
SELECT "2006\u201307" FROM table_7525 WHERE "2010\u201311" = 'n/a' AND "Event" = 'masters'
### Instruction: CREATE TABLE table_73377 ( "Season" text, "League" text, "Division" text, "GP" real, "W" real, "L" real, "T" real, "OTL" real, "SOL" real, "Pts" real, "PCT" text, "GF" real, "GA" real, "PIM" real, "Coach(es)" text, "Result" text ) -- Usi...
SELECT MIN("L") FROM table_73377 WHERE "GA" = '272'
### 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_train_50 ( "id" int, "raynaud_syndrome" bool, "active_infection" bool, "antibiotic_treatment" bool, "receiving_vasopressor" bool, "sepsis" bool, "vasospastic_diathesis" bool, "organ_failure" bool, "septic_shock" bool, "NOUSE" float ) -- Using...
SELECT * FROM table_train_50 WHERE vasospastic_diathesis = 1 OR raynaud_syndrome = 1
### 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.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
### Instruction: CREATE TABLE table_204_703 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which country won more total medals than tue fre...
SELECT "nation" FROM table_204_703 WHERE "total" > (SELECT "total" FROM table_204_703 WHERE "nation" = 'france') AND "total" < (SELECT "total" FROM table_204_703 WHERE "nation" = 'germany')
### 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 DESC
### Instruction: CREATE TABLE region ( Region_id int, Region_code text, Region_name text ) CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_city_affected real ) CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions...
SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id
### Instruction: CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE photos ( id int, camera_lens_id int, mountain_id int, color text, name text ) CREATE TABLE mountain ( id int, name text, Height real, ...
SELECT Height, Prominence FROM mountain WHERE Range <> 'Aberdare Range'
### Instruction: CREATE TABLE appellations ( no number, appelation text, county text, state text, area text, isava text ) CREATE TABLE wine ( no number, grape text, winery text, appelation text, state text, name text, year number, price number, score number, ...
SELECT DISTINCT name FROM wine WHERE year < 2000 OR year > 2010
### Instruction: CREATE TABLE table_16105186_2 ( california__san_francisco_ VARCHAR, alaska___juneau__ VARCHAR, southeast__atlanta_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the emission rating in California for the vehicle that was rated 8...
SELECT california__san_francisco_ FROM table_16105186_2 WHERE alaska___juneau__ = "80 g/mi (50 g/km)" AND southeast__atlanta_ = "250 g/mi (155 g/km)"
### 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 Headquarter, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
### Instruction: CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int ) CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text ) CREATE TABLE editor ( Editor_ID int, Name text, Age real ) -- Using valid SQLite, answer the following q...
SELECT T1.Theme, T1.Sales FROM journal EXCEPT SELECT T1.Date, T1.Theme, T1.Sales FROM journal AS T1 JOIN journal_committee AS T2 ON T1.Journal_ID = T2.Journal_ID
### Instruction: CREATE TABLE table_17228 ( "State" text, "Norwegian Americans (1980)" real, "Percent (1980)" text, "Norwegian Americans (1990)" real, "Percent (1990)" text, "Norwegian Americans (2000)" real, "Percent (2000)" text, "Norwegian Americans (2009)" real, "Percent (2009)" ...
SELECT "Percent (1990)" FROM table_17228 WHERE "State" = 'Mississippi'
### Instruction: CREATE TABLE table_65151 ( "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 COUNT("Total Goals") FROM table_65151 WHERE "Total Apps" = '1' AND "Name" = 'bob mountain' AND "FA Cup Goals" < '0'
### 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.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name
### Instruction: CREATE TABLE bank ( branch_id number, bname text, no_of_customers number, city text, state text ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, acc_bal number, no_of_loans number, credit_score number, branch_id number, state te...
SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1
### Instruction: CREATE TABLE table_204_616 ( id number, "township" text, "fips" number, "population\ncenter" text, "population" number, "population\ndensity\n/km2 (/sq mi)" text, "land area\nkm2 (sq mi)" text, "water area\nkm2 (sq mi)" text, "water %" text, "geographic coordinat...
SELECT (SELECT "land area\nkm2 (sq mi)" FROM table_204_616 WHERE "township" = 'delaware') > 45
### Instruction: CREATE TABLE table_69213 ( "Rank (CSA)" text, "State(s)" text, "2007 Estimate" text, "2000 Population" text, "Percent Change (1990\u20132000)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2000 population in OK with a 1...
SELECT "2000 Population" FROM table_69213 WHERE "State(s)" = 'ok' AND "Percent Change (1990\u20132000)" = 'a078 +17.22%'
### 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 T1.Name
### 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 bedType, COUNT(*) FROM Rooms GROUP BY bedType ORDER BY COUNT(*) DESC
### 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.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder
### Instruction: CREATE TABLE table_train_256 ( "id" int, "mini_mental_state_examination_mmse" int, "language" string, "mild_cognitive_impairment" bool, "moca_score" int, "dementia" bool, "body_mass_index_bmi" float, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the fo...
SELECT * FROM table_train_256 WHERE dementia = 0 OR (mild_cognitive_impairment = 0 OR moca_score <= 25)
### Instruction: CREATE TABLE table_69205 ( "2003/ 04" text, "2004/ 05" text, "2007/ 08" 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. -- What was held in 2009/10 when 2004/05...
SELECT "2009/ 10" FROM table_69205 WHERE "2004/ 05" = 'variant format tournaments'
### Instruction: CREATE TABLE table_204_39 ( id number, "number" number, "symbol" text, "name" text, "21st" number, "22nd" number, "23rd" number, "24th" number, "25th" number, "26th" number, "27th" number, "28th" number, "29th" number, "30th" number ) -- Using v...
SELECT COUNT("symbol") FROM table_204_39 WHERE "symbol" <> 'kr' AND NOT "30th" IS NULL
### Instruction: CREATE TABLE table_27458 ( "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 COUNT("Rider") FROM table_27458 WHERE "Tues 1 June" = '21'' 05.27 107.351mph'
### Instruction: CREATE TABLE table_17161 ( "Suburb" text, "Population (in 2008)" real, "Median age (in 2006)" text, "Mean household size (in 2006)" text, "Area (km\u00b2)" text, "Density (/km\u00b2)" real, "Date first settled as a suburb" real, "Gazetted as a Division Name" text ) -- ...
SELECT "Date first settled as a suburb" FROM table_17161 WHERE "Median age (in 2006)" = '40 years'
### Instruction: CREATE TABLE table_68686 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the foll...
SELECT "Drawn" FROM table_68686 WHERE "Played" = '22' AND "Points against" = '453' AND "Losing bonus" = '5'
### Instruction: CREATE TABLE club ( clubid number, clubname text, clubdesc text, clublocation text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE member_of_club ( stui...
SELECT COUNT(DISTINCT t2.position) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid WHERE t1.clubname = "Bootup Baltimore"
### Instruction: CREATE TABLE region ( region_id number, region_code text, region_name text ) CREATE TABLE affected_region ( region_id number, storm_id number, number_city_affected number ) CREATE TABLE storm ( storm_id number, name text, dates_active text, max_speed number, ...
SELECT SUM(number_deaths), SUM(damage_millions_usd) FROM storm WHERE max_speed > (SELECT AVG(max_speed) FROM storm)
### Instruction: CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE train ( Train_ID int, Name text, Time text, Service text ...
SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY SUM(Number_of_Platforms)
### Instruction: CREATE TABLE table_6942 ( "Country" text, "Total population (millions)" real, "Total Foreign-born (millions)" real, "Born in other EU state (millions)" real, "Born in a non EU state (millions)" real ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT AVG("Born in other EU state (millions)") FROM table_6942 WHERE "Total Foreign-born (millions)" = '0.5' AND "Total population (millions)" < '5.534'
### Instruction: CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255) ) ...
SELECT Participant_Details, Participant_ID FROM Participants
### 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