instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT demographic.age FROM demographic WHERE demographic.subject_id = "42067" | mimicsql_data |
CREATE TABLE table_8449 (
"Outcome" text,
"Date" real,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the most recent game that he partnered with nicklas k... | SELECT MAX("Date") FROM table_8449 WHERE "Partner" = 'nicklas kulti' AND "Score" = '3–6, 7–6, 6–4' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,... | SELECT person_info.XM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE jybgb.BGDH = '18617943504' | css |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Benign neoplasm of pituitary gland and craniopharyngeal duct" AND lab.flag = "delta" | mimicsql_data |
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.MAIN_COND_DES FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '99383862652' | css |
CREATE TABLE media_types (
id number,
name text
)
CREATE TABLE playlist_tracks (
playlist_id number,
track_id number
)
CREATE TABLE invoices (
id number,
customer_id number,
invoice_date time,
billing_address text,
billing_city text,
billing_state text,
billing_country text... | SELECT COUNT(*), T1.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id GROUP BY T1.name | spider |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | SELECT (SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-85328')) AND intakeoutput.cellpath L... | eicu |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE aircraft (
aircraft_code varc... | 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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBU... | atis |
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Streptococcal septicemia" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
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 (SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '1534223' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-04-28' AND '2018-01-28' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) >= 4038.33) AS T | css |
CREATE TABLE table_name_51 (
year VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was the venue Landshut?
| SELECT year FROM table_name_51 WHERE venue = "landshut" | sql_create_context |
CREATE TABLE table_name_73 (
result VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of rank 1?
| SELECT result FROM table_name_73 WHERE rank = 1 | sql_create_context |
CREATE TABLE table_27619 (
"Letters" text,
"Organization" text,
"Nickname" text,
"Founding Date" text,
"Founding University" text,
"Type" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What organization had the founding date of 1998-11-08?
| SELECT "Organization" FROM table_27619 WHERE "Founding Date" = '1998-11-08' | wikisql |
CREATE TABLE table_76950 (
"Location" text,
"Year" real,
"Champion" text,
"Runner-up" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the champions in 1988?
| SELECT "Champion" FROM table_76950 WHERE "Year" = '1988' | wikisql |
CREATE TABLE table_name_4 (
race_3 VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Race 3 is Round 5?
| SELECT race_3 FROM table_name_4 WHERE round = "round 5" | sql_create_context |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CR... | SELECT *, ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation AS "tes" FROM Users WHERE LOWER(Location) LIKE '%indonesia%' AND Reputation > 200 ORDER BY LastAccessDate DESC | sede |
CREATE TABLE Course (
CID VARCHAR(7),
CName VARCHAR(40),
Credits INTEGER,
Instructor INTEGER,
Days VARCHAR(5),
Hours VARCHAR(11),
DNO INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
... | SELECT CID, Instructor FROM Course ORDER BY Credits | nvbench |
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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '吕莹玉' AND t_kc22.STA_DATE BETWEEN '2008-10-25' AND '2015-12-06' AND t_kc22.SELF_PAY_PRO < 0.73 | css |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time... | SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'seizures - from ischemia/infarction')) AND D... | eicu |
CREATE TABLE table_name_15 (
away_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the away team score for the game played at the Brunswick Street Oval?
| SELECT away_team AS score FROM table_name_15 WHERE venue = "brunswick street oval" | sql_create_context |
CREATE TABLE table_name_74 (
class VARCHAR,
call_sign VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the class with call sign of wmhn
| SELECT class FROM table_name_74 WHERE call_sign = "wmhn" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
... | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-62326')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutpu... | eicu |
CREATE TABLE table_name_15 (
writer VARCHAR,
title VARCHAR,
year VARCHAR,
notes VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the writer of Wallace & Gromit: A Close Shave, a short film from before 2008?
| SELECT writer FROM table_name_15 WHERE year < 2008 AND notes = "short film" AND title = "wallace & gromit: a close shave" | sql_create_context |
CREATE TABLE table_1637041_6 (
winnings VARCHAR,
avg_finish VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the winnings for the season where the average finish is 11.1?
| SELECT winnings FROM table_1637041_6 WHERE avg_finish = "11.1" | sql_create_context |
CREATE TABLE table_name_89 (
match_report VARCHAR,
date VARCHAR,
competition VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Match Report for the Euro2008q at the Athens Olympic Stadium on November 17, 2007?
| SELECT match_report FROM table_name_89 WHERE competition = "euro2008q" AND venue = "athens olympic stadium" AND date = "november 17, 2007" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-6009')) AND intakeoutput.cellpath LIKE '%output%' AND DA... | eicu |
CREATE TABLE table_16124 (
"No." real,
"#" real,
"Title" text,
"Director" text,
"Writer" text,
"US air date" text,
"Storyteller" text,
"Villains" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many have Mrs. briar as a villain
| SELECT COUNT("No.") FROM table_16124 WHERE "Villains" = 'Mrs. Briar' | wikisql |
CREATE TABLE table_19897294_4 (
family_families VARCHAR,
no_overall VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What family had a no.overall of UK10?
| SELECT family_families FROM table_19897294_4 WHERE no_overall = "UK10" | sql_create_context |
CREATE TABLE table_name_99 (
club VARCHAR,
league_goals VARCHAR,
total VARCHAR,
league_cup_goals VARCHAR,
fa_cup_goals VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Club has a League Cup goals of 0, and a FA Cup goals of 1, and a Total lar... | SELECT club FROM table_name_99 WHERE league_cup_goals = "0" AND fa_cup_goals = "1" AND total > 11 AND league_goals = "13" | sql_create_context |
CREATE TABLE table_name_27 (
pick VARCHAR,
nationality VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Pick has a Nationality of canada, and a Player of dennis maxwell?
| SELECT COUNT(pick) FROM table_name_27 WHERE nationality = "canada" AND player = "dennis maxwell" | sql_create_context |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | (SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE person_info.XM = '尤云霞' AND jyb... | css |
CREATE TABLE table_name_71 (
wins INTEGER,
ballarat_fl VARCHAR,
byes VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the lowest Wins that has the Ballarat FL of daylesford, and the Byes smaller than 1?
| SELECT MIN(wins) FROM table_name_71 WHERE ballarat_fl = "daylesford" AND byes < 1 | sql_create_context |
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 WHERE demographic.gender = "F" AND demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" | mimicsql_data |
CREATE TABLE table_79625 (
"Race" text,
"Dist (f)" real,
"Course" text,
"Class" text,
"Prize (\u00a3K)" real,
"Odds" text,
"Runners" real,
"Placing" real,
"Margin" text,
"Time" text,
"Jockey" text,
"Trainer" text
)
-- Using valid SQLite, answer the following questions f... | SELECT MAX("Dist (f)") FROM table_79625 WHERE "Odds" = '11/4' AND "Placing" > '1' | wikisql |
CREATE TABLE table_name_85 (
distance VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the distance with a 1:46.32 time?
| SELECT distance FROM table_name_85 WHERE time = "1:46.32" | sql_create_context |
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 intakeoutput (
in... | 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-52724' AND patient.hosp... | eicu |
CREATE TABLE table_name_6 (
score VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score against andrei pavel?
| SELECT score FROM table_name_6 WHERE opponent = "andrei pavel" | sql_create_context |
CREATE TABLE table_name_72 (
attendance VARCHAR,
week VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance of the game on September 18, 1965 before week 3?
| SELECT attendance FROM table_name_72 WHERE week < 3 AND date = "september 18, 1965" | sql_create_context |
CREATE TABLE table_19681738_1 (
county VARCHAR,
hancock__percentage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- where did hancock get 3.09%
| SELECT county FROM table_19681738_1 WHERE hancock__percentage = "3.09%" | sql_create_context |
CREATE TABLE table_name_59 (
lyrics VARCHAR,
catalog_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What language is the Lyrics of the release with Catalog number 560 6111?
| SELECT lyrics FROM table_name_59 WHERE catalog_number = "560 6111" | sql_create_context |
CREATE TABLE table_12403 (
"Athlete" text,
"Country" text,
"Run 1" real,
"Run 2" real,
"Run 3" real,
"Run 4" real,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Athlete has a Run 1 larger than 57.37, and a Run 4 smaller than 5... | SELECT "Athlete" FROM table_12403 WHERE "Run 1" > '57.37' AND "Run 4" < '59.05' AND "Run 3" = '58.08' | wikisql |
CREATE TABLE table_59459 (
"Club" text,
"Coach" text,
"City" text,
"Stadium" text,
"2007-2008 season" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which stadium did Rashid Budaj coach?
| SELECT "Stadium" FROM table_59459 WHERE "Coach" = 'rashid budaj' | wikisql |
CREATE TABLE table_203_834 (
id number,
"rank" number,
"census subdivision" text,
"province" text,
"type" text,
"land area\n(km2, 2011)" number,
"population 2011" number,
"population 2006" number,
"population 2001" number,
"population 1996" number,
"change in % 2006-2011" num... | SELECT "census subdivision" FROM table_203_834 ORDER BY "change in % 2006-2011" DESC LIMIT 1 | squall |
CREATE TABLE table_14079 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"# / County" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the enrollment for the school Highland?
| SELECT SUM("Enrollment") FROM table_14079 WHERE "School" = 'highland' | wikisql |
CREATE TABLE table_24957 (
"Discipline" text,
"Contested" text,
"Number of Olympiads" real,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the silver for baseball
| SELECT MIN("Silver") FROM table_24957 WHERE "Discipline" = 'Baseball' | wikisql |
CREATE TABLE table_6053 (
"Tone" text,
"Standard Thai" text,
"Phonemic" text,
"Phonetic" text,
"Example meaning in English" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which tone has a Standard Thai at ?
| SELECT "Tone" FROM table_6053 WHERE "Standard Thai" = 'ปลา' | wikisql |
CREATE TABLE table_name_3 (
date VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the game at Junction Oval?
| SELECT date FROM table_name_3 WHERE venue = "junction oval" | sql_create_context |
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
Building VARCHAR(13)
)
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Participates_in (
stuid INTEG... | SELECT Rank, COUNT(Rank) FROM Faculty GROUP BY Rank ORDER BY Rank DESC | nvbench |
CREATE TABLE table_21303 (
"Match Number" real,
"Date" text,
"Venue" text,
"Team 1" text,
"Team 2" text,
"Result" text,
"Man of the Match" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is team 2 where the result is ICL world by 8 wicke... | SELECT "Team 2" FROM table_21303 WHERE "Result" = 'ICL World by 8 wickets' | wikisql |
CREATE TABLE table_2679061_2 (
player VARCHAR,
nhl_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times is the nhl team the winnipeg jets?
| SELECT COUNT(player) FROM table_2679061_2 WHERE nhl_team = "Winnipeg Jets" | sql_create_context |
CREATE TABLE table_name_13 (
rd__number INTEGER,
pl_gp VARCHAR,
pick__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least RD number that has PI GP more than 0 and pick # more than 51
| SELECT MIN(rd__number) FROM table_name_13 WHERE pl_gp > 0 AND pick__number > 51 | sql_create_context |
CREATE TABLE table_name_9 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the 2013 for 2011 of 1r
| SELECT 2013 FROM table_name_9 WHERE 2011 = "1r" | sql_create_context |
CREATE TABLE PostTypes (
Id number,
Name text
)
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,
ProfileImage... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%manila%' OR LOWER(Location) LIKE '%philippines%' ORDER BY Reputation DESC LIMIT 200 | sede |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
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,
JY... | SELECT zzmzjzjlb.JZZDBM, zzmzjzjlb.JZZDSM FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '赵怡宁' UNION SELECT fzzmzjzjlb.JZZDBM, fzzmzjzjlb.JZZDSM FROM person_info JO... | css |
CREATE TABLE table_name_76 (
jianshu VARCHAR,
qiangshu VARCHAR,
total VARCHAR,
athlete VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of Jianshu when the total is more than 19.16, for Nguyen Huy Thanh ( vie ), and Qiangshu is more ... | SELECT COUNT(jianshu) FROM table_name_76 WHERE total > 19.16 AND athlete = "nguyen huy thanh ( vie )" AND qiangshu > 9.66 | sql_create_context |
CREATE TABLE media_types (
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List all media types.
| SELECT name FROM media_types | sql_create_context |
CREATE TABLE table_2190919_3 (
poles INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the maximum amount of the poles?
| SELECT MAX(poles) FROM table_2190919_3 | sql_create_context |
CREATE TABLE table_32588 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times was Arizona the team and the round was bigger than 11?
| SELECT COUNT("Overall") FROM table_32588 WHERE "School/Club Team" = 'arizona' AND "Round" > '11' | wikisql |
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '81459201' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLIN... | css |
CREATE TABLE table_72288 (
"Year" real,
"Catcher" text,
"First Baseman" text,
"Second Baseman" text,
"Shortstop" text,
"Third Baseman" text,
"Rightfielder" text,
"Centerfielder" text,
"Leftfielder" text,
"Starting Pitcher" text
)
-- Using valid SQLite, answer the following ques... | SELECT "Rightfielder" FROM table_72288 WHERE "Starting Pitcher" = 'Vicente Padilla' | wikisql |
CREATE TABLE mission (
mission_id number,
ship_id number,
code text,
launched_year number,
location text,
speed_knots number,
fate text
)
CREATE TABLE ship (
ship_id number,
name text,
type text,
nationality text,
tonnage number
)
-- Using valid SQLite, answer the foll... | SELECT name FROM ship WHERE nationality <> "United States" | spider |
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 jybgb (
BBCJBW text,
BBDM tex... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb... | css |
CREATE TABLE table_11603267_1 (
tournament VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the tournament for arizona
| SELECT tournament FROM table_11603267_1 WHERE location = "Arizona" | sql_create_context |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '8958826' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-02-01' AND '2003-04-23' | css |
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 Founder, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY SUM(Manufacturer) | nvbench |
CREATE TABLE table_55209 (
"Year" real,
"Category" text,
"Character" text,
"For The Show" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is a category before 2012?
| SELECT "Category" FROM table_55209 WHERE "Year" < '2012' | wikisql |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13622)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht'... | mimic_iii |
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 Video_Games (
GameID INTEGER,
GName VARCHAR(40),
GType VARCHAR(40)
)
CREATE TABLE SportsInfo (
St... | SELECT SportName, COUNT(*) FROM SportsInfo GROUP BY SportName ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_38 (
score VARCHAR,
site_stadium VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the game played at Harmon Stadium on February 24?
| SELECT score FROM table_name_38 WHERE site_stadium = "harmon stadium" AND date = "february 24" | sql_create_context |
CREATE TABLE table_203_8 (
id number,
"player" text,
"rec." number,
"yards" number,
"avg." number,
"td's" number,
"long" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which players did not score a touchdown ?
| SELECT "player" FROM table_203_8 WHERE "td's" = 0 | squall |
CREATE TABLE table_50506 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result on 29 September 2007?
| SELECT "Result" FROM table_50506 WHERE "Date" = '29 september 2007' | wikisql |
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 lab.label FROM lab WHERE lab.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_60032 (
"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.
-- What is Away Team, when Tie No is '37'?
| SELECT "Away team" FROM table_60032 WHERE "Tie no" = '37' | wikisql |
CREATE TABLE table_name_26 (
season INTEGER,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Season has a Score of 39-27?
| SELECT MAX(season) FROM table_name_26 WHERE score = "39-27" | sql_create_context |
CREATE TABLE table_2985987_2 (
weight__kg_ VARCHAR,
race VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the autumn classic weight?
| SELECT weight__kg_ FROM table_2985987_2 WHERE race = "Autumn Classic" | sql_create_context |
CREATE TABLE table_name_95 (
press VARCHAR,
world_record VARCHAR,
roger_françois VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the press like for the world olympic record holder Roger Francois and Jaan Kikkas?
| SELECT press FROM table_name_95 WHERE world_record = "olympic record" AND roger_françois = "jaan kikkas" | sql_create_context |
CREATE TABLE table_11719 (
"Version" text,
"Year" text,
"Bore x stroke" text,
"Displacement" text,
"Power" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the displacement for version of db
| SELECT "Displacement" FROM table_11719 WHERE "Version" = 'db' | wikisql |
CREATE TABLE table_18935 (
"Year (Ceremony)" text,
"Film title used in nomination" text,
"Original title" text,
"Director" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years have a film that uses the title 'Nagabonar' in th... | SELECT COUNT("Year (Ceremony)") FROM table_18935 WHERE "Film title used in nomination" = 'Nagabonar' | 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 wdmzjzjlb.MZZYZDZZBM FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '90470855846' UNION SELECT bdmzjzjlb.MZZYZDZZBM FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '90470855846' | css |
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 AVG(t_kc22.SELF_PAY_PRO) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '3382984' AND t_kc22.STA_DATE BETWEEN '2013-02-18' AND '2018-01-29' | css |
CREATE TABLE table_62978 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the sum of Top-10 that has Events that's larger than 16, ... | SELECT COUNT("Top-10") FROM table_62978 WHERE "Events" > '16' AND "Top-5" > '5' | wikisql |
CREATE TABLE table_13455 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which nation has the number of silver medals greater than 1, and bronze medals as 1?
| SELECT "Nation" FROM table_13455 WHERE "Silver" > '1' AND "Bronze" = '1' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE patients (
row_id number,
subject_id number,
... | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97733) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE... | mimic_iii |
CREATE TABLE table_17320 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How ha... | SELECT "High points" FROM table_17320 WHERE "High assists" = 'J. Johnson (7)' | wikisql |
CREATE TABLE qtb (
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 COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '78177381' AND t_kc22.STA_DATE BETWEEN '2003-04-07' AND '2019-05-26' AND t_kc22.SOC_SRT_DIRE_NM = '苯巴比妥片' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID = '7... | css |
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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.diagnosis = "MESENTERIC ISCHEMIA" | mimicsql_data |
CREATE TABLE table_204_364 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which country came in last place in 2009 ?
| SELECT "venue" FROM table_204_364 WHERE "year" = 2009 ORDER BY "position" DESC LIMIT 1 | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.dob_year < "2197" | mimicsql_data |
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 WHERE demographic.diagnosis = "LEFT FEMUR FRACTURE" | mimicsql_data |
CREATE TABLE table_14945881_1 (
record VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the record when attendance 42827
| SELECT record FROM table_14945881_1 WHERE attendance = 42827 | sql_create_context |
CREATE TABLE table_name_75 (
venue VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where did Geelong play as the away team?
| SELECT venue FROM table_name_75 WHERE away_team = "geelong" | sql_create_context |
CREATE TABLE table_name_52 (
round VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the round on 26 August 1995?
| SELECT round FROM table_name_52 WHERE date = "26 august 1995" | sql_create_context |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefin... | SELECT Id, PostTypeId, Posts.Title, Body, CreationDate FROM Posts WHERE Posts.OwnerUserId = @UserId | sede |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
Cr... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%brazil%' OR LOWER(Location) LIKE '%brasil%' OR UPPER(Location) LIKE '%BR' ORDER BY Reputation DESC LIMIT 10 | sede |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
ic... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'congestive heart failure - systolic' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-2 y... | eicu |
CREATE TABLE table_25711913_2 (
touchdowns VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many touchdowns did the player took which gained 25 points?
| SELECT touchdowns FROM table_25711913_2 WHERE points = 25 | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
d... | SELECT (SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-80604')) AND intakeoutput.cellpath L... | eicu |
CREATE TABLE table_23829490_1 (
composer VARCHAR,
name_of_the_media VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is every composer for the media named Hall of Dreams?
| SELECT composer FROM table_23829490_1 WHERE name_of_the_media = "Hall Of Dreams" | sql_create_context |
CREATE TABLE table_43016 (
"Country" text,
"Area (km\u00b2)" text,
"Population (2011 est.)" text,
"Population density (per km\u00b2)" text,
"GDP (PPP) $M USD" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country has a population density of 5... | SELECT "Country" FROM table_43016 WHERE "Population density (per km\u00b2)" = '50.3' | wikisql |
CREATE TABLE table_76278 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"Record" text,
"Streak" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Team on January 20?
| SELECT "Team" FROM table_76278 WHERE "Date" = 'january 20' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.