context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE zzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
从2005年12月14日至2010年2月5日这期间里,编码为98519847的患者曾在医院就诊多少次?
SELECT (SELECT COUNT(*) FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '98519847' AND zzmzjzjlb.JZKSRQ BETWEEN '2005-12-14' AND '2010-02-05' UNION SELECT COUNT(*) FROM hz_info JOIN fzzmzjzjlb ON hz_info.YLJGDM = fzzmzjz...
css
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Questions which no longer have the given tag (but had it at some point).
SELECT DISTINCT Posts.Id AS "post_link", url = 'site://posts/' + CAST(Posts.Id AS TEXT) + '/revisions', Posts.CreationDate, Posts.LastActivityDate FROM PostHistory INNER JOIN Posts ON PostHistory.PostId = Posts.Id WHERE PostHistory.PostHistoryTypeId IN (3, 6, 9) AND PostHistory.Text LIKE '%<##tagName##>%' AND NOT (Post...
sede
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, ...
门诊给水晓凡这个患者诊断为糖尿病,看看游离前列腺特异性抗原的检测结果定量还有单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jy...
css
CREATE TABLE table_name_95 ( air_date VARCHAR, episode VARCHAR )
What was the air date of 'Gary tries to do it all'?
SELECT air_date FROM table_name_95 WHERE episode = "gary tries to do it all"
sql_create_context
CREATE TABLE table_51305 ( "Outcome" text, "Year" real, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text )
what is the score when the outcome is runner-up, the opponent in the final is herbert lawford and the year is after 1882?
SELECT "Score" FROM table_51305 WHERE "Year" > '1882' AND "Outcome" = 'runner-up' AND "Opponent in the final" = 'herbert lawford'
wikisql
CREATE TABLE table_66724 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Extra" text )
Result of 1st, and an Extra of 4 x 400 m relay is in what lowest year?
SELECT MIN("Year") FROM table_66724 WHERE "Result" = '1st' AND "Extra" = '4 x 400 m relay'
wikisql
CREATE TABLE table_20745685_1 ( opponent VARCHAR, date VARCHAR )
Who was the opponent on February 28, 1991
SELECT opponent FROM table_20745685_1 WHERE date = "February 28, 1991"
sql_create_context
CREATE TABLE table_35665 ( "School Year" text, "Class A" text, "Class AA" text, "Class AAA" text, "Class AAAA" text, "Class AAAAA" text )
Which AAA class has Fort Bend Dulles as a Class AAAAA?
SELECT "Class AAA" FROM table_35665 WHERE "Class AAAAA" = 'fort bend dulles'
wikisql
CREATE TABLE table_38845 ( "Rank" real, "Name" text, "Attempts" real, "Net Yds" real, "Yds/Att" real, "Year" real )
What is the lowest Rank when Attempts was 319, and the Year was larger than 2000?
SELECT MIN("Rank") FROM table_38845 WHERE "Attempts" = '319' AND "Year" > '2000'
wikisql
CREATE TABLE table_63920 ( "Club" text, "Wins" real, "Losses" real, "Draws" real, "Against" real )
what is the average wins when draws is less than 0?
SELECT AVG("Wins") FROM table_63920 WHERE "Draws" < '0'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
How many questions and answers are posted until 2019?.
SELECT SUM(CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END) AS Number_of_Questions, SUM(CASE WHEN PostTypeId = 2 THEN 1 ELSE 0 END) AS Number_of_Answers FROM Posts WHERE CreationDate < '2019-01-01'
sede
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId num...
Server Fault posts linked to from SO.
SELECT COUNT(*) FROM Posts WHERE Body LIKE '%.serverfault.com%' AND CreationDate > CURRENT_TIMESTAMP() - 30
sede
CREATE TABLE table_16581695_3 ( original_airdate VARCHAR, production_code VARCHAR )
How many days are associated with production code 210?
SELECT COUNT(original_airdate) FROM table_16581695_3 WHERE production_code = 210
sql_create_context
CREATE TABLE table_24915874_1 ( jockey VARCHAR, weight__kg_ VARCHAR )
For which jockey was the weight in kg 53.5?
SELECT jockey FROM table_24915874_1 WHERE weight__kg_ = "53.5"
sql_create_context
CREATE TABLE table_name_48 ( number INTEGER, college VARCHAR )
What is the lowest Number, when College is 'University of Alabama'?
SELECT MIN(number) FROM table_name_48 WHERE college = "university of alabama"
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
褚芳芳这个病人在2013-05-19之后在哪些门诊做过检验报告?查一下这些门诊就诊的流水号
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND pers...
css
CREATE TABLE table_29489 ( "No." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
Name who directed when the viewers is 5.86
SELECT "Directed by" FROM table_29489 WHERE "U.S. viewers (million)" = '5.86'
wikisql
CREATE TABLE table_55194 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When did a home team score 9.6 (60)?
SELECT "Date" FROM table_55194 WHERE "Home team score" = '9.6 (60)'
wikisql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
For those employees who did not have any job in the past, return a scatter chart about the correlation between employee_id and department_id .
SELECT EMPLOYEE_ID, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE table_name_26 ( date_of_birth__age_ VARCHAR, club_province VARCHAR, position VARCHAR )
What is the date of birth for the player from Ulster and plays at Centre position?
SELECT date_of_birth__age_ FROM table_name_26 WHERE club_province = "ulster" AND position = "centre"
sql_create_context
CREATE TABLE table_name_36 ( ofsted_number INTEGER, type VARCHAR, intake VARCHAR )
Can you tell me the highest Ofsted number that has the Type of infants, and the Intake larger than 60?
SELECT MAX(ofsted_number) FROM table_name_36 WHERE type = "infants" AND intake > 60
sql_create_context
CREATE TABLE gas_station ( Station_ID int, Open_Year int, Location text, Manager_Name text, Vice_Manager_Name text, Representative_Name text ) CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_billion real, Pr...
what are the main indstries and total market value for each industry?, and order by the x-axis in desc.
SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry ORDER BY Main_Industry DESC
nvbench
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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 ) ...
what is the total production of urine out foley that patient 76327 has in yesterday?
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 = 76327)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'uri...
mimic_iii
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientuni...
did patient 030-80604 have any procedure during the last year?
SELECT COUNT(*) > 0 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 DATETIME(treatment.treatmenttime, 'start of year') = DATETI...
eicu
CREATE TABLE table_1004033_1 ( team VARCHAR, draft_pick__number VARCHAR )
How many teams had a #1 draft pick that won the Rookie of the Year Award?
SELECT COUNT(team) FROM table_1004033_1 WHERE draft_pick__number = "1"
sql_create_context
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE DEPARTME...
How many credits does the department offer Show bar chart, and order from high to low by the X-axis.
SELECT DEPT_CODE, SUM(CRS_CREDIT) FROM COURSE GROUP BY DEPT_CODE ORDER BY DEPT_CODE DESC
nvbench
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 first names and last names of the students who are 18 years old and have vice president votes.
SELECT DISTINCT T1.fname, T1.lname FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = T2.vice_president_vote WHERE T1.age = 18
spider
CREATE TABLE table_27274566_2 ( division VARCHAR, result VARCHAR )
What is the division where the result was 0 2?
SELECT division FROM table_27274566_2 WHERE result = "0–2"
sql_create_context
CREATE TABLE table_204_223 ( id number, "party" text, "previous council" number, "staying councillors" number, "seats up for election" number, "election result" number, "new council" number )
which party had more staying councilors ?
SELECT "party" FROM table_204_223 ORDER BY "staying councillors" DESC LIMIT 1
squall
CREATE TABLE table_name_30 ( league_a VARCHAR, years VARCHAR )
What is the League a for 1908 1928?
SELECT league_a FROM table_name_30 WHERE years = "1908–1928"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
count the number of patients whose admission type is urgent and drug route is td?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.route = "TD"
mimicsql_data
CREATE TABLE table_54335 ( "Area" text, "Name" text, "Zone" text, "Group(s)" real, "Parties" real, "Max People" real, "Camp Type" text )
Which zone has max capacity of 23 in a group under 2 at Robbers Roost?
SELECT "Zone" FROM table_54335 WHERE "Max People" > '23' AND "Group(s)" < '2' AND "Name" = 'robbers roost'
wikisql
CREATE TABLE table_1213511_7 ( position VARCHAR, player VARCHAR )
what are all the position where player is al simmons
SELECT position FROM table_1213511_7 WHERE player = "Al Simmons"
sql_create_context
CREATE TABLE table_name_46 ( decile INTEGER, roll VARCHAR, years VARCHAR, authority VARCHAR )
What is the largest Decile with Years of 1 8, anAuthority of state, and a Roll of 141?
SELECT MAX(decile) FROM table_name_46 WHERE years = "1–8" AND authority = "state" AND roll = 141
sql_create_context
CREATE TABLE table_2668405_17 ( district VARCHAR, candidates VARCHAR )
What is the district with the candidates leven powell (f) 63.8% roger west (dr) 36.4%?
SELECT district FROM table_2668405_17 WHERE candidates = "Leven Powell (F) 63.8% Roger West (DR) 36.4%"
sql_create_context
CREATE TABLE table_204_261 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
which nation ranked in first with the most amount of total medals ?
SELECT "nation" FROM table_204_261 ORDER BY "total" DESC LIMIT 1
squall
CREATE TABLE qtb ( 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...
查一下医院7159417各科室的编码和名称及住院的平均时长,然后按平均住院时长升序排列这些信息
SELECT qtb.MED_ORG_DEPT_CD, qtb.MED_ORG_DEPT_NM, AVG(qtb.IN_HOSP_DAYS) FROM qtb WHERE qtb.MED_SER_ORG_NO = '7159417' GROUP BY qtb.MED_ORG_DEPT_CD ORDER BY AVG(qtb.IN_HOSP_DAYS) UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.MED_ORG_DEPT_NM, AVG(gyb.IN_HOSP_DAYS) FROM gyb WHERE gyb.MED_SER_ORG_NO = '7159417' GROUP BY gyb.MED_ORG...
css
CREATE TABLE table_24269 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
What is the smallest pick number for McGill?
SELECT MIN("Pick #") FROM table_24269 WHERE "College" = 'McGill'
wikisql
CREATE TABLE table_57068 ( "Grand Prix" text, "Date" text, "Location" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Constructor" text, "Report" text )
Who had the fastest lap of the race that Ayrton Senna won on 23 April?
SELECT "Fastest Lap" FROM table_57068 WHERE "Winning Driver" = 'ayrton senna' AND "Date" = '23 april'
wikisql
CREATE TABLE table_20666 ( "Code" real, "County" text, "Former Province" text, "Area (km 2 )" text, "Population Census 2009" real, "Capital" text )
How many numbers were listed under area with a population of 240075 as of 2009?
SELECT COUNT("Area (km 2 )") FROM table_20666 WHERE "Population Census 2009" = '240075'
wikisql
CREATE TABLE table_77417 ( "Rank" text, "Nation" text, "Gold" text, "Silver" text, "Bronze" text, "Total" text )
What is the number of gold medals when the number of bronze medals is 8?
SELECT "Gold" FROM table_77417 WHERE "Bronze" = '8'
wikisql
CREATE TABLE table_14737 ( "Unit" text, "Reactor type" text, "Net capacity" text, "Gross capacity" text, "Construction started" text, "Electricity grid" text, "Commercial operation" text, "Shutdown" text )
What was the net capacity with a gross capacity of 1,126 mw, and a Unit of tianwan-4?
SELECT "Net capacity" FROM table_14737 WHERE "Gross capacity" = '1,126 mw' AND "Unit" = 'tianwan-4'
wikisql
CREATE TABLE table_40918 ( "Title" text, "Director" text, "Producer" text, "Production Cost" text, "Singapore Gross" text )
For the directed by 1991, what was the gross in Singapore?
SELECT "Singapore Gross" FROM table_40918 WHERE "Director" = '1991'
wikisql
CREATE TABLE table_name_52 ( status VARCHAR, against VARCHAR )
Which status has an against of 35?
SELECT status FROM table_name_52 WHERE against = 35
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, ...
what is the percentile of 3.83 in a lab test of rbc given the same age of patient 027-142451 during their current hospital encounter?
SELECT DISTINCT t1.c1 FROM (SELECT lab.labresult, PERCENT_RANK() OVER (ORDER BY lab.labresult) AS c1 FROM lab WHERE lab.labname = 'rbc' AND lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age = (SELECT patient.age FROM patient WHERE patient.uniquepid = '027-142451' AND patient.hosp...
eicu
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, ...
之前患者62748683的就诊医院是哪里
SELECT wdmzjzjlb.YLJGDM FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '62748683' UNION SELECT bdmzjzjlb.YLJGDM FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND hz_info.KH = bdmzjzjlb.KH AND hz_info....
css
CREATE TABLE table_14038363_1 ( position VARCHAR, player VARCHAR )
What is Maksim Botin's position?
SELECT position FROM table_14038363_1 WHERE player = "Maksim Botin"
sql_create_context
CREATE TABLE table_18933037_3 ( b_52_model VARCHAR, unit VARCHAR )
When 441st bs, 7th bw is the unit what is the b-52 model?
SELECT b_52_model FROM table_18933037_3 WHERE unit = "441st BS, 7th BW"
sql_create_context
CREATE TABLE table_14813 ( "Office" text, "Representative" text, "Party" text, "Residence" text, "First Elected" text )
Which Office has a Party of dem, and a First Elected of 1991 ?
SELECT "Office" FROM table_14813 WHERE "Party" = 'dem' AND "First Elected" = '1991†'
wikisql
CREATE TABLE table_name_55 ( against VARCHAR, venue VARCHAR, date VARCHAR )
What is Against, when Venue is 'Twickenham , London', and when Date is '04/03/2000'?
SELECT against FROM table_name_55 WHERE venue = "twickenham , london" AND date = "04/03/2000"
sql_create_context
CREATE TABLE enzyme ( id number, name text, location text, product text, chromosome text, omim number, porphyria text ) CREATE TABLE medicine ( id number, name text, trade_name text, fda_approved text ) CREATE TABLE medicine_enzyme_interaction ( enzyme_id number, me...
What is the count of enzymes without any interactions?
SELECT COUNT(*) FROM enzyme WHERE NOT id IN (SELECT enzyme_id FROM medicine_enzyme_interaction)
spider
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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time,...
what are the three diagnoses with the lowest three year survival rate?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt...
mimic_iii
CREATE TABLE table_name_40 ( round VARCHAR, method VARCHAR )
What is Round, when Method is 'submission (reverse armbar)'?
SELECT round FROM table_name_40 WHERE method = "submission (reverse armbar)"
sql_create_context
CREATE TABLE table_16451 ( "1932 (before recount)" text, "party" text, "Manhattan" text, "The Bronx" text, "Brooklyn" text, "Queens" text, "Richmond [Staten Is.]" text, "Total" real, "%" text )
what's the brooklyn with queens value of 16.8%
SELECT "Brooklyn" FROM table_16451 WHERE "Queens" = '16.8%'
wikisql
CREATE TABLE table_name_88 ( losses INTEGER, goals_against VARCHAR, wins VARCHAR )
What is the average loss with a goal higher than 51 and wins higher than 14?
SELECT AVG(losses) FROM table_name_88 WHERE goals_against > 51 AND wins > 14
sql_create_context
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 mzjzjlb.SG, mzjzjlb.TZ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX...
css
CREATE TABLE table_49820 ( "Name" text, "Built" text, "Listed" text, "Location" text, "County" text )
Which county built a bridge in 1934?
SELECT "County" FROM table_49820 WHERE "Built" = '1934'
wikisql
CREATE TABLE table_26769_1 ( area__km²___per_sqmi_ VARCHAR, population_density_per_km² VARCHAR )
What was the area (km ) (per sqmi) of a country with a population density per km of 8.4/km (/sqmi)?
SELECT area__km²___per_sqmi_ FROM table_26769_1 WHERE population_density_per_km² = "8.4/km² (/sqmi)"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
How many patients were diagnosed with hemorrhagic complications and had lab test category as chemistry?
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.short_title = "Hemorrhage complic proc" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
CREATE TABLE table_name_65 ( label VARCHAR, catalog VARCHAR )
Which label has the catalog CDZAP22?
SELECT label FROM table_name_65 WHERE catalog = "cdzap22"
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...
count the number of patients whose admission type is newborn and diagnoses long title is unspecified erythematous condition?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "NEWBORN" AND diagnoses.long_title = "Unspecified erythematous condition"
mimicsql_data
CREATE TABLE table_38975 ( "Preseason" text, "Week 1 Aug 26" text, "Week 2 Sept 2" text, "Week 3 Sept 8" text, "Week 4 Sept 15" text, "Week 5 Sept 22" text, "Week 6 Sept 29" text, "Week 7 Oct 6" text, "Week 8 Oct 13" text, "Week 9 Oct 20" text, "Week 10 Oct 27" text, "Wee...
What is listed for the Week 3 Sept 8 that has a Week 2 Sept 2 of Florida State (2-0) (4)?
SELECT "Week 3 Sept 8" FROM table_38975 WHERE "Week 2 Sept 2" = 'florida state (2-0) (4)'
wikisql
CREATE TABLE table_33496 ( "Date" text, "Name" text, "Party" text, "Province" text, "Details" text )
What are the details for John Buchanan?
SELECT "Details" FROM table_33496 WHERE "Name" = 'john buchanan'
wikisql
CREATE TABLE table_66182 ( "Year" real, "LPGA wins" real, "Earnings ($)" real, "Money list rank" real, "Average" real )
In 2005 the earnings is less than 615,499 with less than 2 LPGA wins and what smallest Money list rank?
SELECT MIN("Money list rank") FROM table_66182 WHERE "LPGA wins" < '2' AND "Year" = '2005' AND "Earnings ($)" < '615,499'
wikisql
CREATE TABLE table_33010 ( "Region" text, "Host" text, "Venue" text, "City" text, "State" text )
What venue is in Santa Barbara, California?
SELECT "Venue" FROM table_33010 WHERE "State" = 'california' AND "City" = 'santa barbara'
wikisql
CREATE TABLE table_50412 ( "Branding" text, "Callsign" text, "Frequency" text, "Power (kW)" text, "Location" text )
Which frequency has 40kw power?
SELECT "Frequency" FROM table_50412 WHERE "Power (kW)" = '40kw'
wikisql
CREATE TABLE table_name_21 ( date VARCHAR, format VARCHAR )
What date was the release when the format was lp?
SELECT date FROM table_name_21 WHERE format = "lp"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
统计医疗机构5779181处理过多少新生儿门诊,在一四年十二月十一日到一八年四月十八日的这几年里
SELECT COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.YLJGDM = '5779181' AND txmzjzjlb.JZKSRQ BETWEEN '2014-12-11' AND '2018-04-18' AND txmzjzjlb.ZSEBZ > 0 UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.YLJGDM = '5779181' AND ftxmzjzjlb.JZKSRQ BETWEEN '2014-12-11' AND '2018-04-18' AND ftxmzjzjlb.ZSEBZ > 0
css
CREATE TABLE table_57019 ( "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text )
What's the race name that the driver Innes Ireland won?
SELECT "Race Name" FROM table_57019 WHERE "Winning driver" = 'innes ireland'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
find the number of male patients who stayed in the hospital for more than 69 days.
SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.days_stay = "69"
mimicsql_data
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 correlation between manufacturer and code , and group by attribute name in a scatter chart.
SELECT T1.Manufacturer, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name
nvbench
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number,...
what is the monthly minimum value of patient 63849's ph since 98 months ago?
SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 63849) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ph') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-98 mon...
mimic_iii
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, ...
Users with a Website or AboutMe - IDs <248532.
SELECT * FROM Users WHERE (LENGTH(WebsiteUrl) > 0 OR LENGTH(AboutMe) > 0) AND Id < 248532 ORDER BY Id
sede
CREATE TABLE table_33109 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who is the home team at brunswick street oval?
SELECT "Home team" FROM table_33109 WHERE "Venue" = 'brunswick street oval'
wikisql
CREATE TABLE table_23319 ( "Vehicle Category" text, "Till Aligarh" real, "Till Mathura" real, "Till Agra" real, "For Round Trip" real )
What kind of vehicle is the agra 1050?
SELECT "Vehicle Category" FROM table_23319 WHERE "Till Agra" = '1050'
wikisql
CREATE TABLE table_name_81 ( home_team VARCHAR, venue VARCHAR )
In the game at Glenferrie Oval, what is the home team score?
SELECT home_team AS score FROM table_name_81 WHERE venue = "glenferrie oval"
sql_create_context
CREATE TABLE table_71986 ( "Outcome" text, "Date" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
What was Olga Govortsova's score when she played on a clay surface on 19 May 2008?
SELECT "Score" FROM table_71986 WHERE "Surface" = 'clay' AND "Date" = '19 may 2008'
wikisql
CREATE TABLE table_name_55 ( series_ep VARCHAR, netflix VARCHAR )
Which series episode has a Netflix episode of S03E16?
SELECT series_ep FROM table_name_55 WHERE netflix = "s03e16"
sql_create_context
CREATE TABLE table_20466 ( "Cartridge" text, "Bullet weight" text, "Muzzle velocity" text, "Muzzle energy" text, "Source" text )
When using a .375 Remington Ultra Magnum, what is the muzzle velocity?
SELECT "Muzzle velocity" FROM table_20466 WHERE "Cartridge" = '.375 Remington Ultra Magnum'
wikisql
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId numb...
Posts by month, for all math.se moderator election nominees.
SELECT Users.DisplayName, COUNT(*) AS Posts, CAST(TIME_TO_STR(p.CreationDate, '%Y.%m.%d') AS TEXT(7)) AS Month FROM Posts AS p JOIN Users ON Users.Id = p.OwnerUserId WHERE p.OwnerUserId IN (8173, 62278, 8348, 15416, 45760, 23353, 21674, 14082, 25805, 34662, 12952) GROUP BY CAST(TIME_TO_STR(p.CreationDate, '%Y.%m.%d') A...
sede
CREATE TABLE table_name_35 ( wchmp VARCHAR, race VARCHAR, pole VARCHAR )
What's the WChmp of the race greater than 42 and pole greater than 11?
SELECT COUNT(wchmp) FROM table_name_35 WHERE race > 42 AND pole > 11
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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 ) CR...
what is the monthly maximum amount of wbc of patient 95235 since 04/2102?
SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95235) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'wbc') AND STRFTIME('%y-%m', labevents.charttime) >= '2102-04' GROUP BY STRF...
mimic_iii
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
68054249569的检验报告单,其标本是采集的哪个部位
SELECT BBCJBW FROM jybgb WHERE BGDH = '68054249569'
css
CREATE TABLE table_name_50 ( rank INTEGER, silver VARCHAR, total VARCHAR, bronze VARCHAR )
What is the rank for total less than 5, 1 bronze and less than 1 silver?
SELECT AVG(rank) FROM table_name_50 WHERE total < 5 AND bronze = 1 AND silver < 1
sql_create_context
CREATE TABLE apartments ( apt_id number, building_id number, apt_type_code text, apt_number text, bathroom_count number, bedroom_count number, room_count text ) CREATE TABLE apartment_facilities ( apt_id number, facility_code text ) CREATE TABLE apartment_buildings ( building_i...
Show the apartment type codes and apartment numbers in the buildings managed by 'Kyle'.
SELECT T2.apt_type_code, T2.apt_number FROM apartment_buildings AS T1 JOIN apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_manager = "Kyle"
spider
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...
看看患者05968496的医疗记录中哪几次开的药品金额超过6385.54元?列出医疗就诊编码
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '05968496' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT > 6385.54)
css
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...
specify the gender and icd9 code for patient id 2560
SELECT demographic.gender, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_26167 ( "Represented" text, "Contestant" text, "Age" real, "Height (in.)" text, "Height (cm.)" real, "Hometown" text )
What is the height in inches if the represented is Erongo?
SELECT "Height (in.)" FROM table_26167 WHERE "Represented" = 'Erongo'
wikisql
CREATE TABLE table_46613 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text )
What is the Verb meaning when part 1 is alan?
SELECT "Verb meaning" FROM table_46613 WHERE "Part 1" = 'alan'
wikisql
CREATE TABLE Catalogs ( catalog_id INTEGER, catalog_name VARCHAR(50), catalog_publisher VARCHAR(80), date_of_publication DATETIME, date_of_latest_revision DATETIME ) CREATE TABLE Catalog_Structure ( catalog_level_number INTEGER, catalog_id INTEGER, catalog_level_name VARCHAR(50) ) CREA...
What are the name and level of catalog structure with level number between 5 and 1. Show bar chart.
SELECT catalog_level_name, catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10
nvbench
CREATE TABLE table_78395 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/junior/club team (league)" text )
What College/junior/club team (league) did mitch fadden play for?
SELECT "College/junior/club team (league)" FROM table_78395 WHERE "Player" = 'mitch fadden'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Questions with answers that score higher than the accepted answer.
SELECT COUNT(DISTINCT question.Id) AS "low_score_accepted" FROM Posts AS question INNER JOIN Posts AS accepted ON question.AcceptedAnswerId = accepted.Id INNER JOIN Posts AS higher ON question.Id = higher.ParentId WHERE higher.Score > accepted.Score
sede
CREATE TABLE table_204_996 ( id number, "no." text, "air date" text, "network" text, "household\nrating" number, "viewers\n(millions)" text )
which awards ceremony had the same number of viewers as the 18th ?
SELECT "no." FROM table_204_996 WHERE "no." <> 18 AND "viewers\n(millions)" = (SELECT "viewers\n(millions)" FROM table_204_996 WHERE "no." = 18)
squall
CREATE TABLE table_name_19 ( year INTEGER, round_1 VARCHAR, money__$_ VARCHAR )
Round 1 of 66, and a Money ($) larger than 400,000 has what sum of year?
SELECT SUM(year) FROM table_name_19 WHERE round_1 = "66" AND money__$_ > 400 OFFSET 000
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 d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text )...
what was the name of the drug, which was prescribed to patient 25796 for the last time in the last hospital visit?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25796 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE table_23248869_8 ( date VARCHAR, high_points VARCHAR )
How many times was the high points david lee (30)
SELECT COUNT(date) FROM table_23248869_8 WHERE high_points = "David Lee (30)"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CRE...
give the total amount of crystalloids given to patient 013-12480 until 338 days ago.
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-12480')) AND intakeoutput.celllabel = 'cryst...
eicu
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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime ti...
since 6 years ago, what are the four most frequent drugs prescribed within 2 months to the female patients aged 20s after they have been diagnosed with single lb in-hosp w/o cs?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 ...
mimic_iii
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Most viewed posts with tags became synonyms.
WITH Raw AS (SELECT TagName FROM Tags INTERSECT SELECT SourceTagName AS TagName FROM TagSynonyms WHERE NOT ApprovalDate IS NULL) SELECT DENSE_RANK() OVER (ORDER BY Posts.ViewCount DESC) AS N, Posts.Id AS "post_link", Posts.ViewCount, 'site://tags/' + TagSynonyms.SourceTagName + '|' + TagSynonyms.SourceTagName AS Source...
sede
CREATE TABLE table_29782 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Which game was played on October 13?
SELECT MAX("Game") FROM table_29782 WHERE "Date" = 'October 13'
wikisql