instruction stringlengths 212 6.3k | output stringlengths 6 2.03k |
|---|---|
### Instruction:
CREATE TABLE city (
City_ID int,
County_ID int,
Name text,
White real,
Black real,
Amerindian real,
Asian real,
Multiracial real,
Hispanic real
)
CREATE TABLE county_public_safety (
County_ID int,
Name text,
Population int,
Police_officers int,
R... | SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force ORDER BY Police_force |
### Instruction:
CREATE TABLE table_64935 (
"Country" text,
"1960" real,
"1961" real,
"1962" real,
"1963" real,
"1964" real,
"1965" real,
"1966" real,
"1967" real,
"1968" real,
"1969" real
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT MIN("1964") FROM table_64935 WHERE "Country" = 'united states' AND "1969" < '7.3' |
### Instruction:
CREATE TABLE table_41883 (
"Episode number" real,
"Title" text,
"Original airing on Channel 4" text,
"Time of airing on Channel 4" text,
"Original airing on E4" text,
"Time of airing on E4" text,
"Position in Channel 4 and Channel 4+1's ratings" text,
"Position in E4 and... | SELECT "Time of airing on Channel 4" FROM table_41883 WHERE "Episode number" > '106' AND "Title" = 'marry me a little' |
### Instruction:
CREATE TABLE party (
party_id number,
minister text,
took_office text,
left_office text,
region_id number,
party_name text
)
CREATE TABLE party_events (
event_id number,
event_name text,
party_id number,
member_in_charge_id number
)
CREATE TABLE region (
re... | SELECT DISTINCT region_name FROM region ORDER BY label |
### Instruction:
CREATE TABLE branch (
branch_id number,
name text,
open_year text,
address_road text,
city text,
membership_amount text
)
CREATE TABLE membership_register_branch (
member_id number,
branch_id text,
register_year text
)
CREATE TABLE member (
member_id number,
... | SELECT city, COUNT(*) FROM branch WHERE open_year < 2010 GROUP BY city |
### Instruction:
CREATE TABLE table_203_90 (
id number,
"religious\ngroup" text,
"population\n%" text,
"growth\n(1991-2001)" text,
"sex ratio\n(total)" number,
"literacy\n(%)" text,
"work participation\n(%)" text,
"sex ratio\n(rural)" number,
"sex ratio\n(urban)" number,
"sex rat... | SELECT COUNT("religious\ngroup") FROM table_203_90 WHERE "sex ratio\n(total)" > 1000 |
### Instruction:
CREATE TABLE table_68878 (
"Digital channel" text,
"Digital PSIP" real,
"Rogers Cable (Ottawa)" real,
"Vid\u00e9otron (Gatineau)" real,
"Call sign" text,
"Network" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total ... | SELECT COUNT("Rogers Cable (Ottawa)") FROM table_68878 WHERE "Digital PSIP" > '9.1' AND "Vid\u00e9otron (Gatineau)" = '14' |
### 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, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY bedType 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 T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name |
### 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.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC |
### Instruction:
CREATE TABLE table_train_199 (
"id" int,
"t2dm" bool,
"hemoglobin_a1c_hba1c" float,
"renal_disease" bool,
"diabetic" string,
"hypoglycemia" bool,
"diabetes" bool,
"seizure_disorder" bool,
"glaucoma" bool,
"hypertension" bool,
"age" float,
"NOUSE" float
)
... | SELECT * FROM table_train_199 WHERE renal_disease = 1 AND (diabetes = 0 AND hypertension = 0) |
### Instruction:
CREATE TABLE table_train_265 (
"id" int,
"systolic_blood_pressure_sbp" int,
"fasting_blood_glucose_fbg" float,
"diastolic_blood_pressure_dbp" int,
"hba1c" float,
"body_mass_index_bmi" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tabl... | SELECT * FROM table_train_265 WHERE systolic_blood_pressure_sbp > 159 OR diastolic_blood_pressure_dbp > 99 |
### Instruction:
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,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREA... | SELECT Openning_year, COUNT(Openning_year) FROM cinema ORDER BY Openning_year 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 T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC |
### Instruction:
CREATE TABLE table_203_185 (
id number,
"season" text,
"a\ntechnical" text,
"b\nscientific" text,
"c\nfine arts" text,
"d\nimprovisational" text,
"e\nstructural" text,
"rising stars!\u00ae" text,
"po\nprojectoutreach\u00ae" text,
"university level" text
)
-- Us... | SELECT "a\ntechnical" FROM table_203_185 WHERE "season" = '2013-2014' |
### Instruction:
CREATE TABLE table_56799 (
"Parties and voter communities" text,
"% 2006" real,
"Seats 2006" real,
"% 2001" real,
"Seats 2001" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the %2006 that has fewer seats than 23 in Seats 20... | SELECT "% 2006" FROM table_56799 WHERE "Seats 2001" < '23' AND "Seats 2006" > '4' AND "% 2001" = '25.4' |
### Instruction:
CREATE TABLE table_204_226 (
id number,
"municipality/communes" text,
"coalition for the citizen" text,
"coalition for the future" text,
"other/independent" text,
"winning party/coalition" text,
"voter turnout" text
)
-- Using valid SQLite, answer the following questions f... | SELECT ABS((SELECT "coalition for the citizen" FROM table_204_226 WHERE "coalition for the citizen" = 'dallandyshe allkaj') - (SELECT "coalition for the future" FROM table_204_226 WHERE "coalition for the future" = 'ilir cela')) |
### 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 Headquarter, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter |
### Instruction:
CREATE TABLE pilot_record (
Record_ID int,
Pilot_ID int,
Aircraft_ID int,
Date text
)
CREATE TABLE aircraft (
Aircraft_ID int,
Order_Year int,
Manufacturer text,
Model text,
Fleet_Series text,
Powertrain text,
Fuel_Propulsion text
)
CREATE TABLE pilot (
... | SELECT Nationality, COUNT(*) FROM pilot GROUP BY Nationality ORDER BY COUNT(*) 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 Founder, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC |
### Instruction:
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_o... | SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Headquarters |
### Instruction:
CREATE TABLE table_203_642 (
id number,
"name" text,
"quadrant" text,
"sector" text,
"ward" text,
"type" text,
"2012\npopulation\nrank" number,
"population\n(2012)" number,
"population\n(2011)" number,
"% change" number,
"dwellings\n(2012)" number,
"area\... | SELECT "name" FROM table_203_642 ORDER BY "area\n(km2)" LIMIT 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 Grape, COUNT(*) FROM wine GROUP BY Grape |
### Instruction:
CREATE TABLE employment (
Company_ID int,
People_ID int,
Year_working int
)
CREATE TABLE company (
Company_ID real,
Name text,
Headquarters text,
Industry text,
Sales_in_Billion real,
Profits_in_Billion real,
Assets_in_Billion real,
Market_Value_in_Billion r... | SELECT Industry, COUNT(Industry) FROM company GROUP BY Industry ORDER BY Industry |
### 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.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name |
### 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.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Price 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 T2.Name, COUNT(T2.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC |
### Instruction:
CREATE TABLE gas_station (
station_id number,
open_year number,
location text,
manager_name text,
vice_manager_name text,
representative_name text
)
CREATE TABLE company (
company_id number,
rank number,
company text,
headquarters text,
main_industry text,
... | SELECT headquarters, COUNT(*) FROM company GROUP BY headquarters |
### 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 DISTINCT T1.fname FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = T2.class_senator_vote |
### Instruction:
CREATE TABLE review (
a_id integer,
u_id integer,
i_id integer,
rating integer,
rank integer
)
CREATE TABLE useracct (
u_id integer,
name varchar(128)
)
CREATE TABLE item (
i_id integer,
title varchar(20)
)
CREATE TABLE trust (
source_u_id integer,
target_... | SELECT name, COUNT(*) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id ORDER BY COUNT(*) |
### 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, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY AVG(basePrice) |
### Instruction:
CREATE TABLE band (
id number,
firstname text,
lastname text
)
CREATE TABLE vocals (
songid number,
bandmate number,
type text
)
CREATE TABLE albums (
aid number,
title text,
year number,
label text,
type text
)
CREATE TABLE tracklists (
albumid number... | SELECT DISTINCT instrument FROM instruments |
### Instruction:
CREATE TABLE table_47371 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided ... | SELECT "Date" FROM table_47371 WHERE "High assists" = 'ramon sessions (8)' AND "High points" = 'richard jefferson (29)' AND "Score" = 'w 107–78 (ot)' |
### 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 "material" FROM table_203_385 WHERE "refractive\nindex(es)\n589.3 nm" > 2.6 |
### Instruction:
CREATE TABLE news_report (
journalist_id number,
event_id number,
work_type text
)
CREATE TABLE event (
event_id number,
date text,
venue text,
name text,
event_attendance number
)
CREATE TABLE journalist (
journalist_id number,
name text,
nationality text,... | SELECT T3.name FROM news_report AS T1 JOIN event AS T2 ON T1.event_id = T2.event_id JOIN journalist AS T3 ON T1.journalist_id = T3.journalist_id GROUP BY T3.name HAVING COUNT(*) > 1 |
### Instruction:
CREATE TABLE table_66898 (
"Year" text,
"Superintendent" text,
"Glendale Principal" text,
"H.H. Principal" text,
"Maplemere Principal" text,
"W.R. Principal" text,
"M.S. Principal" text,
"H.S. Principal" text,
"H. S. Asst. Principal" text
)
-- Using valid SQLite, a... | SELECT "H.H. Principal" FROM table_66898 WHERE "Superintendent" = 'james finch' AND "Maplemere Principal" = 'charlie taylor' |
### 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 employment (
Company_ID int,
People_ID int,
Year_working int
)
CREATE TABLE company (
Company_ID real,
Name text,
Headquarters text,
Industry text,
Sales_in_Billion real,
Profits_in_Billion real,
Assets_in_Billion real,
Market_Value_in_Billion r... | SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Headquarters ORDER BY Headquarters |
### 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 ORDER BY T1.Code |
### 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 SUM(enrollment), affiliation FROM university GROUP BY affiliation |
### Instruction:
CREATE TABLE table_train_82 (
"id" int,
"mini_mental_state_examination_mmse" int,
"systolic_blood_pressure_sbp" int,
"diastolic_blood_pressure_dbp" int,
"body_mass_index_bmi" float,
"hypertension" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the fol... | SELECT * FROM table_train_82 WHERE mini_mental_state_examination_mmse >= 15 AND mini_mental_state_examination_mmse <= 26 |
### 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(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC |
### Instruction:
CREATE TABLE office_locations (
building_id number,
company_id number,
move_in_year number
)
CREATE TABLE companies (
id number,
name text,
headquarters text,
industry text,
sales_billion number,
profits_billion number,
assets_billion number,
market_value_bi... | SELECT industry FROM companies WHERE headquarters = "USA" INTERSECT SELECT industry FROM companies WHERE headquarters = "China" |
### 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, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY SUM(Price) DESC |
### Instruction:
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Ranking int
)
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price real
)
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text... | SELECT Name, COUNT(Name) FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID GROUP BY 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 Founder, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC |
### Instruction:
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge bool
)
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_hosts int
)
CREATE TABLE host (
Host_ID int,
Name text,
National... | SELECT Last_year, COUNT(Last_year) FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology" |
### Instruction:
CREATE TABLE table_34015 (
"Year ended" text,
"Passengers flown" real,
"Employees (Average/Year)" real,
"Net profit/loss (SEK)" real,
"Basic eps (SEK)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Employees (Average/Year)... | SELECT COUNT("Employees (Average/Year)") FROM table_34015 WHERE "Net profit/loss (SEK)" > '4,936,000,000' AND "Basic eps (SEK)" > '1.06' |
### Instruction:
CREATE TABLE table_13629 (
"[A] (mol/L)" text,
"[H 3 PO 4 ]/[A] (%)" text,
"[H 2 PO 4 \u2212 ]/[A] (%)" real,
"[HPO 4 2\u2212 ]/[A] (%)" text,
"[PO 4 3\u2212 ]/[A] (%)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the [A] w... | SELECT "[A] (mol/L)" FROM table_13629 WHERE "[H 2 PO 4 \u2212 ]/[A] (%)" = '61.7' |
### Instruction:
CREATE TABLE table_29688 (
"Currency" text,
"Country" text,
"Generic Name or Nickname" text,
"Rating ( S&P / Moodys )" text,
"Negotiable debt at mid-2005 ( US dollar bn equivalent)" real,
"Government financial liabilities as % of GDP (end 2003 - source : OECD )" text,
"Issue... | SELECT "Currency" FROM table_29688 WHERE "Negotiable debt at mid-2005 ( US dollar bn equivalent)" = '1300' |
### Instruction:
CREATE TABLE table_train_253 (
"id" int,
"pregnancy_or_lactation" bool,
"pre_eclampsia" bool,
"acute_ischemia" bool,
"pre_gestational_hypertension" bool,
"diabetic" string,
"smoking" bool,
"coronary_artery_disease_cad" bool,
"NOUSE" float
)
-- Using valid SQLite, a... | SELECT * FROM table_train_253 WHERE pregnancy_or_lactation = 1 AND (coronary_artery_disease_cad = 1 OR acute_ischemia = 1) |
### Instruction:
CREATE TABLE table_27208311_1 (
episode_no_episode_no_refers_to_the_episodes_number_in_the_overall_series VARCHAR,
_whereas_series_no_refers_to_the_episodes_number_in_this_particular_series VARCHAR,
series_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables p... | SELECT episode_no_episode_no_refers_to_the_episodes_number_in_the_overall_series, _whereas_series_no_refers_to_the_episodes_number_in_this_particular_series FROM table_27208311_1 WHERE series_no = 3 |
### Instruction:
CREATE TABLE video_games (
gameid number,
gname text,
gtype text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE sportsinfo (
stuid number,
sportname te... | SELECT stuid, SUM(hours_played) FROM plays_games GROUP BY stuid |
### Instruction:
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID in... | 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 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 T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name |
### Instruction:
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID in... | SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID ORDER BY COUNT(*) |
### 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.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name |
### Instruction:
CREATE TABLE airport (
id number,
city text,
country text,
iata text,
icao text,
name text
)
CREATE TABLE operate_company (
id number,
name text,
type text,
principal_activities text,
incorporated_in text,
group_equity_shareholding number
)
CREATE TABLE... | SELECT vehicle_flight_number, date, pilot FROM flight ORDER BY altitude |
### Instruction:
CREATE TABLE classroom (
capacity INTEGER,
building VARCHAR,
room_number VARCHAR
)
CREATE TABLE course (
title VARCHAR,
credits VARCHAR,
course_id VARCHAR
)
CREATE TABLE SECTION (
course_id VARCHAR,
building VARCHAR,
room_number VARCHAR
)
-- Using valid SQLite, a... | SELECT T3.title, T3.credits FROM classroom AS T1 JOIN SECTION AS T2 ON T1.building = T2.building AND T1.room_number = T2.room_number JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T1.capacity = (SELECT MAX(capacity) FROM classroom) |
### Instruction:
CREATE TABLE table_38743 (
"Institution" text,
"Location" text,
"Established" real,
"Gained university status" real,
"Vice-chancellor" text,
"Total Number of Students" real,
"Research Funding (\u00a3,000)" real
)
-- Using valid SQLite, answer the following questions for th... | SELECT "Institution" FROM table_38743 WHERE "Total Number of Students" > '19,020' AND "Location" = 'london' AND "Research Funding (\u00a3,000)" > '7,734' |
### Instruction:
CREATE TABLE table_204_878 (
id number,
"model" text,
"release date" text,
"sensor\nres., size" text,
"lens (35 mm equiv.)\nzoom, aperture" text,
"screen\nsize, pixels" text,
"dimensions\nw (mm) \u00d7 h (mm) \u00d7 d (mm)" text,
"weight" text,
"features" text
)
--... | SELECT "model" FROM table_204_878 WHERE "screen\nsize, pixels" = 3 AND "weight" >= 210 |
### 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 decor, COUNT(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor ORDER BY decor DESC |
### 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 technician (
technician... | SELECT Team, COUNT(*) FROM technician GROUP BY Team |
### Instruction:
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_sp... | SELECT services, COUNT(services) FROM station GROUP BY services |
### Instruction:
CREATE TABLE browser (
name VARCHAR,
id VARCHAR
)
CREATE TABLE accelerator_compatible_browser (
browser_id VARCHAR,
accelerator_id VARCHAR,
compatible_since_year VARCHAR
)
CREATE TABLE web_client_accelerator (
id VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the ... | SELECT T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id = T2.browser_id JOIN web_client_accelerator AS T3 ON T2.accelerator_id = T3.id WHERE T3.name = 'CProxy' AND T2.compatible_since_year > 1998 |
### 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 card_number, name, hometown FROM member ORDER BY level DESC |
### Instruction:
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE party (
... | SELECT County_name, Population FROM county ORDER BY Population DESC |
### Instruction:
CREATE TABLE county_public_safety (
County_ID int,
Name text,
Population int,
Police_officers int,
Residents_per_officer int,
Case_burden int,
Crime_rate real,
Police_force text,
Location text
)
CREATE TABLE city (
City_ID int,
County_ID int,
Name text,
... | SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force ORDER BY Police_force |
### Instruction:
CREATE TABLE table_55086 (
"Series ^" text,
"Model" text,
"CPU clock ( MHz )" text,
"CPU cores" real,
"TDP ( W )" text,
"L2 cache (KiB)" text,
"Radeon cores" real,
"DDR3 speed" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT "CPU clock ( MHz )" FROM table_55086 WHERE "L2 cache (KiB)" = '2*512' AND "Series ^" = 'e-series' AND "DDR3 speed" = '1066' |
### 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, AVG(Capacity) FROM cinema ORDER BY Openning_year |
### 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 stat_cause_code FROM fires GROUP BY stat_cause_code ORDER BY COUNT(*) DESC LIMIT 1 |
### Instruction:
CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
)
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
)
-- Using valid SQLite, answer the following question... | SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cname = T2.cname WHERE T2.ppos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cname = T2.cname WHERE T2.ppos = 'goalie' |
### Instruction:
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE T... | SELECT Committee, COUNT(Committee) FROM election GROUP BY Committee ORDER BY Committee DESC |
### Instruction:
CREATE TABLE table_28373 (
"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 "No-Yds" FROM table_28373 WHERE "No.-Yds" = '1-13' |
### Instruction:
CREATE TABLE table_22084 (
"Birth Name" text,
"Birth Name As Announced in Latin (Accusative case Forename Undeclined Surname)" text,
"Papal Name" text,
"Papal Name As Announced in Latin" text,
"Latin declension of Papal Name" text,
"Numeral in Papal Name" text
)
-- Using valid... | SELECT "Birth Name As Announced in Latin (Accusative case Forename Undeclined Surname)" FROM table_22084 WHERE "Numeral in Papal Name" = 'not given' AND "Latin declension of Papal Name" = 'genitive' |
### Instruction:
CREATE TABLE table_21956 (
"Name" text,
"Map colour" text,
"First operated" real,
"Type" text,
"Length" text,
"No. Sta" real,
"Current Stock" text,
"Future Stock" text,
"Trips per annum (\u00d71000)" real,
"Avg. trips per mile (\u00d71000)" real
)
-- Using vali... | SELECT "Current Stock" FROM table_21956 WHERE "Avg. trips per mile (\u00d71000)" = '4744' |
### 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 Founder, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC |
### Instruction:
CREATE TABLE table_45951 (
"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. 1" FROM table_45951 WHERE "No. 2" = 'emma' AND "No. 7" = 'olivia' |
### Instruction:
CREATE TABLE volume (
Volume_ID int,
Volume_Issue text,
Issue_Date text,
Weeks_on_Top real,
Song text,
Artist_ID int
)
CREATE TABLE artist (
Artist_ID int,
Artist text,
Age int,
Famous_Title text,
Famous_Release_date text
)
CREATE TABLE music_festival (
... | SELECT Result, COUNT(*) FROM music_festival GROUP BY Result ORDER BY COUNT(*) DESC |
### Instruction:
CREATE TABLE table_31170 (
"Year" real,
"Tournaments played" real,
"Cuts made" real,
"Wins" real,
"2nd" real,
"3rd" real,
"Top 10s" real,
"Best finish" text,
"Earnings ( \u20ac )" text,
"Money list rank" text,
"Scoring average" text,
"Scoring rank" text,
... | SELECT "Money list rank" FROM table_31170 WHERE "Top 10s" = '0' |
### 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(*) FROM fires WHERE county = "Gloucester" AND fire_size > 10 |
### Instruction:
CREATE TABLE table_13934 (
"Date" text,
"Type" text,
"Time (greatest)" text,
"Saros" real,
"Member" real,
"Gamma" real,
"Magnitude" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the date when saros is more than 124,... | SELECT "Date" FROM table_13934 WHERE "Saros" > '124' AND "Type" = 'total' AND "Magnitude" > '1.0535' AND "Time (greatest)" = '20:55:28' |
### Instruction:
CREATE TABLE table_202_295 (
id number,
"club" text,
"season" text,
"league\napps" number,
"league\ngoals" number,
"fa cup\napps" number,
"fa cup\ngoals" number,
"league cup\napps" number,
"league cup\ngoals" number,
"other\napps" number,
"other\ngoals" numbe... | SELECT COUNT("season") FROM table_202_295 WHERE "club" = 'yeovil town' |
### Instruction:
CREATE TABLE table_17702 (
"Rank in Nyagatare Sectors, 2012" real,
"Sector" text,
"Area in sqkm" real,
"Population August 15, 2012" real,
"Population, August 15, 2002" real,
"Population Change 2002-2012 (%)" text,
"Population Density 2012 (km 2 )" real
)
-- Using valid SQL... | SELECT MIN("Population Density 2012 (km 2 )") FROM table_17702 WHERE "Sector" = 'Gatunda' |
### Instruction:
CREATE TABLE aircraft (
Aircraft_ID int,
Order_Year int,
Manufacturer text,
Model text,
Fleet_Series text,
Powertrain text,
Fuel_Propulsion text
)
CREATE TABLE pilot (
Pilot_ID int,
Pilot_name text,
Rank int,
Age int,
Nationality text,
Position text,... | SELECT Position, COUNT(Position) FROM pilot GROUP BY Position ORDER BY Position 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 T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code |
### Instruction:
CREATE TABLE tweets (
id bigint(20),
uid int(11),
text char(140),
createdate datetime
)
CREATE TABLE user_profiles (
uid int(11),
name varchar(255),
email varchar(255),
partitionid int(11),
followers int(11)
)
CREATE TABLE follows (
f1 int(11),
f2 int(11)
)... | SELECT name, partitionid FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid ORDER BY name DESC |
### Instruction:
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Det... | SELECT Participant_Details, Participant_ID FROM Participants |
### Instruction:
CREATE TABLE debate_people (
Debate_ID int,
Affirmative int,
Negative int,
If_Affirmative_Win bool
)
CREATE TABLE debate (
Debate_ID int,
Date text,
Venue text,
Num_of_Audience int
)
CREATE TABLE people (
People_ID int,
District text,
Name text,
Party t... | SELECT Name, COUNT(*) FROM debate_people AS T1 JOIN people AS T2 ON T1.Affirmative = T2.People_ID GROUP BY T2.Name ORDER BY COUNT(*) |
### 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, COUNT(Openning_year) FROM cinema ORDER BY Openning_year |
### Instruction:
CREATE TABLE table_18015 (
"Name" text,
"GP" real,
"Solo" real,
"Ast" real,
"Total" real,
"TFL-Yds" text,
"No-Yds" text,
"BrUp" real,
"QBH" real,
"No.-Yds" text,
"Avg" text,
"TD" real,
"Long" real,
"Rcv-Yds" text,
"FF" real,
"Blkd Kick" re... | SELECT "No-Yds" FROM table_18015 WHERE "Ast" = '8' |
### Instruction:
CREATE TABLE table_train_204 (
"id" int,
"systolic_blood_pressure_sbp" int,
"plasma_glucose_concentration" int,
"fasting_plasma_glucose_fpg" float,
"increase_risk_of_intervention" bool,
"diastolic_blood_pressure_dbp" int,
"life_span" bool,
"body_mass_index_bmi" float,
... | SELECT * FROM table_train_204 WHERE life_span = 1 OR increase_risk_of_intervention = 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 Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY AVG(Price) |
### 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 Founder, COUNT(Founder) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder 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 T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Code |
### Instruction:
CREATE TABLE web_client_accelerator (
name VARCHAR,
operating_system VARCHAR
)
CREATE TABLE browser (
id VARCHAR,
name VARCHAR
)
CREATE TABLE accelerator_compatible_browser (
accelerator_id VARCHAR,
browser_id VARCHAR
)
-- Using valid SQLite, answer the following questions f... | SELECT name, operating_system FROM web_client_accelerator EXCEPT SELECT T1.name, T1.operating_system FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T3.name = 'Opera' |
### Instruction:
CREATE TABLE tracklists (
albumid number,
position number,
songid number
)
CREATE TABLE instruments (
songid number,
bandmateid number,
instrument text
)
CREATE TABLE performance (
songid number,
bandmate number,
stageposition text
)
CREATE TABLE vocals (
song... | SELECT DISTINCT type FROM vocals |
### Instruction:
CREATE TABLE table_13404 (
"Year" real,
"Champion (average in final)" text,
"Legs" text,
"Runner-up (average in final)" text,
"Sponsor" text,
"Prize Fund" text,
"Champion" text,
"Runner-up" text,
"Venue" text
)
-- Using valid SQLite, answer the following questions ... | SELECT "Champion" FROM table_13404 WHERE "Year" < '2012' AND "Runner-up (average in final)" = 'steve beaton (97.16)' |
### Instruction:
CREATE TABLE volume (
Volume_ID int,
Volume_Issue text,
Issue_Date text,
Weeks_on_Top real,
Song text,
Artist_ID int
)
CREATE TABLE artist (
Artist_ID int,
Artist text,
Age int,
Famous_Title text,
Famous_Release_date text
)
CREATE TABLE music_festival (
... | SELECT Result, COUNT(Result) FROM music_festival GROUP BY Result ORDER BY Result DESC |
### Instruction:
CREATE TABLE table_48022 (
"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. 4" FROM table_48022 WHERE "No. 10" = 'harper' AND "No. 5" = 'abigail' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.