instruction stringlengths 212 6.3k | output stringlengths 6 2.03k |
|---|---|
### Instruction:
CREATE TABLE table_47044 (
"Squad No." real,
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" text,
"FA Cup Goals" real,
"League Cup Apps" text,
"League Cup Goals" real,
"FLT Apps" text,
"FLT Goals" real,
"Playoff Apps"... | SELECT "Playoff Apps" FROM table_47044 WHERE "Position" = 'df' AND "Name" = 'thomas heary' |
### Instruction:
CREATE TABLE table_49343 (
"Municipalities of the city" text,
"Area km\u00b2" text,
"Population censo 2007(hab)" text,
"Population under 1 year-old Censo 2007(hab)" text,
"Households (2007)" text,
"Density (hab/ km\u00b2 )" text,
"Elevation msnm" text
)
-- Using valid SQLi... | SELECT "Density (hab/ km\u00b2 )" FROM table_49343 WHERE "Population censo 2007(hab)" = '336.293*' |
### 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 director FROM movie WHERE year = 2000 INTERSECT SELECT director FROM movie WHERE year = 1999 |
### 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 COUNT(*), affiliation FROM university WHERE enrollment > 20000 GROUP BY affiliation |
### 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 ORDER BY COUNT(Name) DESC |
### Instruction:
CREATE TABLE aircraft (
aid number(9,0),
name varchar2(30),
distance number(6,0)
)
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
arrival_date date,
price number(7,2),
aid num... | SELECT destination, COUNT(destination) FROM flight GROUP BY destination |
### Instruction:
CREATE TABLE game (
stadium_id int,
id int,
Season int,
Date text,
Home_team text,
Away_team text,
Score text,
Competition text
)
CREATE TABLE injury_accident (
game_id int,
id int,
Player text,
Injury text,
Number_of_matches text,
Source text
)
... | SELECT Season, COUNT(Season) FROM game GROUP BY Home_team, Season ORDER BY Season DESC |
### Instruction:
CREATE TABLE table_train_55 (
"id" int,
"ejection_fraction_ef" int,
"systolic_dysfunction" bool,
"language" string,
"valvular_dysfunction" bool,
"consent" bool,
"heart_disease" bool,
"left_bundle_branch_block" bool,
"trauma" bool,
"pericardial_disease" bool,
... | SELECT * FROM table_train_55 WHERE trauma = 1 |
### Instruction:
CREATE TABLE region (
Region_ID int,
Region_name text,
Date text,
Label text,
Format text,
Catalogue text
)
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
Party_ID int,
Member_in_charge_ID int
)
CREATE TABLE party (
Party_ID int,
Minister te... | SELECT Minister, COUNT(Minister) FROM party GROUP BY Minister ORDER BY COUNT(Minister) DESC |
### Instruction:
CREATE TABLE table_42524 (
"Year ended" text,
"Passengers (thousand)" real,
"RPK (million)" real,
"ASK (million)" real,
"Load factor (%)" real,
"Yield (S\u00a2/km)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the high... | SELECT MAX("Yield (S\u00a2/km)") FROM table_42524 WHERE "ASK (million)" > '88,252.7' AND "RPK (million)" = '74,183.2' AND "Load factor (%)" < '74.5' |
### Instruction:
CREATE TABLE manager (
Manager_ID int,
Name text,
Country text,
Working_year_starts text,
Age int,
Level int
)
CREATE TABLE train (
Train_ID int,
Train_Num text,
Name text,
From text,
Arrival text,
Railway_ID int
)
CREATE TABLE railway_manage (
Rail... | SELECT Working_year_starts, COUNT(Working_year_starts) FROM manager ORDER BY Level DESC |
### Instruction:
CREATE TABLE railway_manage (
Railway_ID int,
Manager_ID int,
From_Year text
)
CREATE TABLE manager (
Manager_ID int,
Name text,
Country text,
Working_year_starts text,
Age int,
Level int
)
CREATE TABLE train (
Train_ID int,
Train_Num text,
Name text,
... | SELECT Name, COUNT(Name) FROM train GROUP BY Name ORDER BY Name |
### Instruction:
CREATE TABLE routes (
rid number,
dst_apid number,
dst_ap text,
src_apid number,
src_ap text,
alid number,
airline text,
codeshare text
)
CREATE TABLE airports (
apid number,
name text,
city text,
country text,
x number,
y number,
elevation n... | SELECT COUNT(*), city FROM airports WHERE country = 'United States' GROUP BY city ORDER BY COUNT(*) DESC |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT All_Home, COUNT(All_Home) FROM basketball_match GROUP BY All_Home |
### Instruction:
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
Team int
)
CREATE TABLE team (
Team_id int,
Name text
)
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Countr... | SELECT Position, COUNT(*) FROM match_season GROUP BY Position ORDER BY Position |
### Instruction:
CREATE TABLE aircraft (
aid number(9,0),
name varchar2(30),
distance number(6,0)
)
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departu... | SELECT origin, COUNT(origin) FROM flight GROUP BY origin ORDER BY origin |
### 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 gas_station (
Station_ID int,
Open_Year int,
Location te... | SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY COUNT(*) |
### Instruction:
CREATE TABLE gymnast (
Gymnast_ID int,
Floor_Exercise_Points real,
Pommel_Horse_Points real,
Rings_Points real,
Vault_Points real,
Parallel_Bars_Points real,
Horizontal_Bar_Points real,
Total_Points real
)
CREATE TABLE people (
People_ID int,
Name text,
Age ... | SELECT Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown ORDER BY COUNT(*) DESC |
### Instruction:
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE train (
id int,
train_number int,
name text,... | SELECT services, COUNT(services) FROM station GROUP BY local_authority, services ORDER BY COUNT(services) |
### Instruction:
CREATE TABLE table_train_117 (
"id" int,
"mini_mental_state_examination_mmse" int,
"systolic_blood_pressure_sbp" int,
"renal_disease" bool,
"total_serum_protein" int,
"diastolic_blood_pressure_dbp" int,
"geriatric_depression_scale_gds" int,
"serum_creatinine" float,
... | SELECT * FROM table_train_117 WHERE renal_disease = 1 OR serum_creatinine > 2 |
### Instruction:
CREATE TABLE table_train_171 (
"id" int,
"systolic_blood_pressure_sbp" int,
"hiv_infection" bool,
"hemoglobin_a1c_hba1c" float,
"hepatitis_c" bool,
"diastolic_blood_pressure_dbp" int,
"body_mass_index_bmi" float,
"triglyceride_tg" float,
"NOUSE" float
)
-- Using va... | SELECT * FROM table_train_171 WHERE (systolic_blood_pressure_sbp >= 160 OR diastolic_blood_pressure_dbp >= 100) |
### Instruction:
CREATE TABLE music_festival (
id number,
music_festival text,
date_of_ceremony text,
category text,
volume number,
result text
)
CREATE TABLE volume (
volume_id number,
volume_issue text,
issue_date text,
weeks_on_top number,
song text,
artist_id number
... | SELECT T1.date_of_ceremony FROM music_festival AS T1 JOIN volume AS T2 ON T1.volume = T2.volume_id WHERE T2.weeks_on_top > 2 |
### Instruction:
CREATE TABLE 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 T1.county FROM appellations AS T1 JOIN wine AS T2 ON T1.appelation = T2.appelation WHERE T2.score > 90 GROUP BY T1.county ORDER BY COUNT(*) DESC LIMIT 1 |
### Instruction:
CREATE TABLE club (
clubid number,
clubname text,
clubdesc text,
clublocation text
)
CREATE TABLE member_of_club (
stuid number,
clubid number,
position text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major ... | SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = "Davis" AND t3.lname = "Steven" |
### Instruction:
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREA... | SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY Title DESC |
### Instruction:
CREATE TABLE table_25533 (
"Rank" real,
"Country/Territory" text,
"Manhunt International" real,
"1st runner-up" real,
"2nd runner-up" real,
"3rd runner-up" real,
"4th runner-up" real,
"Semifinalists" real,
"Total" real
)
-- Using valid SQLite, answer the following ... | SELECT COUNT("4th runner-up") FROM table_25533 WHERE "2nd runner-up" < '1.0' AND "1st runner-up" < '1.0' AND "Total" = '2' |
### Instruction:
CREATE TABLE table_dev_51 (
"id" int,
"gender" string,
"antihypertensive_agents" bool,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"obesity" bool,
"diastolic_blood_pressure_dbp" int,
"body_mass_index_bmi" float,
"hypertension" bool,
"prehyper... | SELECT * FROM table_dev_51 WHERE gender = 'male' OR gender = 'female' AND age > 18 |
### Instruction:
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
Team int
)
CREATE TABLE country (
Country_id int,
Country_name text,
Capital text,
Official_native_language text
)
CREATE TABLE team (
... | SELECT Position, COUNT(*) FROM match_season GROUP BY Position ORDER BY Position |
### 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 book_club (
book_club_id number,
year number,
author_or_editor text,
book_title text,
publish... | SELECT title, director FROM movie WHERE year <= 2000 ORDER BY gross_worldwide DESC LIMIT 1 |
### Instruction:
CREATE TABLE table_61806 (
"2010" text,
"2009" real,
"2008" real,
"2007" text,
"2006" real,
"2005" real,
"2004" real,
"2003" real,
"2002" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the 2008 wit... | SELECT SUM("2008") FROM table_61806 WHERE "2007" = '4,244,115' AND "2003" < '3,296,267' |
### Instruction:
CREATE TABLE finrev_fed_17 (
state_code number,
idcensus number,
school_district text,
nces_id text,
yr_data number,
t_fed_rev number,
c14 number,
c25 number
)
CREATE TABLE ndecoreexcel_math_grade8 (
year number,
state text,
all_students text,
average_sc... | SELECT t_fed_rev FROM finrev_fed_17 WHERE school_district = "FAIRFAX CO SCHS" |
### Instruction:
CREATE TABLE table_train_55 (
"id" int,
"ejection_fraction_ef" int,
"systolic_dysfunction" bool,
"language" string,
"valvular_dysfunction" bool,
"consent" bool,
"heart_disease" bool,
"left_bundle_branch_block" bool,
"trauma" bool,
"pericardial_disease" bool,
... | SELECT * FROM table_train_55 WHERE prisoners = 1 |
### Instruction:
CREATE TABLE genre (
g_name text,
rating text,
most_popular_in text
)
CREATE TABLE artist (
artist_name text,
country text,
gender text,
preferred_genre text
)
CREATE TABLE song (
song_name text,
artist_name text,
country text,
f_id number,
genre_is tex... | SELECT song_name FROM song WHERE rating < (SELECT MAX(rating) FROM song WHERE genre_is = "blues") |
### Instruction:
CREATE TABLE table_64201 (
"Years covered" text,
"All bills sponsored" real,
"All amendments sponsored" real,
"All bills cosponsored" real,
"All amendments cosponsored" real,
"Bills originally cosponsored" real,
"Amendments originally cosponsored" real
)
-- Using valid SQL... | SELECT COUNT("All bills cosponsored") FROM table_64201 WHERE "All amendments sponsored" < '15' AND "All bills sponsored" = '6' AND "All amendments cosponsored" < '0' |
### Instruction:
CREATE TABLE table_40792 (
"Tournament" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer... | SELECT "2008" FROM table_40792 WHERE "2006" = 'grand slam tournaments' |
### Instruction:
CREATE TABLE table_25645 (
"Model number" text,
"sSpec number" text,
"Frequency" text,
"Turbo" text,
"GPU frequency" text,
"Cores" real,
"L2 cache" text,
"L3 cache" text,
"I/O bus" text,
"Mult." text,
"Memory" text,
"Voltage" text,
"TDP" text,
"So... | SELECT "Part number(s)" FROM table_25645 WHERE "Model number" = 'Core i5-670' |
### Instruction:
CREATE TABLE restaurant_type (
restypeid number,
restypename text,
restypedescription text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE type_of_restaurant (
... | SELECT major, COUNT(*) FROM student GROUP BY major ORDER BY COUNT(major) LIMIT 1 |
### Instruction:
CREATE TABLE table_41028 (
"Tournament" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"Win %" text
)
-- Using valid SQLite, answer the following q... | SELECT "2006" FROM table_41028 WHERE "2012" = 'a' AND "2011" = '3r' |
### Instruction:
CREATE TABLE table_204_957 (
id number,
"year" number,
"team" text,
"games" number,
"combined tackles" number,
"tackles" number,
"assisted tackles" number,
"sacks" number,
"forced fumbles" number,
"fumble recoveries" number,
"fumble return yards" number,
... | SELECT SUM("passes defended") FROM table_204_957 |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT School_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Home |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT Team_ID, School_ID FROM basketball_match GROUP BY Team_Name |
### Instruction:
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE train (
id int,
train_number int,
name text,... | SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority ORDER BY local_authority |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT All_Home, SUM(Team_ID) FROM basketball_match GROUP BY All_Home |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT ACC_Regular_Season, Team_ID FROM basketball_match |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home |
### Instruction:
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
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... | SELECT T1.Date, T1.Attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.Exhibition_ID = T2.Exhibition_ID WHERE T2.Year = 2004 ORDER BY Attendance DESC |
### Instruction:
CREATE TABLE endowment (
endowment_id int,
School_id int,
donator_name text,
amount real
)
CREATE TABLE budget (
School_id int,
Year int,
Budgeted int,
total_budget_percent_budgeted real,
Invested int,
total_budget_percent_invested real,
Budget_invested_perc... | SELECT County, SUM(Enrollment) FROM School GROUP BY County |
### Instruction:
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_Name text,
Vice_Manager_Name text,
Representative_Name text
)
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_bil... | SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry |
### Instruction:
CREATE TABLE table_52982 (
"Season" text,
"Pyramid Level" text,
"Regular Season 1" text,
"Playoffs 1" text,
"Regular Season 2" text,
"Playoffs 2" text,
"Copa M\u00e9xico" text,
"CONCACAF" text
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT "Regular Season 1" FROM table_52982 WHERE "Copa M\u00e9xico" = 'no longer played' AND "Pyramid Level" = '2' AND "Regular Season 2" = '15th' |
### 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_assignment (
technician_id int,
repair_ID int,
Machine_ID int
)
CREATE TABLE repair (
repair_ID int... | SELECT Name, COUNT(Name) FROM technician WHERE Team <> "NYY" GROUP BY Name ORDER BY Name DESC |
### Instruction:
CREATE TABLE table_train_106 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"mini_mental_state_examination_mmse" int,
"uncontrolled_diabetes" bool,
"blood_glucose" int,
"rosen_modified_hachinski_ischemic_score" int,
"body_mass_index_bmi" float,
"age" flo... | SELECT * FROM table_train_106 WHERE (gender = 'male' OR (gender = 'female' AND pregnancy_or_lactation = 0)) AND age >= 50 |
### Instruction:
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_Name text,
Vice_Manager_Name text,
Representative_Name text
)
CREATE TABLE company (
Company_I... | SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry |
### Instruction:
CREATE TABLE table_65031 (
"Party" text,
"Burnley" real,
"Chorley" real,
"Fylde" real,
"Hyndburn" real,
"Lancaster" real,
"Pendle" real,
"Preston" real,
"Ribble Valley" real,
"Rossendale" real,
"South Ribble" real,
"West Lancashire" real,
"Wyre" real,... | SELECT MAX("West Lancashire") FROM table_65031 WHERE "Pendle" > '1' AND "Rossendale" > '2' |
### Instruction:
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE route (
train_id int,
station_id... | SELECT services, COUNT(services) FROM station GROUP BY local_authority, services ORDER BY COUNT(services) DESC |
### Instruction:
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State ... | SELECT AVG(Price), AVG(Score) FROM wine GROUP BY AVG(Price) |
### Instruction:
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE party (
... | SELECT County_name, COUNT(County_name) FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District GROUP BY County_name |
### Instruction:
CREATE TABLE game (
stadium_id int,
id int,
Season int,
Date text,
Home_team text,
Away_team text,
Score text,
Competition text
)
CREATE TABLE stadium (
id int,
name text,
Home_Games int,
Average_Attendance real,
Total_Attendance real,
Capacity_P... | SELECT Home_team, COUNT(Home_team) FROM game GROUP BY Home_team ORDER BY Home_team DESC |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY All_Home |
### Instruction:
CREATE TABLE country (
country_id number,
country_name text,
capital text,
official_native_language text
)
CREATE TABLE player (
player_id number,
player text,
years_played text,
total_wl text,
singles_wl text,
doubles_wl text,
team number
)
CREATE TABLE te... | SELECT college FROM match_season GROUP BY college HAVING COUNT(*) >= 2 ORDER BY college DESC |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT All_Games, School_ID FROM basketball_match ORDER BY School_ID |
### Instruction:
CREATE TABLE table_64884 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" real,
"Water (sqmi)" real,
"Latitude" real,
"Longitude" real,
"GEO ID" real,
"ANSI code" real
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT MAX("Latitude") FROM table_64884 WHERE "Water (sqmi)" > '0.518' AND "Longitude" < '-99.830606' AND "Pop. (2010)" = '18' |
### Instruction:
CREATE TABLE table_79056 (
"Name or route" text,
"type" text,
"elevation groundstation" real,
"elevation mountainstation" real,
"slope length" real,
"capacity in persons/hour" real,
"construction year(s)" text
)
-- Using valid SQLite, answer the following questions for the... | SELECT "slope length" FROM table_79056 WHERE "type" = 'surface lift' AND "elevation groundstation" < '1974' AND "construction year(s)" = '1971' AND "Name or route" = 'alpmatten 1' |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT ACC_Regular_Season, School_ID FROM basketball_match |
### Instruction:
CREATE TABLE movie (
movie_id int,
Title text,
Year int,
Director text,
Budget_million real,
Gross_worldwide int
)
CREATE TABLE culture_company (
Company_name text,
Type text,
Incorporated_in text,
Group_Equity_Shareholding real,
book_club_id text,
movie... | SELECT Category, COUNT(*) FROM book_club GROUP BY Category ORDER BY Category DESC |
### Instruction:
CREATE TABLE table_59490 (
"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 AVG("League Goals") FROM table_59490 WHERE "FA Cup Goals" = '0' AND "Position" = 'mf' AND "League Cup Apps" = '0' AND "Name" = 'ben thornley' |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT All_Neutral, All_Games_Percent FROM basketball_match |
### Instruction:
CREATE TABLE table_76163 (
"Rank" real,
"Company" text,
"Headquarters" text,
"Industry" text,
"Sales (billion $)" real,
"Profits (billion $)" real,
"Assets (billion $)" real,
"Market Value (billion $)" real
)
-- Using valid SQLite, answer the following questions for th... | SELECT SUM("Assets (billion $)") FROM table_76163 WHERE "Industry" = 'oil and gas' AND "Rank" = '9' AND "Market Value (billion $)" > '121.7' |
### Instruction:
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State ... | SELECT Grape, COUNT(*) FROM wine GROUP BY Grape ORDER BY Grape DESC |
### Instruction:
CREATE TABLE club (
clubid number,
clubname text,
clubdesc text,
clublocation text
)
CREATE TABLE member_of_club (
stuid number,
clubid number,
position text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major ... | SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.sex = "F" GROUP BY t1.clubname ORDER BY COUNT(*) DESC LIMIT 1 |
### Instruction:
CREATE TABLE faculty_participates_in (
facid number,
actid number
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE faculty (
facid number,
lname text,
fn... | SELECT COUNT(DISTINCT facid) FROM faculty_participates_in |
### Instruction:
CREATE TABLE screen_mode (
graphics_mode number,
char_cells text,
pixels text,
hardware_colours number,
used_kb number,
map text,
type text
)
CREATE TABLE phone (
company_name text,
hardware_model_name text,
accreditation_type text,
accreditation_level text,... | SELECT company_name FROM phone GROUP BY company_name HAVING COUNT(*) > 1 |
### Instruction:
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
... | SELECT T1.Date, T1.Attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.Exhibition_ID = T2.Exhibition_ID WHERE T2.Year = 2004 ORDER BY Date DESC |
### Instruction:
CREATE TABLE table_28159 (
"Graphics" text,
"Launch" real,
"Market" text,
"CPU" text,
"Code name" text,
"Device ID" real,
"Core clock ( MHz )" text,
"Execution units" real,
"Shader model" text,
"DirectX" text,
"OpenGL" text,
"OpenCL" text,
"Memory ban... | SELECT COUNT("Shader model") FROM table_28159 WHERE "Core clock ( MHz )" = '900' |
### Instruction:
CREATE TABLE table_14256 (
"Model number" text,
"sSpec number" text,
"Cores" real,
"Frequency" text,
"Turbo" text,
"L2 cache" text,
"L3 cache" text,
"GPU model" text,
"GPU frequency" text,
"Socket" text,
"I/O bus" text,
"Release date" text,
"Part numb... | SELECT "GPU frequency" FROM table_14256 WHERE "Part number(s)" = 'cw8064701470702' |
### Instruction:
CREATE TABLE table_dev_22 (
"id" int,
"gender" string,
"hemoglobin_a1c_hba1c" float,
"heart_disease" bool,
"cardiovascular_disease" bool,
"esophageal_varices" bool,
"liver_disease" bool,
"diabetes" bool,
"serum_creatinine" float,
"hypertension" bool,
"portal_... | SELECT * FROM table_dev_22 WHERE liver_disease = 1 OR portal_hypertension = 1 OR esophageal_varices = 1 |
### Instruction:
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 text
)
CREATE TABLE bank (
branch_id number,
bname text,
no_of_customers number,
city text,
state te... | SELECT SUM(T2.amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T1.state = 'New York' |
### Instruction:
CREATE TABLE bank (
branch_id number,
bname text,
no_of_customers number,
city text,
state text
)
CREATE TABLE loan (
loan_id text,
loan_type text,
cust_id text,
branch_id text,
amount number
)
CREATE TABLE customer (
cust_id text,
cust_name text,
a... | SELECT DISTINCT T1.cust_name, T1.credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id |
### Instruction:
CREATE TABLE artist (
Artist_ID int,
Artist text,
Age int,
Famous_Title text,
Famous_Release_date text
)
CREATE TABLE volume (
Volume_ID int,
Volume_Issue text,
Issue_Date text,
Weeks_on_Top real,
Song text,
Artist_ID int
)
CREATE TABLE music_festival (
... | SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category ORDER BY COUNT(Category) |
### Instruction:
CREATE TABLE table_26336 (
"Player" text,
"GP-GS" text,
"Min Avg" text,
"FG-FGA" text,
"FG Pct" text,
"3FG-FGA" text,
"3FG Pct" text,
"FT-FTA" text,
"FT Pct" text,
"Reb" real,
"Ast" real,
"Blk" real,
"Stl" real,
"Pts" real,
"Avg Pts" text
)
... | SELECT COUNT("FT Pct") FROM table_26336 WHERE "3FG-FGA" = '1-20' |
### Instruction:
CREATE TABLE repair_assignment (
technician_id number,
repair_id number,
machine_id number
)
CREATE TABLE machine (
machine_id number,
making_year number,
class text,
team text,
machine_series text,
value_points number,
quality_rank number
)
CREATE TABLE repair... | SELECT starting_year FROM technician WHERE team = "CLE" INTERSECT SELECT starting_year FROM technician WHERE team = "CWS" |
### Instruction:
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 TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTE... | SELECT Year, AVG(Price) FROM wine GROUP BY Year ORDER BY Year |
### Instruction:
CREATE TABLE table_14258 (
"Model number" text,
"sSpec number" text,
"Cores" real,
"Frequency" text,
"Turbo" text,
"L2 cache" text,
"L3 cache" text,
"GPU model" text,
"GPU frequency" text,
"Socket" text,
"I/O bus" text,
"Release date" text,
"Part numb... | SELECT "sSpec number" FROM table_14258 WHERE "Part number(s)" = 'cw8064701470802' |
### Instruction:
CREATE TABLE table_204_408 (
id number,
"nation" text,
"1986" text,
"1989" text,
"1991" text,
"1997" text,
"1999" text,
"2000" text,
"2003" text,
"2005" text,
"2007" text,
"2009" text,
"2011" text,
"years" number
)
-- Using valid SQLite, answer ... | SELECT "nation" FROM table_204_408 WHERE "nation" IN ('greenland', 'mexico') ORDER BY "2000" LIMIT 1 |
### Instruction:
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE aircraft (
aid number(9,0),
name varchar2(30),
distance number(6,0)
)
CREATE TABLE flight (
flno number(4,0... | SELECT name, distance FROM aircraft ORDER BY name DESC |
### Instruction:
CREATE TABLE table_61626 (
"Tournament" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1998" text,
"2003" text,
"2004" text,
"2005" text,
"Career" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What i... | SELECT "2003" FROM table_61626 WHERE "1998" = '1r' AND "1994" = '1r' AND "Career" = '7-12' |
### Instruction:
CREATE TABLE table_54186 (
"! Late 1941" text,
"Late 1942" real,
"Sept. 1943" real,
"Late 1943" real,
"Late 1944" real,
"1978 Veteran membership" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of the 197... | SELECT COUNT("1978 Veteran membership") FROM table_54186 WHERE "Late 1943" > '78,000' AND "Sept. 1943" > '60,000' |
### Instruction:
CREATE TABLE table_64447 (
"Rank" real,
"Metropolitan area" text,
"Country" text,
"GDP (PPP) (2008) Billions of US$" real,
"Metropolitan population (2006) Millions" real,
"GDP (PPP) US$ per capita" real
)
-- Using valid SQLite, answer the following questions for the tables pro... | SELECT MIN("Metropolitan population (2006) Millions") FROM table_64447 WHERE "Country" = 'mexico' AND "Metropolitan area" = 'mexico city' AND "GDP (PPP) US$ per capita" < '20,300' |
### Instruction:
CREATE TABLE stadium (
id int,
name text,
Home_Games int,
Average_Attendance real,
Total_Attendance real,
Capacity_Percentage real
)
CREATE TABLE game (
stadium_id int,
id int,
Season int,
Date text,
Home_team text,
Away_team text,
Score text,
Co... | SELECT Home_team, COUNT(Home_team) FROM game GROUP BY Home_team ORDER BY Home_team DESC |
### Instruction:
CREATE TABLE table_51510 (
"Squad No." real,
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" text,
"FA Cup Goals" real,
"League Cup Apps" text,
"League Cup Goals" real,
"FLT Apps" text,
"FLT Goals" real,
"Total Apps" t... | SELECT "League Apps" FROM table_51510 WHERE "League Goals" < '2' AND "Position" = 'df' AND "FA Cup Apps" = '5' |
### Instruction:
CREATE TABLE participates_in (
stuid number,
actid number
)
CREATE TABLE activity (
actid number,
activity_name text
)
CREATE TABLE faculty (
facid number,
lname text,
fname text,
rank text,
sex text,
phone number,
room text,
building text
)
CREATE TAB... | SELECT stuid FROM student EXCEPT SELECT stuid FROM participates_in |
### Instruction:
CREATE TABLE table_23714 (
"Year" real,
"District" real,
"Blocks" real,
"Panchayat" real,
"Village" real,
"Human (in Lakh )" text,
"Animal (in Lakh )" text,
"Total Area (in Lakh ha )" text,
"Cropped area (in Lakh ha )" text,
"Crop Damaged (in Lakh INR )" text,
... | SELECT MIN("District") FROM table_23714 WHERE "Animal (in Lakh )" = '33.25' |
### Instruction:
CREATE TABLE table_204_217 (
id number,
"camp" text,
"div sec\ndivision" text,
"admin\ndistrict" text,
"9 feb" number,
"11 feb" number,
"16 feb" number,
"25 feb" number,
"27 feb" number,
"2 mar" number,
"4 mar" number,
"6 mar" number,
"11 mar" number,... | SELECT COUNT("camp") FROM table_204_217 WHERE "div sec\ndivision" = 'vavuniya' |
### Instruction:
CREATE TABLE table_9519 (
"Name" text,
"Nationality" text,
"Position [F ]" text,
"Date from [G ]" text,
"Date to [H ]" text,
"Appearances" real,
"Goals" real,
"Club source [I ]" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT "Date to [H ]" FROM table_9519 WHERE "Position [F ]" = 'defender' AND "Goals" < '3' AND "Appearances" > '113' AND "Date from [G ]" = '1997' |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT All_Road, All_Games_Percent FROM basketball_match |
### Instruction:
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CREATE TABLE dorm_amenity (
amenid number,
amenity_name text
)
CREATE TABLE lives_in (
stuid number,
dormid number,
room_number number
)
CREATE TABLE dorm (
dormid number,
dorm_name text,
student_capaci... | SELECT COUNT(*), city_code FROM student GROUP BY city_code HAVING COUNT(*) > 1 |
### Instruction:
CREATE TABLE table_48867 (
"Season" real,
"Total Attendance" real,
"Games" real,
"Average" real,
"High avg." real,
"Team" text,
"No. Of Clubs" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of clubs when t... | SELECT AVG("No. Of Clubs") FROM table_48867 WHERE "Average" > '18,571' AND "Games" < '182' AND "Total Attendance" = '3,140,280' AND "Season" > '1995' |
### Instruction:
CREATE TABLE table_203_59 (
id number,
"country" text,
"2000" number,
"2001" number,
"2002" number,
"2003" number,
"2004" number,
"2005" number,
"2006" number,
"2007" number,
"2008" number,
"2009" number,
"2010" number,
"2011" number
)
-- Using ... | SELECT "country" FROM table_203_59 WHERE "country" <> 'australia' AND "2000" > 100 |
### Instruction:
CREATE TABLE game (
stadium_id int,
id int,
Season int,
Date text,
Home_team text,
Away_team text,
Score text,
Competition text
)
CREATE TABLE stadium (
id int,
name text,
Home_Games int,
Average_Attendance real,
Total_Attendance real,
Capacity_P... | SELECT Home_team, COUNT(Home_team) FROM game GROUP BY Home_team ORDER BY Home_team |
### Instruction:
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
arrival_date date,
price number(7,2),
aid number(9,0)
)
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary numbe... | SELECT origin, COUNT(origin) FROM flight GROUP BY origin |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT Team_ID, All_Games_Percent FROM basketball_match |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.