instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_33299 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"Facility ID" real,
"ERP W" real,
"Height m ( ft )" text,
"Class" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowe... | SELECT MIN("ERP W") FROM table_33299 WHERE "Facility ID" = '67829' | wikisql |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT MED_ORG_DEPT_CD, OUT_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '6135153' GROUP BY MED_ORG_DEPT_CD, OUT_DIAG_DIS_NM | css |
CREATE TABLE table_name_67 (
rider VARCHAR,
grid VARCHAR,
bike VARCHAR,
laps VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the driver with the laps under 16, grid of 10, a bike of Yamaha YZF-R6, and ended with an accident?
| SELECT rider FROM table_name_67 WHERE laps < 16 AND time = "accident" AND bike = "yamaha yzf-r6" AND grid = 10 | sql_create_context |
CREATE TABLE table_name_97 (
longest_span_in_s_metre___feet__ VARCHAR,
land VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How long is the UK's Ballochmyle Viaduct?
| SELECT longest_span_in_s_metre___feet__ FROM table_name_97 WHERE land = "uk" AND name = "ballochmyle viaduct" | sql_create_context |
CREATE TABLE table_204_223 (
id number,
"party" text,
"previous council" number,
"staying councillors" number,
"seats up for election" number,
"election result" number,
"new council" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many ... | SELECT COUNT("party") FROM table_204_223 WHERE "new council" = 0 | squall |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2187" AND procedures.long_title = "Infusion of vasopressor agent" | mimicsql_data |
CREATE TABLE table_name_50 (
took_office INTEGER,
senator VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Took Office, when Senator is Eddie Bernice Johnson, and when District is greater than 23?
| SELECT MIN(took_office) FROM table_name_50 WHERE senator = "eddie bernice johnson" AND district > 23 | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.expire_flag = "1" | mimicsql_data |
CREATE TABLE table_204_135 (
id number,
"position" number,
"club" text,
"played" number,
"points" number,
"wins" number,
"draws" number,
"losses" number,
"goals for" number,
"goals against" number,
"goal difference" number
)
-- Using valid SQLite, answer the following quest... | SELECT "club" FROM table_204_135 WHERE "points" = 27 AND "goal difference" = 1 | squall |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jo... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour... | advising |
CREATE TABLE table_3729 (
"#" real,
"Matches As Captain" text,
"Player" text,
"Asian Cup Played As A Captain" text,
"Years Active" text,
"Caps(Goals)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the years active where Asian Cup play... | SELECT "Years Active" FROM table_3729 WHERE "Asian Cup Played As A Captain" = 'Qatar 1988' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'int inser lead atri-vent') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 67902) AND... | mimic_iii |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.MED_ORG_DEPT_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '25237614940' | css |
CREATE TABLE table_204_431 (
id number,
"yacht" text,
"nation" text,
"owner" text,
"skipper" text,
"launch year" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the owner of the wild oatsxi bob oatley or mark richards ?
| SELECT "owner" FROM table_204_431 WHERE "yacht" = 'wild oats xi' | squall |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2146" AND diagnoses.icd9_code = "3004" | mimicsql_data |
CREATE TABLE table_74305 (
"#" real,
"Episode" text,
"Directed by" text,
"Written by" text,
"U.S. Viewers (in millions)" text,
"Original airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wrote the episode with 7.52 million US viewers?
| SELECT "Written by" FROM table_74305 WHERE "U.S. Viewers (in millions)" = '7.52' | wikisql |
CREATE TABLE table_name_2 (
record VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when attendance was 19,887?
| SELECT record FROM table_name_2 WHERE attendance = "19,887" | sql_create_context |
CREATE TABLE table_204_840 (
id number,
"no. in\nseries" number,
"no. in\nseason" number,
"title" text,
"directed by" text,
"written by" text,
"original air date" text,
"prod. code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who wrot... | SELECT "written by" FROM table_204_840 WHERE "no. in\nseason" = 1 | squall |
CREATE TABLE table_38793 (
"Season" text,
"Team" text,
"Wins" text,
"Losses" text,
"Draws" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which season had 0 wins and 5 losses for the Surrey team?
| SELECT "Season" FROM table_38793 WHERE "Wins" = '0' AND "Losses" = '5' AND "Team" = 'surrey' | wikisql |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'THTREMUS' AND course.number = 252 AND semester.semester_id = course_offering.semester ORDER BY semester.year DESC LIMIT 1 | advising |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'encephalopathy - metabolic' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY STRFTIME('%y-%m', diagnosis.diagnosistime)) ... | eicu |
CREATE TABLE table_name_76 (
engine VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What engine was used in 1999?
| SELECT engine FROM table_name_76 WHERE year = "1999" | sql_create_context |
CREATE TABLE table_name_2 (
second VARCHAR,
fourth VARCHAR,
fifth VARCHAR,
sixth VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team placed second during the season where Western Australia placed fifth, South Australia placed sixth, and Tasmania... | SELECT second FROM table_name_2 WHERE fifth = "western australia" AND sixth = "south australia" AND fourth = "tasmania" | sql_create_context |
CREATE TABLE fzzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZD... | SELECT zzmzjzjlb.JZLSH FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '89963549' AND NOT zzmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2015-03-17') UNION SELECT fzzmzjzjlb.JZLSH FROM hz_info JOI... | css |
CREATE TABLE table_11914 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which away team scored 10.5 (65)?
| SELECT "Away team" FROM table_11914 WHERE "Away team score" = '10.5 (65)' | wikisql |
CREATE TABLE table_name_73 (
rating___percentage_ VARCHAR,
channel VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the rating % for channel of anhui satellite tv
| SELECT rating___percentage_ FROM table_name_73 WHERE channel = "anhui satellite tv" | sql_create_context |
CREATE TABLE table_27504 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What title did Bill Foster direct ?
| SELECT "Title" FROM table_27504 WHERE "Directed by" = 'Bill Foster' | wikisql |
CREATE TABLE table_60387 (
"Year" real,
"Gold" text,
"Silver" text,
"Bronze" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won Gold later than 2004 with Notes of 2.73km, 14controls?
| SELECT "Gold" FROM table_60387 WHERE "Year" > '2004' AND "Notes" = '2.73km, 14controls' | wikisql |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | SELECT JCRGH, JCRXM FROM jyjgzbb WHERE JYZBLSH = '06175030615' | css |
CREATE TABLE player (
Player_ID int,
Sponsor_name text,
Player_name text,
Gender text,
Residence text,
Occupation text,
Votes int,
Rank text
)
CREATE TABLE player_coach (
Player_ID int,
Coach_ID int,
Starting_year int
)
CREATE TABLE coach (
Coach_ID int,
Coach_name ... | SELECT Residence, COUNT(Residence) FROM player WHERE Occupation <> "Researcher" GROUP BY Residence ORDER BY COUNT(Residence) DESC | nvbench |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.icd9_code = "25541" | mimicsql_data |
CREATE TABLE table_name_43 (
loser VARCHAR,
year VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the loser against the New York Giants in 2001?
| SELECT loser FROM table_name_43 WHERE year = 2001 AND winner = "new york giants" | sql_create_context |
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE party (
Party_ID int,
... | 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 | nvbench |
CREATE TABLE table_203_338 (
id number,
"#" number,
"title" text,
"date" text,
"director" text,
"story" text,
"synopsis" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the next cartoon directed by robert mckimson af... | SELECT "title" FROM table_203_338 WHERE "director" = 'robert mckimson' AND "date" > (SELECT "date" FROM table_203_338 WHERE "title" = 'le quiet squad') ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE table_name_87 (
uninterrupted_rank VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many uninterrupted ranks does john dingell have?
| SELECT COUNT(uninterrupted_rank) FROM table_name_87 WHERE name = "john dingell" | sql_create_context |
CREATE TABLE table_56465 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the record of Carlos Boozer (23) as the leading scorer?
| SELECT "Record" FROM table_56465 WHERE "Leading scorer" = 'carlos boozer (23)' | wikisql |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
CO... | SELECT FIRST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID DESC | nvbench |
CREATE TABLE gyb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT AVG(zyb.MED_CLINIC_ID) FROM zyb WHERE zyb.MED_SER_ORG_NO = '中医外科' AND zyb.IN_HOSP_DAYS BETWEEN '2011-01-24' AND '2015-03-06' AND zyb.IN_DIAG_DIS_NM = 'B02.750' | css |
CREATE TABLE table_name_40 (
position INTEGER,
points VARCHAR,
conceded VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The highest position with more than 16 points and less than 7 concedes?
| SELECT MAX(position) FROM table_name_40 WHERE points > 16 AND conceded < 7 | sql_create_context |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC... | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '... | css |
CREATE TABLE table_name_39 (
mascot VARCHAR,
_number___county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the mascot for 66 pulaski 2?
| SELECT mascot FROM table_name_39 WHERE _number___county = "66 pulaski 2" | sql_create_context |
CREATE TABLE zyjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
... | SELECT zyjybgb.SQKS, zyjybgb.SQKSMC FROM zyjybgb WHERE zyjybgb.BGDH = '52839871632' UNION SELECT mzjybgb.SQKS, mzjybgb.SQKSMC FROM mzjybgb WHERE mzjybgb.BGDH = '52839871632' | css |
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
)
CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
)
-- Using valid SQLite, answer the following questions for the tables ... | SELECT DISTINCT state FROM college AS T1 JOIN tryout AS T2 ON T1.cname = T2.cname | spider |
CREATE TABLE school_performance (
School_Id int,
School_Year text,
Class_A text,
Class_AA text
)
CREATE TABLE school_details (
School_ID int,
Nickname text,
Colors text,
League text,
Class text,
Division text
)
CREATE TABLE player (
Player_ID int,
Player text,
Team ... | SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination | nvbench |
CREATE TABLE table_name_32 (
official_itv1_rating INTEGER,
share VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest official ITV1 rating with 45.4% share?
| SELECT MIN(official_itv1_rating) FROM table_name_32 WHERE share = "45.4%" | sql_create_context |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_n... | atis |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 96833 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatine kinase (ck)') ORDER BY labevents.chart... | mimic_iii |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | SELECT COUNT(*) FROM jybgb WHERE YLJGDM = '9692570' AND BGRQ BETWEEN '2002-02-27' AND '2016-10-08' | css |
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
... | SELECT Rank, COUNT(*) FROM Faculty GROUP BY Rank ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_62381 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real,
"Money ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much money did Willie Klein take home from the game in which he had a to par sc... | SELECT SUM("Money ( $ )") FROM table_62381 WHERE "Player" = 'willie klein' AND "To par" > '13' | wikisql |
CREATE TABLE table_61341 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Total for the Player with a To par of +11?
| SELECT MAX("Total") FROM table_61341 WHERE "To par" = '+11' | wikisql |
CREATE TABLE table_name_21 (
rank VARCHAR,
gross VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What rank is the title with a gross of $26,589,355?
| SELECT rank FROM table_name_21 WHERE gross = "$26,589,355" | sql_create_context |
CREATE TABLE table_40471 (
"Year" real,
"Author" text,
"Illustrator" text,
"Title" text,
"Publisher" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the illustrator in 1987?
| SELECT "Illustrator" FROM table_40471 WHERE "Year" = '1987' | wikisql |
CREATE TABLE table_61246 (
"Week 1" text,
"Week 2" text,
"Week 3" text,
"Week 4" text,
"Week 5" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the girl on week 1 that preceded week 2's Kamila Sulewska?
| SELECT "Week 1" FROM table_61246 WHERE "Week 2" = 'kamila sulewska' | wikisql |
CREATE TABLE table_5645 (
"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)" text,
"Voice acto... | SELECT "Mecha" FROM table_5645 WHERE "Bird Uniform" = 'condor' | wikisql |
CREATE TABLE table_train_208 (
"id" int,
"anemia" bool,
"serum_bicarbonate" int,
"hemoglobin_a1c_hba1c" float,
"temperature" float,
"dementia" bool,
"electrolyte_imbalances" bool,
"impaired_sensorium" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the followin... | SELECT * FROM table_train_208 WHERE age > 75 | criteria2sql |
CREATE TABLE table_name_63 (
area VARCHAR,
roll VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Area with 26 in Roll
| SELECT area FROM table_name_63 WHERE roll = 26 | sql_create_context |
CREATE TABLE table_16602 (
"No." real,
"Episode" text,
"Air Date" text,
"Timeslot" text,
"Rating" text,
"Share" text,
"18\u201349 (Rating/Share)" text,
"Viewers (m)" text,
"Rank (#)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wha... | SELECT "Episode" FROM table_16602 WHERE "Viewers (m)" = '2.05' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name DESC | nvbench |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE... | SELECT 'post_link' = Posts.Id, Posts.ViewCount, Posts.Score, Tags.TagName AS "tag_name" FROM PostHistory INNER JOIN PostTags ON PostTags.PostId = PostHistory.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON PostTags.PostId = Posts.Id WHERE PostHistory.PostHistoryTypeId = 19 AND Tags.TagName = @Tag... | sede |
CREATE TABLE table_18955 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What club had 523 point... | SELECT "Club" FROM table_18955 WHERE "Points against" = '523' | wikisql |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJ... | css |
CREATE TABLE table_204_937 (
id number,
"rank" number,
"lane" number,
"athlete" text,
"time" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many athletes did not finish with the time less than 53.00 ?
| SELECT COUNT("athlete") FROM table_204_937 WHERE "time" >= 53 | squall |
CREATE TABLE table_4948 (
"Race Title" text,
"Circuit" text,
"City / State" text,
"Date" text,
"Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what Date is the Circuit at Sandown Raceway?
| SELECT "Date" FROM table_4948 WHERE "Circuit" = 'sandown raceway' | wikisql |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 1 AND date_day.month_number = 9... | atis |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5211360' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_NM HAVING AVG(t_kc21.PERSON_AGE) > 10 | css |
CREATE TABLE table_204_151 (
id number,
"game" number,
"day" text,
"date" text,
"kickoff" text,
"opponent" text,
"results\nscore" text,
"results\nrecord" text,
"location" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT COUNT(*) FROM table_204_151 WHERE "opponent" = 'home' AND "results\nscore" <> 'w' | squall |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.drug = "Lidocaine 5% Patch" | mimicsql_data |
CREATE TABLE table_name_15 (
year INTEGER,
category VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year had Best Actor in a Musical as a category?
| SELECT SUM(year) FROM table_name_15 WHERE category = "best actor in a musical" | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT SUM(MED_AMOUT) FROM t_kc21 WHERE PERSON_ID = '25376993' AND CLINIC_TYPE = '门诊' | css |
CREATE TABLE table_53610 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- where did rochdale play as opponent?
| SELECT "Venue" FROM table_53610 WHERE "Opponent" = 'rochdale' | wikisql |
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int... | SELECT DISTINCT paper.journalid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Neutralizing Antibody Languages' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid GROUP BY paper.journalid | scholar |
CREATE TABLE table_204_414 (
id number,
"name" text,
"armenian" text,
"location" text,
"# of prisoners designed for" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many prisons are in nubarashen ?
| SELECT COUNT("name") FROM table_204_414 WHERE "location" = 'nubarashen' | squall |
CREATE TABLE table_49359 (
"Date" text,
"City" text,
"Event" text,
"Winner" text,
"Prize" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date of the Event in Punta del Este?
| SELECT "Date" FROM table_49359 WHERE "City" = 'punta del este' | wikisql |
CREATE TABLE table_7116 (
"Title" text,
"Author" text,
"Un-/Abridged" text,
"Read by" text,
"Published" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who read the unabridged book written by Gary Paulsen?
| SELECT "Read by" FROM table_7116 WHERE "Un-/Abridged" = 'unabridged' AND "Author" = 'gary paulsen' | wikisql |
CREATE TABLE table_15248 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Pts." real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earliest year with points more than 8?
| SELECT MIN("Year") FROM table_15248 WHERE "Pts." > '8' | wikisql |
CREATE TABLE table_33987 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the score on April 9?
| SELECT "Score" FROM table_33987 WHERE "Date" = 'april 9' | wikisql |
CREATE TABLE table_5600 (
"Season" text,
"Regionalliga S\u00fcd" text,
"Regionalliga West/S\u00fcdwest" text,
"Regionalliga Nord" text,
"Regionalliga Nord-Ost" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which season had a Regionalliga Sud of Stu... | SELECT "Season" FROM table_5600 WHERE "Regionalliga S\u00fcd" = 'stuttgarter kickers' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT demographic.age, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "42067" | mimicsql_data |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE medication (
medi... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-37411')) AND medication.drugname IN ('protonix', 'ondansetron inj', 'l... | eicu |
CREATE TABLE table_18967450_2 (
club VARCHAR,
goals VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team/s have 48 goals total?
| SELECT club FROM table_18967450_2 WHERE goals = 48 | sql_create_context |
CREATE TABLE table_25240 (
"Rnd" real,
"Date" text,
"Race Name" text,
"Length" text,
"Track" text,
"Location" text,
"Type" text,
"Pole Position" text,
"Winning Driver" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many races too... | SELECT COUNT("Race Name") FROM table_25240 WHERE "Track" = 'Indianapolis Motor Speedway' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT demographic.admittime, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_56425 (
"Date" text,
"Tournament" text,
"Surface" text,
"Partnering" text,
"Opponents in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the opponents of the final on June 23, 2003?
| SELECT "Opponents in the final" FROM table_56425 WHERE "Date" = 'june 23, 2003' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BRADYCARDIA" AND demographic.days_stay > "5" | mimicsql_data |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime ... | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26507) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_28275 (
"Rank" real,
"Runs" real,
"Average" text,
"Strike rate" text,
"Player" text,
"Matches" real,
"Innings" real,
"Period" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest number of runs?
| SELECT MIN("Runs") FROM table_28275 | wikisql |
CREATE TABLE table_64988 (
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" real,
"FA Cup Goals" real,
"League Cup Apps" real,
"League Cup Goals" real,
"Total Apps" text,
"Total Goals" real
)
-- Using valid SQLite, answer the following questi... | SELECT COUNT("League Cup Apps") FROM table_64988 WHERE "League Goals" < '0' | wikisql |
CREATE TABLE table_66696 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what round was the loss at ufc 118?
| SELECT "Round" FROM table_66696 WHERE "Res." = 'loss' AND "Event" = 'ufc 118' | wikisql |
CREATE TABLE table_191105_3 (
first_aired INTEGER,
performed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When zachary sanders is the performer what is the lowerst first aired?
| SELECT MIN(first_aired) FROM table_191105_3 WHERE performed_by = "Zachary Sanders" | sql_create_context |
CREATE TABLE table_22548 (
"Rank" real,
"Name" text,
"Tenure" text,
"Leagues" text,
"Attempts" real,
"Completions" real,
"Comp %" text,
"Touchdowns" real,
"Interceptions" real,
"Yardage" real,
"QB Rating" text
)
-- Using valid SQLite, answer the following questions for the ... | SELECT "QB Rating" FROM table_22548 WHERE "Comp %" = '62.0' | wikisql |
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEGER,
lot_details VARCHAR(255)
)
CREATE TABLE Purchases (
purchase_transaction_id INTEGER,
purchase_details VARCHAR(255)
)
CREATE TABLE Investors (
invest... | SELECT sales_details, COUNT(sales_details) FROM Sales AS T1 JOIN Transactions AS T2 ON T1.sales_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction < 3000 GROUP BY sales_details ORDER BY COUNT(sales_details) DESC | nvbench |
CREATE TABLE table_name_56 (
record VARCHAR,
nationality VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record for Norway on 23 august 1981?
| SELECT record FROM table_name_56 WHERE nationality = "norway" AND date = "23 august 1981" | sql_create_context |
CREATE TABLE table_35773 (
"Rank" real,
"Building" text,
"City" text,
"Height (m/ft)" text,
"Built" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Rank with a build year earlier than 2007 for the howard johnson hotel bucharest?
| SELECT SUM("Rank") FROM table_35773 WHERE "Built" < '2007' AND "Building" = 'howard johnson hotel bucharest' | wikisql |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
... | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(EMPLOYEE_ID) | nvbench |
CREATE TABLE table_29619494_2 (
apocalypstix VARCHAR,
denim_demons VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List all the places that the Apocalypstix occupied when the Denim Demons were 2nd.
| SELECT apocalypstix FROM table_29619494_2 WHERE denim_demons = "2nd" | sql_create_context |
CREATE TABLE table_79418 (
"Time" text,
"Wind" text,
"Athlete" text,
"Nationality" text,
"Location of race" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the athlete with a wind of 1.8?
| SELECT "Athlete" FROM table_79418 WHERE "Wind" = '1.8' | wikisql |
CREATE TABLE table_63803 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player has a to par of +8?
| SELECT "Player" FROM table_63803 WHERE "To par" = '+8' | wikisql |
CREATE TABLE table_name_71 (
wins VARCHAR,
events VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many win total which has the rank smaller than 3 and events smaller than 22
| SELECT COUNT(wins) FROM table_name_71 WHERE events < 22 AND rank < 3 | sql_create_context |
CREATE TABLE table_204_442 (
id number,
"institution" text,
"location" text,
"enrollment" number,
"nickname" text,
"varsity\nsports" number,
"rugby\nsince" text,
"head coach" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when was the fi... | SELECT "rugby\nsince" FROM table_204_442 WHERE "nickname" = 'terrapins' | squall |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.