context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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... | give the duration of hospital stay for subject id 8440. | SELECT demographic.days_stay FROM demographic WHERE demographic.subject_id = "8440" | mimicsql_data |
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,... | 病患编号41538489在医院7012713入院确诊的疾病名称里包括了未字的医疗就医记录都是多少编号? | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '41538489' AND MED_SER_ORG_NO = '7012713' AND IN_DIAG_DIS_NM LIKE '%未%' | css |
CREATE TABLE table_21592 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What day(s) did the team play indiana? | SELECT "Date" FROM table_21592 WHERE "Team" = 'Indiana' | wikisql |
CREATE TABLE table_name_56 (
erp_w VARCHAR,
city_of_license VARCHAR
) | Name the ERP W for glens falls, new york | SELECT erp_w FROM table_name_56 WHERE city_of_license = "glens falls, new york" | sql_create_context |
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... | what was the first drug that patient 016-9636 had been prescribed via ngt route in this month? | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-9636')) AND medication.routeadmin = 'ngt' AND DATETIME(medicati... | eicu |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | Let me know on which date the patient Brian Taylor died. | SELECT demographic.dod FROM demographic WHERE demographic.name = "Brian Taylor" | mimicsql_data |
CREATE TABLE table_53425 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How large of a crowd can the Brunswick Street Oval hold? | SELECT COUNT("Crowd") FROM table_53425 WHERE "Venue" = 'brunswick street oval' | wikisql |
CREATE TABLE table_28693349_2 (
games INTEGER,
player VARCHAR
) | How many games did Robert Peare play? | SELECT MAX(games) FROM table_28693349_2 WHERE player = "Robert Peare" | sql_create_context |
CREATE TABLE table_78445 (
"Name" text,
"Gender" text,
"Local board" text,
"Suburb" text,
"Authority" text,
"Decile" text,
"Roll" real
) | What is the name when the local board is albert eden, and a Decile of 9? | SELECT "Name" FROM table_78445 WHERE "Local board" = 'albert–eden' AND "Decile" = '9' | wikisql |
CREATE TABLE table_name_35 (
record VARCHAR,
event VARCHAR
) | Which Record has an Event of cage rage 23? | SELECT record FROM table_name_35 WHERE event = "cage rage 23" | sql_create_context |
CREATE TABLE table_50370 (
"Start Date/Time" text,
"Duration" text,
"End Time" text,
"Spacecraft" text,
"Crew" text
) | What crew's EVA started on 20 February 20:09? | SELECT "Crew" FROM table_50370 WHERE "Start Date/Time" = '20 february 20:09' | 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,
... | 患者的门诊诊断为疾病C26.768的检测指标680382的参考值范围下限和上限是什么? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'C26.768' AND jyjgzbb.JCZBDM = '680382' | css |
CREATE TABLE table_19446 (
"School Year" text,
"Class A" text,
"Class AA" text,
"Class AAA" text,
"Class AAAA" text,
"Class AAAAA" text
) | What are all the AAA classes in the school years of 2004-05? | SELECT "Class AAA" FROM table_19446 WHERE "School Year" = '2004-05' | wikisql |
CREATE TABLE table_name_46 (
date VARCHAR,
winner VARCHAR,
race_name VARCHAR
) | What date did Ted Horn win Lakewood Race 2? | SELECT date FROM table_name_46 WHERE winner = "ted horn" AND race_name = "lakewood race 2" | sql_create_context |
CREATE TABLE company (
headquarters VARCHAR
) | List all headquarters and the number of companies in each headquarter. | SELECT headquarters, COUNT(*) FROM company GROUP BY headquarters | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost numbe... | what was the name of the procedure, which patient 006-70268 was first received this year? | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-70268')) AND DATETIME(treatment.treatmenttime, 'start of year... | eicu |
CREATE TABLE table_46742 (
"Country" text,
"Amateur Era" real,
"Open Era" real,
"All-time" real,
"First title" real,
"Last title" real
) | What is the sum of All-Time, when Amateur Era is less than 0? | SELECT SUM("All-time") FROM table_46742 WHERE "Amateur Era" < '0' | wikisql |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | What courses should I take before BCS 439 ? | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'BCS' AND number = 439 | advising |
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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | what is death status and diagnoses icd9 code of subject name bruce harris? | SELECT demographic.expire_flag, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Bruce Harris" | mimicsql_data |
CREATE TABLE table_32253 (
"Season" real,
"Series" text,
"Team" text,
"Races" text,
"Wins" text,
"Poles" text,
"Podiums" text,
"Points" text,
"Final Placing" text
) | What was the points with 7 races? | SELECT "Points" FROM table_32253 WHERE "Races" = '7' | wikisql |
CREATE TABLE table_30818 (
"Pick" text,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | Who did Edmonton Oilers get for their draft pick? | SELECT "Player" FROM table_30818 WHERE "NHL team" = 'Edmonton Oilers' | wikisql |
CREATE TABLE table_name_96 (
outcome VARCHAR,
score_in_the_final VARCHAR
) | Which Outcome has a Score in the final of 4 6, 5 7? | SELECT outcome FROM table_name_96 WHERE score_in_the_final = "4–6, 5–7" | sql_create_context |
CREATE TABLE table_30511 (
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | what is the number of the chosen club where the hc dukla tren n (slovakia) is from | SELECT COUNT("Pick") FROM table_30511 WHERE "College/junior/club team" = 'HC Dukla Trenčín (Slovakia)' | wikisql |
CREATE TABLE table_17814458_1 (
capacity_in_persons_hour INTEGER,
construction_year_s_ VARCHAR
) | Name the least capacity for persons hour for 1983 | SELECT MIN(capacity_in_persons_hour) FROM table_17814458_1 WHERE construction_year_s_ = "1983" | 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... | when was the first time that patient 027-139111 had a maximum systemicsystolic on 07/06/2103. | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-139111')) AND NOT vitalperiodic.systemicsystoli... | eicu |
CREATE TABLE table_204_903 (
id number,
"title" text,
"character" text,
"broadcaster" text,
"episodes" number,
"date" number
) | were there more than four episodes that featured cynthia ? | SELECT (SELECT "episodes" FROM table_204_903 WHERE "character" = 'cynthia') > 4 | squall |
CREATE TABLE table_train_152 (
"id" int,
"systolic_blood_pressure_sbp" int,
"creatinine_clearance_cl" float,
"diastolic_blood_pressure_dbp" int,
"total_cholesterol" int,
"urine_protein" int,
"proteinuria" int,
"NOUSE" float
) | creatinine > 1.6 mg / dl | SELECT * FROM table_train_152 WHERE creatinine_clearance_cl > 1.6 | criteria2sql |
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 PendingFlags (
Id number,
FlagTypeId number,
Po... | Top 50 users from Auckland. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%auckland%' OR UPPER(Location) LIKE '%AUCKLAND' ORDER BY Reputation DESC LIMIT 50 | sede |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDa... | Questions from a user with no accepted answer. | SELECT questions.Id AS "post_link", COUNT(*) AS "AnswerCount" FROM Posts AS questions JOIN Posts AS answers ON answers.ParentId = questions.Id WHERE questions.OwnerUserId = '##UserId##' AND questions.PostTypeId = 1 AND questions.AcceptedAnswerId IS NULL GROUP BY questions.Id | sede |
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(gwyjzb.PERSON_ID) FROM gwyjzb WHERE gwyjzb.IN_DIAG_DIS_NM = '酒精依赖综合征' UNION SELECT COUNT(fgwyjzb.PERSON_ID) FROM fgwyjzb WHERE fgwyjzb.IN_DIAG_DIS_NM = '酒精依赖综合征' | css |
CREATE TABLE program (
program_id number,
name text,
origin text,
launch number,
owner text
)
CREATE TABLE broadcast_share (
channel_id number,
program_id number,
date text,
share_in_percent number
)
CREATE TABLE channel (
channel_id number,
name text,
owner text,
s... | Count the number of distinct channel owners. | SELECT COUNT(DISTINCT owner) FROM channel | spider |
CREATE TABLE table_name_10 (
winner VARCHAR,
young_rider_classification VARCHAR,
mountains_classification VARCHAR,
general_classification VARCHAR,
points_classification VARCHAR
) | Who was the winner when the General classification was held by Miguel Indurain, the Points classification held by Mario Cipollini, the Mountains classification held by Claudio Chiappucci, and the Young RIder classification held by Pavel Tonkov? | SELECT winner FROM table_name_10 WHERE general_classification = "miguel indurain" AND points_classification = "mario cipollini" AND mountains_classification = "claudio chiappucci" AND young_rider_classification = "pavel tonkov" | sql_create_context |
CREATE TABLE table_20236726_2 (
builder VARCHAR,
wd_no VARCHAR
) | Name the builder for wd number being 22 | SELECT builder FROM table_20236726_2 WHERE wd_no = 22 | sql_create_context |
CREATE TABLE table_name_60 (
route INTEGER,
rank VARCHAR,
elevation VARCHAR
) | On what Route is the mountain with a Rank less than 33 and an Elevation of 11,312 feet 3448 m? | SELECT MAX(route) FROM table_name_60 WHERE rank < 33 AND elevation = "11,312 feet 3448 m" | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 在2012年6月13日到2015年7月4日期间,患者72132920花了多少医保金额? | SELECT SUM(PER_ACC_PAY) FROM t_kc24 WHERE PERSON_ID = '72132920' AND CLINIC_SLT_DATE BETWEEN '2012-06-13' AND '2015-07-04' | css |
CREATE TABLE table_76493 (
"Game" real,
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" text
) | What is the venue of game 3? | SELECT "Venue" FROM table_76493 WHERE "Game" = '3' | wikisql |
CREATE TABLE table_name_12 (
player VARCHAR,
to_par VARCHAR,
score VARCHAR
) | What Player's had a To par of +1 and a Score of 73-71-73=217? | SELECT player FROM table_name_12 WHERE to_par = "+1" AND score = 73 - 71 - 73 = 217 | 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,
... | 在2007-03-13之后,患者潘锐泽有哪些住院就诊的检验报告单?查查住院就诊的流水号 | SELECT zyjzjlb.JZLSH 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 = '潘锐泽' AND NOT zyjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ <= '2007-03-13') | css |
CREATE TABLE view_unit_status (
apt_id number,
apt_booking_id number,
status_date time,
available_yn others
)
CREATE TABLE apartments (
apt_id number,
building_id number,
apt_type_code text,
apt_number text,
bathroom_count number,
bedroom_count number,
room_count text
)
CRE... | What is the minimum and maximum number of bathrooms of all the apartments? | SELECT MIN(bathroom_count), MAX(bathroom_count) FROM apartments | spider |
CREATE TABLE table_4962 (
"Date" real,
"Opponent" text,
"Result" text,
"Odds" text,
"Location" text,
"Score" text
) | What was the score for a game with the odds of p + 2 after 1847? | SELECT "Score" FROM table_4962 WHERE "Odds" = 'p + 2' AND "Date" > '1847' | wikisql |
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... | 患者苗芳蔼在医院序号3888607出院时的就诊记录中诊断的疾病名称没有药字的编号是啥? | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '苗芳蔼' AND t_kc21.MED_SER_ORG_NO = '3888607' AND NOT t_kc21.OUT_DIAG_DIS_NM LIKE '%药%' | css |
CREATE TABLE store_district (
store_id number,
district_id number
)
CREATE TABLE product (
product_id number,
product text,
dimensions text,
dpi number,
pages_per_minute_color number,
max_page_size text,
interface text
)
CREATE TABLE district (
district_id number,
district_... | Find the list of page size which have more than 3 product listed | SELECT max_page_size FROM product GROUP BY max_page_size HAVING COUNT(*) > 3 | spider |
CREATE TABLE table_72729 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by:" text,
"Written by:" text,
"Original air date" text
) | Who directed the episode that was written by Jackson Gillis and Originally aired on May 21, 1955? | SELECT "Directed by:" FROM table_72729 WHERE "Written by:" = 'Jackson Gillis' AND "Original air date" = 'May 21, 1955' | wikisql |
CREATE TABLE table_71138 (
"Auckland" text,
"Canterbury" text,
"Central Districts" text,
"Otago" text,
"Wellington" text
) | What is Auckland thats got Otago of 184 R.C. Blunt & W. Hawksworth V (C) 1931/32? | SELECT "Auckland" FROM table_71138 WHERE "Otago" = '184 r.c. blunt & w. hawksworth v (c) 1931/32' | wikisql |
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,
... | show me patient 013-17922's daily maximum mchc since 160 months ago. | SELECT MAX(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 = '013-17922')) AND lab.labname = 'mchc' AND DATETIME(lab.labresulttime) >= DATETIME(... | eicu |
CREATE TABLE table_44814 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"School/Club Team" text
) | In what Round was Grant Long Drafted? | SELECT MIN("Round") FROM table_44814 WHERE "Player" = 'grant long' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
... | had patient 27146 received meds since 12/2105? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27146) AND STRFTIME('%y-%m', prescriptions.startdate) >= '2105-12' | mimic_iii |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city var... | Which professor will be teaching HJCS 477 next semester ? | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_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,... | 名称包含不孕的科室开出的所有医疗费用在医疗就诊92057161700中明细项目分别是哪些? | SELECT * FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '92057161700' AND t_kc22.MED_ORG_DEPT_NM LIKE '%不孕%' | css |
CREATE TABLE table_name_58 (
tournament VARCHAR
) | What Tournament was the 2010 Olympic Games? | SELECT tournament FROM table_name_58 WHERE 2010 = "olympic games" | sql_create_context |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction 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... | On the ANTHRCUL 500 -level which courses are for 17 -credits ? | SELECT DISTINCT department, name, number FROM course WHERE credits = 17 AND department = 'ANTHRCUL' AND number < 500 + 100 AND number >= 500 | advising |
CREATE TABLE table_30490 (
"Team" text,
"Female \u00e9p\u00e9e" text,
"Male \u00e9p\u00e9e" text,
"Female foil" text,
"Male foil" text,
"Female saber" text,
"Male saber" text,
"Average fencers rank" text,
"Initial Team rank" real
) | What female fenced with a saber on the team that had an average fencer rank of 3.5? | SELECT "Female saber" FROM table_30490 WHERE "Average fencers rank" = '3.5' | wikisql |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate re... | What is the averag weights for people of each sex? Show a bar chart. | SELECT Sex, AVG(Weight) FROM people GROUP BY Sex | nvbench |
CREATE TABLE table_16317 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What was the college for the player with the cfl team of Edmonton Eskimos (via calgary)? | SELECT "College" FROM table_16317 WHERE "CFL Team" = 'Edmonton Eskimos (via Calgary)' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row... | calculate the number of patients who received a periph nerve destruction procedure two or more times. | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'periph nerve destruct... | mimic_iii |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationD... | How many answers are there?. | SELECT COUNT(A.Id) FROM Posts AS A WHERE A.PostTypeId = 2 | sede |
CREATE TABLE table_name_83 (
bleeding_time VARCHAR,
platelet_count VARCHAR,
condition VARCHAR
) | Name the bleeding time with platelet count of unaffected and condition of factor xii deficiency | SELECT bleeding_time FROM table_name_83 WHERE platelet_count = "unaffected" AND condition = "factor xii deficiency" | sql_create_context |
CREATE TABLE table_name_2 (
played INTEGER,
drawn VARCHAR,
lost VARCHAR,
percentage VARCHAR
) | what is the highest number of games played when there was 2 losses, percentage was 0.00% and more than 0 draws? | SELECT MAX(played) FROM table_name_2 WHERE lost = 2 AND percentage = "0.00%" AND drawn > 0 | sql_create_context |
CREATE TABLE competition (
Competition_type VARCHAR,
Country VARCHAR
) | What are the types and countries of competitions? | SELECT Competition_type, Country FROM competition | 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 demographic ... | Give me the number of patients with atrial septal defect/mitral valve replacement repair atrial-septal defect/sda who underwent catheter based invasive electrophysiologic testing. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "ATRIAL SEPTAL DEFECT\MITRAL VALVE REPLACEMENT;REPAIR ATRIAL-SEPTAL DEFECT/SDA" AND procedures.short_title = "Cath base invasv ep test" | mimicsql_data |
CREATE TABLE table_name_36 (
fastest_lap VARCHAR,
grand_prix VARCHAR
) | Who had the fastest lap at the Australian Grand Prix? | SELECT fastest_lap FROM table_name_36 WHERE grand_prix = "australian grand prix" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE chartevents (
ro... | when was patient 4401's heart rate last measured less than 90.0 since 12/25/2105? | SELECT chartevents.charttime 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 = 4401)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rat... | mimic_iii |
CREATE TABLE table_name_80 (
away_team VARCHAR,
home_team VARCHAR
) | When the home team was geelong, who played as the away team? | SELECT away_team FROM table_name_80 WHERE home_team = "geelong" | sql_create_context |
CREATE TABLE table_64918 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
) | What is the rank for the rowers with the time of 6:24.35? | SELECT "Rank" FROM table_64918 WHERE "Time" = '6:24.35' | wikisql |
CREATE TABLE table_29141354_7 (
scores VARCHAR,
andrew_and_jacks_guest VARCHAR
) | What was the score for the episode with Matt Smith as Andrew and Jack's guest? | SELECT scores FROM table_29141354_7 WHERE andrew_and_jacks_guest = "Matt Smith" | sql_create_context |
CREATE TABLE table_229059_2 (
score VARCHAR,
champion VARCHAR
) | What was the score in the tournament won by Jan Stephenson? | SELECT score FROM table_229059_2 WHERE champion = "Jan Stephenson" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | what is drug route of drug name ascorbic acid? | SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Ascorbic Acid" | mimicsql_data |
CREATE TABLE table_203_215 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
) | how many times did japan place in the top 2 ? | SELECT COUNT(*) FROM table_203_215 WHERE "position" <= 2 | squall |
CREATE TABLE table_27361255_1 (
location VARCHAR,
institution VARCHAR
) | Where is Robert Morris University-Illinois held? | SELECT location FROM table_27361255_1 WHERE institution = "Robert Morris University-Illinois" | sql_create_context |
CREATE TABLE table_1341577_50 (
result VARCHAR,
incumbent VARCHAR
) | What was the final result for Les Aspin? | SELECT result FROM table_1341577_50 WHERE incumbent = "Les Aspin" | sql_create_context |
CREATE TABLE storm (
damage_millions_USD INTEGER,
max_speed INTEGER
) | Show the average and maximum damage for all storms with max speed higher than 1000. | SELECT AVG(damage_millions_USD), MAX(damage_millions_USD) FROM storm WHERE max_speed > 1000 | sql_create_context |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PendingFlags ... | Top 50 Stack Overflow Users Of Nepal. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC), Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%nepal%' OR UPPER(Location) LIKE '%NP' ORDER BY Reputation DESC LIMIT 50 | sede |
CREATE TABLE accounts (
account_id number,
customer_id number,
account_name text,
other_account_details text
)
CREATE TABLE financial_transactions (
transaction_id number,
previous_transaction_id number,
account_id number,
card_id number,
transaction_type text,
transaction_date ... | What are the different card type codes, and how many different customers hold each type? | SELECT card_type_code, COUNT(DISTINCT customer_id) FROM customers_cards GROUP BY card_type_code | spider |
CREATE TABLE table_71854 (
"Matches" real,
"Innings" real,
"Not Out" real,
"High Score" text,
"Runs" real,
"Average" real
) | What is the high run total associated with a high score of 385 and under 407 innings? | SELECT MAX("Runs") FROM table_71854 WHERE "High Score" = '385' AND "Innings" < '407' | wikisql |
CREATE TABLE table_name_77 (
place VARCHAR,
country VARCHAR,
player VARCHAR
) | Where is john daly of united states from? | SELECT place FROM table_name_77 WHERE country = "united states" AND player = "john daly" | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | how many patients whose drug route is po? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "PO" | mimicsql_data |
CREATE TABLE table_56198 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings( $ )" real,
"Wins" real
) | What is the highest rank for gene littler with under 3 wins and under $962,133? | SELECT MAX("Rank") FROM table_56198 WHERE "Earnings( $ )" < '962,133' AND "Player" = 'gene littler' AND "Wins" < '3' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | how much of a difference has patient 010-6010 in anion gap second measured on the first hospital visit compared to the first value measured on the first hospital visit? | 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 = '010-6010' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospit... | eicu |
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_id number
)
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,
... | 从07年9月24日到19年9月4日患者钱建章的检测指标535180的情况是什么样的? | 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_43633 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | What is Event, when Round is '1', when Location is 'New Town, North Dakota , United States' and when Time is '4:12'? | SELECT "Event" FROM table_43633 WHERE "Round" = '1' AND "Location" = 'new town, north dakota , united states' AND "Time" = '4:12' | wikisql |
CREATE TABLE table_12082 (
"Draw" real,
"Artist" text,
"Song" text,
"Points" real,
"Place" real
) | Where did the artist All Mixed Up place? | SELECT MIN("Place") FROM table_12082 WHERE "Artist" = 'all mixed up' | wikisql |
CREATE TABLE table_name_48 (
attendance VARCHAR,
home_team VARCHAR
) | What was the attendance for the home team of Walsall? | SELECT attendance FROM table_name_48 WHERE home_team = "walsall" | sql_create_context |
CREATE TABLE table_64351 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | Playing against the Seattle Seahawks in a week after week 1 before 69,149 people what was the result of the game? | SELECT "Result" FROM table_64351 WHERE "Week" > '1' AND "Attendance" = '69,149' AND "Opponent" = 'seattle seahawks' | wikisql |
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Ra... | Show the number of faculty members for each rank in a bar chart. | SELECT Rank, COUNT(Rank) FROM Faculty GROUP BY Rank | nvbench |
CREATE TABLE table_738 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | what's the party with incumbent being herbert covington bonner | SELECT "Party" FROM table_738 WHERE "Incumbent" = 'Herbert Covington Bonner' | wikisql |
CREATE TABLE table_32250 (
"Season" real,
"Series" text,
"Team" text,
"Races" text,
"Wins" text,
"Poles" text,
"Podiums" text,
"Points" text,
"Final Placing" text
) | What are the points for the GP3 series with 2 podiums? | SELECT "Points" FROM table_32250 WHERE "Series" = 'gp3 series' AND "Podiums" = '2' | wikisql |
CREATE TABLE table_38734 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | Which Venue has a Result of 5-1, and a Score of 3-0? | SELECT "Venue" FROM table_38734 WHERE "Result" = '5-1' AND "Score" = '3-0' | wikisql |
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE election (
... | For each party, use a bar chart to show the number of its delegates, sort bars in asc order. | SELECT T2.Party, COUNT(T2.Party) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY T2.Party | nvbench |
CREATE TABLE 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | what is diagnoses short title and procedure short title of subject name lue white? | SELECT diagnoses.short_title, procedures.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Lue White" | mimicsql_data |
CREATE TABLE musical (
musical_id number,
name text,
year number,
award text,
category text,
nominee text,
result text
)
CREATE TABLE actor (
actor_id number,
name text,
musical_id number,
character text,
duration text,
age number
) | What are the names of actors, ordered alphabetically? | SELECT name FROM actor ORDER BY name | spider |
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,
... | calculate the total dose of pregestimil ng in patient 17398 on 08/21/2102. | SELECT SUM(inputevents_cv.amount) 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 = 17398)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab... | mimic_iii |
CREATE TABLE table_name_40 (
partner VARCHAR,
style VARCHAR,
results VARCHAR
) | Who was the partner for the jazz piece in the bottom three? | SELECT partner FROM table_name_40 WHERE style = "jazz" AND results = "bottom three" | sql_create_context |
CREATE TABLE table_name_51 (
unit VARCHAR,
novelty VARCHAR
) | What unit has gen et sp nov as the novelty? | SELECT unit FROM table_name_51 WHERE novelty = "gen et sp nov" | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | how many patients whose language is *lit and lab test name is creatine kinase, mb isoenzyme? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.language = "*LIT" AND lab.label = "Creatine Kinase, MB Isoenzyme" | 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,
... | 编码为40871241962项目在医疗就诊72388757351中费用明细的处方号和处方流水号各是多少? | SELECT t_kc22.PRESCRIPTION_CODE, t_kc22.PRESCRIPTION_ID FROM t_kc22 WHERE t_kc22.MED_EXP_DET_ID = '40871241962' | css |
CREATE TABLE table_name_44 (
draws INTEGER,
against VARCHAR,
wins VARCHAR
) | Can you tell me the sum of Draws that has the Against larger than 1106, and the Wins larger than 13? | SELECT SUM(draws) FROM table_name_44 WHERE against > 1106 AND wins > 13 | sql_create_context |
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,... | 统计一下医疗记录中医院8058667的住院诊断为非器质性睡眠障碍的最低医疗费总金额是多少元钱?最高医疗费总金额多少钱? | SELECT MIN(MED_AMOUT), MAX(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '8058667' AND IN_DIAG_DIS_NM = '非器质性睡眠障碍') | css |
CREATE TABLE table_name_77 (
total INTEGER,
gold INTEGER
) | What is the average Total with a Gold that is larger than 4? | SELECT AVG(total) FROM table_name_77 WHERE gold > 4 | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | how many patients on continuous invasive mechanical ventilation for more than or equal to 96 consecutive hours had medicaid insurance? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.long_title = "Continuous invasive mechanical ventilation for 96 consecutive hours or more" | 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 prescriptions (
row_id number,
subject_id number,
h... | tell me the difference between the total amount of input of patient 15447 on the current icu visit and the total amount of output of the patient? | SELECT (SELECT SUM(inputevents_cv.amount) 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 = 15447) AND icustays.outtime IS NULL)) - (SELECT SUM(outputevents.value) FROM outpu... | mimic_iii |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.