context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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...
金额top10的项目在医疗机构4618778是哪个?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '4618778' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 10 UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.ME...
css
CREATE TABLE table_name_46 ( pick VARCHAR, round VARCHAR, school_club_team VARCHAR )
Name all Pick that has a Round of 7, and a School/Club Team of arizona st.?
SELECT COUNT(pick) FROM table_name_46 WHERE round = 7 AND school_club_team = "arizona st."
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
统计医疗记录中入院诊断为精神分裂症的在医院4152205的最低和最高医疗费有什么总额?
SELECT MIN(MED_AMOUT), MAX(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '4152205' AND IN_DIAG_DIS_NM = '精神分裂症')
css
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, ...
list the top three most frequent medications that patients have been prescribed during the same month after being diagnosed with hyperosmolality since 2105.
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 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 diagnoses short title is other pulmonary insuff and drug route is pr?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Other pulmonary insuff" AND prescriptions.route = "PR"
mimicsql_data
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, ...
在零五年七月四号到二零年四月四号之间医院4991184所有的就诊记载里个人账户的支出与全部医疗费的平均比值
SELECT AVG(t_kc24.PER_ACC_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '4991184' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-07-04' AND '2020-04-04' UNION SELECT AVG(t_kc24.PER_ACC_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHE...
css
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, "Home Town" text ) CREATE TABLE perpetrator ( Perpetrator_ID int, People_ID int, Date text, Year real, Location text, Country text, Killed int, Injured int )
Bar chart x axis country y axis the total number, list total number from high to low order.
SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_32778 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real )
What Grid has Driver Cristiano da Matta?
SELECT "Grid" FROM table_32778 WHERE "Driver" = 'cristiano da matta'
wikisql
CREATE TABLE table_name_36 ( crowd INTEGER, home_team VARCHAR )
What was the attendance at the Fitzroy home game?
SELECT SUM(crowd) FROM table_name_36 WHERE home_team = "fitzroy"
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 ...
在2007-10-30之后,患者27160966有哪些门诊就诊的检验报告单?看一下门诊就诊的流水号
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON 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 person_info_hz_info.YLJGDM = hz_info.YLJGDM AND pers...
css
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
What is the difficulty based on averages of the ULCS classes ?
SELECT AVG(workload) FROM program_course WHERE category LIKE '%ULCS%'
advising
CREATE TABLE table_6368 ( "Date" real, "Opponent" text, "Venue" text, "Result" text, "Attendance" real, "Competition" text )
How many Dates have an Opponent of romford raiders, and a Result of won 7-3, and an Attendance larger than 1,769?
SELECT COUNT("Date") FROM table_6368 WHERE "Opponent" = 'romford raiders' AND "Result" = 'won 7-3' AND "Attendance" > '1,769'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
count the number of patients who were diagnosed with chronic kidney disease but did not come back to hospital within 2 months until 1 year ago.
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'chronic kidney disease' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-1 year')...
eicu
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, ...
how many patients were diagnosed with pneumonia after they were diagnosed with encephalopathy - toxic during the same hospital visit?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pneumonia') AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagnosistime...
eicu
CREATE TABLE table_11565 ( "Official Name in Malay" text, "Acronym" text, "Foundation" real, "Type" text, "Location" text )
what was the foundation of Politeknik Pagoh?
SELECT AVG("Foundation") FROM table_11565 WHERE "Official Name in Malay" = 'politeknik pagoh'
wikisql
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TAB...
I have to leave by 5:00 P.M. in order to arrive at work on time , what time will 464 and 384 finish up ?
SELECT DISTINCT course_offering.end_time, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'department0' AND (course.number = 464 OR course.number = 384) AND course_offeri...
advising
CREATE TABLE table_name_23 ( country VARCHAR, score VARCHAR )
What is the country of the player with a score of 69-74-71=214?
SELECT country FROM table_name_23 WHERE score = 69 - 74 - 71 = 214
sql_create_context
CREATE TABLE table_name_57 ( constructor VARCHAR, grid VARCHAR, driver VARCHAR )
Tell me the constructor for Grid more than 4 and drivers being heinz-harald frentzen
SELECT constructor FROM table_name_57 WHERE grid > 4 AND driver = "heinz-harald frentzen"
sql_create_context
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALA...
Just show the employee's last name and their employee id using a bar chart, display in asc by the bars.
SELECT LAST_NAME, EMPLOYEE_ID FROM employees ORDER BY LAST_NAME
nvbench
CREATE TABLE table_name_28 ( first_elected VARCHAR, party VARCHAR, incumbent VARCHAR )
When was republican incumbent Joseph McKenna first elected?
SELECT first_elected FROM table_name_28 WHERE party = "republican" AND incumbent = "joseph mckenna"
sql_create_context
CREATE TABLE table_name_10 ( country VARCHAR, money___$__ VARCHAR, score VARCHAR )
What is the Country of the Player with a Score of 70-72-70-73=285 and Money ( $ ) of 5,500?
SELECT country FROM table_name_10 WHERE money___$__ = "5,500" AND score = 70 - 72 - 70 - 73 = 285
sql_create_context
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...
参照不一样的科室编码,以及不一样的入院诊断疾病编码,把医院6293946所有医疗就诊记录中病人的平均年龄列出来
SELECT qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '6293946' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.IN_DIAG_DIS_CD, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '6293946' GROUP BY gyb.MED_ORG_DEPT_CD, gyb.IN_...
css
CREATE TABLE table_18046 ( "Shirt No" real, "Player" text, "Birth Date" text, "Weight" real, "Height" real )
How many players weight 95?
SELECT COUNT("Player") FROM table_18046 WHERE "Weight" = '95'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
what is admission time and discharge time of subject name alice nixon?
SELECT demographic.admittime, demographic.dischtime FROM demographic WHERE demographic.name = "Alice Nixon"
mimicsql_data
CREATE TABLE table_name_20 ( date VARCHAR, venue VARCHAR )
When was the game played at Princes Park?
SELECT date FROM table_name_20 WHERE venue = "princes park"
sql_create_context
CREATE TABLE table_name_68 ( team VARCHAR, season VARCHAR )
What team did the 2003-04 winner play for?
SELECT team FROM table_name_68 WHERE season = "2003-04"
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 all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of job_id and the sum of manager_id , and group by attribute job_id, and I want to sort in ascending by the x-axis please.
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_name_63 ( current_rank VARCHAR, ring_name VARCHAR )
What is Current Rank, when Ring Name is Kimurayama Mamoru?
SELECT current_rank FROM table_name_63 WHERE ring_name = "kimurayama mamoru"
sql_create_context
CREATE TABLE table_27539808_5 ( points INTEGER, game VARCHAR )
What is the lowest number of points for game 32?
SELECT MIN(points) FROM table_27539808_5 WHERE game = 32
sql_create_context
CREATE TABLE table_name_40 ( attendance VARCHAR, opponent VARCHAR )
What is the Attendance at the game against the Oakland Raiders?
SELECT attendance FROM table_name_40 WHERE opponent = "oakland raiders"
sql_create_context
CREATE TABLE table_16756 ( "#" real, "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text )
How many dates have silverstone circuit
SELECT COUNT("Date") FROM table_16756 WHERE "Circuit" = 'Silverstone'
wikisql
CREATE TABLE table_69292 ( "Island" text, "Group" text, "Area ( ha )" text, "Population" text, "Height (m)" real )
What is the lowest Height (m) on the island of Burray?
SELECT MIN("Height (m)") FROM table_69292 WHERE "Island" = 'burray'
wikisql
CREATE TABLE table_name_97 ( code VARCHAR, cr VARCHAR )
What code has a C.R of 16.7:1?
SELECT code FROM table_name_97 WHERE cr = "16.7:1"
sql_create_context
CREATE TABLE bank ( branch_id number, bname text, no_of_customers number, city text, state text ) CREATE TABLE loan ( loan_id text, loan_type text, cust_id text, branch_id text, amount number ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, ...
What are the names of the different bank branches, and what are their total loan amounts?
SELECT SUM(amount), T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname
spider
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
A bar chart shows the distribution of Sex and the average of Weight , and group by attribute Sex, and list y axis from high to low order.
SELECT Sex, AVG(Weight) FROM people GROUP BY Sex ORDER BY AVG(Weight) DESC
nvbench
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...
provide the number of patients whose age is less than 76 and drug name is simvastatin?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "76" AND prescriptions.drug = "Simvastatin"
mimicsql_data
CREATE TABLE table_name_91 ( pick VARCHAR, player VARCHAR )
What number pick is Ray Hall?
SELECT pick FROM table_name_91 WHERE player = "ray hall"
sql_create_context
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...
how many hours have it been since the first diagnosis of atrial fibrillation - with rapid ventricular response in patient 027-85328 on the current hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-85328...
eicu
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
provide the number of patients whose discharge location is snf and age is less than 80?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.age < "80"
mimicsql_data
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, U...
Top 50 users from Gujarat.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%maharashtra%' OR UPPER(Location) LIKE '%MAHARASHTRA%' ORDER BY Reputation DESC LIMIT 5000
sede
CREATE TABLE table_27653955_1 ( ihsa_cheerleading_class VARCHAR, enrollment VARCHAR )
What is the IHSA cheerleading class for the enrollment of 2600?
SELECT ihsa_cheerleading_class FROM table_27653955_1 WHERE enrollment = 2600
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...
列出患者31659348在6659356这个医院中被开过什么单价最高的药?列出这个药的编码、名称和单价
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '31659348' AND t_kc22.t_kc21_MED_SER_ORG_NO = '6659356') ORDER BY t_kc22.UNIVALENT DESC LIMIT 1
css
CREATE TABLE table_28846752_13 ( economy VARCHAR, bbi VARCHAR )
How many economy stats for the player with 2/19 BBI?
SELECT COUNT(economy) FROM table_28846752_13 WHERE bbi = "2/19"
sql_create_context
CREATE TABLE table_name_61 ( division_one VARCHAR, division_two VARCHAR )
What Division One team were champions at the same time the Division Two Hereford Lads Club Colts were champs?
SELECT division_one FROM table_name_61 WHERE division_two = "hereford lads club colts"
sql_create_context
CREATE TABLE table_204_269 ( id number, "week" number, "room" text, "winning couple" text, "2nd couple" text, "3rd couple" text, "chumps" text )
who became the winning couple the most ?
SELECT "winning couple" FROM table_204_269 GROUP BY "winning couple" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_45542 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real )
Which driver had 248 laps?
SELECT "Driver" FROM table_45542 WHERE "Laps" = '248'
wikisql
CREATE TABLE table_name_86 ( track VARCHAR, pole_position VARCHAR )
On which track did Takashi Kogure hold pole position?
SELECT track FROM table_name_86 WHERE pole_position = "takashi kogure"
sql_create_context
CREATE TABLE table_9227 ( "Date" text, "Home" text, "Score" text, "Away" text, "Attendance" real )
When was the attendance 3686?
SELECT "Date" FROM table_9227 WHERE "Attendance" = '3686'
wikisql
CREATE TABLE table_203_320 ( id number, "rank in\n2011" number, "name of\nconcern" text, "location of\nheadquarters" text, "revenue\n(thou.\npln)" number, "profit\n(thou.\npln)" number, "employees" number )
what company has the top number of employees ?
SELECT "name of\nconcern" FROM table_203_320 ORDER BY "employees" DESC LIMIT 1
squall
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 records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the sum of code , and group by attribute name, and could you show in descending by the y axis?
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.Code DESC
nvbench
CREATE TABLE table_17579 ( "Season" text, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text )
Where were the Womens Doubles in the 1951/1952 season and who won?
SELECT "Womens doubles" FROM table_17579 WHERE "Season" = '1951/1952'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, v...
was the value of lactate in patient 78131 second measured on the first hospital visit less than the first value measured on the first hospital visit?
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 78131 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label ...
mimic_iii
CREATE TABLE table_38165 ( "Season" real, "Belonging league" text, "Matches" real, "Points" real, "Draw" real, "Lose" real, "Goal difference" real, "Goals For" real, "Goals Against" real, "Position" real )
What is the earliest season that has a position over 12?
SELECT MIN("Season") FROM table_38165 WHERE "Position" > '12'
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 whose year of birth is less than 2168 and item id is 51375?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2168" AND lab.itemid = "51375"
mimicsql_data
CREATE TABLE table_17649 ( "#" real, "Athlete (NOC)" text, "Shooting" text, "Fencing" text, "Swimming" text, "Riding" text, "Running" text, "Total" real )
What's Luis Siri's shooting score?
SELECT "Shooting" FROM table_17649 WHERE "Athlete (NOC)" = 'Luis Siri'
wikisql
CREATE TABLE table_name_32 ( tournament VARCHAR )
Which 2007 has a Tournament of grand slam sr?
SELECT 2007 FROM table_name_32 WHERE tournament = "grand slam sr"
sql_create_context
CREATE TABLE table_22098274_1 ( time VARCHAR, site VARCHAR, result VARCHAR )
At what time is the site usf softball field tampa, fl and w4-0 is the result?
SELECT time FROM table_22098274_1 WHERE site = "USF Softball Field • Tampa, FL" AND result = "W4-0"
sql_create_context
CREATE TABLE table_6574 ( "Position" real, "Team" text, "Points" real, "Played" real, "Won by 2 or more goals difference" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
Which Against is the highest one that has a Team of flamengo, and a Lost smaller than 1?
SELECT MAX("Against") FROM table_6574 WHERE "Team" = 'flamengo' AND "Lost" < '1'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
how many patients whose primary disease is sternal wound infection and year of death is less than or equal to 2122?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "STERNAL WOUND INFECTION" AND demographic.dod_year <= "2122.0"
mimicsql_data
CREATE TABLE table_73849 ( "Name" text, "Nearest city" text, "Skiable area (acres)" real, "Top elevation (feet)" real, "Base elevation (feet)" real, "Vertical (feet)" real, "Runs" text, "Lifts" real, "Snowfall (in/year)" real )
If the name is Steamboat, what is the top elevation?
SELECT "Top elevation (feet)" FROM table_73849 WHERE "Name" = 'Steamboat'
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID...
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of phone_number and employee_id , and sort in ascending by the Y.
SELECT PHONE_NUMBER, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID
nvbench
CREATE TABLE table_5698 ( "Model" text, "Engine" text, "Displacement" text, "Power" text, "Torque" text )
Which model had a power of 66kw (90 ps) @ 6250 rpm?
SELECT "Model" FROM table_5698 WHERE "Power" = '66kw (90 ps) @ 6250 rpm'
wikisql
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, ...
华雨华这位团伙成员最常去看病的几位医生的排序看一下
SELECT gwyjzb.OUT_DIAG_DOC_CD, gwyjzb.OUT_DIAG_DOC_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '华雨华' GROUP BY gwyjzb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC UNION SELECT fgwyjzb.OUT_DIAG_DOC_CD, fgwyjzb.OUT_DIAG_DOC_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '华雨华' GROUP BY fgwyjzb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE table_name_39 ( tie_no VARCHAR, score VARCHAR )
What is the Tie no of the game with a Score of 1 1?
SELECT tie_no FROM table_name_39 WHERE score = "1–1"
sql_create_context
CREATE TABLE table_name_46 ( full_word VARCHAR, case_suffix__case_ VARCHAR )
What is the Full Word, when Case Suffix (case) is '-sa (dative)'?
SELECT full_word FROM table_name_46 WHERE case_suffix__case_ = "-sa (dative)"
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 who did not have any job in the past, return a line chart about the change of department_id over hire_date , list HIRE_DATE in descending order.
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE table_27553627_2 ( episodes INTEGER, viewers__in_millions_ VARCHAR )
What episode number had 14.41 million viewers?
SELECT MAX(episodes) FROM table_27553627_2 WHERE viewers__in_millions_ = "14.41"
sql_create_context
CREATE TABLE table_25974 ( "Rank" real, "Dismissals" real, "Player" text, "Caught" real, "Stumped" real, "Matches" real, "Innings" real )
Name the number of dismissals for adam gilchrist
SELECT COUNT("Dismissals") FROM table_25974 WHERE "Player" = 'Adam Gilchrist'
wikisql
CREATE TABLE table_name_81 ( country VARCHAR, rank VARCHAR, time VARCHAR )
Which country had a rank smaller than 7 and a time of 1:43.189?
SELECT country FROM table_name_81 WHERE rank < 7 AND time = "1:43.189"
sql_create_context
CREATE TABLE table_name_63 ( republican_ticket VARCHAR, workers_ticket VARCHAR )
What is the name on the Republican ticket when the Workers ticket is edward lindgren?
SELECT republican_ticket FROM table_name_63 WHERE workers_ticket = "edward lindgren"
sql_create_context
CREATE TABLE table_44064 ( "Season" text, "Games" real, "Yellow Cards" real, "Red Cards" real, "Average Cards a game" real )
Which Games has a Season of 2003/2004, and a Red Cards smaller than 5?
SELECT AVG("Games") FROM table_44064 WHERE "Season" = '2003/2004' AND "Red Cards" < '5'
wikisql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewRejectionReasons ( Id ...
query tech trend by year.
SELECT CONCAT(TIME_TO_STR(CreationDate, '%Y'), '-', TIME_TO_STR(CreationDate, '%m')) AS dt, COUNT(1) AS num_mentions FROM Posts WHERE Title LIKE '%javascript%' GROUP BY CONCAT(TIME_TO_STR(CreationDate, '%Y'), '-', TIME_TO_STR(CreationDate, '%m'))
sede
CREATE TABLE table_50082 ( "Lane" real, "Name" text, "Country" text, "Mark" text, "React" real )
What is Mark, when React is less than 0.148?
SELECT "Mark" FROM table_50082 WHERE "React" < '0.148'
wikisql
CREATE TABLE table_45656 ( "Class" text, "Team" text, "Driver" text, "Chassis \u2013 Engine" text, "Laps" real )
How many Laps does GP Motorsport Team have?
SELECT SUM("Laps") FROM table_45656 WHERE "Team" = 'gp motorsport'
wikisql
CREATE TABLE table_name_83 ( total INTEGER, bronze VARCHAR, silver VARCHAR, nation VARCHAR )
What is the highest total medals of russia, which has more than 1 silver and more than 6 bronze medals?
SELECT MAX(total) FROM table_name_83 WHERE silver > 1 AND nation = "russia" AND bronze > 6
sql_create_context
CREATE TABLE table_13564702_4 ( club VARCHAR, points_against VARCHAR )
What club got 239 points against?
SELECT club FROM table_13564702_4 WHERE points_against = "239"
sql_create_context
CREATE TABLE table_77331 ( "C/W 15+" real, "Oblast\\Age" text, "15 to 17" real, "18 to 19" real, "20 to 24" real, "25 to 29" real, "30 to 34" real, "35 to 39" real, "40 to 44" real, "45 to 49" real, "50 to 54" real, "55 to 59" real, "60 to 64" real, "65 to 69" rea...
With a 35 to 39 greater than 3,315 what is the 45 to 49?
SELECT "45 to 49" FROM table_77331 WHERE "35 to 39" > '3,315'
wikisql
CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_...
How many documents for each document type description? Visualize by a bar chart, and rank by the Document_Type_Description from high to low.
SELECT Document_Type_Description, COUNT(Document_Type_Description) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Description ORDER BY Document_Type_Description DESC
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, ...
how many patients on urgent admission were diagnosed with ostium secundum type atrial septal defect?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.long_title = "Ostium secundum type atrial septal defect"
mimicsql_data
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...
what is the number of patients whose age is less than 76 and diagnoses short title is adv eff cardiovasc nec?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "76" AND diagnoses.short_title = "Adv eff cardiovasc NEC"
mimicsql_data
CREATE TABLE table_71751 ( "Election" text, "1st Member" text, "1st Party" text, "2nd Member" text, "2nd Party" text )
Which 1st Party has a 2nd Member of constituency abolished?
SELECT "1st Party" FROM table_71751 WHERE "2nd Member" = 'constituency abolished'
wikisql
CREATE TABLE table_name_81 ( home_captain VARCHAR, venue VARCHAR )
What is the Home Captain which has Waca Ground as a Venue
SELECT home_captain FROM table_name_81 WHERE venue = "waca ground"
sql_create_context
CREATE TABLE table_name_48 ( english VARCHAR, bulgarian VARCHAR )
What's the English Pluperfect when the Bulgarian is ?
SELECT english FROM table_name_48 WHERE bulgarian = "бяха чули"
sql_create_context
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(...
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of email and employee_id , could you show from high to low by the x axis?
SELECT EMAIL, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL DESC
nvbench
CREATE TABLE table_64697 ( "Player" text, "Matches" text, "Runs" text, "Balls" text, "Strike Rate" text, "Average" text, "100s" text )
What runs has 11 matches, and 2 as the 100s?
SELECT "Runs" FROM table_64697 WHERE "Matches" = '11' AND "100s" = '2'
wikisql
CREATE TABLE table_20754016_2 ( contestant VARCHAR, height__cm_ VARCHAR )
What contestant is 173 cm tall?
SELECT contestant FROM table_20754016_2 WHERE height__cm_ = 173
sql_create_context
CREATE TABLE table_15267 ( "Year" real, "Population (Region total)" real, "Population (Bundaberg)" text, "Population (Gooburrum)" real, "Population (Woongarra)" real, "Population (Isis)" real, "Population (Kolan)" real )
When the Isis Population is 3,718 and the Gooburrum Population is less than 4,776, what is the highest Woongarra Population?
SELECT MAX("Population (Woongarra)") FROM table_15267 WHERE "Population (Isis)" = '3,718' AND "Population (Gooburrum)" < '4,776'
wikisql
CREATE TABLE table_59150 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score in the final" text )
On what Date is the match played on Clay Surface with a Score in the final of 6 2, 7 5?
SELECT "Date" FROM table_59150 WHERE "Surface" = 'clay' AND "Score in the final" = '6–2, 7–5'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
从08年5月3日到11年5月6日患者77333677检查的次数是多少?
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '77333677' AND t_kc22.STA_DATE BETWEEN '2008-05-03' AND '2011-05-06' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_name_42 ( venue VARCHAR, player VARCHAR )
What was the venue where Josh Hamilton played?
SELECT venue FROM table_name_42 WHERE player = "josh hamilton"
sql_create_context
CREATE TABLE table_657 ( "Department" text, "Acronym" text, "Office" text, "Incumbent" text, "in Office since" text )
what's the department with incumbent being enrique ona
SELECT "Department" FROM table_657 WHERE "Incumbent" = 'Enrique Ona'
wikisql
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...
41736838这位患者的妊娠相关性血浆蛋白-A指标在08年4月18日至10月22日期间的情况
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BG...
css
CREATE TABLE payments ( payment_id number, booking_id number, customer_id number, payment_type_code text, amount_paid_in_full_yn text, payment_date time, amount_due number, amount_paid number ) CREATE TABLE view_product_availability ( product_id number, booking_id number, st...
What are the names and descriptions of the products that are of 'Cutlery' type and have daily hire cost lower than 20?
SELECT product_name, product_description FROM products_for_hire WHERE product_type_code = 'Cutlery' AND daily_hire_cost < 20
spider
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...
when did patient 003-34282 first receive prescriptions for insulin lispro, recombinant in their last hospital encounter?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-34282' AND NOT patient.hospitaldischargetime IS NULL ORDER...
eicu
CREATE TABLE table_63965 ( "Rank" real, "Rider" text, "Team" text, "Speed" text, "Time" text )
What time has jules croft as the rider?
SELECT "Time" FROM table_63965 WHERE "Rider" = 'jules croft'
wikisql
CREATE TABLE table_49560 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What was Jim Furyk's score?
SELECT "Score" FROM table_49560 WHERE "Player" = 'jim furyk'
wikisql
CREATE TABLE table_64696 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real )
Which Team has Laps of 100, and a Time/Retired of +8.6 secs?
SELECT "Team" FROM table_64696 WHERE "Laps" = '100' AND "Time/Retired" = '+8.6 secs'
wikisql
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, ins...
Show me classes that involve parts of Plant Physiological Ecology and Collat Conseq of Crim Conv .
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id WHERE (area.area LIKE '%Collat Conseq of Crim Conv%' OR course.description LIKE '%Collat Conseq of Crim Conv%' OR course.name LIKE '%Collat Conseq of Crim Conv%') AND (area.area LIKE '%Plant Ph...
advising
CREATE TABLE table_63264 ( "City of license" text, "Identifier" text, "Frequency" text, "Power" text, "Class" text, "RECNet" text )
what is the class when the identifier is cjbc-1-fm?
SELECT "Class" FROM table_63264 WHERE "Identifier" = 'cjbc-1-fm'
wikisql
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...
统计医疗记录中入院诊断为S20.783的在医院7357954最低医疗费总额和最高医疗费总额分别是多少?
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '7357954' AND t_kc24.t_kc21_IN_DIAG_DIS_CD = 'S20.783')
css