instruction stringlengths 212 6.3k | output stringlengths 6 2.03k |
|---|---|
### Instruction:
CREATE TABLE store_product (
store_id number,
product_id number
)
CREATE TABLE district (
district_id number,
district_name text,
headquartered_city text,
city_population number,
city_area number
)
CREATE TABLE product (
product_id number,
product text,
dimensi... | SELECT product FROM product WHERE product <> (SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY COUNT(*) DESC LIMIT 1) |
### Instruction:
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
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
)
CR... | SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY Nationality |
### Instruction:
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
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CR... | SELECT meter_300, meter_100 FROM swimmer ORDER BY meter_100 DESC |
### Instruction:
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VA... | SELECT Building, COUNT(*) FROM Faculty GROUP BY Building |
### 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 Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VA... | SELECT Sex, MAX(Age) FROM Student GROUP BY Sex ORDER BY Sex |
### Instruction:
CREATE TABLE ref_document_types (
document_type_code text,
document_type_name text,
document_type_description text
)
CREATE TABLE documents_with_expenses (
document_id number,
budget_type_code text,
document_details text
)
CREATE TABLE accounts (
account_id number,
sta... | SELECT COUNT(*) FROM ref_budget_codes |
### 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, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road ORDER BY COUNT(ACC_Road) DESC |
### Instruction:
CREATE TABLE table_203_530 (
id number,
"country" text,
"gdp (usd bln, 2012)" number,
"gdp (usd bln, 2017)" number,
"gdp (usd ppp bln, 2012)" number,
"gdp (usd ppp bln, 2017)" number,
"per capita (usd, 2012)" number,
"per capita (usd, 2017)" number,
"per capita (usd ... | SELECT COUNT("country") FROM table_203_530 WHERE "gdp (usd bln, 2012)" >= 8 |
### Instruction:
CREATE TABLE player (
Player_ID int,
name text,
Position text,
Club_ID int,
Apps real,
Tries real,
Goals text,
Points real
)
CREATE TABLE club_rank (
Rank real,
Club_ID int,
Gold real,
Silver real,
Bronze real,
Total real
)
CREATE TABLE club (
... | SELECT Country, COUNT(Country) FROM competition GROUP BY Competition_type, Country ORDER BY Country DESC |
### Instruction:
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
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... | SELECT city_code, AVG(Age) FROM Student GROUP BY city_code |
### 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 artist (
artist_name text,
country text,
gender text,
preferred_genre te... | SELECT MIN(T1.duration), MIN(T2.rating), T2.genre_is FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY T2.genre_is ORDER BY T2.genre_is |
### 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 site FROM sampledata15 WHERE sample_pk = 3763 |
### Instruction:
CREATE TABLE protein (
common_name text,
protein_name text,
divergence_from_human_lineage real,
accession_number text,
sequence_length real,
sequence_identity_to_human_protein text,
Institution_id text
)
CREATE TABLE Institution (
Institution_id text,
Institution te... | SELECT Institution, COUNT(*) FROM Institution AS T1 JOIN protein AS T2 ON T1.Institution_id = T2.Institution_id GROUP BY T1.Institution_id ORDER BY Institution |
### 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 record (
ID int,
Result text,
Swimmer_ID int,
... | SELECT meter_300, meter_100 FROM swimmer ORDER BY meter_300 DESC |
### Instruction:
CREATE TABLE channel (
channel_id number,
name text,
owner text,
share_in_percent number,
rating_in_percent number
)
CREATE TABLE broadcast_share (
channel_id number,
program_id number,
date text,
share_in_percent number
)
CREATE TABLE broadcast (
channel_id nu... | SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Morning' INTERSECT SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Night' |
### Instruction:
CREATE TABLE player (
Player_ID int,
Sponsor_name text,
Player_name text,
Gender text,
Residence text,
Occupation text,
Votes int,
Rank text
)
CREATE TABLE coach (
Coach_ID int,
Coach_name text,
Gender text,
Club_ID int,
Rank int
)
CREATE TABLE club... | SELECT Occupation, COUNT(Occupation) FROM player GROUP BY Occupation |
### Instruction:
CREATE TABLE school_performance (
School_Id int,
School_Year text,
Class_A text,
Class_AA text
)
CREATE TABLE player (
Player_ID int,
Player text,
Team text,
Age int,
Position text,
School_ID int
)
CREATE TABLE school_details (
School_ID int,
Nickname t... | SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination ORDER BY COUNT(*) |
### Instruction:
CREATE TABLE school_performance (
school_id number,
school_year text,
class_a text,
class_aa text
)
CREATE TABLE school (
school_id number,
school text,
location text,
enrollment number,
founded number,
denomination text,
boys_or_girls text,
day_or_board... | SELECT T1.location, T2.nickname FROM school AS T1 JOIN school_details AS T2 ON T1.school_id = T2.school_id |
### 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 Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY Nationality |
### 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, AVG(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY AVG(School_ID) DESC |
### 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 meter_700, meter_100 FROM swimmer ORDER BY meter_100 |
### Instruction:
CREATE TABLE table_40818 (
"1935" text,
"1936" text,
"1937" text,
"1938" text,
"1939" text,
"1940" text,
"1941" text,
"1943" text,
"1945" text,
"1946" text,
"1947" text,
"1948" text,
"1949" text,
"1950" text,
"1951" text,
"1952" text,
... | SELECT "1953" FROM table_40818 WHERE "1949" = '2' AND "1952" = '3' |
### Instruction:
CREATE TABLE table_19130 (
"Character Name" text,
"Voice Actor (Japanese)" text,
"Voice Actor (English 1997 / Saban)" text,
"Voice Actor (English 1998 / Pioneer)" text,
"Voice Actor (English 2006 / FUNimation)" text
)
-- Using valid SQLite, answer the following questions for the t... | SELECT "Voice Actor (English 1998 / Pioneer)" FROM table_19130 WHERE "Voice Actor (English 1997 / Saban)" = 'Alec Willows' AND "Voice Actor (English 2006 / FUNimation)" = 'Andy McAvin' |
### 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 state FROM sampledata15 WHERE claim = "PO" GROUP BY state ORDER BY COUNT(*) DESC LIMIT 1 |
### Instruction:
CREATE TABLE services (
service_id number,
service_name text
)
CREATE TABLE claims (
claim_id number,
fnol_id number,
effective_date time
)
CREATE TABLE customers_policies (
customer_id number,
policy_id number,
date_opened time,
date_closed time
)
CREATE TABLE av... | SELECT customer_id, customer_name FROM customers ORDER BY customer_id |
### Instruction:
CREATE TABLE band (
id number,
firstname text,
lastname text
)
CREATE TABLE performance (
songid number,
bandmate number,
stageposition text
)
CREATE TABLE vocals (
songid number,
bandmate number,
type text
)
CREATE TABLE songs (
songid number,
title text
... | SELECT T2.lastname FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id JOIN songs AS T3 ON T3.songid = T1.songid GROUP BY lastname ORDER BY COUNT(*) DESC LIMIT 1 |
### Instruction:
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
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 t... | SELECT meter_300, meter_100 FROM swimmer ORDER BY meter_300 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 Affiliation, SUM(Enrollment) FROM university WHERE Founded > 1850 GROUP BY Affiliation ORDER BY Affiliation |
### 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 meter_200, AVG(ID) FROM swimmer GROUP BY meter_200 ORDER BY AVG(ID) |
### 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 stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CR... | SELECT Nationality, SUM(ID) FROM swimmer GROUP BY Nationality ORDER BY Nationality DESC |
### 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 meter_400, meter_100 FROM swimmer ORDER BY meter_100 DESC |
### 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 meter_300, meter_100 FROM swimmer ORDER BY meter_100 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 meter_200, AVG(ID) FROM swimmer GROUP BY meter_200 |
### Instruction:
CREATE TABLE routes (
rid integer,
dst_apid integer,
dst_ap varchar(4),
src_apid bigint,
src_ap varchar(4),
alid bigint,
airline varchar(4),
codeshare text
)
CREATE TABLE airlines (
alid integer,
name text,
iata varchar(2),
icao varchar(3),
callsign ... | SELECT country, COUNT(country) FROM airlines WHERE name LIKE 'Orbit%' GROUP BY country ORDER BY COUNT(country) |
### 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 T3.manager_name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.company = 'ExxonMobil' |
### 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 conunit FROM resultsdata15 WHERE sample_pk = 3879 |
### 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_400, meter_100 FROM swimmer ORDER BY meter_400 |
### Instruction:
CREATE TABLE table_41570 (
"Year" real,
"January" real,
"February" real,
"March" real,
"April" real,
"June" real,
"July" real,
"August" real,
"September" real,
"October" real,
"November" real,
"December" real,
"Annual Additions(in millions)" real,
... | SELECT COUNT("October") FROM table_41570 WHERE "September" < '2.48' AND "Year" > '2002' AND "June" > '1.42' AND "February" < '7.44' |
### Instruction:
CREATE TABLE faculty (
campus number,
year number,
faculty number
)
CREATE TABLE discipline_enrollments (
campus number,
discipline number,
year number,
undergraduate number,
graduate number
)
CREATE TABLE csu_fees (
campus number,
year number,
campusfee nu... | SELECT campus FROM campuses WHERE location = "Northridge" AND county = "Los Angeles" UNION SELECT campus FROM campuses WHERE location = "San Francisco" AND county = "San Francisco" |
### Instruction:
CREATE TABLE store (
store_id number,
store_name text,
type text,
area_size number,
number_of_product_category number,
ranking number
)
CREATE TABLE district (
district_id number,
district_name text,
headquartered_city text,
city_population number,
city_area... | SELECT SUM(city_population) FROM district WHERE city_area > (SELECT AVG(city_area) FROM district) |
### Instruction:
CREATE TABLE table_dev_60 (
"id" int,
"systolic_blood_pressure_sbp" int,
"body_weight" float,
"renal_disease" bool,
"allergy_to_aspirin" bool,
"creatinine_clearance_cl" float,
"allergy_to_clopidogrel" bool,
"allergy_to_heparin" bool,
"platelet_count" float,
"thro... | SELECT * FROM table_dev_60 WHERE thrombocytopenia = 1 OR platelet_count < 100000 |
### Instruction:
CREATE TABLE routes (
rid integer,
dst_apid integer,
dst_ap varchar(4),
src_apid bigint,
src_ap varchar(4),
alid bigint,
airline varchar(4),
codeshare text
)
CREATE TABLE airlines (
alid integer,
name text,
iata varchar(2),
icao varchar(3),
callsign ... | SELECT country, COUNT(country) FROM airlines WHERE name LIKE 'Orbit%' GROUP BY country ORDER BY COUNT(country) DESC |
### Instruction:
CREATE TABLE table_train_140 (
"id" int,
"gender" string,
"mini_mental_state_examination_mmse" int,
"allergy_to_quinidine" bool,
"systolic_blood_pressure_sbp" int,
"postural_syncope" bool,
"hypotension" bool,
"unexplained_syncope" bool,
"allergy_to_dextromethorphan" ... | SELECT * FROM table_train_140 WHERE alcohol_abuse = 1 OR drug_abuse = 1 |
### Instruction:
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Dorm_amen... | SELECT Sex, COUNT(*) FROM Student WHERE Age > (SELECT AVG(Age) FROM Student) GROUP BY Sex |
### Instruction:
CREATE TABLE table_31010 (
"Rnd" text,
"Circuit" text,
"AP Winning Team" text,
"BP Winning Team" text,
"CM Winning Team" text,
"CP Winning Team" text,
"DM Winning Team" text,
"DP Winning Team" text,
"EM Winning Team" text,
"EP Winning Team" text,
"FM Winning ... | SELECT "EP Winning Team" FROM table_31010 WHERE "CP Winning Team" = 'Dave Clark' AND "GM Winning Team" = 'Stuart Northrup' |
### 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_600, meter_100 FROM swimmer ORDER BY meter_100 |
### Instruction:
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
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,
... | SELECT meter_700, meter_100 FROM swimmer ORDER BY meter_700 |
### 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 stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CR... | SELECT meter_500, meter_100 FROM swimmer ORDER BY meter_100 DESC |
### Instruction:
CREATE TABLE table_train_70 (
"id" int,
"pregnancy_or_lactation" bool,
"white_blood_cell_count_wbc" int,
"systolic_blood_pressure_sbp" int,
"mean_arterial_pressure_map" int,
"temperature" float,
"oliguria" bool,
"surgery" bool,
"heart_rate" int,
"systemic_inflamm... | SELECT * FROM table_train_70 WHERE surgery = 1 OR systemic_inflammatory_response = 1 |
### Instruction:
CREATE TABLE table_dev_21 (
"id" int,
"gender" string,
"leukopenia" int,
"dialysis" bool,
"hemoglobin_a1c_hba1c" float,
"cd4_count" int,
"platelets" int,
"renal_disease" bool,
"fasting_triglycerides" int,
"hyperlipidemia" bool,
"lymphopenia" int,
"hba1c" ... | SELECT * FROM table_dev_21 WHERE triglyceride_tg >= 500 |
### Instruction:
CREATE TABLE table_61151 (
"7:00 am" text,
"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:00 pm" text,
"3:30 pm" text,
"4:00 pm" text,
"4:30 pm" tex... | SELECT "1:30 pm" FROM table_61151 WHERE "7:00 am" = 'tiny toon adventures' |
### 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 competition_result (
Competition_ID int,
Club... | SELECT Competition_type, COUNT(Competition_type) FROM competition GROUP BY Competition_type ORDER BY Competition_type |
### Instruction:
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,
branch_ID int,
state varchar(20)
)
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varcha... | SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID ORDER BY credit_score DESC |
### Instruction:
CREATE TABLE table_204_582 (
id number,
"model" text,
"launch" text,
"code name" text,
"fab (nm)" number,
"bus interface" text,
"memory (mib)" text,
"core clock (mhz)" number,
"memory clock (mhz)" number,
"config core1" text,
"fillrate\nmoperations/s" number,... | SELECT COUNT(*) FROM table_204_582 WHERE "fab (nm)" = 500 |
### 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 conunit FROM resultsdata15 WHERE commod = "PO" |
### Instruction:
CREATE TABLE injury_accident (
game_id int,
id int,
Player text,
Injury text,
Number_of_matches text,
Source text
)
CREATE TABLE game (
stadium_id int,
id int,
Season int,
Date text,
Home_team text,
Away_team text,
Score text,
Competition text
)
... | SELECT Number_of_matches, COUNT(Number_of_matches) FROM injury_accident WHERE Injury <> 'Knee problem' GROUP BY Number_of_matches ORDER BY Number_of_matches DESC |
### Instruction:
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
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,
... | SELECT meter_200, SUM(ID) FROM swimmer GROUP BY meter_200 ORDER BY SUM(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, meter_100 FROM swimmer ORDER BY meter_100 |
### Instruction:
CREATE TABLE table_59913 (
"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 MIN("FA Cup Goals") FROM table_59913 WHERE "Total Goals" > '0' AND "League Goals" = '4' AND "FA Cup Apps" = '1' AND "League Cup Goals" > '0' |
### 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, AVG(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY AVG(School_ID) |
### Instruction:
CREATE TABLE member (
Member_ID int,
Card_Number text,
Name text,
Hometown text,
Level int
)
CREATE TABLE membership_register_branch (
Member_ID int,
Branch_ID text,
Register_Year text
)
CREATE TABLE purchase (
Member_ID int,
Branch_ID text,
Year text,
... | SELECT Name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.Branch_ID = T2.Branch_ID WHERE T1.Register_Year > 2015 GROUP BY T2.Branch_ID ORDER BY Name |
### Instruction:
CREATE TABLE table_test_20 (
"id" int,
"ejection_fraction_ef" int,
"anemia" bool,
"gender" string,
"bleeding" int,
"systolic_blood_pressure_sbp" int,
"left_main_coronary_artery_stenosis" int,
"hemoglobin_a1c_hba1c" float,
"renal_disease" bool,
"creatinine_clearan... | SELECT * FROM table_test_20 WHERE anemia = 1 OR hemoglobin_a1c_hba1c < 8.5 |
### Instruction:
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,
branch_ID int,
state varchar(20)
)
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varcha... | SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID ORDER BY cust_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, AVG(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY AVG(School_ID) DESC |
### 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 year, month, day FROM sampledata15 WHERE sample_pk = 3763 |
### Instruction:
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
... | SELECT city_code, AVG(Age) FROM Student GROUP BY city_code |
### Instruction:
CREATE TABLE table_20843 (
"C/W 15+" real,
"Oblast\\Age" text,
"15 to 17" real,
"18 to 19" real,
"20 to 24" real,
"25 to 29" real,
"30 to 34" real,
"35 to 39" real,
"40 to 44" real,
"45 to 49" real,
"50 to 54" real,
"55 to 59" real,
"60 to 64" real,
... | SELECT "65 to 69" FROM table_20843 WHERE "50 to 54" = '1571' |
### Instruction:
CREATE TABLE table_37821 (
"2005/ 06" text,
"2006/ 07" text,
"2007/ 08" text,
"2008/ 09" text,
"2009/ 10" text,
"2010/ 11" text,
"2011/ 12" text,
"2012/ 13" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 2011/ 12 h... | SELECT "2011/ 12" FROM table_37821 WHERE "2010/ 11" = 'a' AND "2007/ 08" = 'not held' AND "2012/ 13" = 'lq' |
### 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 Affiliation, SUM(Enrollment) FROM university WHERE Founded > 1850 GROUP BY Affiliation ORDER BY SUM(Enrollment) |
### 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, meter_100 FROM swimmer ORDER BY meter_700 |
### Instruction:
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
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,
... | SELECT meter_200, AVG(ID) FROM swimmer GROUP BY meter_200 |
### Instruction:
CREATE TABLE club (
Club_ID int,
name text,
Region text,
Start_year text
)
CREATE TABLE player (
Player_ID int,
name text,
Position text,
Club_ID int,
Apps real,
Tries real,
Goals text,
Points real
)
CREATE TABLE competition_result (
Competition_ID ... | SELECT Position, AVG(Points) FROM player GROUP BY Position ORDER BY Position 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, AVG(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC |
### Instruction:
CREATE TABLE finrev_fed_key_17 (
state_code number,
state text,
#_records text
)
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 nde... | SELECT T1.school_district FROM finrev_fed_17 AS T1 JOIN finrev_fed_key_17 AS T2 ON T1.state_code = T2.state_code WHERE T2.state = "Wisconsin" ORDER BY T1.t_fed_rev 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_600, ID FROM swimmer ORDER BY meter_600 DESC |
### 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 pestcode FROM resultsdata15 GROUP BY pestcode ORDER BY COUNT(*) DESC LIMIT 1 |
### 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, AVG(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY AVG(School_ID) |
### 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, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY SUM(School_ID) DESC |
### Instruction:
CREATE TABLE building (
building_id text,
Name text,
Street_address text,
Years_as_tallest text,
Height_feet int,
Floors int
)
CREATE TABLE protein (
common_name text,
protein_name text,
divergence_from_human_lineage real,
accession_number text,
sequence_len... | SELECT Name, COUNT(*) FROM building AS T1 JOIN Institution AS T2 ON T1.building_id = T2.building_id GROUP BY T1.building_id |
### Instruction:
CREATE TABLE competition_record (
Competition_ID int,
Farm_ID int,
Rank int
)
CREATE TABLE farm_competition (
Competition_ID int,
Year int,
Theme text,
Host_city_ID int,
Hosts text
)
CREATE TABLE farm (
Farm_ID int,
Year int,
Total_Horses real,
Working_... | SELECT Status, AVG(Population) FROM city GROUP BY Status ORDER BY AVG(Population) |
### Instruction:
CREATE TABLE product (
product_id int,
product text,
dimensions text,
dpi real,
pages_per_minute_color real,
max_page_size text,
interface text
)
CREATE TABLE store_district (
Store_ID int,
District_ID int
)
CREATE TABLE store_product (
Store_ID int,
Produc... | SELECT Type, COUNT(*) FROM store GROUP BY Type ORDER BY COUNT(*) DESC |
### Instruction:
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
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 t... | SELECT Nationality, AVG(meter_100) FROM swimmer GROUP BY Nationality ORDER BY Nationality DESC |
### 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_700, meter_100 FROM swimmer ORDER BY meter_100 |
### Instruction:
CREATE TABLE table_46451 (
"Tournament" text,
"1984" text,
"1985" text,
"1986" text,
"1987" text,
"1988" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text... | SELECT "1987" FROM table_46451 WHERE "1994" = 'atp masters series' |
### Instruction:
CREATE TABLE table_27251 (
"Rank" real,
"WS Points" real,
"Name" text,
"Country" text,
"09-10 I/O best" real,
"09-10 GP/JGP best" real,
"09-10 GP/JGP 2nd" real,
"09-10 OI best" real,
"09-10 OI 2nd" real,
"08-09 I/O best" real,
"08-09 GP/JGP best" real,
"0... | SELECT MIN("09-10 OI 2nd") FROM table_27251 |
### Instruction:
CREATE TABLE table_test_13 (
"id" int,
"systolic_blood_pressure_sbp" int,
"tachycardia" int,
"diastolic_blood_pressure_dbp" int,
"total_cholesterol" int,
"high_density_lipoprotein_cholesterol_hdl_c" int,
"serum_creatinine" float,
"alcohol_abuse" bool,
"drug_abuse" bo... | SELECT * FROM table_test_13 WHERE high_density_lipoprotein_cholesterol_hdl_c >= 40 |
### Instruction:
CREATE TABLE table_25642 (
"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 "Model number" FROM table_25642 WHERE "Part number(s)" = 'CM80616003177ACBX80616I5660' |
### Instruction:
CREATE TABLE projects (
project_id number,
project_details text
)
CREATE TABLE ref_budget_codes (
budget_type_code text,
budget_type_description text
)
CREATE TABLE documents_with_expenses (
document_id number,
budget_type_code text,
document_details text
)
CREATE TABLE s... | SELECT COUNT(*) FROM statements |
### Instruction:
CREATE TABLE protein (
common_name text,
protein_name text,
divergence_from_human_lineage number,
accession_number text,
sequence_length number,
sequence_identity_to_human_protein text,
institution_id text
)
CREATE TABLE institution (
institution_id text,
institutio... | SELECT COUNT(*) FROM building WHERE height_feet > (SELECT AVG(height_feet) FROM building) OR floors > (SELECT AVG(floors) FROM building) |
### Instruction:
CREATE TABLE table_46117 (
"Model" text,
"1998" text,
"1999" 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
)
-- Using valid SQ... | SELECT "2003" FROM table_46117 WHERE "2000" = '—' AND "2007" = '—' AND "2010" = '—' |
### 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 meter_500, meter_100 FROM swimmer ORDER BY meter_500 |
### Instruction:
CREATE TABLE table_202_294 (
id number,
"year" number,
"entrant" text,
"chassis" text,
"engine" text,
"tyres" text,
"drivers" text,
"1" number,
"2" number,
"3" number,
"4" number,
"5" number,
"6" number,
"7" number,
"8" number,
"9" number,... | SELECT "year" FROM table_202_294 ORDER BY "points" DESC LIMIT 1 |
### 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, meter_100 FROM swimmer ORDER BY meter_700 DESC |
### Instruction:
CREATE TABLE city (
city_id number,
city text,
hanzi text,
hanyu_pinyin text,
regional_population number,
gdp number
)
CREATE TABLE match (
match_id number,
date text,
venue text,
score text,
result text,
competition text
)
CREATE TABLE hosting_city (
... | SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY T2.host_city ORDER BY COUNT(*) DESC LIMIT 1 |
### Instruction:
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
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 t... | SELECT Nationality, AVG(meter_100) FROM swimmer GROUP BY Nationality ORDER BY Nationality |
### Instruction:
CREATE TABLE table_75781 (
"Capital/Region" text,
"1997" real,
"1998" real,
"1999" real,
"2000" real,
"2001" real,
"2002" real,
"2003" real,
"2004" real,
"2005" real,
"2006" real,
"2007" real
)
-- Using valid SQLite, answer the following questions for t... | SELECT SUM("2007") FROM table_75781 WHERE "2003" < '36,4' AND "2001" = '27,9' AND "1999" < '25,2' |
### Instruction:
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
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
)
CR... | SELECT meter_600, meter_100 FROM swimmer ORDER BY meter_600 DESC |
### Instruction:
CREATE TABLE competition_result (
competition_id number,
club_id_1 number,
club_id_2 number,
score text
)
CREATE TABLE club_rank (
rank number,
club_id number,
gold number,
silver number,
bronze number,
total number
)
CREATE TABLE club (
club_id number,
... | SELECT position FROM player WHERE points > 20 INTERSECT SELECT position FROM player WHERE points < 10 |
### Instruction:
CREATE TABLE genre (
g_name text,
rating text,
most_popular_in text
)
CREATE TABLE files (
f_id number,
artist_name text,
file_size text,
duration text,
formats text
)
CREATE TABLE artist (
artist_name text,
country text,
gender text,
preferred_genre te... | SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = "bangla" GROUP BY T2.artist_name ORDER BY COUNT(*) DESC LIMIT 3 |
### 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, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY SUM(School_ID) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.