instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2144" AND diagnoses.icd9_code = "5720" | mimicsql_data |
CREATE TABLE table_59717 (
"Country" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date for catalog RCD 10160?
| SELECT "Date" FROM table_59717 WHERE "Catalog" = 'rcd 10160' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeou... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-23047' AND patient.hosp... | eicu |
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 COUNT(*) FROM zyjybgb WHERE zyjybgb.JZLSH = '08934000082' UNION SELECT COUNT(*) FROM mzjybgb WHERE mzjybgb.JZLSH = '08934000082' | css |
CREATE TABLE table_59616 (
"Combined" text,
"50 yard Freestyle" text,
"100 yard Freestyle" text,
"200 yard Freestyle" text,
"500 yard Freestyle" text,
"100 yard Backstroke" text,
"100 yard Butterfly" text
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT "50 yard Freestyle" FROM table_59616 WHERE "100 yard Butterfly" = 'diving' | wikisql |
CREATE TABLE table_1049 (
"Season" real,
"Episodes" real,
"Premiere Date" text,
"End Date" text,
"Timeslot" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the timeslot for season 5
| SELECT "Timeslot" FROM table_1049 WHERE "Season" = '5' | wikisql |
CREATE TABLE table_414 (
"Jurisdiction" text,
"Voted Yes" real,
"Percent Yes" text,
"Voted No" real,
"Percent No" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the jurisdiction where percent yes is 43.4
| SELECT "Jurisdiction" FROM table_414 WHERE "Percent Yes" = '43.4' | wikisql |
CREATE TABLE table_name_89 (
role VARCHAR,
teams VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What role has the team of Troyes AC Grenoble Foot?
| SELECT role FROM table_name_89 WHERE teams = "troyes ac grenoble foot" | sql_create_context |
CREATE TABLE table_37953 (
"picture" text,
"Dual Archimedean solid" text,
"Faces" real,
"Edges" real,
"Vertices" real,
"Face Polygon" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Vertices have a Dual Archimedean solid of truncated dodeca... | SELECT MAX("Vertices") FROM table_37953 WHERE "Dual Archimedean solid" = 'truncated dodecahedron' | wikisql |
CREATE TABLE table_name_93 (
locomotive_type VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What kind of locomotive is Winston Churchill?
| SELECT locomotive_type FROM table_name_93 WHERE name = "winston churchill" | sql_create_context |
CREATE TABLE table_7175 (
"Year" real,
"League" text,
"Average Attendance" real,
"# of Home Games" real,
"League Rank" text,
"Canada - USA Rank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Average Attendance during the Year in wh... | SELECT MAX("Average Attendance") FROM table_7175 WHERE "# of Home Games" = '9' | wikisql |
CREATE TABLE table_254 (
"Player" text,
"No." text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What number does the player from Ohio play with?
| SELECT "No." FROM table_254 WHERE "School/Club Team" = 'Ohio' | wikisql |
CREATE TABLE table_13050822_2 (
length VARCHAR,
stage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the length for stage ss22
| SELECT length FROM table_13050822_2 WHERE stage = "SS22" | sql_create_context |
CREATE TABLE table_name_71 (
score VARCHAR,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the Red Wings game when Vancouver was the home team?
| SELECT score FROM table_name_71 WHERE home = "vancouver" | sql_create_context |
CREATE TABLE table_name_28 (
decay_mode VARCHAR,
discovery_year VARCHAR,
isotope VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the decay mode of the 265m hs isotope discovered in 1984?
| SELECT decay_mode FROM table_name_28 WHERE discovery_year = "1984" AND isotope = "265m hs" | sql_create_context |
CREATE TABLE table_name_29 (
time INTEGER,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average time in a rank of 61?
| SELECT AVG(time) FROM table_name_29 WHERE rank = 61 | sql_create_context |
CREATE TABLE table_72733 (
"N\u00b0" real,
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"DAR" text,
"HDTV" text,
"Package/Option" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what television service are i... | SELECT "Television service" FROM table_72733 WHERE "Country" = 'United Kingdom' AND "N\u00b0" > '854.0' | wikisql |
CREATE TABLE table_70267 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Decile has an Authority of state, a Roll smaller than 61, and an A... | SELECT "Decile" FROM table_70267 WHERE "Authority" = 'state' AND "Roll" < '61' AND "Area" = 'kotemaori' | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '46795591' AND jyjgzbb.JYRQ BETWEEN '2006-09-1... | css |
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 mzjzjlb (
HXPLC number,
HZXM ... | SELECT zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '78507360' | css |
CREATE TABLE table_203_137 (
id number,
"title" text,
"album details" text,
"peak chart positions\nus" number,
"peak chart positions\nus r&b" number,
"certifications" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many albums had a higher po... | SELECT COUNT("title") FROM table_203_137 WHERE "peak chart positions\nus" <= 50 OR "peak chart positions\nus r&b" <= 50 | squall |
CREATE TABLE table_35176 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the game on November 7, 1999?
| SELECT "Result" FROM table_35176 WHERE "Date" = 'november 7, 1999' | 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 * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND 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.YLJG... | css |
CREATE TABLE table_1776943_1 (
archive VARCHAR,
run_time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the archive where run time 24:04
| SELECT archive FROM table_1776943_1 WHERE run_time = "24:04" | sql_create_context |
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE instructor (
ID varchar(5),
name varchar(20),
dep... | SELECT dept_name, COUNT(dept_name) FROM student GROUP BY dept_name ORDER BY tot_cred | nvbench |
CREATE TABLE table_37007 (
"Player" text,
"Sacks" real,
"INT'S" real,
"Yards" real,
"Average" real,
"Long" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of values for INT'S with Mossy Cade for 0 yards and less than 3 sacks?
| SELECT SUM("INT'S") FROM table_37007 WHERE "Yards" = '0' AND "Sacks" < '3' AND "Player" = 'mossy cade' | wikisql |
CREATE TABLE table_204_475 (
id number,
"home team" text,
"score" text,
"away team" text,
"date" text,
"agg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number of ties listed ?
| SELECT COUNT(*) FROM table_204_475 WHERE "score" = "score" | squall |
CREATE TABLE table_59809 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much To par has a Total larger than 149, and a Country of united states, and a Year(s) won of 199... | SELECT SUM("To par") FROM table_59809 WHERE "Total" > '149' AND "Country" = 'united states' AND "Year(s) won" = '1997' | wikisql |
CREATE TABLE table_33650 (
"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.
-- What was the lowest attendance at a Fitzroy matc... | SELECT MIN("Crowd") FROM table_33650 WHERE "Home team" = 'fitzroy' | wikisql |
CREATE TABLE table_name_81 (
bronze INTEGER,
gold VARCHAR,
silver VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the most bronze can be when silver is larger than 2, and the nation is germany, and gold is more than 8?
| SELECT MAX(bronze) FROM table_name_81 WHERE silver > 2 AND nation = "germany" AND gold > 8 | sql_create_context |
CREATE TABLE table_name_39 (
rank VARCHAR,
average VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total rank of the celebrity with a 34.66 average and a season greater than 1?
| SELECT COUNT(rank) FROM table_name_39 WHERE average = 34.66 AND season > 1 | sql_create_context |
CREATE TABLE table_29504351_2 (
money_list_rank INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the money list rank for player Doug Barron?
| SELECT MAX(money_list_rank) FROM table_29504351_2 WHERE player = "Doug Barron" | sql_create_context |
CREATE TABLE table_11961582_10 (
high_rebounds VARCHAR,
high_assists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the high rebounds when the high assists were from J. Johnson (7)?
| SELECT high_rebounds FROM table_11961582_10 WHERE high_assists = "J. Johnson (7)" | sql_create_context |
CREATE TABLE table_name_56 (
type VARCHAR,
group VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which type is filed under the Group Animated?
| SELECT type FROM table_name_56 WHERE group = "animated" | sql_create_context |
CREATE TABLE table_77762 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the low week from october 15, 1961?
| SELECT MIN("Week") FROM table_77762 WHERE "Date" = 'october 15, 1961' | wikisql |
CREATE TABLE table_26842 (
"Team #1" text,
"Points" text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the 2nd leg for team #1 River Plate?
| SELECT "2nd leg" FROM table_26842 WHERE "Team #1" = 'River Plate' | wikisql |
CREATE TABLE table_74499 (
"Aircraft" text,
"Origin" text,
"Type" text,
"Versions" text,
"In service" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the versions for czechoslovakia?
| SELECT "Versions" FROM table_74499 WHERE "Origin" = 'czechoslovakia' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-27355')) AND lab.labname = 'rbc' AND lab.labresulttime = '2100-08-27 07:42:... | eicu |
CREATE TABLE zyb (
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.IN_DIAG_DIS_NM = '结膜炎' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.IN_DIAG_DIS_NM = '结膜炎' UNION SELE... | css |
CREATE TABLE table_3686 (
"Date" text,
"Battles" text,
"Conflict" text,
"Combatants A" text,
"Combatants B" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many battles resulted in Battle of the Yellow Sea?
| SELECT COUNT("Result") FROM table_3686 WHERE "Battles" = 'Battle of the Yellow Sea' | wikisql |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar... | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN semester... | advising |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9861939' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_NM HAVING AVG(t_kc21.PERSON_AGE) < 3 | css |
CREATE TABLE plays_games (
stuid number,
gameid number,
hours_played number
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE video_games (
gameid number,
gname text,
... | SELECT lname, sex FROM student WHERE stuid IN (SELECT T1.stuid FROM plays_games AS T1 JOIN video_games AS T2 ON T1.gameid = T2.gameid WHERE T2.gname = "Call of Destiny" INTERSECT SELECT T1.stuid FROM plays_games AS T1 JOIN video_games AS T2 ON T1.gameid = T2.gameid WHERE T2.gname = "Works of Widenius") | spider |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilege... | SELECT CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END AS "accepted", a.Score AS "score", a.Id AS "post_link", q.ClosedDate AS "date_closed", a.CreationDate AS "date_posted" FROM Posts AS a INNER JOIN Posts AS q ON a.ParentId = q.Id WHERE NOT q.ClosedDate IS NULL AND NOT EXISTS(SELECT 1 FROM PostHistory WHERE Pos... | sede |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE restriction (
restriction_c... | 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, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN DIEGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.ci... | atis |
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 Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY Building | nvbench |
CREATE TABLE table_2226817_12 (
title VARCHAR,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name of the episode when the production code is 11.01?
| SELECT title FROM table_2226817_12 WHERE production_code = "11.01" | sql_create_context |
CREATE TABLE table_1973729_1 (
nickname VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many nicknames were associated with Milton, Massachusetts?
| SELECT COUNT(nickname) FROM table_1973729_1 WHERE location = "Milton, Massachusetts" | sql_create_context |
CREATE TABLE table_35744 (
"Name" text,
"Location" text,
"State" text,
"Opened (closing date if defunct)" text,
"Surface" text,
"Length" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Location for the newington international airport?... | SELECT "Location" FROM table_35744 WHERE "Name" = 'newington international airport' | wikisql |
CREATE TABLE table_204_73 (
id number,
"date" text,
"opponent" text,
"score" text,
"result" text,
"record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many total wins did they have in july ?
| SELECT COUNT(*) FROM table_204_73 WHERE "result" = 'win' AND "date" = 7 | squall |
CREATE TABLE table_13477468_3 (
original_air_date VARCHAR,
directed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the original air date of the episode directed by Jeff Melman?
| SELECT original_air_date FROM table_13477468_3 WHERE directed_by = "Jeff Melman" | sql_create_context |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
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,
JO... | SELECT HIRE_DATE, SALARY FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE | nvbench |
CREATE TABLE table_203_611 (
id number,
"player" text,
"hr" number,
"date reached 500 hr" text,
"team" text,
"seasons played" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many players hit more than 600 runs in their career ?
| SELECT COUNT("player") FROM table_203_611 WHERE "hr" > 600 | squall |
CREATE TABLE table_name_10 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What did the team score at home in north melbourne?
| SELECT home_team AS score FROM table_name_10 WHERE away_team = "north melbourne" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND demographic.dob_year < "2110" | mimicsql_data |
CREATE TABLE table_name_67 (
bronze VARCHAR,
silver VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of bronze medals of the team with more than 8 silvers and a total of 50 medals?
| SELECT COUNT(bronze) FROM table_name_67 WHERE silver > 8 AND total = 50 | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '012-25893' AND DATETIME(patient.hospitaldischargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY patient.hospitaldischargetime DESC LIMIT 1 | eicu |
CREATE TABLE table_name_18 (
position VARCHAR,
nominated_work VARCHAR,
award VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the position that the nominated work La Quinta Esencia, which also won an award for best CD coverbox, won?
| SELECT position FROM table_name_18 WHERE nominated_work = "la quinta esencia" AND award = "best cd coverbox" | sql_create_context |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CR... | SELECT p.Id FROM Posts AS p WHERE p.Body LIKE '%<br>%' AND p.PostTypeId = 1 ORDER BY p.Id DESC LIMIT 128 | sede |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "75261" | mimicsql_data |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
s... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8016)) AND DATETIME(outputevents.charttime... | mimic_iii |
CREATE TABLE table_58416 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the time/retired with 22 laps and a grid of 29?
| SELECT "Time/Retired" FROM table_58416 WHERE "Laps" = '22' AND "Grid" = '29' | wikisql |
CREATE TABLE table_name_89 (
round INTEGER,
method VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average round for the TKO (punches and elbows) method?
| SELECT AVG(round) FROM table_name_89 WHERE method = "tko (punches and elbows)" | sql_create_context |
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.days_stay, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "29541" | mimicsql_data |
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 jyjgzbb.JCFF FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH... | css |
CREATE TABLE table_25122 (
"Details" text,
"Host Nation(s)" text,
"Final Venue" text,
"Winner" text,
"Result" text,
"Runner-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winner if the final venue is Kowloon Cricket Club?
| SELECT "Winner" FROM table_25122 WHERE "Final Venue" = 'Kowloon Cricket Club' | wikisql |
CREATE TABLE table_18792 (
"City of license /Market" text,
"Station" text,
"Channel TV ( DT )" text,
"Owned since" text,
"Primary affiliation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many channel tv (dt)s are in austin, texas?
| SELECT COUNT("Channel TV ( DT )") FROM table_18792 WHERE "City of license /Market" = 'Austin, Texas' | wikisql |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT * FROM Posts, PostTypes WHERE Posts.PostTypeId = PostTypes.Id AND PostTypes.Id = 1 AND Posts.CreationDate BETWEEN '2015-03-08 00:00:00' AND '2015-03-08 23:59:59' ORDER BY Posts.ViewCount DESC LIMIT 50 | sede |
CREATE TABLE mzb (
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 qtb.CLINIC_ID FROM qtb WHERE qtb.MED_CLINIC_ID = '78371715301' UNION SELECT gyb.CLINIC_ID FROM gyb WHERE gyb.MED_CLINIC_ID = '78371715301' UNION SELECT zyb.CLINIC_ID FROM zyb WHERE zyb.MED_CLINIC_ID = '78371715301' UNION SELECT mzb.CLINIC_ID FROM mzb WHERE mzb.MED_CLINIC_ID = '78371715301' | css |
CREATE TABLE table_name_90 (
icao VARCHAR,
country VARCHAR,
iata VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ICAO in India with IATA TRZ?
| SELECT icao FROM table_name_90 WHERE country = "india" AND iata = "trz" | sql_create_context |
CREATE TABLE table_name_67 (
name VARCHAR,
country VARCHAR,
index VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the player from Malaysia, Kuala Lumpur in Index f8?
| SELECT name FROM table_name_67 WHERE country = "malaysia, kuala lumpur" AND index = "f8" | sql_create_context |
CREATE TABLE table_56076 (
"Round" real,
"Overall" text,
"Player" text,
"Position" text,
"Nationality" text,
"Club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average round of a player with an overall of 138?
| SELECT AVG("Round") FROM table_56076 WHERE "Overall" = '138' | wikisql |
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 text,
ACC_Per... | SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY Team_Name | nvbench |
CREATE TABLE table_33978 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record of the team with a St. Louis home?
| SELECT "Record" FROM table_33978 WHERE "Home" = 'st. louis' | wikisql |
CREATE TABLE table_name_98 (
team VARCHAR,
coach VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team has an unknown coach and location of Athelstone?
| SELECT team FROM table_name_98 WHERE coach = "unknown" AND location = "athelstone" | sql_create_context |
CREATE TABLE gwyjzb (
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 gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '许浩歌' AND gwyjzb.MED_SER_ORG_NO = '8126391' AND NOT gwyjzb.IN_DIAG_DIS_NM LIKE '%肺%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '许浩歌' AND fgwyjzb.MED_SER_ORG_NO = '8126391' AND NOT fgwyjzb.IN_DIAG_DIS_NM LIKE '%肺%' | css |
CREATE TABLE table_3013 (
"Institution" text,
"Nickname" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Sport" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the enrollment with cougars
| SELECT "Enrollment" FROM table_3013 WHERE "Nickname" = 'Cougars' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_... | SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE STRFTIME('%y', microbiologyevents.charttime) >= '2104' GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 4 | mimic_iii |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM t... | SELECT zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '袁康安' | css |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime t... | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-80884')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.ce... | eicu |
CREATE TABLE table_58272 (
"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.
-- I want to see the away team the has a home team ... | SELECT "Away team" FROM table_58272 WHERE "Home team" = 'richmond' | wikisql |
CREATE TABLE table_name_80 (
record VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the record of the game on Nov 13?
| SELECT record FROM table_name_80 WHERE date = "nov 13" | sql_create_context |
CREATE TABLE table_203_589 (
id number,
"protein" text,
"natural host" text,
"normal function" text,
"prion state" text,
"prion phenotype" text,
"year identified" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many prions were identifi... | SELECT COUNT("protein") FROM table_203_589 WHERE "year identified" = 2012 | squall |
CREATE TABLE table_203_671 (
id number,
"name" text,
"rank" text,
"age" number,
"years until mandatory retirement" text,
"appointed by" text,
"year appointed" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the only associate justic... | SELECT "name" FROM table_203_671 WHERE "rank" = 'associate justice' AND "year appointed" = 2010 | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Other chronic pulmonary heart diseases" | mimicsql_data |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
u... | SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-35134' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL OR... | eicu |
CREATE TABLE table_200_1 (
id number,
"year" number,
"title" text,
"role" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the name of the girl on sixth sense played by mischa barton ?
| SELECT "role" FROM table_200_1 WHERE "title" = 'the sixth sense' | squall |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-44598' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hosp... | eicu |
CREATE TABLE table_12571 (
"Central Murray" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of losses of the central murray of lake boga, which has ... | SELECT MAX("Losses") FROM table_12571 WHERE "Central Murray" = 'lake boga' AND "Wins" < '10' | wikisql |
CREATE TABLE table_3331 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the dominant... | SELECT "Dominant religion (2002)" FROM table_3331 WHERE "Type" = 'village' AND "Cyrillic Name Other Names" = 'Бачко Добро Поље' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,... | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'vasc shunt & bypass nec') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 58730 AND NOT admissions.di... | mimic_iii |
CREATE TABLE table_74013 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the first elected for kentucky 3
| SELECT "First elected" FROM table_74013 WHERE "District" = 'Kentucky 3' | wikisql |
CREATE TABLE table_name_3 (
school_club_team VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who did mark eaton play for?
| SELECT school_club_team FROM table_name_3 WHERE player = "mark eaton" | sql_create_context |
CREATE TABLE table_59475 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which home team has 44 ties?
| SELECT "Home team" FROM table_59475 WHERE "Tie no" = '44' | wikisql |
CREATE TABLE table_203_547 (
id number,
"ship" text,
"built" number,
"in service for cunard" text,
"type" text,
"tonnage" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the date that the last ship was built ?
| SELECT MAX("built") FROM table_203_547 | squall |
CREATE TABLE table_name_75 (
stuffit VARCHAR,
lha_lzh VARCHAR,
gzip VARCHAR,
iso_cd_image VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Stuffit ability that has a gzip of yes, ISO/CD images of no and LHA/LZH of no?
| SELECT stuffit FROM table_name_75 WHERE gzip = "yes" AND iso_cd_image = "no" AND lha_lzh = "no" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '云芷文' AND t_kc22.STA_DATE BETWEEN '2004-08-29' AND '2011-07-14' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
CREATE TABLE lives_in (
stuid number,
dormid number,
room_number number
)
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CRE... | SELECT COUNT(DISTINCT dormid) FROM has_amenity | spider |
CREATE TABLE table_58200 (
"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.
-- What is the Home Team Score at VFL Park?
| SELECT "Home team score" FROM table_58200 WHERE "Venue" = 'vfl park' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.