context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
what are the top four most common procedures?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd GROUP BY procedures_icd.icd9_code) AS t1 WHERE t1.c1 <= 4)
mimic_iii
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...
根据不同的入院诊断疾病编码和科室编码,医疗就诊记录中医院1685355所有患者的平均年龄都列出来是多少?
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '1685355' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
how many patients stayed in hospital for more than 30 days and were tested with metamyelocytes in lab?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "30" AND lab.label = "Metamyelocytes"
mimicsql_data
CREATE TABLE table_2619 ( "Office" text, "Type" text, "Location" text, "Elected" text, "Term began" text, "Term ended" text )
When did the term end that began December 4, 1978?
SELECT "Term ended" FROM table_2619 WHERE "Term began" = 'December 4, 1978'
wikisql
CREATE TABLE table_203_437 ( id number, "year" number, "laureate" text, "relation" text, "category" text, "rationale" text )
who was the first laureate in physiology or medicine ?
SELECT "laureate" FROM table_203_437 WHERE "category" = 'physiology or medicine' ORDER BY "year" LIMIT 1
squall
CREATE TABLE table_45659 ( "Country" text, "Skip" text, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot %" real )
Name the highest Ends Lost which has an Shot % larger than 78, and a Ends Won smaller than 38?
SELECT MAX("Ends Lost") FROM table_45659 WHERE "Shot %" > '78' AND "Ends Won" < '38'
wikisql
CREATE TABLE table_name_73 ( high_rebounds VARCHAR, game VARCHAR, date VARCHAR )
Who had the highest rebounds of the game with a game number higher than 65 on March 28?
SELECT high_rebounds FROM table_name_73 WHERE game > 65 AND date = "march 28"
sql_create_context
CREATE TABLE table_23466021_4 ( opponent VARCHAR, attendance VARCHAR )
Which opponent has 36102 is the attendance?
SELECT opponent FROM table_23466021_4 WHERE attendance = 36102
sql_create_context
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 lab ( subject_id text, hadm_id text, ...
what is the total number of patients discharged to snf?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF"
mimicsql_data
CREATE TABLE table_name_80 ( city VARCHAR, stadium VARCHAR )
Which City has a Stadium of stadio artemio franchi, florence?
SELECT city FROM table_name_80 WHERE stadium = "stadio artemio franchi, florence"
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_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, H...
在哪几次医疗记录中患者彭宏才被开出过金额不低于82.93元的药品?列出医疗就诊编号有哪些?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '彭宏才' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 82.93)
css
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE patients ( row_id number,...
calculate the total amount of jackson pratt #1 output for patient 1902 on 12/30/this year.
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1902)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'jack...
mimic_iii
CREATE TABLE table_21321804_3 ( cfl_team VARCHAR, college VARCHAR )
What team does the player who went to Nebraska play for?
SELECT cfl_team FROM table_21321804_3 WHERE college = "Nebraska"
sql_create_context
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, ...
Tell me if there are any 17 -credit courses in the SOCADMIN 400 -level .
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE program_course.catego...
advising
CREATE TABLE table_name_44 ( time_retired VARCHAR, driver VARCHAR )
What is the Time of Driver Jan Heylen (r)?
SELECT time_retired FROM table_name_44 WHERE driver = "jan heylen (r)"
sql_create_context
CREATE TABLE table_name_33 ( tv_series VARCHAR, species VARCHAR )
What show has a boar?
SELECT tv_series FROM table_name_33 WHERE species = "boar"
sql_create_context
CREATE TABLE table_204_760 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
how many times has this athlete not finished in a competition ?
SELECT COUNT(*) FROM table_204_760 WHERE "position" IS NULL
squall
CREATE TABLE table_37996 ( "Game" real, "April" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
How many Points have a Score of 1 3, and a Game larger than 82?
SELECT COUNT("Points") FROM table_37996 WHERE "Score" = '1–3' AND "Game" > '82'
wikisql
CREATE TABLE table_name_62 ( place VARCHAR, score VARCHAR )
In what place was the golfer that had a score of 69?
SELECT place FROM table_name_62 WHERE score = 69
sql_create_context
CREATE TABLE table_69768 ( "Game" real, "Date" text, "Location" text, "Time" text, "Attendance" real )
Game larger than 1, and a Location of comiskey park (i), and a Date of October 9 happened at what time?
SELECT "Time" FROM table_69768 WHERE "Game" > '1' AND "Location" = 'comiskey park (i)' AND "Date" = 'october 9'
wikisql
CREATE TABLE invoices ( id INTEGER, customer_id INTEGER, invoice_date TIMESTAMP, billing_address VARCHAR(70), billing_city VARCHAR(40), billing_state VARCHAR(40), billing_country VARCHAR(40), billing_postal_code VARCHAR(10), total NUMERIC(10,2) ) CREATE TABLE tracks ( id INTEGER...
Bar chart x axis name y axis how many name, could you sort by the Y in descending please?
SELECT name, COUNT(name) FROM playlists GROUP BY name ORDER BY COUNT(name) DESC
nvbench
CREATE TABLE table_name_87 ( monday_to_friday VARCHAR, el_canal_de_las_estrellas VARCHAR )
When does the El Canal de las Estrellas of pop tv show from Monday to Friday?
SELECT monday_to_friday FROM table_name_87 WHERE el_canal_de_las_estrellas = "pop tv"
sql_create_context
CREATE TABLE table_202_63 ( id number, "year" number, "position (after finals)" text, "coach" text, "captain" text, "best & fairest" text, "leading goalkicker (goals)" text )
who was the highest leading goalkicker from the year 1997-2014 ?
SELECT "leading goalkicker (goals)" FROM table_202_63 ORDER BY "leading goalkicker (goals)" DESC LIMIT 1
squall
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 ...
how many patients until 1 year ago were diagnosed with heart disease nos during the same month after being diagnosed with ac on chr syst hrt fail?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'heart disease nos'...
mimic_iii
CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Number_Deaths int ) CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_city_affected real ) CREATE TABLE region ( Region_id int, Region_code text, R...
List name and damage for all storms in a descending order of max speed. Plot them as bar chart.
SELECT Name, Damage_millions_USD FROM storm ORDER BY Max_speed DESC
nvbench
CREATE TABLE table_name_88 ( december INTEGER, opponent VARCHAR, game VARCHAR )
What is the sum of the dates in december that were against the atlanta flames before game 40?
SELECT SUM(december) FROM table_name_88 WHERE opponent = "atlanta flames" AND game < 40
sql_create_context
CREATE TABLE table_name_92 ( no_s_ INTEGER, position VARCHAR, school_club_team_country VARCHAR )
What is the total number of years did he play the forward position and what school/club/team/country of Oregon State did he play?
SELECT SUM(no_s_) FROM table_name_92 WHERE position = "forward" AND school_club_team_country = "oregon state"
sql_create_context
CREATE TABLE table_name_69 ( championship INTEGER, fa_cup VARCHAR, league_cup VARCHAR )
What is the smallest championship when the FA Cup is 0 and the League Cup is 1?
SELECT MIN(championship) FROM table_name_69 WHERE fa_cup = 0 AND league_cup = 1
sql_create_context
CREATE TABLE table_3783 ( "Game" real, "February" real, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text, "Points" real )
What day in February was the team 17-29-7?
SELECT MAX("February") FROM table_3783 WHERE "Record" = '17-29-7'
wikisql
CREATE TABLE table_204_847 ( id number, "#" number, "name" text, "position" text, "birthday" text, "size" text, "weight" text, "last team" text )
how many weights are at least 90kg ?
SELECT COUNT("weight") FROM table_204_847 WHERE "weight" >= 90
squall
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 Comments ( Id number, PostId number, Score numb...
Highest scored double / multiple answers.
SELECT Q.Id AS "post_link", A.OwnerUserId AS "user_id", A.OwnerUserId AS "user_link", COUNT(*) AS Answers, MIN(A.Score) AS MinScore, MAX(A.Score) AS MaxScore FROM Posts AS Q JOIN Posts AS A ON A.ParentId = Q.Id WHERE Q.PostTypeId = 1 AND A.PostTypeId = 2 AND NOT A.OwnerUserId IS NULL GROUP BY Q.Id, A.OwnerUserId HAVING...
sede
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 days did Morgan Mcgee stay in the hospital?
SELECT demographic.days_stay FROM demographic WHERE demographic.name = "Morgan Mcgee"
mimicsql_data
CREATE TABLE table_14862 ( "Round" text, "Track" text, "Race 1" text, "Race 2" text, "Race 3" text )
What Round has the Track Winton?
SELECT "Round" FROM table_14862 WHERE "Track" = 'winton'
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...
what is the number of patients who had elective hospital admission with procedure icd9 code 3611?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.icd9_code = "3611"
mimicsql_data
CREATE TABLE table_4531 ( "Year" text, "Home team" text, "Score" text, "Away team" text, "Venue" text )
Which Home team has an Away team of al-ain fc, and a Year of 2002/03?
SELECT "Home team" FROM table_4531 WHERE "Away team" = 'al-ain fc' AND "Year" = '2002/03'
wikisql
CREATE TABLE table_65899 ( "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponent in the final" text, "Score" text )
What date has kimberly po nathalie tauziat as the opponent in the final?
SELECT "Date" FROM table_65899 WHERE "Opponent in the final" = 'kimberly po nathalie tauziat'
wikisql
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance...
Number of unclosed questions with close votes per month.
SELECT DATE(MIN(P.CreationDate)) AS PostDay, COUNT(DISTINCT P.Id) FROM Posts AS P INNER JOIN PendingFlags AS PF ON P.Id = PF.PostId WHERE PF.FlagTypeId = 14 GROUP BY YEAR(P.CreationDate), MONTH(P.CreationDate) ORDER BY PostDay
sede
CREATE TABLE table_16331144_1 ( third_place VARCHAR, season VARCHAR )
Who won third place in season four?
SELECT third_place FROM table_16331144_1 WHERE season = "Four"
sql_create_context
CREATE TABLE tryout ( pid number, cname text, ppos text, decision text ) CREATE TABLE college ( cname text, state text, enr number ) CREATE TABLE player ( pid number, pname text, ycard text, hs number )
How many schools have some students playing in goalie and mid positions.
SELECT COUNT(*) FROM (SELECT cname FROM tryout WHERE ppos = 'goalie' INTERSECT SELECT cname FROM tryout WHERE ppos = 'mid')
spider
CREATE TABLE table_33082 ( "sliding tackle" text, "spear tackle" text, "dump tackle" text, "body tackle" text, "ankle tap" text, "diving tackle" text, "bumping/blocking" text, "shoulder charge" text, "steal/intercept ball" text, "Chicken wing" text )
Which shoulder charge has restricted as the body tackle?
SELECT "shoulder charge" FROM table_33082 WHERE "body tackle" = 'restricted'
wikisql
CREATE TABLE table_203_220 ( id number, "outcome" text, "no." number, "date" text, "tournament" text, "surface" text, "opponent in the final" text, "score" text )
what was the only tournament that karolina sprem was runner up in 2001 ?
SELECT "tournament" FROM table_203_220 WHERE "outcome" = 'runner-up' AND "date" = 2001
squall
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 I take DUTCH 111 which other courses should I take ?
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'DUTCH' AND number = 111
advising
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
what are the numbers of patients who took a immunoglobulin a test since 1 year ago?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'immunoglobulin a') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-1 year'))
mimic_iii
CREATE TABLE table_name_93 ( away_team VARCHAR, home_team VARCHAR )
If north melbourne played as the home team, who was the away team they played?
SELECT away_team FROM table_name_93 WHERE home_team = "north melbourne"
sql_create_context
CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id number ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGR...
患者72267378以前就诊的地方在哪?
SELECT mzjzjlb.YLJGDM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '72267378' UNION SELECT hz_info_zyjzjlb.YLJGDM FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjz...
css
CREATE TABLE medicine ( id number, name text, trade_name text, fda_approved text ) 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, me...
What are the names and trade names of the medcines that are FDA approved?
SELECT name, trade_name FROM medicine WHERE fda_approved = 'Yes'
spider
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, d...
count how many times patient 031-23605 came in to icu during the last hospital visit.
SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23605' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1)
eicu
CREATE TABLE table_27089 ( "Rank" text, "Player" text, "Nationality" text, "Team" text, "Opponent" text, "Score" text, "Competition" text, "Vote percentage" text )
What was the score for the game in which Samir Nasri played?
SELECT "Score" FROM table_27089 WHERE "Player" = 'Samir Nasri'
wikisql
CREATE TABLE table_name_74 ( record VARCHAR, season VARCHAR )
What was the record during the 1973 season?
SELECT record FROM table_name_74 WHERE season = 1973
sql_create_context
CREATE TABLE table_42967 ( "Year" real, "Drivers" text, "Races" real, "Wins" real, "Poles" real, "Fast laps" real, "Points" real, "D.C." text, "T.C." text )
What is the least number of Races for a Racer with less than 0 Points?
SELECT MIN("Races") FROM table_42967 WHERE "Points" < '0'
wikisql
CREATE TABLE table_77472 ( "Team" text, "Athletes" text, "Run 1" text, "Run 2" text, "Run 3" text, "Run 4" text, "Final" text )
Which Final has a Run 2 of 1:27.58?
SELECT "Final" FROM table_77472 WHERE "Run 2" = '1:27.58'
wikisql
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
what is the number of patients on po/ng route of drug administration who have late effect of unspecified injury?
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.short_title = "Late effect injury NOS" AND prescriptions.route = "PO/NG"
mimicsql_data
CREATE TABLE table_73377 ( "Season" text, "League" text, "Division" text, "GP" real, "W" real, "L" real, "T" real, "OTL" real, "SOL" real, "Pts" real, "PCT" text, "GF" real, "GA" real, "PIM" real, "Coach(es)" text, "Result" text )
What was the minimum L if the GA is 272?
SELECT MIN("L") FROM table_73377 WHERE "GA" = '272'
wikisql
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
count the number of patients whose discharge location is short term hospital and procedure short title is attach pedicle graft nec.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND procedures.short_title = "Attach pedicle graft NEC"
mimicsql_data
CREATE TABLE table_20440 ( "Engine type" text, "Scenario" text, "SFC in lb/(lbf\u00b7h)" text, "SFC in g/(kN\u00b7s)" text, "Specific impulse (s)" real, "Effective exhaust velocity (m/s)" real )
What is the SFC when the specific impulse is 453?
SELECT "SFC in g/(kN\u00b7s)" FROM table_20440 WHERE "Specific impulse (s)" = '453'
wikisql
CREATE TABLE table_8312 ( "Years as tallest" text, "Name" text, "Height (m)" real, "Height (ft)" real, "Floors" real, "Location" text )
What is the total height in meters for the building that has a less than 380.6 feet height?
SELECT SUM("Height (m)") FROM table_8312 WHERE "Height (ft)" < '380.6'
wikisql
CREATE TABLE table_9394 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "School/Club Team" text )
How many round values are associated with Cleveland McCrae?
SELECT COUNT("Round") FROM table_9394 WHERE "Player" = 'cleveland mccrae'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
is sao2 of patient 027-203413 last measured on the current intensive care unit visit greater than first measured on the current intensive care unit visit?
SELECT (SELECT 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 = '027-203413') AND patient.unitdischargetime IS NULL) AN...
eicu
CREATE TABLE table_11994 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text )
Name the constructor for the belgian grand prix
SELECT "Constructor" FROM table_11994 WHERE "Race" = 'belgian grand prix'
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...
患者昌正平开出的药品在哪几次医疗记录中均不低于1846.9元?列出医疗就诊编号都是什么?
SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '昌正平' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 1846.9) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '昌正平' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM...
css
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
provide the number of patients whose admission type is urgent and lab test name is troponin i?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.label = "Troponin I"
mimicsql_data
CREATE TABLE table_71696 ( "Builder" text, "Model" text, "Length (ft/m)" text, "Order Year" text, "Fuel Propulsion" text, "Fleet Series (Quantity)" text )
Which order year has a Fleet Series (Quantity) of 12081-12090 (10)?
SELECT "Order Year" FROM table_71696 WHERE "Fleet Series (Quantity)" = '12081-12090 (10)'
wikisql
CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Claims_Documents ( Claim_ID INTEGER, Document_Type_Code CHAR(15), Created_by_Staff_ID INTEGER, Created_Date INTEGER ) CREATE TABLE Claim_Headers ( Claim_Header_ID INTEGER, Claim_Status_Code CHAR(...
Find the number of records of each policy type and its type code Visualize by bar chart, and could you display x-axis in desc order?
SELECT Policy_Type_Code, COUNT(*) FROM Policies GROUP BY Policy_Type_Code ORDER BY Policy_Type_Code DESC
nvbench
CREATE TABLE table_25947 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real )
What was the record on October 17?
SELECT "Record" FROM table_25947 WHERE "Date" = 'October 17'
wikisql
CREATE TABLE table_name_54 ( bullet_tip_color VARCHAR, headstamp_id VARCHAR )
Tell me the bullet tip color of headstamp id of h1z
SELECT bullet_tip_color FROM table_name_54 WHERE headstamp_id = "h1z"
sql_create_context
CREATE TABLE table_1342218_43 ( candidates VARCHAR, result VARCHAR )
When the result is retired to run for U.S. Senate Democratic Hold, who is the candidate?
SELECT candidates FROM table_1342218_43 WHERE result = "Retired to run for U.S. Senate Democratic hold"
sql_create_context
CREATE TABLE table_name_50 ( result VARCHAR, kick_off VARCHAR )
WHAT WAS THE SCORE OF THE GAME WITH A 2007-03-06, 20:45 KICKOFF?
SELECT result FROM table_name_50 WHERE kick_off = "2007-03-06, 20:45"
sql_create_context
CREATE TABLE table_name_87 ( fastest_lap VARCHAR, race VARCHAR )
Who had the fastest lap at the German Grand Prix?
SELECT fastest_lap FROM table_name_87 WHERE race = "german grand prix"
sql_create_context
CREATE TABLE table_name_78 ( apparent_magnitude VARCHAR, object_type VARCHAR )
What is the Apparent magnitude of a globular cluster?
SELECT apparent_magnitude FROM table_name_78 WHERE object_type = "globular cluster"
sql_create_context
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, Parent...
Revival badge candidates for a certain tag.
SELECT a.Id AS "post_link", a.Score, a.CreationDate FROM Posts AS a WHERE a.PostTypeId = 2 AND EXISTS(SELECT * FROM Posts AS q WHERE q.Id = a.ParentId AND q.PostTypeId = 1 AND a.CreationDate > q.CreationDate + 30 AND Tags LIKE '%<' + LOWER(@tag) + '>%') ORDER BY a.Score DESC, a.CreationDate LIMIT 1000
sede
CREATE TABLE table_45720 ( "Japanese" text, "R\u014dmaji" text, "Meaning" text, "Chinese" text, "Romanization" text, "Source language" text )
What language did the word that means mahjong first come from?
SELECT "Source language" FROM table_45720 WHERE "Meaning" = 'mahjong'
wikisql
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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttim...
calculate how many times potassium chloride replacement (oncology) was prescribed to patient 76372 during this month.
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76372) AND prescriptions.drug = 'potassium chloride replacement (oncology)' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 ...
mimic_iii
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_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, H...
病患柳静雅在2010年4月28日到2020年4月14日内看了多少病?
SELECT COUNT(t_kc21.IN_DIAG_DIS_CD) FROM t_kc21 WHERE t_kc21.PERSON_NM = '柳静雅' AND t_kc21.IN_HOSP_DATE BETWEEN '2010-04-28' AND '2020-04-14'
css
CREATE TABLE table_58702 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text )
Which Date has Result of 86-87?
SELECT "Date" FROM table_58702 WHERE "Result" = '86-87'
wikisql
CREATE TABLE debate_people ( Debate_ID int, Affirmative int, Negative int, If_Affirmative_Win bool ) CREATE TABLE debate ( Debate_ID int, Date text, Venue text, Num_of_Audience int ) CREATE TABLE people ( People_ID int, District text, Name text, Party text, Age int ...
A bar chart for listing the number of the venues of debates in ascending order of the number of audience.
SELECT Venue, COUNT(Venue) FROM debate GROUP BY Venue ORDER BY Num_of_Audience
nvbench
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 change does patient 030-17510's urinary sodium change last 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 = '030-17510' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
eicu
CREATE TABLE table_71819 ( "Date" text, "Visiting Team" text, "Final Score" text, "Host Team" text, "Stadium" text )
Which host team won on a final scoreline of 13-10?
SELECT "Host Team" FROM table_71819 WHERE "Final Score" = '13-10'
wikisql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number...
Top SO users from istanbul.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%istanbul%' OR UPPER(Location) LIKE '%ISTANBUL%' OR UPPER(Location) LIKE '% STANBUL%' OR Location LIKE '% STANBUL%' AND Reputation >= 1000 ORDER BY Reputation DESC
sede
CREATE TABLE table_name_44 ( score VARCHAR, result VARCHAR )
What was the score of the match with a 3-0 result?
SELECT score FROM table_name_44 WHERE result = "3-0"
sql_create_context
CREATE TABLE table_name_73 ( high_points VARCHAR, score VARCHAR )
What is the High points with a Score that is l 64 94 (ot)?
SELECT high_points FROM table_name_73 WHERE score = "l 64–94 (ot)"
sql_create_context
CREATE TABLE table_74165 ( "Warrior" text, "Close ranged weapons" text, "Mid ranged weapons" text, "Long ranged weapons" text, "Armor" text, "Special weapon" text )
If the special weapon is glass egg, what is the close ranged weapon?
SELECT "Close ranged weapons" FROM table_74165 WHERE "Special weapon" = 'Glass egg'
wikisql
CREATE TABLE table_19410 ( "1890 No game" text, "1891 No game" text, "1892 No game" text, "1893 No game" text, "1894 WSU 10\u20130 Moscow" text, "1895 WSU* 10\u20134 Pullman" text, "1896 No game" text, "1897 No game" text, "1898 No game" text, "1899 WSU* 11\u20130 Pullman" text )
When 1971 no game is the 1891 no game what is the 1896 no game?
SELECT "1896 No game" FROM table_19410 WHERE "1891 No game" = '1971 No game'
wikisql
CREATE TABLE table_11330 ( "Municipalities" text, "Extension km\u00b2" text, "Population (hab)" text, "Density (hab/ km\u00b2 )" text, "Altitude m" text, "Distance Medell\u00edn Downtown ( km )" text )
What is the Distance Medell n Downtown (km) when the municipalities Envigado?
SELECT "Distance Medell\u00edn Downtown ( km )" FROM table_11330 WHERE "Municipalities" = 'envigado'
wikisql
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
how many patients whose days of hospital stay is greater than 43 and procedure icd9 code is 4432?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "43" AND procedures.icd9_code = "4432"
mimicsql_data
CREATE TABLE table_204_202 ( id number, "year" number, "tournament" text, "venue" text, "result" text, "rank" text, "event" text )
where was the last meeting in which kaseorg competed ?
SELECT "venue" FROM table_204_202 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE table_name_35 ( bronze INTEGER, silver VARCHAR, rank VARCHAR, nation VARCHAR )
What's the most bronze medals for Great Britain (GBR) with more than 1 silver and ranked more than 6?
SELECT MAX(bronze) FROM table_name_35 WHERE rank > 6 AND nation = "great britain (gbr)" AND silver > 1
sql_create_context
CREATE TABLE table_name_78 ( segment_c VARCHAR, segment_a VARCHAR )
Name the segment c for ski goggles
SELECT segment_c FROM table_name_78 WHERE segment_a = "ski goggles"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9cod...
of the patients with age 20s in 2104, what is the top three most frequent procedures?
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND STRFTIME('%y', treatment.treatmenttime) = '2104' GROUP BY treatment.t...
eicu
CREATE TABLE table_11964047_6 ( score VARCHAR, _number VARCHAR )
What was the result and score of Game #29?
SELECT score FROM table_11964047_6 WHERE _number = 29
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,...
查查医疗就诊85730231541中盐酸金霉素眼膏的外涂方法,每天的频次及每次的用量
SELECT USE_FRE, EACH_DOSAGE FROM t_kc22 WHERE MED_CLINIC_ID = '85730231541' AND SOC_SRT_DIRE_NM = '盐酸金霉素眼膏'
css
CREATE TABLE table_64047 ( "Title" text, "Author" text, "First Issue" text, "Last Issue" text, "Completed?" text )
What is the title that was first published in February 2009 and is still ongoing?
SELECT "Title" FROM table_64047 WHERE "Last Issue" = 'ongoing' AND "First Issue" = 'february 2009'
wikisql
CREATE TABLE table_48343 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real, "Finish" text )
What is Player, when Total is '294', and when Year(s) Won is '1955'?
SELECT "Player" FROM table_48343 WHERE "Total" = '294' AND "Year(s) won" = '1955'
wikisql
CREATE TABLE table_name_65 ( wins INTEGER, byes INTEGER )
Which Wins has a Byes larger than 0?
SELECT MAX(wins) FROM table_name_65 WHERE byes > 0
sql_create_context
CREATE TABLE table_10577579_2 ( enrollment INTEGER, founded VARCHAR, type VARCHAR )
What is the enrollment for the institution that was founded in 1866 and is a private/(african methodist) type?
SELECT MAX(enrollment) FROM table_10577579_2 WHERE founded = 1866 AND type = "Private/(African Methodist)"
sql_create_context
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, ...
count the number of patients whose admission location is trsf within this facility and year of birth is less than 1837?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.dob_year < "1837"
mimicsql_data
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
what is the name of the medicine that patient 013-20464 was prescribed with within the same day after having been diagnosed with s/p thoracoscopic procedure - decortication in 07/this year?
SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-20464') AND diagnosis.diagnos...
eicu
CREATE TABLE faculty ( facid number, lname text, fname text, rank text, sex text, phone number, room text, building text ) CREATE TABLE activity ( actid number, activity_name text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex...
Show the number of male and female assistant professors.
SELECT sex, COUNT(*) FROM faculty WHERE rank = "AsstProf" GROUP BY sex
spider
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
tell me the last lab test that was given to patient 002-7771 until 09/2102?
SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-7771')) AND STRFTIME('%y-%m', lab.labresulttime) <= '2102-09' ORDER BY lab.labresultt...
eicu
CREATE TABLE table_47435 ( "Year" real, "Award" text, "Category" text, "Nominated work" text, "Result" text )
What categories had a Nominated work of yerma before 1992?
SELECT "Category" FROM table_47435 WHERE "Year" < '1992' AND "Nominated work" = 'yerma'
wikisql
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 the name of the output, which patient 027-151154 had last?
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 = '027-151154')) AND intakeoutput.cellpath LIKE '%output%' ORDE...
eicu