context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_8376 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
Which Score has a Visitor of toronto st. pats, and a Home of montreal canadiens, and a Record of 3 2 0?
SELECT "Score" FROM table_8376 WHERE "Visitor" = 'toronto st. pats' AND "Home" = 'montreal canadiens' AND "Record" = '3–2–0'
wikisql
CREATE TABLE table_21565 ( "1391 Carelia" text, "1398 Donnera" text, "1405 Sibelius" text, "1406 Komppa" text, "1407 Lindel\u00f6f" text )
what is the 1405 sibelius of asteroid which 1407 lindel f is 2020 ukko
SELECT "1405 Sibelius" FROM table_21565 WHERE "1407 Lindel\u00f6f" = '2020 Ukko'
wikisql
CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id number ) 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, ...
在03年1月5日到10年11月6日期间,病患20286940的所有检验结果指标记录的检测人为58375381的检验指标流水号分别是多少?
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz...
css
CREATE TABLE table_11132 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
Who was the opponent on December 10, 2000?
SELECT "Opponent" FROM table_11132 WHERE "Date" = 'december 10, 2000'
wikisql
CREATE TABLE table_name_45 ( played INTEGER, points VARCHAR, position VARCHAR )
What is the mean number of played when there are less than 18 points and the position is less than 8?
SELECT AVG(played) FROM table_name_45 WHERE points < 18 AND position < 8
sql_create_context
CREATE TABLE table_dev_14 ( "id" int, "anemia" bool, "pulmonary_disease" bool, "c_peptide_level" float, "hemoglobin_a1c_hba1c" float, "renal_disease" bool, "cardiovascular_disease" bool, "estimated_glomerular_filtration_rate_egfr" int, "fasting_c_peptide" float, "organ_failure" b...
fasting c _ peptide greater than or equal to 0.8 ng / ml.
SELECT * FROM table_dev_14 WHERE fasting_c_peptide >= 0.8
criteria2sql
CREATE TABLE table_name_47 ( start_source VARCHAR, started VARCHAR )
what is the start source when started on 2 february?
SELECT start_source FROM table_name_47 WHERE started = "2 february"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
how much is the change of systemicsystolic in patient 006-66713 last measured on the first intensive care unit visit compared to the first value measured on the first intensive care unit visit?
SELECT (SELECT vitalperiodic.systemicsystolic FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-66713') AND NOT patient.unitdischarget...
eicu
CREATE TABLE table_41819 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" text, "Record" text )
What is the score of the competition on November 10?
SELECT "Score" FROM table_41819 WHERE "Date" = 'november 10'
wikisql
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...
在02年1月22日到03年3月1日期间,23868941的参保人门诊手术费有多少元
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '23868941' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2002-01-22' AND '2003-03-01' AND t_kc22.MED_INV_ITEM_TYPE = '手术费'
css
CREATE TABLE Ref_Locations ( Location_Code CHAR(15), Location_Name VARCHAR(255), Location_Description VARCHAR(255) ) CREATE TABLE Employees ( Employee_ID INTEGER, Role_Code CHAR(15), Employee_Name VARCHAR(255), Gender_MFU CHAR(1), Date_of_Birth DATETIME, Other_Details VARCHAR(255) )...
Show me a scatter plot of destroyed by employee id and the total number for .
SELECT Destroyed_by_Employee_ID, COUNT(*) FROM Documents_to_be_Destroyed GROUP BY Destroyed_by_Employee_ID
nvbench
CREATE TABLE table_55145 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
What's the region for an item on November 10, 2007 that's a cd?
SELECT "Region" FROM table_55145 WHERE "Date" = 'november 10, 2007' AND "Format" = 'cd'
wikisql
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) 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 t...
在08年1月31日到11年3月15日这三年里,患者58099146有什么检验结果指标记录中的仪器编号以及名称?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = ...
css
CREATE TABLE Plays_games ( gameid VARCHAR ) CREATE TABLE Video_games ( gameid VARCHAR )
Show all game names played by at least 1000 hours.
SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid HAVING SUM(hours_played) >= 1000
sql_create_context
CREATE TABLE table_17093 ( "Player" text, "Position" text, "School" text, "Hometown" text, "College" text )
who are all the players for armwood high school
SELECT "Player" FROM table_17093 WHERE "School" = 'Armwood High School'
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 ...
在2000-02-17到2009-07-01内,列出医院2298937开出的检验报告单中,列出不同检测指标名称以及不同检测指标结果定量单位下,检测指标结果定量的平均值,并把数据按平均值升序排序
SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDW, AVG(jyjgzbb.JCZBJGDL) FROM jyjgzbb JOIN jybgb_jyjgzbb JOIN jybgb ON jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id = jyjgzbb.jyjgzbb_id AND jybgb_jyjgzbb.YLJGDM = jybgb.YLJGDM WHERE jybgb.YLJGDM = '2298937' AND jyjgzbb.BGRQ BETWEEN '2000-02-17' AND '2009-07...
css
CREATE TABLE table_name_13 ( points VARCHAR, draws VARCHAR, wins VARCHAR, goal_difference VARCHAR )
How many points have more than 14 wins, a goal difference of 14, and more than 6 draws?
SELECT COUNT(points) FROM table_name_13 WHERE wins > 14 AND goal_difference = 14 AND draws > 6
sql_create_context
CREATE TABLE Affiliated_With ( Physician INTEGER, Department INTEGER, PrimaryAffiliation BOOLEAN ) CREATE TABLE Procedures ( Code INTEGER, Name VARCHAR(30), Cost REAL ) CREATE TABLE Department ( DepartmentID INTEGER, Name VARCHAR(30), Head INTEGER ) CREATE TABLE On_Call ( Nurs...
Find the number of the physicians who are trained in a procedure that costs more than 5000, order by the Y from high to low.
SELECT T1.Name, COUNT(T1.Name) FROM Physician AS T1 JOIN Trained_In AS T2 ON T1.EmployeeID = T2.Physician JOIN Procedures AS T3 ON T3.Code = T2.Treatment WHERE T3.Cost > 5000 GROUP BY T1.Name ORDER BY COUNT(T1.Name) DESC
nvbench
CREATE TABLE table_name_24 ( record VARCHAR, game VARCHAR )
What is Record, when Game is '24'?
SELECT record FROM table_name_24 WHERE game = 24
sql_create_context
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, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
沈安娜这位病人在05年2月20日到10年8月10号所开出的检验报告单的全部科室编码以及名称各是什么?
SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZ...
css
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int,...
show me ground transportation information for SAN FRANCISCO
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'SAN FRANCISCO' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_41383 ( "Year" real, "Award" text, "Category" text, "Nominee" text, "Result" text )
What year was best costume design the award category?
SELECT "Year" FROM table_41383 WHERE "Category" = 'best costume design'
wikisql
CREATE TABLE table_48522 ( "Game" real, "Date" text, "Team" text, "Score" text, "Record" text, "Streak" text )
What is Score when Team is @ Kansas City-Omaha Kings?
SELECT "Score" FROM table_48522 WHERE "Team" = '@ kansas city-omaha kings'
wikisql
CREATE TABLE table_18600760_20 ( ansi_code VARCHAR, latitude VARCHAR )
How many ansi codes are there for latitude 48.142938?
SELECT COUNT(ansi_code) FROM table_18600760_20 WHERE latitude = "48.142938"
sql_create_context
CREATE TABLE table_67337 ( "Call sign" text, "Frequency MHz" text, "City of license" text, "ERP W" real, "Class" text, "FCC info" text )
What is the name of call sign that uses a Frequency MHz of 91.1 fm?
SELECT "Call sign" FROM table_67337 WHERE "Frequency MHz" = '91.1 fm'
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...
把2002年10月16日到2006年1月26日期间患者喻思聪主要患的是什么疾病查看一下
SELECT gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '喻思聪' AND gwyjzb.IN_HOSP_DATE BETWEEN '2002-10-16' AND '2006-01-26' GROUP BY gwyjzb.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '喻...
css
CREATE TABLE table_name_96 ( date VARCHAR, opponent VARCHAR )
Which date featured the Boston Patriots as the opponent?
SELECT date FROM table_name_96 WHERE opponent = "boston patriots"
sql_create_context
CREATE TABLE table_40834 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
In the Phoenix Open, what was the winning score?
SELECT "Winning score" FROM table_40834 WHERE "Tournament" = 'phoenix open'
wikisql
CREATE TABLE table_name_52 ( rec INTEGER, yards VARCHAR, s_touchdown VARCHAR )
Which rec has Yards of 192, and a Touchdown smaller than 1?
SELECT AVG(rec) FROM table_name_52 WHERE yards = 192 AND s_touchdown < 1
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
did any phenytoin (suspension) ever been prescribed to patient 77980 until 4 years ago?
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 77980) AND prescriptions.drug = 'phenytoin (suspension)' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-4 year')
mimic_iii
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...
Before ANTHRCUL 461 , which courses do I need to take ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
advising
CREATE TABLE table_204_357 ( id number, "year" number, "div." text, "pos." text, "cup" text, "top scorer (league)" text, "score" number )
how many years was shodiev the top scorer ?
SELECT COUNT("year") FROM table_204_357 WHERE "top scorer (league)" = 'vokhid shodiev'
squall
CREATE TABLE actor ( aid int, gender text, name text, nationality text, birth_city text, birth_year int ) CREATE TABLE writer ( wid int, gender text, name text, nationality text, birth_city text, birth_year int ) CREATE TABLE director ( did int, gender text, ...
Find all movies written and produced by ' Woody Allen
SELECT movie.title FROM made_by, movie, producer, writer, written_by WHERE movie.mid = made_by.msid AND producer.name = 'Woody Allen' AND producer.pid = made_by.pid AND writer.name = 'Woody Allen' AND written_by.msid = movie.mid AND written_by.wid = writer.wid
imdb
CREATE TABLE table_1341568_14 ( district VARCHAR, elected VARCHAR )
What district had elections in 1964?
SELECT district FROM table_1341568_14 WHERE elected = 1964
sql_create_context
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 election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, ...
Show the proportion of each party in a pie chart.
SELECT T2.Party, COUNT(T2.Party) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party
nvbench
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 whose insurance is medicare and diagnoses long title is body mass index less than 19, adult?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicare" AND diagnoses.long_title = "Body Mass Index less than 19, adult"
mimicsql_data
CREATE TABLE table_train_130 ( "id" int, "gender" string, "systolic_blood_pressure_sbp" int, "right_bundle_branch_block" bool, "space_occupying_cerebral_lesion" bool, "huntington_disease" bool, "psychiatric_disease" bool, "mental_illness" bool, "treatment_regimen" bool, "psychoti...
alt and / or ast levels that are twice the upper limit of normal; bilirubin levels that exceed 2 mg / dl; serum creatinine > 1.5 mg / dl in male or > 1.4 mg / dl in female .
SELECT * FROM table_train_130 WHERE bilirubin > 2 OR ((gender = 'male' AND serum_creatinine > 1.5) OR (gender = 'female' AND serum_creatinine > 1.4))
criteria2sql
CREATE TABLE table_168274_1 ( index_weighting___percentage__at_17_january_2013 VARCHAR, company VARCHAR )
Name the total number of index weighting % at 17 january 2013 for bouygues
SELECT COUNT(index_weighting___percentage__at_17_january_2013) FROM table_168274_1 WHERE company = "Bouygues"
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 of the patients with parent infus nutrit sub were transferred to a cancer/children hospital?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND procedures.short_title = "Parent infus nutrit sub"
mimicsql_data
CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, ...
A pie chart about how many male and female assistant professors do we have?
SELECT Sex, COUNT(*) FROM Faculty WHERE Rank = "AsstProf" GROUP BY Sex
nvbench
CREATE TABLE table_64088 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text )
Who are the opponents in the February 19, 1996 final?
SELECT "Opponents in the final" FROM table_64088 WHERE "Date" = 'february 19, 1996'
wikisql
CREATE TABLE table_63202 ( "Position" real, "Gymnast" text, "A score" real, "B score" real, "Total" real )
What is the total when the A score was less than 6.6, and the B score was 8.925?
SELECT "Total" FROM table_63202 WHERE "A score" < '6.6' AND "B score" = '8.925'
wikisql
CREATE TABLE table_23066 ( "Draw" real, "Artist" text, "Original" text, "English Meaning" text, "Language" text, "Authors" text )
Who was the artist for the origin Shake it, Europe?
SELECT "Artist" FROM table_23066 WHERE "Original" = 'Shake It, Europe'
wikisql
CREATE TABLE table_46991 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real )
Can you tell me the Player that has the Country of united states, and the Score of 77-72-72=221?
SELECT "Player" FROM table_46991 WHERE "Country" = 'united states' AND "Score" = '77-72-72=221'
wikisql
CREATE TABLE table_23274514_9 ( record VARCHAR, team VARCHAR )
What was the record when they played golden state?
SELECT record FROM table_23274514_9 WHERE team = "Golden State"
sql_create_context
CREATE TABLE table_17058178_8 ( team VARCHAR, date VARCHAR )
Who did the Trail Blazers play on January 2?
SELECT team FROM table_17058178_8 WHERE date = "January 2"
sql_create_context
CREATE TABLE table_15187735_5 ( netflix VARCHAR, segment_b VARCHAR )
When marshmallow cookies is segment b what episode is it on netflix?
SELECT netflix FROM table_15187735_5 WHERE segment_b = "Marshmallow Cookies"
sql_create_context
CREATE TABLE table_22165661_3 ( head_coach VARCHAR, score VARCHAR )
Who is the head coach for the score of 4-3?
SELECT head_coach FROM table_22165661_3 WHERE score = "4-3"
sql_create_context
CREATE TABLE table_name_37 ( to_par INTEGER, place VARCHAR, country VARCHAR )
What is the highest to par with a place of t8 and West Germany as the country?
SELECT MAX(to_par) FROM table_name_37 WHERE place = "t8" AND country = "west germany"
sql_create_context
CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) )
What are the names and number of hours spent training for each player who trains for less than 1500 hours Visualize by bar chart, rank y axis in descending order.
SELECT pName, HS FROM Player WHERE HS < 1500 ORDER BY HS DESC
nvbench
CREATE TABLE enzyme ( id int, name text, Location text, Product text, Chromosome text, OMIM int, Porphyria text ) CREATE TABLE medicine_enzyme_interaction ( enzyme_id int, medicine_id int, interaction_type text ) CREATE TABLE medicine ( id int, name text, Trade_Name...
Show me a bar chart for what are the ids and trade names of the medicine that can interact with at least 3 enzymes?, sort y-axis in desc order.
SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY id DESC
nvbench
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...
What is the percentage of down voting users?.
WITH DownVoterCount AS (SELECT DownVoterCount = CAST(COUNT(*) AS FLOAT) FROM Users WHERE Users.DownVotes > 0), UserCount AS (SELECT UserCount = CAST(COUNT(*) AS FLOAT) FROM Users), DownVoterPercentage AS (SELECT ROUND(((SELECT DownVoterCount FROM DownVoterCount) / (SELECT UserCount FROM UserCount)) * 100, 2) AS DownVot...
sede
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
what is the daily maximum value of patient 017-83812's o2 sat (%) in 2105?
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 = '017-83812')) AND lab.labname = 'o2 sat (%)' AND STRFTIME('%y', lab.labresulttime) ...
eicu
CREATE TABLE table_name_90 ( points INTEGER, opponent VARCHAR, january VARCHAR )
Which Points have an Opponent of calgary flames, and a January larger than 22?
SELECT AVG(points) FROM table_name_90 WHERE opponent = "calgary flames" AND january > 22
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, ...
give me the number of patients whose diagnoses long title is other chronic pain and lab test abnormal status is abnormal?
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 = "Other chronic pain" AND lab.flag = "abnormal"
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...
provide the number of patients whose marital status is divorced and lab test name is ph?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "pH"
mimicsql_data
CREATE TABLE table_name_86 ( hits VARCHAR, year INTEGER )
Name the hits for years before 1883
SELECT hits FROM table_name_86 WHERE year < 1883
sql_create_context
CREATE TABLE table_51486 ( "Year" real, "Organisation" text, "Award" text, "Nominated Work Title" text, "Result" text )
what is the organisation when the nominated work title is n/a in the year 2005?
SELECT "Organisation" FROM table_51486 WHERE "Nominated Work Title" = 'n/a' AND "Year" = '2005'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
what was the average daily number of patients who were diagnosed with platelet dysfunction until 2104?
SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'platelet dysfunction' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104' GROUP BY STRFTIME('%y-%m-%d', diagnosis.diagnosistime)) AS t1
eicu
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, ...
on 11 23 what flights are available between BOSTON and DENVER
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 = 'DENVER' AND date_day.day_number = 23 AND date_day.month_number = 11 AND d...
atis
CREATE TABLE table_train_138 ( "id" int, "mini_mental_state_examination_mmse" int, "stroke" bool, "body_weight" float, "cranial_neurosurgery" bool, "first_degree_relative" bool, "seizure_disorder" bool, "alcohol_abuse" bool, "body_mass_index_bmi" float, "aneurysm" bool, "NOUS...
subjects with history of stroke , aneurysm, or cranial neurosurgery
SELECT * FROM table_train_138 WHERE stroke = 1 OR aneurysm = 1 OR cranial_neurosurgery = 1
criteria2sql
CREATE TABLE table_50135 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What method was used in the match that went to round 1, and had a 6-3-1 record?
SELECT "Method" FROM table_50135 WHERE "Round" = '1' AND "Record" = '6-3-1'
wikisql
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 patient ( uniquep...
how many days have it been since patient 006-195316's last prescription of furosemide 40 mg tab in the current hospital visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-195...
eicu
CREATE TABLE table_204_398 ( id number, "title" text, "year" number, "publisher" text, "developer" text, "platforms" text )
what is the total number of lord of the rings games released since 1982 ?
SELECT COUNT("title") FROM table_204_398 WHERE "year" > 1982
squall
CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Number_Deaths int ) CREATE TABLE region ( Region_id int, Region_code text, Region_name text ) CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_cit...
List the name for storms and the number of affected regions for each storm with a bar chart.
SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID
nvbench
CREATE TABLE trained_in ( physician number, treatment number, certificationdate time, certificationexpires time ) CREATE TABLE patient ( ssn number, name text, address text, phone text, insuranceid number, pcp number ) CREATE TABLE nurse ( employeeid number, name text, ...
Count the number of patients who stayed in room 112.
SELECT COUNT(patient) FROM stay WHERE room = 112
spider
CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases IN...
What are the wines that have prices lower than 50 and have appelations in Monterey county, and count them by a bar chart, rank total number from low to high order.
SELECT Name, COUNT(Name) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.Price < 50 GROUP BY Name ORDER BY COUNT(Name)
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
give me the number of patients whose marital status is divorced and lab test name is alkaline phosphatase?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "Alkaline Phosphatase"
mimicsql_data
CREATE TABLE table_name_42 ( high_rebounds VARCHAR, date VARCHAR )
Who had the highest number of rebounds on February 14?
SELECT high_rebounds FROM table_name_42 WHERE date = "february 14"
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...
how many patients whose admission type is newborn and diagnoses long title is loss of weight?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "NEWBORN" AND diagnoses.long_title = "Loss of weight"
mimicsql_data
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
has patient 73075 had any surgeries since 2103?
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73075) AND STRFTIME('%y', procedures_icd.charttime) >= '2103'
mimic_iii
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
How often is reprex, mcve, mwe, sscce, mvce, example used in comments on SO?.
SELECT COUNT(sel.Id) FROM (SELECT c.Id FROM Comments AS c WHERE YEAR(c.CreationDate) >= 2019) AS sel
sede
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime t...
what is the name of drug that patient 3369 was prescribed within 2 days after being diagnosed with alcohol cirrhosis liver until 58 months ago?
SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 3369 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'alcohol...
mimic_iii
CREATE TABLE table_76531 ( "Date" text, "Opponent" text, "Score" text, "Result" text, "Record" text )
What is the Opponent of the game with a Score of 74-66?
SELECT "Opponent" FROM table_76531 WHERE "Score" = '74-66'
wikisql
CREATE TABLE Students ( student_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(40), last_name VARCHAR(40), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), date_first_rental DATETIME, date_left_university DATETIME, other_student_details VARC...
A line chart shows the change of the sum of monthly_rental over date_address_to , and group by attribute date_address_to
SELECT date_address_to, SUM(monthly_rental) FROM Student_Addresses GROUP BY date_address_to ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_10706961_2 ( rd VARCHAR, name VARCHAR )
Which Rd took place at the Indianapolis 500?
SELECT rd FROM table_10706961_2 WHERE name = "Indianapolis 500"
sql_create_context
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年4月2日到10年8月17日内患者云文石全部检验结果指标记录中的仪器名称以及编号都是什么啊?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_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...
css
CREATE TABLE Student_Addresses ( student_id INTEGER, address_id INTEGER, date_address_from DATETIME, date_address_to DATETIME, monthly_rental DECIMAL(19,4), other_details VARCHAR(255) ) CREATE TABLE Students ( student_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middl...
Give me a pie chart to reflect the proportion of other_details and the sum of monthly_rental.
SELECT other_details, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_2285 ( "Type" text, "Beam height (mm)" real, "Flange width (mm)" real, "Web thickness (mm)" text, "Flange thickness (mm)" text, "Weight (kg/m)" text, "Cross-section area (cm 2 )" text, "Moment of inertia in torsion (J) (cm 4 )" text )
What is the weight with a cross section area of 25.3?
SELECT "Weight (kg/m)" FROM table_2285 WHERE "Cross-section area (cm 2 )" = '25.3'
wikisql
CREATE TABLE table_name_36 ( home_team VARCHAR, road_team VARCHAR, date VARCHAR )
Who was the home team on April 20 against Boston?
SELECT home_team FROM table_name_36 WHERE road_team = "boston" AND date = "april 20"
sql_create_context
CREATE TABLE table_57093 ( "car plates (since 1937)" text, "Voivodeship Separate city" text, "Capital" text, "Area in 1000km\u00b2 (1930)" text, "Population in 1000 (1931)" text )
what is the capital with the Voivodeship Separate city of bia ostockie?
SELECT "Capital" FROM table_57093 WHERE "Voivodeship Separate city" = 'białostockie'
wikisql
CREATE TABLE table_9574 ( "Year" real, "Character" text, "Title" text, "Author" text, "Artist" text, "Imprint" text )
who is the character when the artist is take and the year is before 2006?
SELECT "Character" FROM table_9574 WHERE "Artist" = 'take' AND "Year" < '2006'
wikisql
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, ...
what is the discharge location and time of the patient melinda miers?
SELECT demographic.discharge_location, demographic.dischtime FROM demographic WHERE demographic.name = "Melinda Miers"
mimicsql_data
CREATE TABLE table_12406 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Who is the player with a 68-67-75=210 score?
SELECT "Player" FROM table_12406 WHERE "Score" = '68-67-75=210'
wikisql
CREATE TABLE table_204_28 ( id number, "election" text, "name of the party/alliance" text, "number of votes" number, "percentage" text, "seats in the parliament" number )
which party/alliance has more than 300,000 votes ?
SELECT "name of the party/alliance" FROM table_204_28 WHERE "number of votes" > 300000
squall
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
how many patients whose admission type is urgent and diagnoses short title is hemochromatos-rbc trans?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.short_title = "Hemochromatos-rbc trans"
mimicsql_data
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...
自2002年1月31日到2009年6月9日,查一下医疗机构2412028的总金额和统筹总金额
SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '2412028' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-01-31' AND '2009-06-09'
css
CREATE TABLE table_name_52 ( city_of_license VARCHAR, frequency_mhz VARCHAR, call_sign VARCHAR )
What city of license has a Frequency under 107.7, and a call sign of w247aq?
SELECT city_of_license FROM table_name_52 WHERE frequency_mhz < 107.7 AND call_sign = "w247aq"
sql_create_context
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id...
Unanswered, uncommented and unclosed questions.
SELECT Id AS "post_link", CreationDate, Score, ViewCount FROM Posts WHERE PostTypeId = 1 AND AnswerCount = 0 AND CommentCount = 0 AND ClosedDate IS NULL ORDER BY ViewCount
sede
CREATE TABLE table_59153 ( "Aircraft" text, "1990" real, "destroyed" real, "damaged" real, "to Iran" real, "survived" real )
What's the average destroyed with a 1990 over 12, more than 1 damaged, 6 survivors, and a to Iran less than 4?
SELECT AVG("destroyed") FROM table_59153 WHERE "1990" > '12' AND "damaged" > '1' AND "to Iran" < '4' AND "survived" = '6'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
找一下患者52953159在医院3607978从一五年的八月十二到国庆这段时间里开的所有的药和药品编码
SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '52953159' AND MED_SER_ORG_NO = '3607978' AND IN_HOSP_DATE BETWEEN '2015-08-12' AND '2015-10-01')
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...
provide the number of patients with the item id 50902 and who were born before 2109.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2109" AND lab.itemid = "50902"
mimicsql_data
CREATE TABLE table_name_45 ( team__number1 VARCHAR, round VARCHAR )
What is team 1 in group h?
SELECT team__number1 FROM table_name_45 WHERE round = "group h"
sql_create_context
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId numb...
Reputation and Percentile Rank.
WITH Rankings AS (SELECT Id, DisplayName, Reputation, Ranking = ROW_NUMBER() OVER (ORDER BY Reputation DESC) FROM Users), Counts AS (SELECT Count = COUNT(*) FROM Users WHERE Reputation > 100) SELECT Id, DisplayName, Reputation, CAST(Ranking AS FLOAT(20, 5)) / (SELECT Count FROM Counts) AS Percentile FROM Rankings
sede
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
when on the current hospital visit did patient 005-87465 receive a prescription for the first time?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-87465' AND patient.hospitaldischargetime IS NULL)) ORDER B...
eicu
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 diagnosis ( diagn...
when was patient 007-11182 for the first time prescribed a drug?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-11182')) ORDER BY medication.drugstarttime LIMIT 1
eicu
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) 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 nu...
列举陈振海患者从2003年9月30日开始2005年3月3日结束被开出的所有检验报告单的科室编码以及名称都是什么呢?
SELECT jybgb.KSBM, jybgb.KSMC 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 = '陈...
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 ( ...
how many of the patients aged below 81 were treated with drug code prismab32k25000?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "81" AND prescriptions.formulary_drug_cd = "PRISMAB32K25000"
mimicsql_data
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, ...
count the number of times sodium chloride 0.9 % iv solp had been prescribed to patient 010-37499.
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-37499')) AND medication.drugname = 'sodium chloride 0.9 % iv solp'
eicu
CREATE TABLE table_40972 ( "Player" text, "Nationality" text, "Position" text, "Years in Orlando" text, "School/Club Team" text )
Who is the Player for School/Club Team Illinois?
SELECT "Player" FROM table_40972 WHERE "School/Club Team" = 'illinois'
wikisql