context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_37589 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
Which visitor had a record of 7 5 3?
SELECT "Visitor" FROM table_37589 WHERE "Record" = '7–5–3'
wikisql
CREATE TABLE table_name_83 ( start INTEGER, year VARCHAR, finish VARCHAR, manufacturer VARCHAR )
WHAT IS THE START THAT HAS A FINISH BIGGER THAN 3, FROM FORD, AFTER 1969?
SELECT MAX(start) FROM table_name_83 WHERE finish > 3 AND manufacturer = "ford" AND year > 1969
sql_create_context
CREATE TABLE table_204_110 ( id number, "year" number, "champion" text, "city" text, "llws" text, "record" text )
in what year did the eighth place team have no wins ?
SELECT "year" FROM table_204_110 WHERE "llws" = 'eighth place'
squall
CREATE TABLE table_16097 ( "Week" real, "Date" text, "Kickoff" text, "Opponent" text, "Final score" text, "Team record" text, "Game site" text, "Attendance" real )
How many opponents were played on Saturday, June 9?
SELECT COUNT("Opponent") FROM table_16097 WHERE "Date" = 'Saturday, June 9'
wikisql
CREATE TABLE table_51597 ( "Block A" text, "Kaz Hayashi" text, "Ryuji Hijikata" text, "TAKA Michinoku" text, "\"brother\" YASSHI" text )
Tell me the Ryuji Hijikata for TAKA Michinoku of Hayashi (28:05)
SELECT "Ryuji Hijikata" FROM table_51597 WHERE "TAKA Michinoku" = 'hayashi (28:05)'
wikisql
CREATE TABLE table_1140085_2 ( race VARCHAR, fastest_lap VARCHAR )
what is the race where the fastest lap is by jean-pierre jarier?
SELECT race FROM table_1140085_2 WHERE fastest_lap = "Jean-Pierre Jarier"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is the number of patients whose marital status is single and diagnoses long title is esophageal reflux?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Esophageal reflux"
mimicsql_data
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
what is maximum days of hospital stay of patients whose year of death is less than 2165?
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.dod_year < "2165.0"
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...
give me the number of patients whose days of hospital stay is greater than 17 and procedure long title is combined right and left heart cardiac catheterization?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "17" AND procedures.long_title = "Combined right and left heart cardiac catheterization"
mimicsql_data
CREATE TABLE table_62857 ( "Athlete" text, "Class" text, "Horse" text, "Event" text, "Result" text, "Rank" text )
What is the result for the Toscane Horse in the freestyle test?
SELECT "Result" FROM table_62857 WHERE "Horse" = 'toscane' AND "Event" = 'freestyle test'
wikisql
CREATE TABLE table_52080 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What did the home team score in the game that the away team scored 10.17 (77)?
SELECT "Home team score" FROM table_52080 WHERE "Away team score" = '10.17 (77)'
wikisql
CREATE TABLE table_name_40 ( letter VARCHAR, british VARCHAR )
Which letter has the British a ?
SELECT letter FROM table_name_40 WHERE british = "aɪ"
sql_create_context
CREATE TABLE procedures ( 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 ) ...
for patient jerry deberry, specify birth date and lab tests conducted
SELECT demographic.dob, lab."CATEGORY" FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE table_60103 ( "Week 1" text, "Week 2" text, "Week 3" text, "Week 4" text, "Week 5" text )
Who was the girl of the week after nicole woodruff in the same month?
SELECT "Week 5" FROM table_60103 WHERE "Week 4" = 'nicole woodruff'
wikisql
CREATE TABLE table_27713 ( "User" text, "Unit (kWh)/Time range" text, "Tariff ( Rs. /kWh)" text, "Fixed Charge ( Rs. /kWh)" text, "Fuel Adjustment Charge (% of Total Energy Charge)" text, "Max. Demand Charge ( Rs. /kVA)" text )
What is the fixed charge for the user who had a tariff of 11.30?
SELECT "Fixed Charge ( Rs. /kWh)" FROM table_27713 WHERE "Tariff ( Rs. /kWh)" = '11.30'
wikisql
CREATE TABLE table_24584486_1 ( wins INTEGER, poles VARCHAR )
What was the least amount of wins when he had 10 poles?
SELECT MIN(wins) FROM table_24584486_1 WHERE poles = 10
sql_create_context
CREATE TABLE table_name_33 ( round VARCHAR, position VARCHAR, player VARCHAR )
What is the total number of rounds that Center position Denis Arkhipov have?
SELECT COUNT(round) FROM table_name_33 WHERE position = "center" AND player = "denis arkhipov"
sql_create_context
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, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
how much is the total hospital bill for patient 73713 in this year during their stay?
SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73713) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
mimic_iii
CREATE TABLE table_8185 ( "Club" text, "Sport" text, "Founded" real, "League" text, "Venue" text )
Which Sport has a Founded larger than 1874 and a Club of birmingham city?
SELECT "Sport" FROM table_8185 WHERE "Founded" > '1874' AND "Club" = 'birmingham city'
wikisql
CREATE TABLE table_204_976 ( id number, "pos" text, "driver" text, "entrant" text, "constructor" text, "time/retired" text, "grid" number )
who came in first ?
SELECT "driver" FROM table_204_976 WHERE "pos" = 1
squall
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...
从2010年2月7日到2014年5月21日内医院1521051科室涉及医疗费总额超过1941.65元的有多少?
SELECT COUNT(*) FROM (SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '1521051' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2010-02-07' AND '2014-05-21' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) > 1941.65) AS T
css
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
have heparin 5,000 unit/ml ever been prescribed to patient 002-76184 since 4 years ago?
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-76184')) AND medication.drugname = 'heparin 5,000 unit/ml' AND DATETIM...
eicu
CREATE TABLE table_name_64 ( location_attendance VARCHAR, high_assists VARCHAR, high_rebounds VARCHAR )
What is Location Attendance, when High Assists is 'Rafer Alston (7)', and when High Rebounds is 'Yao Ming (13)'?
SELECT location_attendance FROM table_name_64 WHERE high_assists = "rafer alston (7)" AND high_rebounds = "yao ming (13)"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
tell me via which route does stephanie suchan administer medication?
SELECT prescriptions.route FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Stephanie Suchan"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
give me the number of patients whose admission location is emergency room admit and procedure short title is oth cardiac mon output?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.short_title = "Oth cardiac mon output"
mimicsql_data
CREATE TABLE table_name_37 ( pos VARCHAR, weight INTEGER )
What is the pos with weight less than 205?
SELECT pos FROM table_name_37 WHERE weight < 205
sql_create_context
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, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
tell me the category of lab test and fluid to be checked in lab test for patient with patient id 2110.
SELECT lab.fluid, lab."CATEGORY" FROM lab WHERE lab.subject_id = "2110"
mimicsql_data
CREATE TABLE table_name_22 ( competition VARCHAR, date VARCHAR )
Which competition was played on 13-11-2012?
SELECT competition FROM table_name_22 WHERE date = "13-11-2012"
sql_create_context
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_40...
A bar chart shows the distribution of name and ID , could you list bar in ascending order?
SELECT name, ID FROM swimmer ORDER BY name
nvbench
CREATE TABLE table_name_3 ( chassis VARCHAR, points INTEGER )
What Chassis has more than 0 points?
SELECT chassis FROM table_name_3 WHERE points > 0
sql_create_context
CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Documents ( Documen...
Scatter plot to show project id on x axis and the total number on y axis.
SELECT Project_ID, COUNT(*) FROM Documents GROUP BY Project_ID
nvbench
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, ...
Most popular data analysis languages by month and year.
SELECT YEAR(Posts.CreationDate) AS year, MONTH(Posts.CreationDate) AS month, Tags.TagName AS language, COUNT(Tags.TagName) AS posts FROM Posts, Tags WHERE Tags.TagName IN ('r', 'python', 'java', 'stata', 'matlab', 'sas', 'tableau') AND Posts.Tags LIKE ('%<' + Tags.TagName + '>%') GROUP BY Tags.TagName, YEAR(Posts.Creat...
sede
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
provide the number of patients whose procedure short title is colonoscopy?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Colonoscopy"
mimicsql_data
CREATE TABLE table_203_450 ( id number, "team" text, "outgoing manager" text, "manner of departure" text, "date of vacancy" text, "replaced by" text, "date of appointment" text, "position in table" text )
what was the top team according to position in table called ?
SELECT "team" FROM table_203_450 WHERE id = 1
squall
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, ...
what is the monthly average ldl value for patient 006-133605 since 2105?
SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-133605')) AND lab.labname = 'ldl' AND STRFTIME('%y', lab.labresulttime) >= '21...
eicu
CREATE TABLE table_57530 ( "Country" text, "Interview" real, "Swimsuit" real, "Evening Gown" real, "Average" real )
Which country has swimsuit more than 9.46 and interview more than 9.22 with average less than 9.6?
SELECT "Country" FROM table_57530 WHERE "Average" < '9.6' AND "Interview" > '9.22' AND "Swimsuit" > '9.46'
wikisql
CREATE TABLE table_63615 ( "Rank" real, "Country/Region" text, "Expenditures on R&D (billions of US$ , PPP )" real, "% of GDP PPP" text, "Year" real )
What is the lowest expenditures on R&D for Poland after 2011?
SELECT MIN("Expenditures on R&D (billions of US$ , PPP )") FROM table_63615 WHERE "Country/Region" = 'poland' AND "Year" > '2011'
wikisql
CREATE TABLE table_18823880_10 ( release_price___usd__ VARCHAR, socket VARCHAR )
When socketg1 is the socket what is the release price in dollars?
SELECT release_price___usd__ FROM table_18823880_10 WHERE socket = "socketG1"
sql_create_context
CREATE TABLE table_25965003_3 ( length_of_stay_permitted VARCHAR, countries_and_territories VARCHAR )
What is the permitted length of stay in the Jersey territory?
SELECT length_of_stay_permitted FROM table_25965003_3 WHERE countries_and_territories = "Jersey"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
until 2103 how many patients were diagnosed with nausea - with vomiting within 2 months after diagnosis of lower urinary tract infection?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'nausea - with vomiting' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2103') AS t1 JOIN (SELECT patient.un...
eicu
CREATE TABLE table_14966 ( "Home" text, "Score" text, "Away" text, "Venue" text, "Golden point(s) scorer" text )
What Golden point(s) scorer has the Away Brisbane Broncos and Home South Sydney Rabbitohs?
SELECT "Golden point(s) scorer" FROM table_14966 WHERE "Away" = 'brisbane broncos' AND "Home" = 'south sydney rabbitohs'
wikisql
CREATE TABLE table_20683 ( "!Simple Present/Future" text, "Probable Future" text, "Simple Past" text, "Past Habitual" text, "Injunctive" text, "Imperative" text )
Name the past habitual for garchas 'you (will) do
SELECT "Past Habitual" FROM table_20683 WHERE "Probable Future" = 'गर्छस् garchas ''you (will) do'
wikisql
CREATE TABLE table_70246 ( "Player" text, "Club" text, "Games Played" real, "Minutes" real, "Goals Against" real, "GA Average" real, "Wins" real, "Loses" real )
What is the highest goals against the goalkeeper of Dallas Burn, who had a GA average larger than 1.46, had?
SELECT MAX("Goals Against") FROM table_70246 WHERE "Club" = 'dallas burn' AND "GA Average" > '1.46'
wikisql
CREATE TABLE table_51520 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Where did the game take place when the away team scored 14.15 (99)?
SELECT "Venue" FROM table_51520 WHERE "Away team score" = '14.15 (99)'
wikisql
CREATE TABLE table_name_10 ( years_as_tallest VARCHAR, floors VARCHAR, street_address VARCHAR )
WHAT IS THE YEAR'S TALLEST VALUE WITH FLOORS LESS THAN 24, AND 05.0 210 north charles street?
SELECT years_as_tallest FROM table_name_10 WHERE floors < 24 AND street_address = "05.0 210 north charles street"
sql_create_context
CREATE TABLE table_53814 ( "Player" text, "Position" text, "Date of Birth (Age)" text, "Caps" real, "Club/province" text )
Which club has 1 cap?
SELECT "Club/province" FROM table_53814 WHERE "Caps" = '1'
wikisql
CREATE TABLE table_name_38 ( home_team VARCHAR, crowd INTEGER )
Which home team has a crowd that is bigger than 22,449?
SELECT home_team FROM table_name_38 WHERE crowd > 22 OFFSET 449
sql_create_context
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
what was the drug that patient 11362 had been prescribed two times in 11/this year.
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11362) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 ye...
mimic_iii
CREATE TABLE table_51818 ( "Tournament" text, "1968" text, "1969" text, "1970" text, "1971" text, "1972" text, "1973" text, "1974" text, "1975" text, "1976" text, "1977" text, "1978" text, "1979" text, "Career SR" text, "Career W\u2013L" text, "Career Win ...
What is the listing for the US Open in 1977?
SELECT "1977" FROM table_51818 WHERE "Tournament" = 'us open'
wikisql
CREATE TABLE table_66673 ( "Rank" real, "Rowers" text, "Country" text, "Time" text, "Notes" text )
What is the Time of the Rowers from Finland with a Rank of less than 4?
SELECT "Time" FROM table_66673 WHERE "Rank" < '4' AND "Country" = 'finland'
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...
how many patients are primarily suffering from coronary heart disease with age below 70?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE" AND demographic.age < "70"
mimicsql_data
CREATE TABLE table_name_3 ( rank INTEGER, react VARCHAR, lane VARCHAR, athlete VARCHAR )
How many ranks have more than 7 lanes, and an Athlete of michael mathieu, and a Reaction time larger than 0.203?
SELECT SUM(rank) FROM table_name_3 WHERE lane > 7 AND athlete = "michael mathieu" AND react > 0.203
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...
what is the three most frequent drugs which were prescribed within 2 months to the patients aged 60 or above after having been diagnosed with acute respiratory distress, during a year before?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory distress' AND DATETIME(diagnosis...
eicu
CREATE TABLE table_73817 ( "Settlement" text, "Cyrillic Name Other Names" text, "Type" text, "Population (2011)" real, "Largest ethnic group (2002)" text, "Dominant religion (2002)" text )
What is the largest ethnic group of the settlement with the cyrillic name of ?
SELECT "Largest ethnic group (2002)" FROM table_73817 WHERE "Cyrillic Name Other Names" = 'Банатско Аранђелово'
wikisql
CREATE TABLE table_1590967_6 ( episode_number VARCHAR, coat_of_cash_wearing_celebrity VARCHAR )
Name the total number of episodes for coat of cash wearing celebrity is matt di angelo
SELECT COUNT(episode_number) FROM table_1590967_6 WHERE coat_of_cash_wearing_celebrity = "Matt Di Angelo"
sql_create_context
CREATE TABLE table_name_53 ( country VARCHAR, album VARCHAR, weeks_on_chart VARCHAR )
what is the country with the album best of and weeks on chart is less than 5?
SELECT country FROM table_name_53 WHERE album = "best of" AND weeks_on_chart < 5
sql_create_context
CREATE TABLE table_17486 ( "Rd." real, "Grand Prix" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Winning constructor" text, "Report" text )
who is the the fastest lap with grand prix being european grand prix
SELECT "Fastest lap" FROM table_17486 WHERE "Grand Prix" = 'European Grand Prix'
wikisql
CREATE TABLE table_train_59 ( "id" int, "bone_marrow_transplant" bool, "nephrolithiasis_history" bool, "taking_vitamin_c" bool, "immune_suppression" bool, "neutrophil_count" int, "monoclonal_antibodies_mab" int, "sepsis" bool, "glucose_6_phosphate_dehydrogenase_deficiency_g6pd" int, ...
esrd patients, transplant eligible on dialysis currently taking vitamin c supplementation
SELECT * FROM table_train_59 WHERE taking_vitamin_c = 1
criteria2sql
CREATE TABLE table_35967 ( "Song title" text, "Artist" text, "Decade" text, "Genre" text, "Family Friendly" text )
Who is the artist of the rock song?
SELECT "Artist" FROM table_35967 WHERE "Genre" = 'rock'
wikisql
CREATE TABLE table_27771406_1 ( stumpings INTEGER )
What is the most amount of stumpings any player had?
SELECT MAX(stumpings) FROM table_27771406_1
sql_create_context
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 the top three most frequent medications that patients were prescribed during the same hospital encounter after being prescribed atorvastatin 20 mg tab since 3 years ago.
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime, patient.patienthealthsystemstayid FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'atorvastatin 20 ...
eicu
CREATE TABLE table_203_824 ( id number, "pick #" number, "player" text, "position" text, "nationality" text, "nhl team" text, "college/junior/club team" text )
which player was drafted after bob pierson ?
SELECT "player" FROM table_203_824 WHERE "pick #" = (SELECT "pick #" FROM table_203_824 WHERE "player" = 'bob pierson') + 1
squall
CREATE TABLE table_name_18 ( format VARCHAR, date VARCHAR, catalog VARCHAR )
In what format was the release that was dated 7 April 2003 from catalog 584 2112?
SELECT format FROM table_name_18 WHERE date = "7 april 2003" AND catalog = "584 2112"
sql_create_context
CREATE TABLE table_name_94 ( college VARCHAR, player VARCHAR )
What college has Lance Moore Category:articles with hcards?
SELECT college FROM table_name_94 WHERE player = "lance moore category:articles with hcards"
sql_create_context
CREATE TABLE table_26847237_1 ( location VARCHAR, opposition VARCHAR )
What was the location when the opposition was East Coast?
SELECT location FROM table_26847237_1 WHERE opposition = "East Coast"
sql_create_context
CREATE TABLE table_name_20 ( round INTEGER, school VARCHAR, pick VARCHAR )
After pick number 158, what is the next round a USC player was picked?
SELECT MIN(round) FROM table_name_20 WHERE school = "usc" AND pick > 158
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
what was the last height of patient 013-21980 in 08/last year.
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-21980') AND NOT patient.admissionheight IS NULL AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-...
eicu
CREATE TABLE table_10797463_1 ( village__slovenian_ VARCHAR, village__german_ VARCHAR )
What is the slovenian name for the village that in german is known as st.margarethen?
SELECT village__slovenian_ FROM table_10797463_1 WHERE village__german_ = "St.Margarethen"
sql_create_context
CREATE TABLE table_50145 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What was their record bfore game 54?
SELECT "Record" FROM table_50145 WHERE "Game" = '54'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
count the number of patients whose year of birth is less than 2060?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dob_year < "2060"
mimicsql_data
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, ...
看看病患33309508颅部各项指标的检验结果怎么样
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON 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.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ...
css
CREATE TABLE table_name_55 ( name VARCHAR, points VARCHAR, nation VARCHAR, pts_game VARCHAR )
what is the name when the nation is France, the pts/game is more than 3 and points is less than 33?
SELECT name FROM table_name_55 WHERE nation = "france" AND pts_game > 3 AND points < 33
sql_create_context
CREATE TABLE table_73473 ( "States" text, "No. of MLA/MPs" real, "Value of each Vote" real, "K.R. Narayanan (Votes)" real, "K.R. Narayanan (Values)" real, "T.N. Seshan (Votes)" real, "T.N. Seshan (Values)" real, "Invalid (Votes)" real, "Invalid (Values)" real )
Name the number of tn seshan values for kr values is 478608
SELECT COUNT("T.N. Seshan (Values)") FROM table_73473 WHERE "K.R. Narayanan (Values)" = '478608'
wikisql
CREATE TABLE table_78256 ( "Years" text, "Supervisor" text, "Clerk" text, "Treasurer" text, "Highway Commissioners" text )
Who was the supervisor in the year 1846?
SELECT "Supervisor" FROM table_78256 WHERE "Years" = '1846'
wikisql
CREATE TABLE table_13447 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "County" text, "Year Joined" real )
What is the enrollment of the school whose mascot is hot dogs?
SELECT SUM("Enrollment") FROM table_13447 WHERE "Mascot" = 'hot dogs'
wikisql
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 ...
what was the name of the organism that was found on the last blood culture microbiology test patient 15905 received?
SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15905) AND microbiologyevents.spec_type_desc = 'blood culture' AND NOT microbiologyevents.org_name IS NULL ORDER BY microbiologyevents.charttime DESC LI...
mimic_iii
CREATE TABLE table_5025 ( "Rank" real, "Name" text, "Nationality" text, "1st (m)" real, "2nd (m)" real, "Points" real, "Overall WC points (Rank)" text )
Which Rank is the highest one that has Points of 248, and a 1st (m) larger than 123.5?
SELECT MAX("Rank") FROM table_5025 WHERE "Points" = '248' AND "1st (m)" > '123.5'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ tim...
找出哪些检测指标和检测指标名称结果定量单位和检验指标记录79766210879相同,且检测指标结果定量大于等于其的检验指标记录?
SELECT * FROM jyjgzbb WHERE jyjgzbb.JCZBMC = (SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '79766210879') AND jyjgzbb.JCZBJGDW = (SELECT jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '79766210879') AND jyjgzbb.JCZBJGDL >= (SELECT jyjgzbb.JCZBJGDL FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '79766210879')
css
CREATE TABLE table_13831 ( "Date" real, "Ships sunk (Pola)" text, "Tonnage" text, "U-boats destroyed (KuK)" text, "U-boats destroyed (Pola)" text )
What is listed as the average Date that has U-boats destroyed (KuK) of 2 with Tonnage of 1,514,050?
SELECT AVG("Date") FROM table_13831 WHERE "U-boats destroyed (KuK)" = '2' AND "Tonnage" = '1,514,050'
wikisql
CREATE TABLE table_13356 ( "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What is Hungary's time with a heat higher than 2 and two lanes?
SELECT "Time" FROM table_13356 WHERE "Heat" > '2' AND "Nationality" = 'hungary' AND "Lane" = '2'
wikisql
CREATE TABLE table_name_12 ( cfl_team VARCHAR, college VARCHAR, player VARCHAR )
Which CFL Team has a College of montreal, and a Player of marc trepanier?
SELECT cfl_team FROM table_name_12 WHERE college = "montreal" AND player = "marc trepanier"
sql_create_context
CREATE TABLE people ( People_ID int, District text, Name text, Party text, Age int ) CREATE TABLE debate ( Debate_ID int, Date text, Venue text, Num_of_Audience int ) CREATE TABLE debate_people ( Debate_ID int, Affirmative int, Negative int, If_Affirmative_Win bool ...
Show the number of debates for each person on the affirmative side in a bar chart, and rank X in desc order.
SELECT Name, COUNT(Name) FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID GROUP BY Name ORDER BY Name DESC
nvbench
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), ...
For all employees who have the letters D or S in their first name, a line chart shows the change of salary over hire_date
SELECT HIRE_DATE, SALARY FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
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 date of birth and lab test category of subject name shawn green?
SELECT demographic.dob, lab."CATEGORY" FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Shawn Green"
mimicsql_data
CREATE TABLE table_50886 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
Which Finish has a Total of 288?
SELECT "Finish" FROM table_50886 WHERE "Total" = '288'
wikisql
CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name...
What is the booking end dates of the apartments with type code 'Duplex'? Bin the year into weekday interval with a bar chart, and sort by the Y in asc.
SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = "Duplex" ORDER BY COUNT(booking_start_date)
nvbench
CREATE TABLE table_name_24 ( tries_for VARCHAR, club VARCHAR )
How many tries did the club Croesyceiliog rfc have?
SELECT tries_for FROM table_name_24 WHERE club = "croesyceiliog rfc"
sql_create_context
CREATE TABLE table_name_62 ( lane INTEGER, time VARCHAR, rank VARCHAR )
What's the highest lane of rank 4 with a time less than 24.72?
SELECT MAX(lane) FROM table_name_62 WHERE time < 24.72 AND rank = 4
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
has there been any surgery on patient 18223 when they came to the hospital first time?
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18223 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)
mimic_iii
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...
count the number of patients whose year of birth is less than 2058 and lab test fluid is other body fluid?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2058" AND lab.fluid = "Other Body Fluid"
mimicsql_data
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...
let me know the diagnoses icd9 code for patient with patient id 3343.
SELECT diagnoses.icd9_code FROM diagnoses WHERE diagnoses.subject_id = "3343"
mimicsql_data
CREATE TABLE table_38491 ( "Gloss" text, "Cholim" text, "Lungchang" text, "Rera" text, "Tikhak" text, "Yonguk" text, "Muklom" text, "Hakhun" text, "Halang" text )
Which Hakhun has a Tikhak of u ?
SELECT "Hakhun" FROM table_38491 WHERE "Tikhak" = 'ʒu²'
wikisql
CREATE TABLE table_test_10 ( "id" int, "left_ventricular_ejection_fraction_lvef" int, "systolic_blood_pressure_sbp" int, "immunosuppressive_disease" bool, "systolic_arterial_pressure_sap" int, "lymphomas" bool, "left_ventricular_dysfunction" bool, "tissue_hypoperfusion" bool, "heart_...
persistent severe heart failure ( left ventricular ejection fraction ( lvef ) < 20 % )
SELECT * FROM table_test_10 WHERE heart_disease = 1 OR left_ventricular_ejection_fraction_lvef < 20
criteria2sql
CREATE TABLE table_name_36 ( draw INTEGER, points VARCHAR )
What is the highest draw number when 23 points are scored?
SELECT MAX(draw) FROM table_name_36 WHERE points = 23
sql_create_context
CREATE TABLE table_27756314_10 ( game INTEGER, score VARCHAR )
What is the highest game with the score l 96 103 (ot)?
SELECT MAX(game) FROM table_27756314_10 WHERE score = "L 96–103 (OT)"
sql_create_context
CREATE TABLE table_38808 ( "Year" real, "Album" text, "Record label" text, "Info" text, "Music" text )
Which Music has a Record label of moviebox/ speed records / music waves?
SELECT "Music" FROM table_38808 WHERE "Record label" = 'moviebox/ speed records / music waves'
wikisql
CREATE TABLE table_name_24 ( school_club_team VARCHAR, position VARCHAR )
What is the team that has forward-center as a position?
SELECT school_club_team FROM table_name_24 WHERE position = "forward-center"
sql_create_context
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...
在2006-02-01到2011-02-17内,医疗机构6798056处理了多少次异地就诊
SELECT COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '6798056' AND qtb.IN_HOSP_DATE BETWEEN '2006-02-01' AND '2011-02-17' AND qtb.REMOTE_SETTLE_FLG = '异地1' OR qtb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '6798056' AND gyb.IN_HOSP_DATE BETWEEN '2006-02-01' AND '2011-02-17' AND g...
css
CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text ) CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text )
Bar graph to show the total number from different team, and could you list by the total number in desc?
SELECT Team, COUNT(*) FROM Elimination GROUP BY Team ORDER BY COUNT(*) DESC
nvbench
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, ...
罗列出从00年10月18日到2005年2月27日内患者04312120所有检验结果指标记录的检测人为孙幼安的检验指标流水序号是多少?
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.B...
css