context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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 diagnoses ( ...
find out the number of female patients who have diagnoses icd9 code 53390.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.icd9_code = "53390"
mimicsql_data
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 ) ...
what is maximum age of patients whose gender is f and insurance is private?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.insurance = "Private"
mimicsql_data
CREATE TABLE table_name_35 ( silver INTEGER, total VARCHAR, rank VARCHAR )
What is the most silver medals when the total is less than 4 and the rank is 12?
SELECT MAX(silver) FROM table_name_35 WHERE total < 4 AND rank = "12"
sql_create_context
CREATE TABLE table_20193855_2 ( author_s__or_editor_s_ VARCHAR, book_title VARCHAR )
How many authors or editors are there for the book title elf child?
SELECT COUNT(author_s__or_editor_s_) FROM table_20193855_2 WHERE book_title = "Elf Child"
sql_create_context
CREATE TABLE table_name_44 ( nationality VARCHAR, round VARCHAR )
What nationality was the round 6 draft pick?
SELECT nationality FROM table_name_44 WHERE round = 6
sql_create_context
CREATE TABLE Documents ( project_id VARCHAR )
Show the ids for projects with at least 2 documents.
SELECT project_id FROM Documents GROUP BY project_id HAVING COUNT(*) >= 2
sql_create_context
CREATE TABLE table_name_65 ( week_2 VARCHAR, week_3 VARCHAR )
Who is week 2 if week 3 is Sara Stokes?
SELECT week_2 FROM table_name_65 WHERE week_3 = "sara stokes"
sql_create_context
CREATE TABLE table_36814 ( "Player" text, "County" text, "Tally" text, "Total" real, "Matches" real, "Average" real )
What is the Tally in Kerry County?
SELECT "Tally" FROM table_36814 WHERE "County" = 'kerry'
wikisql
CREATE TABLE table_41169 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text )
Who was the leading scorer against the visiting team Bulls?
SELECT "Leading scorer" FROM table_41169 WHERE "Visitor" = 'bulls'
wikisql
CREATE TABLE table_13562 ( "Year" text, "1851" text, "1861" text, "1871" text, "1881" text )
What's the 1861 had 1991 in 1881 and a year of year?
SELECT "1861" FROM table_13562 WHERE "Year" = 'year' AND "1881" = '1991'
wikisql
CREATE TABLE table_name_27 ( height_ VARCHAR, m VARCHAR, architect VARCHAR )
What is the height of the building built by architects Ross and Macfarlane?
SELECT height_ AS "m" FROM table_name_27 WHERE architect = "ross and macfarlane"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
how many patients whose diagnoses icd9 code is 2631 and lab test fluid is cerebrospinal fluid (csf)?
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.icd9_code = "2631" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
mimicsql_data
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate n...
when was the last time the respiration of patient 002-39753 was measured until 910 days ago at greater than 35.0?
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-39753')) AND vitalperiodic.respiration > 35.0 A...
eicu
CREATE TABLE table_40149 ( "Value" text, "\u20ac equiv." text, "Diameter" text, "Weight" text, "Composition" text )
How much does the coin with a 14mm diameter weigh?
SELECT "Weight" FROM table_40149 WHERE "Diameter" = '14mm'
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...
分别在哪几次医疗记录中给病号41726844售卖的药品均价超过1130.37元?列出一下医疗就诊编号都是多少?
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '41726844' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT <= 1130.37)
css
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...
give me the number of patients whose procedure long title is endoscopic sphincterotomy and papillotomy and lab test fluid is ascites?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Endoscopic sphincterotomy and papillotomy" AND lab.fluid = "Ascites"
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, ...
孔雅静患者报告日期均在2011年1月25日之后的住院就诊记录对应着哪些检验报告单和住院就诊流水号是多少?
SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND ...
css
CREATE TABLE faculty ( facid number, lname text, fname text, rank text, sex text, phone number, room text, building text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) C...
Find the building that has the largest number of faculty members.
SELECT building FROM faculty GROUP BY building ORDER BY COUNT(*) DESC LIMIT 1
spider
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, ...
give me the number of patients whose admission year is less than 2190 and lab test name is % hemoglobin a1c?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2190" AND lab.label = "% Hemoglobin A1c"
mimicsql_data
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Stack bar chart of school_id vs All_Home based on acc road, rank Y from high to low order.
SELECT ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY School_ID DESC
nvbench
CREATE TABLE table_24613895_1 ( number_of_believers VARCHAR, name_of_village VARCHAR )
Name the number of believers for patavur
SELECT COUNT(number_of_believers) FROM table_24613895_1 WHERE name_of_village = "Patavur"
sql_create_context
CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type ...
What are the nationalities and their average ages of journalists Show me a bar chart, order total number in desc order please.
SELECT Nationality, AVG(Age) FROM journalist GROUP BY Nationality ORDER BY AVG(Age) DESC
nvbench
CREATE TABLE table_79200 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
Which Result has an Opponent of minnesota vikings?
SELECT "Result" FROM table_79200 WHERE "Opponent" = 'minnesota vikings'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, show me about the distribution of name and the average of code , and group by attribute name in a bar chart, and I want to order by the x-axis in asc.
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE store_product ( Store_ID int, Product_ID int ) CREATE TABLE store_district ( Store_ID int, District_ID int ) CREATE TABLE district ( District_ID int, District_name text, Headquartered_City text, City_Population real, City_Area real ) CREATE TABLE product ( product...
How many stores are headquarted in each city. Show a pie chart.
SELECT Headquartered_City, COUNT(*) FROM store AS t1 JOIN store_district AS t2 ON t1.Store_ID = t2.Store_ID JOIN district AS t3 ON t2.District_ID = t3.District_ID GROUP BY t3.Headquartered_City
nvbench
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
give me the number of patients who have elective hospital admissions along with diagnosis icd9 code 4373.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.icd9_code = "4373"
mimicsql_data
CREATE TABLE table_58349 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner-up" text )
what is the tournament when the winning score is 2 and 1?
SELECT "Tournament" FROM table_58349 WHERE "Winning score" = '2 and 1'
wikisql
CREATE TABLE table_name_33 ( race_leader VARCHAR, stage VARCHAR )
Which race Leader has a Stage of 7?
SELECT race_leader FROM table_name_33 WHERE stage = "7"
sql_create_context
CREATE TABLE table_name_51 ( population VARCHAR, germans VARCHAR )
What is the population of the year featuring an 87.5% German population?
SELECT population FROM table_name_51 WHERE germans = "87.5%"
sql_create_context
CREATE TABLE table_name_21 ( opponent VARCHAR, time VARCHAR )
Who is the opponent with a time of 1:19?
SELECT opponent FROM table_name_21 WHERE time = "1:19"
sql_create_context
CREATE TABLE table_name_88 ( japanese_title VARCHAR, romaji_title VARCHAR )
What title to the japanese give the romani title ashita wa ashita no kaze ga fuku?
SELECT japanese_title FROM table_name_88 WHERE romaji_title = "ashita wa ashita no kaze ga fuku"
sql_create_context
CREATE TABLE table_27671835_3 ( members_lost INTEGER, net_change VARCHAR )
What is the lowest number of members lost when the net change is 1?
SELECT MIN(members_lost) FROM table_27671835_3 WHERE net_change = "−1"
sql_create_context
CREATE TABLE table_69676 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What was the score in the venue of Seoul that resulted in 8-0?
SELECT "Score" FROM table_69676 WHERE "Venue" = 'seoul' AND "Result" = '8-0'
wikisql
CREATE TABLE table_73654 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Original air date" text )
How many episodes in the season had 3.81 million US viewers?
SELECT COUNT("No. in season") FROM table_73654 WHERE "U.S. viewers (million)" = '3.81'
wikisql
CREATE TABLE table_60350 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What is the Home team at the Blackburn Rovers Away game?
SELECT "Home team" FROM table_60350 WHERE "Away team" = 'blackburn rovers'
wikisql
CREATE TABLE table_name_73 ( chord VARCHAR, minor_seventh VARCHAR )
What is the Chord with a Minor that is seventh of f?
SELECT chord FROM table_name_73 WHERE minor_seventh = "f"
sql_create_context
CREATE TABLE table_19072602_1 ( score VARCHAR, team_europe VARCHAR )
How many different scores did Team Europe get when Mika Koivuniemi played for them?
SELECT COUNT(score) FROM table_19072602_1 WHERE team_europe = "Mika Koivuniemi"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellv...
how many patients this year have received therapeutic antibacterials within 2 months after receiving glucocorticoid administration?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'glucocorticoid administration' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIM...
eicu
CREATE TABLE table_73860 ( "Constituency" text, "Candidate" text, "Affiliation" text, "Votes -cast" real, "Result - %" text, "Loss/gain" text )
Who as the candidate when the result - % was 2.9%?
SELECT "Candidate" FROM table_73860 WHERE "Result - %" = '2.9%'
wikisql
CREATE TABLE table_70731 ( "Year" text, "Qual" text, "Rank" text, "Finish" text, "Laps" text )
How many laps did Dick Rathmann complete when he ranked 14?
SELECT "Laps" FROM table_70731 WHERE "Rank" = '14'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
calculate how many times patient 030-80604 has undergone the procedure of abscess drainage - percutaneous during the first hospital visit.
SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-80604' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospit...
eicu
CREATE TABLE table_65257 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
Who is the home team when the away team is newcastle united?
SELECT "Home team" FROM table_65257 WHERE "Away team" = 'newcastle united'
wikisql
CREATE TABLE table_2886617_4 ( college_junior_club_team VARCHAR, nhl_team VARCHAR )
What team did the New York Rangers recruit a player from?
SELECT college_junior_club_team FROM table_2886617_4 WHERE nhl_team = "New York Rangers"
sql_create_context
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...
how is patient 655 first admitted to the hospital until 1 year ago?
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 655 AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE table_45200 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What date was Grimsby Town the away team?
SELECT "Date" FROM table_45200 WHERE "Away team" = 'grimsby town'
wikisql
CREATE TABLE table_69167 ( "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real )
What is the sum of all laps with rank 3?
SELECT COUNT("Laps") FROM table_69167 WHERE "Rank" = '3'
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 in elective admission type ?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE"
mimicsql_data
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 ...
凤雨筠这位患者之前会有哪些异常反应
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_info.XM = '凤雨筠'...
css
CREATE TABLE table_65551 ( "Position" real, "Gymnast" text, "A Score" real, "B Score" real, "Total" real )
What is their position when the b score is more than 8.975 for Ekaterina Kramarenko ( rus )?
SELECT "Position" FROM table_65551 WHERE "B Score" > '8.975' AND "Gymnast" = 'ekaterina kramarenko ( rus )'
wikisql
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,...
count the number of patients whose ethnicity is hispanic or latino and drug type is base?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE table_52203 ( "Rank" real, "Name" text, "Team" text, "Games" real, "Rebounds" real )
Which game did Bruesa GBC play in with fewer than 275 rebounds that is ranked less than 4?
SELECT SUM("Games") FROM table_52203 WHERE "Rank" < '4' AND "Rebounds" < '275' AND "Team" = 'bruesa gbc'
wikisql
CREATE TABLE table_name_70 ( record VARCHAR, attendance VARCHAR )
what game had an attendance of 21,629
SELECT record FROM table_name_70 WHERE attendance = "21,629"
sql_create_context
CREATE TABLE table_16248 ( "DVD Name" text, "# of Ep" real, "Region 1" text, "Region 2" text, "Region 4" text )
What DVD season/name for region 2 was released August 22, 2010?
SELECT "DVD Name" FROM table_16248 WHERE "Region 2" = 'August 22, 2010'
wikisql
CREATE TABLE table_203_482 ( id number, "year" number, "award" text, "result" text, "category" text, "series" text )
what was the only award that scrubs won for outstanding supporting actor in a comedy series ?
SELECT DISTINCT "award" FROM table_203_482 WHERE "result" = 'won' AND "category" = 'outstanding supporting actor in a comedy series'
squall
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...
根据不同的出院诊断疾病名字和科室名字,罗列出病人的平均年龄在这家医院5230823所有医疗就诊记录中都是多大?并且保留平均年龄大于二十九岁的记录
SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5230823' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_NM HAVING AVG(t_kc21.PERSON_AGE) > 29
css
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
查询在二零零六年一月五日二零一一年十二月三十日的这段时间里医院5091716有多少科室涉及的医疗费总额低于7482.56元
SELECT COUNT(*) FROM (SELECT qtb.MED_ORG_DEPT_CD FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '5091716' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-01-05' AND '2011-12-30' GROUP BY qtb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) < 7482.56 UNION SELECT gyb.MED_ORG_DEPT_CD FRO...
css
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
标本采集部位在检验报告单63570417818上都有什么?
SELECT BBCJBW FROM jybgb WHERE BGDH = '63570417818'
css
CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number, secretary_vote number, treasurer_vote number, class_president_vote number, class_senator_vote number ) CREATE TABLE student ( stuid number, ...
What are the distinct majors that students with treasurer votes are studying?
SELECT DISTINCT T1.major FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = T2.treasurer_vote
spider
CREATE TABLE table_name_69 ( place VARCHAR, points VARCHAR )
how many times was the points 18?
SELECT COUNT(place) FROM table_name_69 WHERE points = 18
sql_create_context
CREATE TABLE table_62331 ( "Month" text, "15th- 20th century" text, "U.S. (1912)" text, "U.S. (2013)" text, "Britain (2013)" text, "Hindu" text )
In 1912 when the U.S used sapphire, what was the Hindu birthstone?
SELECT "Hindu" FROM table_62331 WHERE "U.S. (1912)" = 'sapphire'
wikisql
CREATE TABLE performance ( Attendance INTEGER )
What is the average number of attendees for performances?
SELECT AVG(Attendance) FROM performance
sql_create_context
CREATE TABLE table_name_87 ( rank VARCHAR, year VARCHAR, ascent_time VARCHAR )
What was the rank of the rider whose ascent time was 43:24 before the year 2002?
SELECT COUNT(rank) FROM table_name_87 WHERE year < 2002 AND ascent_time = "43:24"
sql_create_context
CREATE TABLE table_2603017_2 ( bb___blind_bear VARCHAR, ba___running_bear VARCHAR )
what is bb - blind bear where ba - running bear is tc - tile chariot?
SELECT bb___blind_bear FROM table_2603017_2 WHERE ba___running_bear = "TC - Tile Chariot"
sql_create_context
CREATE TABLE table_50149 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What was the final score for the match where Hereford United was the home team?
SELECT "Score" FROM table_50149 WHERE "Home team" = 'hereford united'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medication...
when was the last time patient 006-40255 was prescribed 37.5 g tube : glucose 40 % po gel and nss 0.9% 500 ml bolus infusion until 9 months ago at the same time?
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = '37.5 g tube : glucose 40 % po gel' AND patient.uniquepid = '006-40255' AND DATETIME(medication.drugstarttime) <= DATETIME...
eicu
CREATE TABLE table_name_46 ( producer_s_ VARCHAR, length VARCHAR, track VARCHAR, songwriter_s_ VARCHAR )
Which Producer(s) has a Track smaller than 8, and a Songwriter(s) of hadise a kg z, yves jongen, and a Length of 3:08?
SELECT producer_s_ FROM table_name_46 WHERE track < 8 AND songwriter_s_ = "hadise açıkgöz, yves jongen" AND length = "3:08"
sql_create_context
CREATE TABLE table_70013 ( "Date" text, "City" text, "Country" text, "Venue" text, "Attendance" text )
When has a City of san jacinto, california?
SELECT "Date" FROM table_70013 WHERE "City" = 'san jacinto, california'
wikisql
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number...
frequency of repuation over 4k.
SELECT Reputation, COUNT(*) AS "#users_with_this_rep" FROM Users WHERE Reputation >= 4000 GROUP BY Reputation ORDER BY COUNT(*)
sede
CREATE TABLE table_4581 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
On which date was the venue at Windy Hill?
SELECT "Date" FROM table_4581 WHERE "Venue" = 'windy hill'
wikisql
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, Acc...
Total Number of Answers by User.
WITH UserAnswers AS (SELECT u.Id, u.DisplayName, COUNT(*) AS TotalAnswers FROM Users AS u JOIN Posts AS p ON u.Id = p.OwnerUserId AND p.PostTypeId = 2 GROUP BY u.Id, u.DisplayName) SELECT RANK() OVER (ORDER BY TotalAnswers DESC) AS Rank, DisplayName, TotalAnswers FROM UserAnswers ORDER BY TotalAnswers DESC
sede
CREATE TABLE table_name_81 ( player VARCHAR, year_s__won VARCHAR )
Who is the player that won in the year 1978?
SELECT player FROM table_name_81 WHERE year_s__won = "1978"
sql_create_context
CREATE TABLE table_name_97 ( episode VARCHAR, writer_s_ VARCHAR )
What episode was written by jonathan lewis?
SELECT episode FROM table_name_97 WHERE writer_s_ = "jonathan lewis"
sql_create_context
CREATE TABLE table_name_79 ( lead VARCHAR, third VARCHAR )
WHAT IS THE LEAD WITH THIRD AS TARA GEORGE?
SELECT lead FROM table_name_79 WHERE third = "tara george"
sql_create_context
CREATE TABLE table_19383 ( "Country" text, "Local Name" text, "Host" text, "Channel" text, "Year Aired" text, "Top Prize" text )
What channel had the prize of 100,000?
SELECT "Channel" FROM table_19383 WHERE "Top Prize" = '€100,000'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
从20年3月29日到21年7月14日,患者周方方,总胆红素三代这个指标怎么样
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJG...
css
CREATE TABLE table_name_39 ( position VARCHAR, round VARCHAR, college VARCHAR )
What is the position for round 5 from alabama state?
SELECT position FROM table_name_39 WHERE round = 5 AND college = "alabama state"
sql_create_context
CREATE TABLE table_20554 ( "Vehicle" text, "EPA rated All-electric range" text, "EPA rated combined fuel economy" text, "Alaska ( Juneau )" text, "California (San Francisco)" text, "Mid-Atlantic South (Washington, D.C.)" text, "U.S. national average electric mix" text, "Southeast (Atlant...
How many Ford Focus electric vehicle emission test scores were recorded in California?
SELECT COUNT("California (San Francisco)") FROM table_20554 WHERE "Vehicle" = 'Ford Focus Electric'
wikisql
CREATE TABLE table_203_59 ( id number, "country" text, "2000" number, "2001" number, "2002" number, "2003" number, "2004" number, "2005" number, "2006" number, "2007" number, "2008" number, "2009" number, "2010" number, "2011" number )
a total of how many -lrb- t -rrb- of niobium was produced in the world in the year 2000 ?
SELECT "2000" FROM table_203_59 WHERE "country" = 'world'
squall
CREATE TABLE table_52785 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What is the score of Colorado when they were a visitor and had a Smith decision?
SELECT "Score" FROM table_52785 WHERE "Decision" = 'smith' AND "Visitor" = 'colorado'
wikisql
CREATE TABLE table_54574 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When the Away team of essendon was playing, what was the Home team's score?
SELECT "Home team score" FROM table_54574 WHERE "Away team" = 'essendon'
wikisql
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 prescriptions...
how many patients whose admission year is less than 2157 and procedure long title is open reduction of fracture with internal fixation, femur?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2157" AND procedures.long_title = "Open reduction of fracture with internal fixation, femur"
mimicsql_data
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
在那些和编号为83066305680的检验指标记录有着一样的检测指标名称以及检测指标结果定量单位的记录上,有着哪些检测指标结果定量不大于那个检验指标记录的情况呢?
SELECT * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '83066305680') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '83066305680') AND JCZBJGDL <= (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '83066305680')
css
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, ...
in 2105 how many patients have undergone other bronchoscopy in the same month after being diagnosed with herpes zoster nos?
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 = 'herpes zoster nos'...
mimic_iii
CREATE TABLE table_67361 ( "Name" text, "Species Authority" text, "Order" text, "Family" text, "Red List" real )
What order has the Species Authority of hydrochaeris hydrochaeris (linnaeus, 1766)?
SELECT "Order" FROM table_67361 WHERE "Species Authority" = 'hydrochaeris hydrochaeris (linnaeus, 1766)'
wikisql
CREATE TABLE table_1404456_1 ( code INTEGER, area__km_2__ VARCHAR )
what is the minimum code with area (km 2 ) being 12,245.9
SELECT MIN(code) FROM table_1404456_1 WHERE area__km_2__ = "12,245.9"
sql_create_context
CREATE TABLE table_name_33 ( date VARCHAR, result VARCHAR )
On what date was the Result 1-0?
SELECT date FROM table_name_33 WHERE result = "1-0"
sql_create_context
CREATE TABLE table_name_90 ( date VARCHAR, record VARCHAR )
What is the date of the game with a 17-31 record?
SELECT date FROM table_name_90 WHERE record = "17-31"
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
62067408977的医疗就诊里用到的药品446311是哪种收费项目等级
SELECT CHA_ITEM_LEV FROM t_kc22 WHERE MED_CLINIC_ID = '62067408977' AND SOC_SRT_DIRE_CD = '446311'
css
CREATE TABLE table_name_20 ( res VARCHAR, record VARCHAR )
Which result has a Record of 16-6?
SELECT res FROM table_name_20 WHERE record = "16-6"
sql_create_context
CREATE TABLE table_25649467_2 ( series__number VARCHAR, season__number VARCHAR )
When 12 is the season number how many series numbers are there?
SELECT COUNT(series__number) FROM table_25649467_2 WHERE season__number = 12
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId ...
TensorFlow: number of askers over time.
SELECT OwnerUserId, MIN(CreationDate), ROW_NUMBER() OVER (ORDER BY MIN(CreationDate)) AS AskerCount FROM Posts WHERE Tags LIKE '%<tensorflow>%' GROUP BY OwnerUserId ORDER BY MIN(CreationDate)
sede
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
从2004年3月27到日2006年6月22日,患者柏德华一共买了多少次西药?
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '柏德华' AND t_kc22.STA_DATE BETWEEN '2004-03-27' AND '2006-06-22' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjz...
css
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE ...
Are all classes available this Spring-Summer ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND semester.semester = 'Spring-Summer' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE table_name_57 ( country VARCHAR, rank VARCHAR )
Which country is ranked 24?
SELECT country FROM table_name_57 WHERE rank = "24"
sql_create_context
CREATE TABLE table_26136228_3 ( written_by VARCHAR, us_viewers__millions_ VARCHAR )
Who wrote the episode that had 1.08 million U.S. viewers?
SELECT written_by FROM table_26136228_3 WHERE us_viewers__millions_ = "1.08"
sql_create_context
CREATE TABLE table_18373863_2 ( fcsl_team VARCHAR, mlb_team VARCHAR )
When toronto blue jays are the mlb team who are the fscl team?
SELECT fcsl_team FROM table_18373863_2 WHERE mlb_team = "Toronto Blue Jays"
sql_create_context
CREATE TABLE table_name_28 ( score VARCHAR, player VARCHAR )
What is the Score that has a Player of Ernie Els?
SELECT score FROM table_name_28 WHERE player = "ernie els"
sql_create_context
CREATE TABLE player ( Team VARCHAR, School_ID VARCHAR ) CREATE TABLE school ( Location VARCHAR, School_ID VARCHAR )
For each player, show the team and the location of school they belong to.
SELECT T1.Team, T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_tit...
what is the weight variation of patient 2518 last measured on the current hospital visit compared to the first value measured on the current hospital visit?
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2518 AND admissions.dischtime IS NULL)) AND chartevents.itemid IN (SELECT d_items.itemid FROM ...
mimic_iii
CREATE TABLE table_1108394_34 ( the_bronx VARCHAR, total VARCHAR )
What number of voters did the Bronx have when the total number was 2054?
SELECT the_bronx FROM table_1108394_34 WHERE total = 2054
sql_create_context