instruction stringlengths 212 6.3k | output stringlengths 6 2.03k |
|---|---|
### Instruction:
CREATE TABLE table_54360 (
"Candidate" text,
"Contributions" real,
"Loans Received" real,
"All Receipts" real,
"Operating Expenditures" real,
"All Disbursements" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much in average... | SELECT AVG("Loans Received") FROM table_54360 WHERE "Contributions" < '34,986,088' AND "All Disbursements" > '251,093,944' AND "Candidate" = 'dennis kucinich †' AND "Operating Expenditures" > '3,638,219' |
### Instruction:
CREATE TABLE route (
train_id number,
station_id number
)
CREATE TABLE station (
id number,
network_name text,
services text,
local_authority text
)
CREATE TABLE weekly_weather (
station_id number,
day_of_week text,
high_temperature number,
low_temperature numb... | SELECT t2.id, t2.local_authority FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id GROUP BY t1.station_id HAVING MAX(t1.precipitation) > 50 |
### Instruction:
CREATE TABLE sampledata15 (
sample_pk number,
state text,
year text,
month text,
day text,
site text,
commod text,
source_id text,
variety text,
origin text,
country text,
disttype text,
commtype text,
claim text,
quantity number,
growst t... | SELECT mean FROM resultsdata15 WHERE commod = "AP" |
### Instruction:
CREATE TABLE resultsdata15 (
sample_pk number,
commod text,
commtype text,
lab text,
pestcode text,
testclass text,
concen number,
lod number,
conunit text,
confmethod text,
confmethod2 text,
annotate text,
quantitate text,
mean text,
extract ... | SELECT lab FROM resultsdata15 WHERE commod = "AP" |
### Instruction:
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)
)
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
... | SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details ORDER BY T1.Event_Details DESC |
### Instruction:
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 t... | SELECT name, meter_100 FROM swimmer ORDER BY name |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT ACC_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent DESC |
### Instruction:
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),... | SELECT Sex, MAX(Age) FROM Student GROUP BY Sex |
### 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 Governor, COUNT(Governor) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 GROUP BY Governor ORDER BY Governor |
### Instruction:
CREATE TABLE song (
song_name text,
artist_name text,
country text,
f_id number,
genre_is text,
rating number,
languages text,
releasedate time,
resolution number
)
CREATE TABLE files (
f_id number,
artist_name text,
file_size text,
duration text,
... | SELECT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.song_name LIKE "%love%" |
### Instruction:
CREATE TABLE table_11000 (
"1910" real,
"1920" real,
"1930" real,
"1940" real,
"1950" real,
"1960" real,
"1970" real,
"1980" real,
"1990" real,
"2000" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 1960 is l... | SELECT SUM("1970") FROM table_11000 WHERE "1960" < '4,228' AND "1920" < '106,021,568' AND "1980" > '949' |
### Instruction:
CREATE TABLE table_26415 (
"Rank" real,
"WS Points" real,
"Name" text,
"Country" text,
"08-09 I/O best" real,
"08-09 GP/JGP best" real,
"08-09 GP/JGP 2nd" real,
"08-09 OI best" real,
"08-09 OI 2nd" real,
"07-08 I/O best" real,
"07-08 GP/JGP best" real,
"0... | SELECT MIN("07-08 OI best") FROM table_26415 |
### Instruction:
CREATE TABLE faculty_participates_in (
facid number,
actid number
)
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,
... | SELECT COUNT(*) FROM faculty AS T1 JOIN faculty_participates_in AS T2 ON T1.facid = T2.facid WHERE T1.fname = "Mark" AND T1.lname = "Giuliano" |
### 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, AVG(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY AVG(School_ID) |
### Instruction:
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
me... | SELECT meter_300, ID FROM swimmer ORDER BY meter_300 |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY School_ID 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 Company, COUNT(*) FROM station_company AS T1 JOIN company AS T2 ON T1.Company_ID = T2.Company_ID GROUP BY T1.Company_ID ORDER BY COUNT(*) |
### 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, AVG(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY AVG(School_ID) DESC |
### Instruction:
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
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 Dorm (
dormid... | SELECT Sex, MAX(Age) FROM Student GROUP BY Sex |
### Instruction:
CREATE TABLE table_test_11 (
"id" int,
"left_ventricular_ejection_fraction_lvef" int,
"systolic_blood_pressure_sbp" int,
"tachycardia" int,
"bradycardia" int,
"renal_disease" bool,
"allergy_to_aspirin" bool,
"temperature" float,
"creatinine_clearance_cl" float,
"... | SELECT * FROM table_test_11 WHERE renal_disease = 1 OR creatinine_clearance_cl <= 30 |
### Instruction:
CREATE TABLE club_rank (
Rank real,
Club_ID int,
Gold real,
Silver real,
Bronze real,
Total real
)
CREATE TABLE club (
Club_ID int,
name text,
Region text,
Start_year text
)
CREATE TABLE competition_result (
Competition_ID int,
Club_ID_1 int,
Club_I... | SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type |
### 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 T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1 |
### Instruction:
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 t... | SELECT Time, meter_100 FROM swimmer ORDER BY meter_100 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_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road |
### Instruction:
CREATE TABLE country (
Country_id int,
Country_name text,
Capital text,
Official_native_language text
)
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
Team int
)
CREATE TABLE match_seaso... | SELECT Draft_Class, Draft_Pick_Number FROM match_season WHERE Position = "Defender" ORDER BY Draft_Pick_Number DESC |
### Instruction:
CREATE TABLE table_9464 (
"Rank" real,
"Airport" text,
"Location" text,
"IATA" text,
"1985\u201386" real,
"1990\u201391" real,
"1995\u201396" real,
"2000\u201301" real,
"2005\u201306" real,
"2007\u201308" real,
"2009\u201310" real,
"2010-11" real
)
-- U... | SELECT "Airport" FROM table_9464 WHERE "1985\u201386" = '407' |
### Instruction:
CREATE TABLE competition (
Competition_ID int,
Year real,
Competition_type text,
Country text
)
CREATE TABLE competition_result (
Competition_ID int,
Club_ID_1 int,
Club_ID_2 int,
Score text
)
CREATE TABLE player (
Player_ID int,
name text,
Position text,
... | SELECT Competition_type, COUNT(Competition_type) FROM competition GROUP BY Competition_type |
### Instruction:
CREATE TABLE table_19519 (
"Station Name" text,
"2002\u201303" real,
"2004\u201305" real,
"2005\u201306" real,
"2006\u201307" real,
"2007\u201308" real,
"2008\u201309" real,
"2009\u201310" real,
"2010\u201311" real,
"2011\u201312" real
)
-- Using valid SQLite, ... | SELECT "Station Name" FROM table_19519 WHERE "2004\u201305" = '5088' |
### Instruction:
CREATE TABLE loan (
loan_ID varchar(3),
loan_type varchar(15),
cust_ID varchar(3),
branch_ID varchar(3),
amount int
)
CREATE TABLE customer (
cust_ID varchar(3),
cust_name varchar(20),
acc_type char(1),
acc_bal int,
no_of_loans int,
credit_score int,
bra... | SELECT acc_type, AVG(acc_bal) FROM customer WHERE credit_score < 50 GROUP BY acc_type ORDER BY acc_type |
### Instruction:
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
... | SELECT meter_700, ID FROM swimmer ORDER BY meter_700 DESC |
### Instruction:
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
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 (
... | SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details ORDER BY T1.Event_Details 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_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road |
### Instruction:
CREATE TABLE table_45989 (
"Gatchaman" text,
"Battle of the Planets" text,
"G-Force" text,
"Eagle Riders" text,
"OVA (Harmony Gold Dub)" text,
"Rank" text,
"Bird Uniform" text,
"Weapon" text,
"Mecha" text,
"Japanese voice actor" text,
"Voice actor (BOTP)" tex... | SELECT "Japanese voice actor" FROM table_45989 WHERE "Mecha" = 'airplane' |
### Instruction:
CREATE TABLE table_59911 (
"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 SUM("League Goals") FROM table_59911 WHERE "Position" = 'df' AND "League Cup Apps" = '0' AND "Total Apps" = '7' AND "FLT Goals" < '0' |
### Instruction:
CREATE TABLE SportsInfo (
StuID INTEGER,
SportName VARCHAR(32),
HoursPerWeek INTEGER,
GamesPlayed INTEGER,
OnScholarship VARCHAR(1)
)
CREATE TABLE Plays_Games (
StuID INTEGER,
GameID INTEGER,
Hours_Played INTEGER
)
CREATE TABLE Video_Games (
GameID INTEGER,
GNa... | SELECT SportName, COUNT(*) FROM SportsInfo GROUP BY SportName ORDER BY SportName DESC |
### Instruction:
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Country int,
Team int,
Draft_Pick_Number int,
Draft_Class text,
College text
)
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
... | SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name ORDER BY COUNT(*) |
### Instruction:
CREATE TABLE table_13127 (
"7:30 am" text,
"8:00 am" text,
"9:00 am" text,
"11:00 am" text,
"noon" text,
"12:30 pm" text,
"1:00 pm" text,
"1:30 pm" text,
"2:00 pm" text,
"3:30 pm" text,
"4:00 pm" text,
"4:30 pm" text,
"5:00 pm" text,
"6:30 pm" tex... | SELECT "3:30 pm" FROM table_13127 WHERE "6:30 pm" = 'abc''s world news tonight with peter jennings' |
### Instruction:
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
... | SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details ORDER BY T1.Event_ID |
### Instruction:
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
... | SELECT Time, meter_100 FROM swimmer ORDER BY meter_100 |
### Instruction:
CREATE TABLE table_60534 (
"Data" text,
"Headcount" real,
"Percent of total" text,
"Less than $25,000" text,
"$25,000 to $40,000" text,
"$40,000 to $50,000" text,
"$50,000 to $60,000" text,
"$60,000 to $70,000" text,
"$70,000 to $80,000" text,
"More than $80,000"... | SELECT "Mean" FROM table_60534 WHERE "$70,000 to $80,000" = '2.80%' |
### 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 station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
CREATE TABLE company (
Company_I... | SELECT Main_Industry, COUNT(Main_Industry) FROM company WHERE NOT Company_ID IN (SELECT Company_ID FROM station_company) GROUP BY Main_Industry ORDER BY Main_Industry |
### Instruction:
CREATE TABLE buildings (
id int,
name text,
City text,
Height int,
Stories int,
Status text
)
CREATE TABLE Office_locations (
building_id int,
company_id int,
move_in_year int
)
CREATE TABLE Companies (
id int,
name text,
Headquarters text,
Industry... | SELECT T3.name, COUNT(T3.name) FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T3.name ORDER BY T3.name |
### Instruction:
CREATE TABLE technician (
technician_id number,
name text,
team text,
starting_year number,
age number
)
CREATE TABLE repair_assignment (
technician_id number,
repair_id number,
machine_id number
)
CREATE TABLE repair (
repair_id number,
name text,
launch_d... | SELECT T3.name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_id = T3.technician_id ORDER BY T2.quality_rank |
### Instruction:
CREATE TABLE resultsdata15 (
sample_pk number,
commod text,
commtype text,
lab text,
pestcode text,
testclass text,
concen number,
lod number,
conunit text,
confmethod text,
confmethod2 text,
annotate text,
quantitate text,
mean text,
extract ... | SELECT COUNT(*) FROM sampledata15 WHERE origin = "3" |
### 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, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home 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 ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY Team_ID |
### Instruction:
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
Left_office text,
Region_ID int,
Party_name text
)
CREATE TABLE member (
Member_ID int,
Member_Name text,
Party_ID text,
In_office text
)
CREATE TABLE party_events (
Event_ID int,
Event... | SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY COUNT(*) |
### Instruction:
CREATE TABLE table_train_21 (
"id" int,
"pregnancy_or_lactation" bool,
"severe_sepsis" bool,
"systolic_blood_pressure_sbp" int,
"active_infection" bool,
"limited_care" bool,
"septic_shock" bool,
"coagulopathy" bool,
"age" float,
"lactate" int,
"NOUSE" float
)... | SELECT * FROM table_train_21 WHERE active_infection = 1 AND (lactate > 4 OR systolic_blood_pressure_sbp < 90) |
### Instruction:
CREATE TABLE table_dev_6 (
"id" int,
"gender" string,
"systolic_blood_pressure_sbp" int,
"heart_disease" bool,
"renal_disease" bool,
"hematocrit_hct" float,
"creatinine_clearance_cl" float,
"diastolic_blood_pressure_dbp" int,
"symptomatic_coronary_artery_disease" boo... | SELECT * FROM table_dev_6 WHERE hypertension = 1 OR systolic_blood_pressure_sbp > 140 OR diastolic_blood_pressure_dbp > 90 |
### Instruction:
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Ye... | SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY Nationality |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road DESC |
### Instruction:
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 text,
Took_office text,
Left_office text,
Region_ID int,
Party_name text
)
CREATE TABLE region (
Region_ID int,
... | SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY Party_name |
### 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, AVG(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY AVG(School_ID) DESC |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT All_Home, AVG(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY AVG(Team_ID) |
### 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 technician (
technician_id real,
Name text,
Team text,
Starting_Year real,
Age int
)
CREATE TABLE repa... | SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id GROUP BY Name |
### Instruction:
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Ti... | SELECT Time, meter_100 FROM swimmer ORDER BY Time DESC |
### Instruction:
CREATE TABLE club_rank (
Rank real,
Club_ID int,
Gold real,
Silver real,
Bronze real,
Total real
)
CREATE TABLE competition (
Competition_ID int,
Year real,
Competition_type text,
Country text
)
CREATE TABLE player (
Player_ID int,
name text,
Positi... | SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type |
### Instruction:
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CR... | SELECT name, meter_100 FROM swimmer ORDER BY meter_100 |
### 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 Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Has_ame... | SELECT Sex, AVG(Age) FROM Student GROUP BY Sex |
### Instruction:
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 r... | SELECT name, meter_100 FROM swimmer ORDER BY name DESC |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road |
### Instruction:
CREATE TABLE team (
Team_id int,
Name text
)
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
Team int
)
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Countr... | SELECT Draft_Class, Draft_Pick_Number FROM match_season WHERE Position = "Defender" ORDER BY Draft_Pick_Number |
### Instruction:
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season ... | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY School_ID |
### Instruction:
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CR... | SELECT meter_700, ID FROM swimmer ORDER BY ID DESC |
### Instruction:
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 t... | SELECT Nationality, AVG(ID) FROM swimmer GROUP BY Nationality |
### 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 match_season (
Season real,
Player text,
Position text,
Country int,
Team int,
Draft_Pick_Number int,
Dr... | SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name ORDER BY Country_name DESC |
### Instruction:
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
arrival_date date,
price number(7,2),
aid number(9,0)
)
CREATE TABLE ... | SELECT name, COUNT(*) FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid ORDER BY name |
### Instruction:
CREATE TABLE sampledata15 (
sample_pk number,
state text,
year text,
month text,
day text,
site text,
commod text,
source_id text,
variety text,
origin text,
country text,
disttype text,
commtype text,
claim text,
quantity number,
growst t... | SELECT COUNT(*) FROM sampledata15 WHERE origin = "2" |
### Instruction:
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE univ... | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY ACC_Road |
### Instruction:
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
Party_ID int,
Member_in_charge_ID int
)
CREATE TABLE member (
Member_ID int,
Member_Name text,
Party_ID text,
In_office text
)
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
... | SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY COUNT(*) |
### Instruction:
CREATE TABLE table_203_117 (
id number,
"region/country" text,
"1882-\n1918" number,
"1919-\n1948" number,
"1948-\n1951" number,
"1952-\n1960" number,
"1961-\n1971" number,
"1972-\n1979" number,
"1980-\n1989" number,
"1990-\n2001" number,
"2002-\n2010" number... | SELECT "region/country" FROM table_203_117 WHERE "region/country" = 'africa' |
### Instruction:
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
Ci... | SELECT Nationality, AVG(ID) FROM swimmer GROUP BY Nationality ORDER BY AVG(ID) 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 ACC_Road, Team_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY Team_ID |
### Instruction:
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
... | SELECT T2.Party, SUM(COUNT(*)) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY T2.Party DESC |
### Instruction:
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 r... | SELECT Time, meter_100 FROM swimmer ORDER BY Time |
### Instruction:
CREATE TABLE services (
service_id number,
service_name text
)
CREATE TABLE settlements (
settlement_id number,
claim_id number,
effective_date time,
settlement_amount number
)
CREATE TABLE claims (
claim_id number,
fnol_id number,
effective_date time
)
CREATE TAB... | SELECT COUNT(*) FROM services |
### Instruction:
CREATE TABLE table_dev_4 (
"id" int,
"hypothyroidism" bool,
"serum_bicarbonate" int,
"c_peptide_level" float,
"autoimmune_disease" bool,
"hemoglobin_a1c_hba1c" float,
"positive_serum" bool,
"inhaled_steroids" bool,
"diabetic_ketoacidosis" bool,
"creatinine_cleara... | SELECT * FROM table_dev_4 WHERE hemoglobin_a1c_hba1c < 12 |
### Instruction:
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,
acc_type text,
acc_bal number,
no_of_loans number,
credit_score number,
branch_id number,
state text... | SELECT T1.cust_name, T1.acc_type FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING SUM(T2.amount) > 5000 |
### Instruction:
CREATE TABLE player (
player_id number,
sponsor_name text,
player_name text,
gender text,
residence text,
occupation text,
votes number,
rank text
)
CREATE TABLE player_coach (
player_id number,
coach_id number,
starting_year number
)
CREATE TABLE match_res... | SELECT player_name FROM player ORDER BY votes DESC LIMIT 1 |
### Instruction:
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Ti... | SELECT meter_300, ID FROM swimmer ORDER BY ID 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 ORDER BY COUNT(All_Home) |
### Instruction:
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CR... | SELECT meter_400, ID FROM swimmer ORDER BY ID |
### Instruction:
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE T... | SELECT Governor, COUNT(Governor) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 GROUP BY Governor ORDER BY Governor DESC |
### Instruction:
CREATE TABLE table_14170 (
"Model number" text,
"sSpec number" text,
"Cores" text,
"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,
"Release p... | SELECT "Turbo" FROM table_14170 WHERE "L2 cache" = '4 × 256 kb' AND "Release date" = 'june 2013' AND "Model number" = 'core i7-4770s' |
### Instruction:
CREATE TABLE table_53547 (
"D 50 \u221a" text,
"D 49 \u221a" text,
"D 48 \u221a" text,
"D 47 \u221a" text,
"D 46 \u221a" text,
"D 45 \u221a" text,
"D 44 \u221a" text,
"D 43 \u221a" text,
"D 42 \u221a" text,
"D 41 \u221a" text
)
-- Using valid SQLite, answer the... | SELECT "D 50 \u221a" FROM table_53547 WHERE "D 47 \u221a" = 'r 27 √' |
### Instruction:
CREATE TABLE sampledata15 (
sample_pk number,
state text,
year text,
month text,
day text,
site text,
commod text,
source_id text,
variety text,
origin text,
country text,
disttype text,
commtype text,
claim text,
quantity number,
growst t... | SELECT COUNT(DISTINCT variety) FROM sampledata15 |
### Instruction:
CREATE TABLE record (
id number,
result text,
swimmer_id number,
event_id number
)
CREATE TABLE event (
id number,
name text,
stadium_id number,
year text
)
CREATE TABLE stadium (
id number,
name text,
capacity number,
city text,
country text,
o... | SELECT COUNT(DISTINCT city) FROM stadium WHERE opening_year < 2006 |
### Instruction:
CREATE TABLE table_52135 (
"Crew" real,
"Open 1st VIII" text,
"Open 2nd VIII" text,
"Open 3rd VIII" text,
"U16 1st VIII" text,
"U16 2nd VIII" text,
"U16 3rd VIII" text,
"U15 1st Quad" text,
"U15 2nd Quad" text,
"U15 3rd Quad" text,
"U15 4th Quad" text,
"U... | SELECT "U15 3rd Quad" FROM table_52135 WHERE "U15 2nd Quad" = 'acgs' |
### Instruction:
CREATE TABLE table_13022 (
"Team" text,
"2005\u201306 Pts" real,
"2006\u201307 Pts" real,
"2007\u201308 Pts" real,
"Total Pts" real,
"Total Pld" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 2007 08 Pts has a Total Pts sm... | SELECT SUM("2007\u201308 Pts") FROM table_13022 WHERE "Total Pts" < '173' AND "Total Pld" > '38' AND "Team" = 'banfield' AND "2005\u201306 Pts" < '59' |
### Instruction:
CREATE TABLE table_50752 (
"2010 ARWU Rankings" text,
"2010 QS World Rankings" text,
"2010 QS Asian Rankings" text,
"2010 eduniversal Rankings" text,
"2009 QS Asian Rankings: Int\u2019l faculty review" text,
"2009 QS Asian Rankings: Int\u2019l student review" real,
"2000 Sin... | SELECT "University" FROM table_50752 WHERE "2009 QS Asian Rankings: Int\u2019l student review" = '195' |
### Instruction:
CREATE TABLE table_5325 (
"Bullet weight gram (grain)" text,
"8.23 g (127 gr)" real,
"9.72 g (150 gr)" real,
"11.34 g (175 gr)" real,
"12.96 g (200 gr)" real,
"14.26 g (220 gr)" real,
"Case capacity (%)" real
)
-- Using valid SQLite, answer the following questions for the ... | SELECT AVG("9.72 g (150 gr)") FROM table_5325 WHERE "Bullet weight gram (grain)" = '.325 wsm' AND "8.23 g (127 gr)" < '108.7' |
### Instruction:
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
arrival_date date,
price number(7,2),
aid number(9,0)
)
CREATE TABLE ... | SELECT name, COUNT(*) FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid ORDER BY name 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 ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY School_ID DESC |
### Instruction:
CREATE TABLE table_10349 (
"D 50 \u221a" text,
"D 49 \u221a" text,
"D 48 \u221a" text,
"D 47 \u221a" text,
"D 46 \u221a" text,
"D 45 \u221a" text,
"D 44 \u221a" text,
"D 43 \u221a" text,
"D 42 \u221a" text,
"D 41 \u221a" text
)
-- Using valid SQLite, answer the... | SELECT "D 41 \u221a" FROM table_10349 WHERE "D 47 \u221a" = 'r 34 o' |
### Instruction:
CREATE TABLE table_19409 (
"1890 No game" text,
"1891 No game" text,
"1892 No game" text,
"1893 No game" text,
"1894 WSU 10\u20130 Moscow" text,
"1895 WSU* 10\u20134 Pullman" text,
"1896 No game" text,
"1897 No game" text,
"1898 No game" text,
"1899 WSU* 11\u2013... | SELECT "1890 No game" FROM table_19409 WHERE "1897 No game" = '1987 No game' |
### 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(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY SUM(School_ID) |
### Instruction:
CREATE TABLE table_dev_28 (
"id" int,
"gender" string,
"systolic_blood_pressure_sbp" int,
"consent" bool,
"hemoglobin_a1c_hba1c" float,
"hematocrit_hct" float,
"fasting_triglycerides" int,
"fasting_blood_glucose_fbg" float,
"diastolic_blood_pressure_dbp" int,
"hb... | SELECT * FROM table_dev_28 WHERE hba1c > 6.5 AND hemoglobin_a1c_hba1c < 9 AND metformin = 1 |
### Instruction:
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Country int,
Team int,
Draft_Pick_Number int,
Draft_Class text,
College text
)
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
... | SELECT Draft_Class, Draft_Pick_Number FROM match_season WHERE Position = "Defender" ORDER BY Draft_Class DESC |
### Instruction:
CREATE TABLE team (
team_id number,
name text
)
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... | SELECT COUNT(DISTINCT T1.college) FROM match_season AS T1 JOIN team AS T2 ON T1.team = T2.team_id WHERE T2.name = "Columbus Crew" |
### Instruction:
CREATE TABLE member (
Member_ID int,
Member_Name text,
Party_ID text,
In_office text
)
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
Left_office text,
Region_ID int,
Party_name text
)
CREATE TABLE region (
Region_ID int,
Region_nam... | SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY Party_name DESC |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.