context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_228439_4 (
reason_for_change VARCHAR,
successor VARCHAR
) | what was the reason Richard K. Meade ( d ) became a successor? | SELECT reason_for_change FROM table_228439_4 WHERE successor = "Richard K. Meade ( D )" | sql_create_context |
CREATE TABLE table_203_862 (
id number,
"draw" number,
"artist" text,
"song" text,
"points" number,
"place" text
) | what is the name of the song listed before the song yesh ? | SELECT "song" FROM table_203_862 WHERE id = (SELECT id FROM table_203_862 WHERE "song" = '"yesh"') - 1 | squall |
CREATE TABLE table_72865 (
"Fin. Pos" real,
"Car No." real,
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Laps Led" real,
"Points" text
) | Name the team for scott dixon | SELECT "Team" FROM table_72865 WHERE "Driver" = 'Scott Dixon' | 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... | count the number of patients whose marital status is married and item id is 50883? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.itemid = "50883" | mimicsql_data |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | Which class is a prereq for lots of other classes and offered this semester ? | SELECT COUNT(DISTINCT course_prerequisite.course_id), course.department, course.name, course.number FROM course, course_offering, course_prerequisite, semester WHERE course.course_id = course_offering.course_id AND course.course_id = course_prerequisite.pre_course_id AND course.department = 'EECS' AND semester.semester... | advising |
CREATE TABLE table_22053 (
"# s Dam and GNIS query Link" real,
"# s Lake and GNIS query Link" real,
"# s Reservoir and GNIS query Link" real,
"Borough or Census area" text,
"Comment" text
) | What was the comment on the Denali area? | SELECT "Comment" FROM table_22053 WHERE "Borough or Census area" = 'Denali' | wikisql |
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 demographic (... | count the number of patients whose primary disease is coronary artery disease\coronary artery bypass graft; myomectomy/sda and age is less than 67? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA" AND demographic.age < "67" | mimicsql_data |
CREATE TABLE activity (
actid number,
activity_name text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE faculty (
facid number,
lname text,
fname text,
rank text,
... | What are the ids of the students who are under 20 years old and are involved in at least one activity. | SELECT stuid FROM participates_in INTERSECT SELECT stuid FROM student WHERE age < 20 | spider |
CREATE TABLE table_1341604_11 (
candidates VARCHAR,
district VARCHAR
) | Name the candidates for georgia 8 | SELECT candidates FROM table_1341604_11 WHERE district = "Georgia 8" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellv... | how many days have it been since the last time during the current hospital encounter patient 030-42006 was diagnosed with hematological effect of infection - thrombocytopenia? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-42006'... | eicu |
CREATE TABLE residents (
resident_id number,
property_id number,
date_moved_in time,
date_moved_out time,
other_details text
)
CREATE TABLE organizations (
organization_id number,
parent_organization_id number,
organization_details text
)
CREATE TABLE customers (
customer_id number... | What are the distinct move in dates of the residents? | SELECT DISTINCT date_moved_in FROM residents | spider |
CREATE TABLE table_38556 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | Which Drawn is the highest one that has an Against larger than 15, and Points smaller than 15, and a Lost smaller than 9? | SELECT MAX("Drawn") FROM table_38556 WHERE "Against" > '15' AND "Points" < '15' AND "Lost" < '9' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Users from Beta near 10k. | SELECT u.Id, u.DisplayName, u.Reputation FROM Badges AS b INNER JOIN Users AS u ON b.UserId = u.Id WHERE b.Name = 'Beta' AND u.Reputation > 9500 AND u.Reputation < 10500 ORDER BY u.Reputation | sede |
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... | provide the number of female patients whose hospital stay is more than 9 days. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.days_stay > "9" | mimicsql_data |
CREATE TABLE table_name_68 (
organized_by VARCHAR,
church_name VARCHAR
) | Who organized Alston Church? | SELECT organized_by FROM table_name_68 WHERE church_name = "alston church" | sql_create_context |
CREATE TABLE table_56841 (
"CERCLIS ID" text,
"Name" text,
"County" text,
"Proposed" text,
"Listed" text,
"Construction completed" text,
"Partially deleted" text,
"Deleted" text
) | What is the Construction that has a Listed 09/08/1983, and a Name of cecil lindsey? | SELECT "Construction completed" FROM table_56841 WHERE "Listed" = '09/08/1983' AND "Name" = 'cecil lindsey' | wikisql |
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TA... | A bar graph listing the local authorities and how many local authorities provided by all stations, order in ascending by the y-axis. | SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority ORDER BY COUNT(local_authority) | nvbench |
CREATE TABLE table_name_33 (
games_played VARCHAR,
draws VARCHAR,
goals_conceded VARCHAR,
goals_scored VARCHAR,
loses VARCHAR
) | What is the total number of games played of the club with less than 40 goals scored, 9 losses, 39 goals conceded, and more than 2 draws? | SELECT COUNT(games_played) FROM table_name_33 WHERE goals_scored < 40 AND loses = 9 AND goals_conceded = 39 AND draws > 2 | sql_create_context |
CREATE TABLE table_name_69 (
yield VARCHAR,
purpose VARCHAR,
location VARCHAR
) | What is the yield in NTS Area U2R when the purpose is weapons development? | SELECT yield FROM table_name_69 WHERE purpose = "weapons development" AND location = "nts area u2r" | sql_create_context |
CREATE TABLE table_59709 (
"Opposing Team" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text,
"Report" text
) | What status has 18 as the against? | SELECT "Status" FROM table_59709 WHERE "Against" = '18' | wikisql |
CREATE TABLE table_204_287 (
id number,
"outcome" text,
"no." number,
"date" number,
"championship" text,
"surface" text,
"opponent in the final" text,
"score in the final" text
) | where did he win his last championship ? | SELECT "championship" FROM table_204_287 WHERE "outcome" = 'winner' ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_39687 (
"Week" real,
"Date" text,
"Opponent" text,
"Location" text,
"Time ( ET )" text,
"Result" text,
"Record" text
) | What time did the game at memorial stadium take place? | SELECT "Time ( ET )" FROM table_39687 WHERE "Location" = 'memorial stadium' | wikisql |
CREATE TABLE table_10007 (
"Position" real,
"Driver / Passenger" text,
"Equipment" text,
"Points" real,
"Wins" text,
"Second" text,
"Third" text
) | How many wins does the driver with 217 points have? | SELECT "Wins" FROM table_10007 WHERE "Points" = '217' | wikisql |
CREATE TABLE table_26677836_1 (
nation VARCHAR,
place VARCHAR
) | What is the nation when the place is 2? | SELECT nation FROM table_26677836_1 WHERE place = 2 | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | what is the number of patients whose lab test name is potassium, urine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Potassium, Urine" | mimicsql_data |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
... | indicate the monthly minimum amount of sao2 for patient 004-13672. | SELECT MIN(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-13672')) AND NOT vitalperiodic.sao2 IS NULL GROUP BY ... | eicu |
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,
... | count the numbers of people that have been admitted to the hospital since 4 years ago. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-4 year') | eicu |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | what was patient 006-62367's last measured calcium last month? | 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 = '006-62367')) AND lab.labname = 'calcium' AND DATETIME(lab.labresulttime, 'start of mont... | eicu |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | 病人严志用药品金额超过6005.61元的在哪几次医疗记录中被开出过已经医疗就诊编号是多少? | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '严志用' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 6005.61) | css |
CREATE TABLE roller_coaster (
Speed INTEGER
) | What is the average speed of roller coasters? | SELECT AVG(Speed) FROM roller_coaster | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID ... | For those employees who was hired before 2002-06-21, return a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by time. | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_name_61 (
games VARCHAR,
assists VARCHAR
) | How many games were played by the player with 127 assists? | SELECT games FROM table_name_61 WHERE assists = "127" | sql_create_context |
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... | How many patients admitted before the year 2187 had arterial catheterization as the procedure long title. | 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 = "Arterial catheterization" | mimicsql_data |
CREATE TABLE table_22360_3 (
silver INTEGER,
discipline VARCHAR
) | Name the silver for baseball | SELECT MIN(silver) FROM table_22360_3 WHERE discipline = "Baseball" | sql_create_context |
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 lab (
subject_id text,
hadm_id text,
... | what is the number of patients whose diagnoses icd9 code is 25013 and drug route is dwell? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "25013" AND prescriptions.route = "DWELL" | mimicsql_data |
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... | what was the first specimen test that was given to patient 031-15417 until 11/2105? | SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15417')) AND STRFTIME('%y-%m', microlab.culturetakentime) <= '2105... | eicu |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 这个名叫窦清润的团伙成员最常去的医生排序是什么样的? | SELECT gwyjzb.OUT_DIAG_DOC_CD, gwyjzb.OUT_DIAG_DOC_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '窦清润' GROUP BY gwyjzb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC UNION SELECT fgwyjzb.OUT_DIAG_DOC_CD, fgwyjzb.OUT_DIAG_DOC_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '窦清润' GROUP BY fgwyjzb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE ReviewRejectionReasons (
Id number,
N... | The 10 Million Dollar Question. | SELECT Id, Id AS "post_link", CreationDate, Score, ViewCount, OwnerDisplayName, AnswerCount, CommentCount, FavoriteCount FROM Posts WHERE PostTypeId = 1 AND Id = 10000000 | sede |
CREATE TABLE table_62601 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | WHAT IS THE PLAYER WITH 287? | SELECT "Player" FROM table_62601 WHERE "Total" = '287' | wikisql |
CREATE TABLE table_10503 (
"Date" text,
"Champion" text,
"2nd Place" text,
"Score" text,
"Stadium" text
) | What stadium has caps as the second place? | SELECT "Stadium" FROM table_10503 WHERE "2nd Place" = 'caps' | wikisql |
CREATE TABLE table_36853 (
"City" text,
"State/Territory" text,
"IATA" text,
"ICAO" text,
"Airport" text,
"Begin" text
) | Which airport has perth as the city? | SELECT "Airport" FROM table_36853 WHERE "City" = 'perth' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org... | what was the name of the drug that was prescribed to patient 14467 within 2 days after oth extraoc mus-tend op? | SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 14467 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = ... | mimic_iii |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
... | 根据不同的出院诊断疾病编码和科室编码,列出医院0255519医疗就诊记录中所有患者是多大平均年龄? | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.OUT_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0255519' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.OUT_DIAG_DIS_CD | css |
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,
... | 08年2月6日到18年10月8日期间,87902700这名患者全段甲状旁腺激素这个指标的所有记录 | SELECT * 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 = '87902700' AND jyjgzbb.JYRQ BETWEEN '2008-02-06' AND '2018-1... | css |
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 (
... | give me the time of discharge and lab test fluid for patient with patient id 74032. | SELECT demographic.dischtime, lab.fluid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "74032" | mimicsql_data |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
... | When Elaine Gazda is the instructor for 165 , does the class meet Fridays ? | SELECT COUNT(*) = 0 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 WHERE course.number = 165 AND c... | advising |
CREATE TABLE table_73597 (
"Rank" real,
"WS Points" real,
"Name" text,
"Country" text,
"08-09 I/O best" real,
"08-09 GP/JGP best" real,
"08-09 GP/JGP 2nd" real,
"08-09 OI best" real,
"08-09 OI 2nd" real,
"07-08 I/O best" real,
"07-08 GP/JGP best" real,
"07-08 GP/JGP 2nd" ... | 08-09 gp/jgp 2nd is 213 and ws points will be what maximum | SELECT MAX("WS Points") FROM table_73597 WHERE "08-09 GP/JGP 2nd" = '213' | wikisql |
CREATE TABLE table_77204 (
"Draw" real,
"Artist" text,
"Song" text,
"Points" real,
"Place" text
) | What's the average amount of points for 'in and out of love' with a draw over 8? | SELECT AVG("Points") FROM table_77204 WHERE "Song" = 'in and out of love' AND "Draw" > '8' | wikisql |
CREATE TABLE table_204_357 (
id number,
"year" number,
"div." text,
"pos." text,
"cup" text,
"top scorer (league)" text,
"score" number
) | what is the total number of years ? | SELECT COUNT("year") FROM table_204_357 | squall |
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,
... | how many patients are admitted before the year 2177? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admityear < "2177" | mimicsql_data |
CREATE TABLE enzyme (
id number,
name text,
location text,
product text,
chromosome text,
omim number,
porphyria text
)
CREATE TABLE medicine_enzyme_interaction (
enzyme_id number,
medicine_id number,
interaction_type text
)
CREATE TABLE medicine (
id number,
name text,... | What is the product, chromosome and porphyria related to the enzymes which take effect at the location 'Cytosol'? | SELECT product, chromosome, porphyria FROM enzyme WHERE location = 'Cytosol' | spider |
CREATE TABLE table_name_19 (
against INTEGER,
date VARCHAR
) | What is the highest number against on 12/04/1969? | SELECT MAX(against) FROM table_name_19 WHERE date = "12/04/1969" | sql_create_context |
CREATE TABLE table_40274 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | Who was the Runner-up for the merrill lynch/golf digest commemorative pro-am tournament? | SELECT "Runner(s)-up" FROM table_40274 WHERE "Tournament" = 'merrill lynch/golf digest commemorative pro-am' | wikisql |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate... | Posts by a user, sorted by length. Posts by a user, sorted by length | SELECT p.Id AS "post_link", LENGTH(p.Body) AS Length FROM Posts AS p WHERE p.OwnerUserId = '##UserId##' ORDER BY Length DESC | sede |
CREATE TABLE table_17106 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
) | Which school is home to player Thomas Tyner? | SELECT "School" FROM table_17106 WHERE "Player" = 'Thomas Tyner' | wikisql |
CREATE TABLE table_74830 (
"Wheel arrangement" text,
"Manufacturer Serial numbers" text,
"Year introduced MRWA" text,
"Quantity made" text,
"Quantity preserved" text,
"Year(s) withdrawn" text
) | What was the year the MRWA with a wheel arrangement of 4-6-2 was introduced? | SELECT "Year introduced MRWA" FROM table_74830 WHERE "Wheel arrangement" = '4-6-2' | wikisql |
CREATE TABLE table_name_89 (
points INTEGER,
year VARCHAR,
chassis VARCHAR
) | What are the lowest points from 1992 with a Chassis of Minardi m192? | SELECT MIN(points) FROM table_name_89 WHERE year = 1992 AND chassis = "minardi m192" | sql_create_context |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
... | Who downvoted my query? The Sherlock Holmes approach. | SELECT p.Id, p.Score, p.Body, v.Id, v.*, vt.Name FROM Posts AS p INNER JOIN Votes AS v ON p.Id = v.PostId INNER JOIN VoteTypes AS vt ON v.VoteTypeId = vt.Id LEFT JOIN Users AS u ON v.UserId = u.Id WHERE p.Id = 30439064 | sede |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescript... | Questions Count with Tag by Month. | SELECT date1, COUNT(DISTINCT Id) FROM (SELECT DISTINCT TIME_TO_STR(d.CreationDate, '%Y-%m') AS "date1", (d.Id) AS id, d.Body, Score, AnswerCount, CommentCount, FavoriteCount FROM Posts AS d WHERE d.PostTypeId = 1 AND d.CreationDate >= '2019-01-01' AND d.CreationDate <= '2020-11-01' AND d.Tags LIKE '%kotlin%') AS z GROU... | sede |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
... | i need a ticket from NASHVILLE to SEATTLE | 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 = 'NASHVILLE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEAT... | atis |
CREATE TABLE table_204_360 (
id number,
"year" number,
"host" text,
"gold" text,
"silver" text,
"bronze" text
) | how many gold medals did brazil win before 2000 ? | SELECT COUNT(*) FROM table_204_360 WHERE "gold" = 'brazil' AND "year" < 2000 | squall |
CREATE TABLE table_1051 (
"Quarterback" text,
"Jersey No." text,
"Games Started" real,
"Wins" real,
"Losses" real,
"Ties" real,
"Winning Pct." text
) | How many ties were there for game 36 started? | SELECT COUNT("Ties") FROM table_1051 WHERE "Games Started" = '36' | wikisql |
CREATE TABLE table_13815 (
"School" text,
"Mascot" text,
"School Corp." text,
"Size" real,
"IHSAA Class (Football)" text,
"Year Joined" text,
"Other Conferences" text
) | What school corporation has a mascot of Bruins and joined in 1971? | SELECT "School Corp." FROM table_13815 WHERE "Year Joined" = '1971' AND "Mascot" = 'bruins' | wikisql |
CREATE TABLE EMPLOYEE (
FirstName VARCHAR,
LastName VARCHAR,
City VARCHAR
) | What are the first names and last names of the employees who live in Calgary city. | SELECT FirstName, LastName FROM EMPLOYEE WHERE City = "Calgary" | sql_create_context |
CREATE TABLE table_72623 (
"Year" real,
"Mens singles" text,
"Womens singles" text,
"Mens doubles" text,
"Womens doubles" text,
"Mixed doubles" text
) | What was the first year of the Lithuanian National Badminton Championships? | SELECT MIN("Year") FROM table_72623 | wikisql |
CREATE TABLE table_3384 (
"Season" text,
"Games started" real,
"20 rebounds" real,
"10 rebounds" real,
"10 offensive rebounds" real,
"Double double" real,
"Rebounding high" real
) | What is the highest rebound Dennis Rodman obtained within the 20 rebounds category given two of the following:points, rebounds, assists, steals, and blocked shots (points) greater equal to 5 | SELECT MAX("20 rebounds") FROM table_3384 WHERE "Double double" = '5' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
had... | what was patient 28443's last intake on this month/22. | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28443)) AND DATETIME(inputevents_cv.... | mimic_iii |
CREATE TABLE table_28211988_1 (
mens_doubles VARCHAR,
mens_singles VARCHAR
) | Who are all men's doubles when men's singles is Jean-Michel Saive? | SELECT mens_doubles FROM table_28211988_1 WHERE mens_singles = "Jean-Michel Saive" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | has patient 027-23129 been having any allergy a year before? | SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-23129')) AND DATETIME(allergy.allergytime, 'start of year') = DATETIME(CURRE... | eicu |
CREATE TABLE table_69037 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
) | What is the FCC info of the w214ba call sign with a frequency below 96.3? | SELECT "FCC info" FROM table_69037 WHERE "Frequency MHz" < '96.3' AND "Call sign" = 'w214ba' | wikisql |
CREATE TABLE table_name_48 (
season VARCHAR,
goals VARCHAR,
country VARCHAR,
team VARCHAR
) | What Season, when Country is China, when Team is Dalian Shide, and when Goals are 0? | SELECT season FROM table_name_48 WHERE country = "china" AND team = "dalian shide" AND goals = 0 | sql_create_context |
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND 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.JZ... | css |
CREATE TABLE table_70379 (
"Rank" real,
"Subdivision name" text,
"Country" text,
"Area (km\u00b2)" real,
"Population" real
) | What's the name of a subdivision in Denmark ranked less than 24 with an area greater than 1,420,968? | SELECT "Subdivision name" FROM table_70379 WHERE "Rank" < '24' AND "Area (km\u00b2)" > '1,420,968' AND "Country" = 'denmark' | wikisql |
CREATE TABLE table_63426 (
"State" text,
"Adopted" text,
"Population (2011-01-01)" text,
"Nominal GDP World Bank, 2009 (million USD)" real,
"Relative GDP of total (nominal)" text,
"GDP per capita World Bank, 2009 nominal (USD)" real
) | What is listed for the Adopted that has a Niminal GDP World Bank 2009 (million USD) of 12460362? | SELECT "Adopted" FROM table_63426 WHERE "Nominal GDP World Bank, 2009 (million USD)" = '12460362' | wikisql |
CREATE TABLE table_53727 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | I want to know the total for silver more than 0 with bronze more than 21 and gold more than 29 | SELECT COUNT("Total") FROM table_53727 WHERE "Silver" > '0' AND "Bronze" > '21' AND "Gold" > '29' | wikisql |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Po... | Top Android users in Ukraine. | WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =... | sede |
CREATE TABLE Statements (
Statement_ID INTEGER,
Statement_Details VARCHAR(255)
)
CREATE TABLE Ref_Budget_Codes (
Budget_Type_Code CHAR(15),
Budget_Type_Description VARCHAR(255)
)
CREATE TABLE Documents_with_Expenses (
Document_ID INTEGER,
Budget_Type_Code CHAR(15),
Document_Details VARCHAR... | How many document type for different document type description? Visualize with a bar chart. | SELECT Document_Type_Description, COUNT(Document_Type_Description) FROM Ref_Document_Types GROUP BY Document_Type_Description | nvbench |
CREATE TABLE table_262527_1 (
nickname VARCHAR,
institution VARCHAR
) | what is the total number of nicknames for southwestern college? | SELECT COUNT(nickname) FROM table_262527_1 WHERE institution = "Southwestern College" | sql_create_context |
CREATE TABLE table_77919 (
"Year" real,
"Organisation" text,
"Ceremony" text,
"Award" text,
"Result" text
) | Which award was nominated for in 2000? | SELECT "Award" FROM table_77919 WHERE "Year" = '2000' AND "Result" = 'nominated' | wikisql |
CREATE TABLE table_55321 (
"Date" text,
"Opponent" text,
"Home/Away" text,
"Field" text,
"Result" text
) | What is the result of the away game played on August 4? | SELECT "Result" FROM table_55321 WHERE "Home/Away" = 'away' AND "Date" = 'august 4' | 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... | Calculate the number of female patients who had an indirect bilirubin lab test done. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.label = "Bilirubin, Indirect" | mimicsql_data |
CREATE TABLE table_16270 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | What's the highest season number of an episode in the series? | SELECT MAX("No. in season") FROM table_16270 | wikisql |
CREATE TABLE table_148535_2 (
hand VARCHAR
) | Name the least 2 credits for flush | SELECT MIN(2 AS _credits) FROM table_148535_2 WHERE hand = "Flush" | sql_create_context |
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num_Employees real
)
CREATE TABLE head (
head_ID int,
name text,
born_state text,
age real
)
CREATE TABLE management (
department_ID int,
head_ID int,
tempor... | Show me the number of born state by born state in a histogram, show by the y axis from low to high. | SELECT born_state, COUNT(born_state) FROM head GROUP BY born_state ORDER BY COUNT(born_state) | nvbench |
CREATE TABLE table_22059 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
) | When was the game played when the opponent was 'at Los Angeles Rams'? | SELECT "Date" FROM table_22059 WHERE "Opponent" = 'at Los Angeles Rams' | wikisql |
CREATE TABLE table_53959 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | What was the home team with a 4-6-0 record? | SELECT "Home" FROM table_53959 WHERE "Record" = '4-6-0' | wikisql |
CREATE TABLE table_203_648 (
id number,
"date" text,
"opposition" text,
"result" text,
"score" text,
"brazil scorers" text,
"competition" text
) | how many matches are wins ? | SELECT COUNT(*) FROM table_203_648 WHERE "result" = 'w' | squall |
CREATE TABLE table_name_43 (
date VARCHAR,
pole_position VARCHAR,
circuit VARCHAR
) | What is the date of the race when Jack Brabham is in the pole position and the circuit is Spa-Francorchamps? | SELECT date FROM table_name_43 WHERE pole_position = "jack brabham" AND circuit = "spa-francorchamps" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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... | 在2016-11-12到2019-10-06期间,0731148医疗机构有多少次外地门诊就诊记录 | SELECT COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.YLJGDM = '0731148' AND zzmzjzjlb.JZKSRQ BETWEEN '2016-11-12' AND '2019-10-06' AND zzmzjzjlb.WDBZ > 0 UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.YLJGDM = '0731148' AND fzzmzjzjlb.JZKSRQ BETWEEN '2016-11-12' AND '2019-10-06' AND fzzmzjzjlb.WDBZ > 0 | css |
CREATE TABLE table_13110459_2 (
air_date VARCHAR,
overall VARCHAR
) | how many air date with overall being 83/95 | SELECT COUNT(air_date) FROM table_13110459_2 WHERE overall = "83/95" | sql_create_context |
CREATE TABLE table_name_21 (
prominence__m_ INTEGER,
col__m_ VARCHAR
) | Which Prominence (m) has a Col (m) of 350? | SELECT AVG(prominence__m_) FROM table_name_21 WHERE col__m_ = 350 | sql_create_context |
CREATE TABLE table_28124 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | Name the number of title for number in series being 25 | SELECT COUNT("Title") FROM table_28124 WHERE "No. in series" = '25' | wikisql |
CREATE TABLE table_name_27 (
draws INTEGER,
al_ahly_wins VARCHAR,
el_zamalek_wins VARCHAR,
total VARCHAR
) | What is the sum of draws for El Zamalek wins under 36, total over 2, and Al Ahly wins over 37? | SELECT SUM(draws) FROM table_name_27 WHERE el_zamalek_wins < 36 AND total > 2 AND al_ahly_wins > 37 | sql_create_context |
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... | what is discharge location of subject id 16438? | SELECT demographic.discharge_location FROM demographic WHERE demographic.subject_id = "16438" | mimicsql_data |
CREATE TABLE table_78927 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
) | In which venue was there an against of 11? | SELECT "Venue" FROM table_78927 WHERE "Against" = '11' | wikisql |
CREATE TABLE table_name_64 (
Id VARCHAR
) | Which 2013 has a 2006 of grand slam tournaments? | SELECT 2013 FROM table_name_64 WHERE 2006 = "grand slam tournaments" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | what's the output of patient 030-42006 for the first time on this month/27? | 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 = '030-42006')) AND intakeoutput.cellpath LIKE '%output%' AND D... | eicu |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE fare (
fare_id int,
from_... | list all AA from MILWAUKEE to PHOENIX on saturday | 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 = 'PHOENIX' AND date_day.day_number = 26 AND date_day.month_number = 7 AND ... | atis |
CREATE TABLE table_name_33 (
crew VARCHAR,
start_date_time VARCHAR
) | What crew's EVA started on 20 February 20:09? | SELECT crew FROM table_name_33 WHERE start_date_time = "20 february 20:09" | sql_create_context |
CREATE TABLE table_38049 (
"Week" text,
"Date" text,
"Kickoff" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"NFL Recap" text
) | Which Date had a Result of 7 20? | SELECT "Date" FROM table_38049 WHERE "Result" = '7–20' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.