context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_25684 ( "Autonomous Community" text, "Organization" text, "Television Channels" text, "Radio Stations" text, "Foundation" real )
Which of the radio stations has the organization of ente p blico radio televisi n madrid (eprtvm)?
SELECT "Radio Stations" FROM table_25684 WHERE "Organization" = 'Ente Público Radio Televisión Madrid (EPRTVM)'
wikisql
CREATE TABLE table_32074 ( "Tournament" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
What is the value for 2012 when the value for 2009 is 1R and the vale for 2007 is 2R?
SELECT "2012" FROM table_32074 WHERE "2009" = '1r' AND "2007" = '2r'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
what is gender of subject name kelly gallardo?
SELECT demographic.gender FROM demographic WHERE demographic.name = "Kelly Gallardo"
mimicsql_data
CREATE TABLE table_19589113_5 ( male_population_2001 VARCHAR, growth_rate_1991_01 VARCHAR )
What are all values for the male population in 2001 with a growth rate in 1991-01 of 36.16?
SELECT male_population_2001 FROM table_19589113_5 WHERE growth_rate_1991_01 = "36.16"
sql_create_context
CREATE TABLE table_28913 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
What is every district for incumbent Joseph Desha?
SELECT "District" FROM table_28913 WHERE "Incumbent" = 'Joseph Desha'
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...
provide the number of patients whose age is less than 56 and procedure icd9 code is 3533?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "56" AND procedures.icd9_code = "3533"
mimicsql_data
CREATE TABLE table_61518 ( "Score" text, "Pos." real, "Inn." real, "Venue" text, "H/A/N" text )
What is the position with a neutral H/A/N and more than 2 innings?
SELECT AVG("Pos.") FROM table_61518 WHERE "H/A/N" = 'neutral' AND "Inn." > '2'
wikisql
CREATE TABLE table_261642_3 ( c__nf_km_ VARCHAR, l__mh_km_ VARCHAR )
what is the c (nf/km) when the l (mh/km) is 0.6099?
SELECT c__nf_km_ FROM table_261642_3 WHERE l__mh_km_ = "0.6099"
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, ...
list the monthly minimum heartrate value of patient 030-67523.
SELECT MIN(vitalperiodic.heartrate) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-67523')) AND NOT vitalperiodic.heartrate IS NULL...
eicu
CREATE TABLE table_4862 ( "Round" real, "Overall" real, "Player" text, "Position" text, "School/Club Team" text )
What round is highest and has a defensive tackle position and overall lower than 282?
SELECT MAX("Round") FROM table_4862 WHERE "Position" = 'defensive tackle' AND "Overall" < '282'
wikisql
CREATE TABLE Customers ( customer_id INTEGER, coupon_id INTEGER, good_or_bad_customer VARCHAR(4), first_name VARCHAR(80), last_name VARCHAR(80), gender_mf VARCHAR(1), date_became_customer DATETIME, date_last_hire DATETIME ) CREATE TABLE View_Product_Availability ( product_id INTEGER...
What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check, and count them by a bar chart
SELECT payment_date, COUNT(payment_date) FROM Payments WHERE amount_paid > 300 OR payment_type_code = 'Check'
nvbench
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperio...
what are the top four most frequent diagnoses which patients were given in the same hospital visit after undergoing treatment of hypernatremia since 2104?
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'treat...
eicu
CREATE TABLE table_77959 ( "Team" text, "Played" real, "Drew" real, "Lost" real, "Against" real, "Difference" real, "Points" real )
What is the most lost games for the team with a difference smaller than 86 and points of 32?
SELECT MAX("Lost") FROM table_77959 WHERE "Points" = '32' AND "Difference" < '86'
wikisql
CREATE TABLE table_8551 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real )
What country won in 2004?
SELECT "Country" FROM table_8551 WHERE "Year(s) won" = '2004'
wikisql
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBase...
Votes: DownVote to UpVote Ratio.
SELECT Id AS "user_link", Reputation, UpVotes, DownVotes, ROUND(CAST(UpVotes AS FLOAT) / DownVotes, 1) AS Ratio FROM Users WHERE Reputation > 250 AND DownVotes > 0 ORDER BY Ratio DESC LIMIT 50
sede
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...
Posts by day of the week.
SELECT TIME_TO_STR(CreationDate, '%W') AS D, COUNT(*) AS Posts FROM Posts GROUP BY TIME_TO_STR(CreationDate, '%A'), TIME_TO_STR(CreationDate, '%W') ORDER BY D
sede
CREATE TABLE volume ( Volume_ID int, Volume_Issue text, Issue_Date text, Weeks_on_Top real, Song text, Artist_ID int ) CREATE TABLE music_festival ( ID int, Music_Festival text, Date_of_ceremony text, Category text, Volume int, Result text ) CREATE TABLE artist ( Ar...
Show me the total number by category in a histogram
SELECT Category, COUNT(*) FROM music_festival GROUP BY Category
nvbench
CREATE TABLE table_1341973_6 ( candidates VARCHAR, incumbent VARCHAR )
What candidates ran in the election that included john shelley?
SELECT candidates FROM table_1341973_6 WHERE incumbent = "John Shelley"
sql_create_context
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...
what is the monthly minimum amount of output (ml)-chest tube #1 mediastinal right lower;anterior that patient 031-22988 had until 11/2105?
SELECT MIN(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 = '031-22988')) AND intakeoutput.celllabel = 'outpu...
eicu
CREATE TABLE table_203_778 ( id number, "representative" text, "title" text, "presentation\nof credentials" text, "termination\nof mission" text, "appointed by" text )
what was the length , in years , of leslie combs ' term ?
SELECT "termination\nof mission" - "presentation\nof credentials" FROM table_203_778 WHERE "representative" = 'leslie combs'
squall
CREATE TABLE table_name_34 ( opposing_team VARCHAR, against VARCHAR, date VARCHAR )
Which Opposing Team has an Against smaller than 19, and a Date of 20/05/1979?
SELECT opposing_team FROM table_name_34 WHERE against < 19 AND date = "20/05/1979"
sql_create_context
CREATE TABLE competition_result ( competition_id number, club_id_1 number, club_id_2 number, score text ) CREATE TABLE club_rank ( rank number, club_id number, gold number, silver number, bronze number, total number ) CREATE TABLE player ( player_id number, name text, ...
How many clubs have total medals less than 10?
SELECT COUNT(*) FROM club_rank WHERE total < 10
spider
CREATE TABLE table_34368 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real )
On what Week was the Detroit Lions the Opponent?
SELECT "Week" FROM table_34368 WHERE "Opponent" = 'detroit lions'
wikisql
CREATE TABLE Order_Items ( Order_Item_ID INTEGER, Order_ID INTEGER, Product_ID INTEGER, Order_Quantity VARCHAR(288), Other_Item_Details VARCHAR(255) ) CREATE TABLE Invoices ( Invoice_ID INTEGER, Order_ID INTEGER, payment_method_code CHAR(15), Product_ID INTEGER, Order_Quantity V...
Which workshop groups have bookings with status code 'stop'? Give me the names, and count them by a pie chart
SELECT Store_Name, COUNT(Store_Name) FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop" GROUP BY Store_Name
nvbench
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...
自06年6月26至07年10月24日患者葛学民买西药的次数
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '葛学民' AND t_kc22.STA_DATE BETWEEN '2006-06-26' AND '2007-10-24' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
what is the total minimum cost of a hospital that includes a anion gap lab test since 5 years ago?
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'anion gap')) AND DATETIME(cost.chargetime) >= DATETIME(CURRENT_TIME(...
eicu
CREATE TABLE table_name_79 ( outcome VARCHAR, surface VARCHAR, tournament VARCHAR )
Which Outcome has a Surface of clay, and a Tournament of morocco f5, rabat , morocco?
SELECT outcome FROM table_name_79 WHERE surface = "clay" AND tournament = "morocco f5, rabat , morocco"
sql_create_context
CREATE TABLE table_65158 ( "Rank" real, "Athlete" text, "Country" text, "Time" text, "Notes" text )
Which country is the athlete latt shwe zin with notes of sc/d from?
SELECT "Country" FROM table_65158 WHERE "Notes" = 'sc/d' AND "Athlete" = 'latt shwe zin'
wikisql
CREATE TABLE table_58631 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "Podiums" real, "Points" real, "Position" text )
What is the total number of Points with Wins larger than 0, a Position of 12th, and Poles larger than 0?
SELECT SUM("Points") FROM table_58631 WHERE "Wins" > '0' AND "Position" = '12th' AND "Poles" > '0'
wikisql
CREATE TABLE wdmzjzjlb ( 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...
自零三年二月十六日起,截止到一一年五月二十二日,医院6771925在门诊就诊中开了6张以上的检验报告单的科室有多少
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM wdmzjzjlb JOIN jybgb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE wdmzjzjlb.YLJGDM = '6771925' AND jybgb.BGRQ BETWEEN '2003-02-16' AND '2011-05-22' GROUP BY jybgb.KSBM HAVING COUNT(*) > 6 UNION SELECT jybgb.KSBM FROM bdmzjzjlb JO...
css
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, C...
编号是4255215的医院在2000年7月1号到2012年9月17号时间段内入院诊断疾病结果与出院诊断疾病结果有差别的医疗就诊记录
SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '4255215' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-07-01' AND '2012-09-17' EXCEPT SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '4255215' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-07-01' AND '2012-09-17' AND t_kc21.IN_DIAG_DIS_CD = t_kc21.OUT_DIAG_DIS_CD
css
CREATE TABLE table_name_85 ( location VARCHAR, district VARCHAR, station_number VARCHAR )
What is the location of the station at Huntingdonshire with a station number of c17?
SELECT location FROM table_name_85 WHERE district = "huntingdonshire" AND station_number = "c17"
sql_create_context
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE T...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, a bar chart shows the distribution of hire_date and the average of employee_id bin hire_date by time, and order Y-axis in asc order.
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(EMPLOYEE_ID)
nvbench
CREATE TABLE table_train_60 ( "id" int, "corticosteroid_therapy" bool, "radiotherapy" bool, "immune_suppression" bool, "hiv_infection" bool, "cd4_count" int, "sargramostim" bool, "chemotherapy" bool, "immune_deficiency_disorder" bool, "tumor" bool, "receiving_prednisolone" in...
solid tumor with on going chemotherapy or radiotherapy
SELECT * FROM table_train_60 WHERE tumor = 1 AND (chemotherapy = 1 OR radiotherapy = 1)
criteria2sql
CREATE TABLE table_66210 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2009)" real )
What is the name when there are more than 161,219 electorates in 2009 and a constituency of 165?
SELECT "Name" FROM table_66210 WHERE "Number of electorates (2009)" > '161,219' AND "Constituency number" = '165'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9cod...
what is the monthly minimum amount of vancomycin - random patient 030-47098 has until 08/2102?
SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-47098')) AND lab.labname = 'vancomycin - random' AND STRFTIME('%y-%m', lab.lab...
eicu
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 ...
在医院8127400中列出患者25092297就诊科室名称包含儿的所有门诊就诊记录的流水号都是啥啊?
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb 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.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzj...
css
CREATE TABLE table_name_18 ( run_2 VARCHAR, final VARCHAR )
Which run 2 with final of 5:24.47?
SELECT run_2 FROM table_name_18 WHERE final = "5:24.47"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients with primary disease angioedema were born before 2076?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ANGIOEDEMA" AND demographic.dob_year < "2076"
mimicsql_data
CREATE TABLE table_name_74 ( player VARCHAR, years VARCHAR, games VARCHAR, rank VARCHAR )
Which player has less than 201 games, is ranked 2, and played between 2007-2012?
SELECT player FROM table_name_74 WHERE games < 201 AND rank = 2 AND years = "2007-2012"
sql_create_context
CREATE TABLE table_18188 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
what's the party with candidates jerry weller (r) 51.77% clem balanoff (d) 48.23%
SELECT "Party" FROM table_18188 WHERE "Candidates" = 'Jerry Weller (R) 51.77% Clem Balanoff (D) 48.23%'
wikisql
CREATE TABLE table_name_47 ( score VARCHAR, save VARCHAR )
Which score has a save of Smith (25)?
SELECT score FROM table_name_47 WHERE save = "smith (25)"
sql_create_context
CREATE TABLE Reviewer ( name VARCHAR, rID VARCHAR ) CREATE TABLE Rating ( stars INTEGER, rID VARCHAR )
What is the average rating star for each reviewer?
SELECT T2.name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name
sql_create_context
CREATE TABLE table_1289762_1 ( for___percentage_ VARCHAR, against___percentage_ VARCHAR )
How many for percentages are there when the against percentage is 35,782 (69)?
SELECT for___percentage_ FROM table_1289762_1 WHERE against___percentage_ = "35,782 (69)"
sql_create_context
CREATE TABLE table_26944 ( "Name" text, "Position" text, "Period" text, "Appearances\u00b9" real, "Goals\u00b9" real, "Nationality\u00b2" text )
What time period had appearances of 219?
SELECT "Period" FROM table_26944 WHERE "Appearances\u00b9" = '219'
wikisql
CREATE TABLE fzzmzjzjlb ( 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, MZZYZD...
二零一零年四月九日到二零一六年十一月二十一日,编号为3364170的医院有多少科室在门诊就诊中开出了不多于7张的检验报告单
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM zzmzjzjlb JOIN jybgb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE zzmzjzjlb.YLJGDM = '3364170' AND jybgb.BGRQ BETWEEN '2010-04-09' AND '2016-11-21' GROUP BY jybgb.KSBM HAVING COUNT(*) <= 7 UNION SELECT jybgb.KSBM FROM fzzmzjzjlb ...
css
CREATE TABLE product_characteristics ( product_id VARCHAR, characteristic_id VARCHAR ) CREATE TABLE products ( product_id VARCHAR, product_name VARCHAR ) CREATE TABLE CHARACTERISTICS ( characteristic_id VARCHAR )
How many characteristics does the product named 'laurel' have?
SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "laurel"
sql_create_context
CREATE TABLE table_42659 ( "Season" text, "Team" text, "Country" text, "Division" real, "Apps" real, "Goals" real )
What Season, when Country is China, when Team is Dalian Shide, and when Goals are 0?
SELECT "Season" FROM table_42659 WHERE "Country" = 'china' AND "Team" = 'dalian shide' AND "Goals" = '0'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
在05年4月24日到11年1月23日的这几年里,共有多少新生儿的门诊就诊记录在5509091这个医疗机构
SELECT COUNT(*) FROM mzjzjlb JOIN hz_info_mzjzjlb JOIN hz_info ON hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.mzjzjlb_id = mzjzjlb.mzjzjlb_id AND hz_info_mzjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '55...
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...
let me know the number of emergency hospital admission patients who have docusate sodium prescription.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.drug = "Docusate Sodium"
mimicsql_data
CREATE TABLE table_67991 ( "Year" text, "Date Final" text, "Venue" text, "Prize Money" text, "Champion" text, "Runner-up" text, "Score in final" text, "Commercial name" text )
What champion has 1981 as the year?
SELECT "Champion" FROM table_67991 WHERE "Year" = '1981'
wikisql
CREATE TABLE table_name_75 ( score_in_final VARCHAR, outcome VARCHAR, date VARCHAR )
What is the final score of the runner-up on 9 February 1992?
SELECT score_in_final FROM table_name_75 WHERE outcome = "runner-up" AND date = "9 february 1992"
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE diagnoses_icd ( ...
did there exist any microbiological tests for patient 1114's sputum since 11/2105?
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1114) AND microbiologyevents.spec_type_desc = 'sputum' AND STRFTIME('%y-%m', microbiologyevents.charttime) >= '2105-11'
mimic_iii
CREATE TABLE table_75335 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text )
Which games had Philadelphia as home team?
SELECT "Game" FROM table_75335 WHERE "Home Team" = 'philadelphia'
wikisql
CREATE TABLE table_name_33 ( time VARCHAR, opponent VARCHAR )
What was jerry bohlander's time?
SELECT time FROM table_name_33 WHERE opponent = "jerry bohlander"
sql_create_context
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...
自2005-10-05到2015-04-23,24242862患者一共住了多少次院
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.PERSON_ID = '24242862' AND gwyjzb.IN_HOSP_DATE BETWEEN '2005-10-05' AND '2015-04-23' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '24242862' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2005-10-05' AND '2015-04-23' AND fgwyjzb.CLINIC_TYPE = '住院...
css
CREATE TABLE table_12643 ( "South West DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What is the average value for Wins, when South West DFL is 'Coleraine', and when Byes is greater than 0?
SELECT AVG("Wins") FROM table_12643 WHERE "South West DFL" = 'coleraine' AND "Byes" > '0'
wikisql
CREATE TABLE table_80069 ( "Representative" text, "Title" text, "Presentation of Credentials" text, "Termination of Mission" text, "Appointed by" text )
What Representative has a Presentation of Credentails of April 10, 1855?
SELECT "Representative" FROM table_80069 WHERE "Presentation of Credentials" = 'april 10, 1855'
wikisql
CREATE TABLE table_53508 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Kickoff [a ]" text, "Game site" text, "Attendance" text, "Record" text )
What week was the record 0-5?
SELECT "Week" FROM table_53508 WHERE "Record" = '0-5'
wikisql
CREATE TABLE Products ( product_id INTEGER, parent_product_id INTEGER, product_category_code VARCHAR(20), date_product_first_available DATETIME, date_product_discontinued DATETIME, product_name VARCHAR(80), product_description VARCHAR(255), product_price DECIMAL(19,4) ) CREATE TABLE Com...
List the name of all products along with the number of complaints that they have received.
SELECT product_name, COUNT(*) FROM Products AS t1 JOIN Complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name
nvbench
CREATE TABLE table_58425 ( "Player" text, "Nationality" text, "Position" text, "Years for Jazz" text, "School/Club Team" text )
Tell me the School/Club team of the player from the United States that play'de guard?
SELECT "School/Club Team" FROM table_58425 WHERE "Nationality" = 'united states' AND "Position" = 'guard'
wikisql
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 lab ( subject_id text, hadm_id text, ...
how many patients whose ethnicity is black/cape verdean and procedure icd9 code is 8960?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND procedures.icd9_code = "8960"
mimicsql_data
CREATE TABLE takes ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), grade varchar(2) ) CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8) ) CREATE TABLE course ( course_id varchar(8), title varchar(50), dept_nam...
I want to see trend the total number over year by semester
SELECT year, COUNT(*) FROM section GROUP BY semester, year
nvbench
CREATE TABLE table_name_40 ( cospar_id VARCHAR, launch_date_time__utc_ VARCHAR )
What COSPAR ID has a Launch date/time (UTC) of 1995-11-06, 05:15:01?
SELECT cospar_id FROM table_name_40 WHERE launch_date_time__utc_ = "1995-11-06, 05:15:01"
sql_create_context
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE city ( city_code varchar, ...
give me all nonstops from NEW YORK to LAS VEGAS that arrive on a SUNDAY
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, days, flight WHERE ((((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND days.day_name = 'SATURDAY' AND flight.fli...
atis
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE patients ( row_id number, subject_id number, ...
what was the first time a drug was prescribed for patient 32153 in the current hospital encounter?
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32153 AND admissions.dischtime IS NULL) ORDER BY prescriptions.startdate 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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
find the route of administration and name of medication with drug code epo2l.
SELECT prescriptions.drug, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "EPO2I"
mimicsql_data
CREATE TABLE table_203_230 ( id number, "place" text, "player" text, "country" text, "score" text, "to par" number )
who was the only other besides david duval in the t2 category ?
SELECT "player" FROM table_203_230 WHERE "player" <> 'david duval' AND "place" = 't2'
squall
CREATE TABLE table_name_83 ( capacity__thousands_of_metric_tons_ VARCHAR, operator VARCHAR )
What is the capacity of the mine that is operated by Cyprus Amax minerals?
SELECT capacity__thousands_of_metric_tons_ FROM table_name_83 WHERE operator = "cyprus amax minerals"
sql_create_context
CREATE TABLE table_27998152_1 ( previous_club VARCHAR, name VARCHAR )
for the ben williams name what was the previous club
SELECT previous_club FROM table_27998152_1 WHERE name = "Ben Williams"
sql_create_context
CREATE TABLE table_name_64 ( location VARCHAR, date VARCHAR )
What location has October 10 as date?
SELECT location FROM table_name_64 WHERE date = "october 10"
sql_create_context
CREATE TABLE campuses ( campus VARCHAR, YEAR VARCHAR )
Find all the campuses opened in 1958.
SELECT campus FROM campuses WHERE YEAR = 1958
sql_create_context
CREATE TABLE table_31633 ( "Conference" text, "# of Bids" real, "Record" text, "Win %" text, "Round of 32" text, "Elite Eight" text, "Final Four" text, "Championship Game" text )
What is Metro's win percentage?
SELECT "Win %" FROM table_31633 WHERE "Conference" = 'metro'
wikisql
CREATE TABLE table_1748444_1 ( builder VARCHAR, number VARCHAR )
Name the number of builders for number 96
SELECT COUNT(builder) FROM table_1748444_1 WHERE number = "96"
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those products with a price between 60 and 120, draw a bar chart about the distribution of name and code , and display by the names in ascending.
SELECT Name, Code FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Name
nvbench
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
what has changed in hct in patient 007-7646 last measured on the last hospital visit compared to the value first measured on the last hospital visit?
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-7646' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospit...
eicu
CREATE TABLE table_name_5 ( goals_for INTEGER, draws VARCHAR, played VARCHAR )
How many goals have more than 38 played and more than 9 draws?
SELECT SUM(goals_for) FROM table_name_5 WHERE draws > 9 AND played > 38
sql_create_context
CREATE TABLE table_name_28 ( name VARCHAR, pos VARCHAR, date_of_birth VARCHAR )
born on 1983-03-14, what is the cb's name?
SELECT name FROM table_name_28 WHERE pos = "cb" AND date_of_birth = "1983-03-14"
sql_create_context
CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machi...
Give me a histogram for what are the names of the technicians and how many machines are they assigned to repair?
SELECT Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_id = T2.technician_id GROUP BY T2.Name
nvbench
CREATE TABLE table_203_502 ( id number, "team" text, "titles" number, "runner-up" number, "third place" number, "fourth place" number, "years participated" number )
which team had the most fourth place finishes ?
SELECT "team" FROM table_203_502 ORDER BY "fourth place" DESC LIMIT 1
squall
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 ) ...
count the number of patients whose admission type is elective and who were given the drug tramadol (ultram).
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug = "TraMADOL (Ultram)"
mimicsql_data
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE treatment ( treat...
what's the daily minimum dose of ivpb for patient 035-19333 in 02/last year?
SELECT MIN(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 = '035-19333')) AND intakeoutput.celllabel = 'ivpb'...
eicu
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...
自二零零九年二月五日开始,截止到二零一零年十二月二十三日,患者07777908的在医治时做过几次检查
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '07777908' AND t_kc22.STA_DATE BETWEEN '2009-02-05' AND '2010-12-23' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID = '0...
css
CREATE TABLE table_27756314_7 ( record VARCHAR, date VARCHAR )
what is the record for date december 11?
SELECT record FROM table_27756314_7 WHERE date = "December 11"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( c...
what was the total amount of evd output (ml)-icp/external ventricular drain (evd) right ventriculostomy-output patient 021-198501 had on the last intensive care unit visit?
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 = '021-198501') AND NOT patient.unitdischargetime I...
eicu
CREATE TABLE table_name_29 ( nhl_team VARCHAR, player VARCHAR )
What is the NHL team of dave murphy?
SELECT nhl_team FROM table_name_29 WHERE player = "dave murphy"
sql_create_context
CREATE TABLE table_29565601_2 ( l INTEGER )
What is the largest number in L?
SELECT MAX(l) FROM table_29565601_2
sql_create_context
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE...
Draw a bar chart about the distribution of Time and meter_100 , and could you order by the X in descending?
SELECT Time, meter_100 FROM swimmer ORDER BY Time DESC
nvbench
CREATE TABLE table_name_77 ( result VARCHAR, week VARCHAR )
What was the result in week 14?
SELECT result FROM table_name_77 WHERE week = 14
sql_create_context
CREATE TABLE table_name_6 ( method VARCHAR, date_of_execution VARCHAR )
What was the method of execution on September 24, 1830?
SELECT method FROM table_name_6 WHERE date_of_execution = "september 24, 1830"
sql_create_context
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE airport ( airport_code varchar, airport_name text, ...
all right would you let me know type of aircraft UA is using on the flights from DENVER to SAN FRANCISCO i would like to know the type of aircraft that they use on these flights before 1000 in the morning
SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time < 1000 AND ...
atis
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE 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, ...
从2007年6月11日到2021年9月4日,科室5788因酒精性肝硬化住院产生了多少平均费用?
SELECT AVG(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.MED_ORG_DEPT_CD = '5788' AND gwyjzb.IN_HOSP_DATE BETWEEN '2007-06-11' AND '2021-09-04' AND gwyjzb.IN_DIAG_DIS_NM = '酒精性肝硬化' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT AVG(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.MED_ORG_DEPT_CD = '5788' AND fgwyjzb.IN_HOSP_DATE...
css
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
在医疗就诊60159630582里,患者83426845的各检验报告的审核人员工号是什么?姓名是什么?
SELECT SHRGH, SHRXM FROM jybgb WHERE JZLSH = '60159630582'
css
CREATE TABLE table_8804 ( "Runs" text, "Wicket" text, "Batting partners" text, "Batting team" text, "Fielding team" text, "Venue" text, "Season" text )
Where did the west indies batting team play at?
SELECT "Venue" FROM table_8804 WHERE "Batting team" = 'west indies'
wikisql
CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Student ( StuID INTEGER, ...
Show the number of male and female assistant professors. Plot them as bar chart.
SELECT Sex, COUNT(*) FROM Faculty WHERE Rank = "AsstProf" GROUP BY Sex
nvbench
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...
患者36091672号从02年2月9日到05年3月12日这段时间去过多少次医院就诊?
SELECT (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '36091672' AND mzjzjlb.JZKSRQ BETWEEN '2002-02-09' AND '2005-03-12') + (SELECT COUNT(*) FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = h...
css
CREATE TABLE table_203_277 ( id number, "entered" number, "wrestler" text, "place" text, "eliminated by" text, "time" text )
wrestler junior fatu was eliminated by a total of how many wrestlers ?
SELECT "eliminated by" FROM table_203_277 WHERE "wrestler" = 'junior fatu'
squall
CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int...
What is the number of countries in the artist table?, I want to rank by the y-axis in ascending.
SELECT Country, COUNT(Country) FROM artist GROUP BY Country ORDER BY COUNT(Country)
nvbench
CREATE TABLE table_9439 ( "Institution" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Team Nickname" text )
what is the least enrollment when founded after 1809 and the institution is university of michigan?
SELECT MIN("Enrollment") FROM table_9439 WHERE "Founded" > '1809' AND "Institution" = 'university of michigan'
wikisql
CREATE TABLE table_name_74 ( bronze INTEGER, rank VARCHAR, gold VARCHAR )
What is the highest number of bronzes for countries ranking over 5 with 0 golds?
SELECT MAX(bronze) FROM table_name_74 WHERE rank > 5 AND gold < 0
sql_create_context