context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_62560 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text, "Location" text )
What round did the event UFC 86 take place?
SELECT "Round" FROM table_62560 WHERE "Event" = 'ufc 86'
wikisql
CREATE TABLE ftxmzjzjlb ( 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...
89956655081的患者卡号以及卡类型在门诊就诊里分别是什么?
SELECT txmzjzjlb.KH, txmzjzjlb.KLX FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '89956655081' UNION SELECT ftxmzjzjlb.KH, ftxmzjzjlb.KLX FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '89956655081'
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
what is the number of patients whose admission location is transfer from hosp/extram and admission year is less than 2175?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.admityear < "2175"
mimicsql_data
CREATE TABLE table_2715355_1 ( winners VARCHAR, entrants VARCHAR )
How many prizes were available in the competition where 696 people entered?
SELECT COUNT(winners) AS Prize FROM table_2715355_1 WHERE entrants = 696
sql_create_context
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 (...
find the number of patients whose drug route is dialys and age under 83 years.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "83" AND prescriptions.route = "DIALYS"
mimicsql_data
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
count the number of patients whose admission location is phys referral/normal deli and drig code is cefe 1i.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND prescriptions.formulary_drug_cd = "CEFE1I"
mimicsql_data
CREATE TABLE table_204_598 ( id number, "name" text, "state of residence" text, "took office" text, "left office" text, "president served under" text )
who was the previous advisor before pete rouse ?
SELECT "name" FROM table_204_598 WHERE "took office" < (SELECT "took office" FROM table_204_598 WHERE "name" = 'pete rouse') ORDER BY "took office" DESC LIMIT 1
squall
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,...
For all employees who have the letters D or S in their first name, for manager_id, hire_date, visualize the trend, show by the x-axis in descending.
SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE table_43230 ( "Family" text, "Baltimore group" text, "envelopment" text, "Virion shape" text, "Replication site" text )
What is the envelopment for the rhabdoviridae family?
SELECT "envelopment" FROM table_43230 WHERE "Family" = 'rhabdoviridae'
wikisql
CREATE TABLE table_name_8 ( bore VARCHAR, designation VARCHAR )
What is the bore of the boat howitzers with a 12-pdr heavy designation?
SELECT bore FROM table_name_8 WHERE designation = "12-pdr heavy"
sql_create_context
CREATE TABLE table_name_79 ( pick__number INTEGER, cfl_team VARCHAR )
What is the total pick numbers for the CFL team Edmonton Eskimos?
SELECT SUM(pick__number) FROM table_name_79 WHERE cfl_team = "edmonton eskimos"
sql_create_context
CREATE TABLE table_22133191_3 ( date_of_appointment VARCHAR, position_in_table VARCHAR )
What was the date of appointment for the 10th person in position?
SELECT date_of_appointment FROM table_22133191_3 WHERE position_in_table = "10th"
sql_create_context
CREATE TABLE table_74238 ( "No" real, "Driver" text, "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text )
Name the chassis for sfacs ecurie france
SELECT "Chassis" FROM table_74238 WHERE "Entrant" = 'SFACS Ecurie France'
wikisql
CREATE TABLE table_name_50 ( attendance INTEGER, away VARCHAR )
Which Attendance has an Away of real juventud?
SELECT SUM(attendance) FROM table_name_50 WHERE away = "real juventud"
sql_create_context
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description...
Most voted questions tagged with Ruby.
SELECT Id, * FROM Posts AS Question WHERE Tags LIKE '%ruby%' AND PostTypeId = 2 ORDER BY Score DESC LIMIT 150
sede
CREATE TABLE table_name_34 ( position VARCHAR, college VARCHAR )
What position did the palyer drafted out of Washington play?
SELECT position FROM table_name_34 WHERE college = "washington"
sql_create_context
CREATE TABLE table_20760802_1 ( drawn VARCHAR, points_against VARCHAR )
How may drawn equal points against at 129?
SELECT drawn FROM table_20760802_1 WHERE points_against = "129"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
医疗机构3521914自从一六年二月十六日一直到一七年一月十九这段时间内所有的就诊记录中未从业患者的就诊记录数
SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '3521914' AND IN_HOSP_DATE BETWEEN '2016-02-16' AND '2017-01-19' AND INSURED_STS = '未就业'
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
how many patients whose admission year is less than 2194 and procedure short title is form cutan ileoureterost?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2194" AND procedures.short_title = "Form cutan ileoureterost"
mimicsql_data
CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20), salary numeric(8,2) ) CREATE TABLE department ( dept_name varchar(20), building varchar(15), budget numeric(12,2) ) CREATE TABLE course ( course_id varchar(8), title varchar(50), dept_name varchar...
Find the average of credits of courses that have more than one prerequisite for each department with a bar chart, and sort in desc by the Y please.
SELECT dept_name, AVG(credits) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY dept_name ORDER BY AVG(credits) DESC
nvbench
CREATE TABLE table_name_35 ( loan_club VARCHAR, name VARCHAR )
From which club is player C. Dickinson?
SELECT loan_club FROM table_name_35 WHERE name = "c. dickinson"
sql_create_context
CREATE TABLE table_78247 ( "D 48" text, "D 47" text, "D 46" text, "D 45" text, "D 44" text, "D 43" text, "D 42" text, "D 41" text )
Name the D 48 when it has a D 44 of d 33
SELECT "D 48" FROM table_78247 WHERE "D 44" = 'd 33'
wikisql
CREATE TABLE fgwyjzb ( 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, ...
查查科室030在00.9.21至18.1.31期间,因治疗沙眼这个疾病住院的平均费用是多少
SELECT AVG(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.MED_ORG_DEPT_CD = '030' AND gwyjzb.IN_HOSP_DATE BETWEEN '2000-09-21' AND '2018-01-31' AND gwyjzb.IN_DIAG_DIS_NM = '沙眼' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT AVG(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.MED_ORG_DEPT_CD = '030' AND fgwyjzb.IN_HOSP_DATE BETWE...
css
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info_mzjzjlb ( JZLSH number, ...
在13年9月2日到21年5月16日这段时间里91296755号病患的所有检验结果指标记录中的都有什么检测方法?
SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND ...
css
CREATE TABLE table_49534 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
what is the tournament when the outcome is winner and the opponents is kerry-anne guse corina morariu?
SELECT "Tournament" FROM table_49534 WHERE "Outcome" = 'winner' AND "Opponents" = 'kerry-anne guse corina morariu'
wikisql
CREATE TABLE table_61000 ( "Semi-closed initial unstressed vowels" text, "17th c." text, "American" text, "Australian" text, "Examples" text )
What is the example for the American of , , and a Semi-closed initial unstressed vowels of y / /?
SELECT "Examples" FROM table_61000 WHERE "American" = 'ɪ, ə' AND "Semi-closed initial unstressed vowels" = 'y /ɨ/'
wikisql
CREATE TABLE table_60854 ( "Position" real, "Club" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Points" real, "Goal Difference" real )
Can you tell me the highest Draws that has the Goal Difference smaller than 64, and the Played larger than 30?
SELECT MAX("Draws") FROM table_60854 WHERE "Goal Difference" < '64' AND "Played" > '30'
wikisql
CREATE TABLE table_15893020_2 ( overs VARCHAR, player VARCHAR )
How many overs did Oliver Hannon-Dalby have?
SELECT overs FROM table_15893020_2 WHERE player = "Oliver Hannon-Dalby"
sql_create_context
CREATE TABLE table_name_47 ( ship_type VARCHAR, disposition_of_ship VARCHAR, tonnage VARCHAR )
What is the Ship Type of the Prize Disposition of ship and a tonnage less than 151?
SELECT ship_type FROM table_name_47 WHERE disposition_of_ship = "prize" AND tonnage < 151
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airli...
okay give me the flights that leave DENVER after 1900 next monday arriving in BOSTON
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, date_day, days, flight WHERE ((date_day.day_number = 21 AND date_day.month_number = 2 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time...
atis
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Comments ( Id number, PostId number, ...
upvote and downvote count broken down by post type.
SELECT COUNT(*), pt.Name, vt.Name FROM Votes AS v, Posts AS p, PostTypes AS pt, VoteTypes AS vt WHERE v.PostId = p.Id AND v.VoteTypeId IN (2, 3) AND p.PostTypeId IN (1, 2) AND pt.Id = p.PostTypeId AND vt.Id = v.VoteTypeId AND p.OwnerUserId = 5373 GROUP BY pt.Name, vt.Name ORDER BY pt.Name, vt.Name
sede
CREATE TABLE table_76692 ( "Date" text, "Time" text, "Opponent" text, "Score" text, "Site" text, "City" text )
Which site has a Score of 0-1?
SELECT "Site" FROM table_76692 WHERE "Score" = '0-1'
wikisql
CREATE TABLE table_75319 ( "Date" text, "Type" text, "Record description" text, "Achievement" text, "Pilot" text )
Achievement of m (ft), and a Type of mi-10r, and a Pilot of v.p. koloshenko, and a Date of 28 may 1965 had what record description?
SELECT "Record description" FROM table_75319 WHERE "Achievement" = 'm (ft)' AND "Type" = 'mi-10r' AND "Pilot" = 'v.p. koloshenko' AND "Date" = '28 may 1965'
wikisql
CREATE TABLE table_46411 ( "C/W 15+" real, "Oblast\\Age" text, "15 to 17" real, "18 to 19" text, "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...
what is the average 60 to 64 when 50 to 54 is less than 2,054, 35 to 39 is more than 1,704, 30 to 34 is less than 1,381 and oblast\age is evenkia?
SELECT AVG("60 to 64") FROM table_46411 WHERE "50 to 54" < '2,054' AND "35 to 39" > '1,704' AND "30 to 34" < '1,381' AND "Oblast\\Age" = 'evenkia'
wikisql
CREATE TABLE table_name_10 ( l2_cache VARCHAR, clock_speed VARCHAR )
Name the L2 Cache which has a Clock Speed of 1.5 ghz?
SELECT l2_cache FROM table_name_10 WHERE clock_speed = "1.5 ghz"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid ...
since 1652 days ago, had patient 006-13677 excreted any urinary catheter output: coude urethral 14 fr.?
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-13677')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu...
eicu
CREATE TABLE table_65136 ( "Pick" real, "Team" text, "Player" text, "Position" text, "College" text )
Which College has a Position of Offensive Tackle?
SELECT "College" FROM table_65136 WHERE "Position" = 'offensive tackle'
wikisql
CREATE TABLE table_23122988_1 ( episode VARCHAR, location VARCHAR )
What episode took place in Belfast Waterfront Hall?
SELECT episode FROM table_23122988_1 WHERE location = "Belfast Waterfront Hall"
sql_create_context
CREATE TABLE table_64211 ( "Position" real, "Gymnast" text, "Floor" text, "Pommel Horse" text, "Rings" text, "Vault" text, "Parallel Bars" text, "Horizontal Bar" text, "Total" real )
What is the horizontal bar score with a pommel horse of n/a, and the position is less than 27, and the parallel bars score is 15.800?
SELECT "Horizontal Bar" FROM table_64211 WHERE "Pommel Horse" = 'n/a' AND "Position" < '27' AND "Parallel Bars" = '15.800'
wikisql
CREATE TABLE table_1342013_41 ( candidates VARCHAR, incumbent VARCHAR )
What candidates were in the election when james patrick sutton was incumbent?
SELECT candidates FROM table_1342013_41 WHERE incumbent = "James Patrick Sutton"
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb ( BBCJBW text, BBDM tex...
从二00二年四月二十五日到二0二0年十二月二十一日这段时间,患者沈宾鸿检测超敏肌钙蛋白T找的哪些医务人员做的,这些医务人员的工号和姓名报一下
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jy...
css
CREATE TABLE ref_document_types ( document_type_code text, document_type_name text, document_type_description text ) CREATE TABLE employees ( employee_id number, role_code text, employee_name text, gender_mfu text, date_of_birth time, other_details text ) CREATE TABLE ref_locations...
What is the description of the role named 'Proof Reader'?
SELECT role_description FROM roles WHERE role_name = "Proof Reader"
spider
CREATE TABLE table_16678 ( "Source" text, "Date" text, "Method" text, "iOS" text, "Android" text, "BlackBerry" text, "Symbian / Series 40" text, "Bada" text, "Windows" text, "Other" text )
When Symbian/Series 40 is 0.40%, what is the percentage of 'other'?
SELECT "Other" FROM table_16678 WHERE "Symbian / Series 40" = '0.40%'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number,...
how much metronidazole was prescribed for the last time the last month to patient 23070?
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23070) AND prescriptions.drug = 'metronidazole' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORD...
mimic_iii
CREATE TABLE table_13228 ( "Season" text, "Competition" text, "Round" text, "Club" text, "Home" text, "Away" text, "Aggregate" text )
What round did the spartak moscow club play?
SELECT "Round" FROM table_13228 WHERE "Club" = 'spartak moscow'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(2...
For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of job_id and the average of employee_id , and group by attribute job_id.
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID
nvbench
CREATE TABLE table_name_51 ( first_issued INTEGER, color VARCHAR )
When was Color of green first issued?
SELECT MIN(first_issued) FROM table_name_51 WHERE color = "green"
sql_create_context
CREATE TABLE table_name_67 ( home_team VARCHAR, venue VARCHAR )
Which home team played at Princes Park?
SELECT home_team FROM table_name_67 WHERE venue = "princes park"
sql_create_context
CREATE TABLE table_name_5 ( cfl_team VARCHAR, college VARCHAR )
Which CFL team drafted a pick from Boston College?
SELECT cfl_team FROM table_name_5 WHERE college = "boston college"
sql_create_context
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...
在门诊检查的邹元良患者在查出疾病F78.797时的检测指标290838的结果定量及其单位各是多少?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZ...
css
CREATE TABLE table_name_26 ( matches INTEGER, high_score VARCHAR, innings VARCHAR )
What is the match total for a score over 299 and under 412 innings?
SELECT SUM(matches) FROM table_name_26 WHERE high_score = "299" AND innings < 412
sql_create_context
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 DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), ...
Return a bar chart on how many hours do the students spend studying in each department?
SELECT DEPT_CODE, SUM(STU_HRS) FROM STUDENT GROUP BY DEPT_CODE
nvbench
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE time_inte...
do you have a flight from BOSTON to FORT WORTH
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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'FORT WO...
atis
CREATE TABLE table_17570 ( "Condition" text, "Prothrombin time" text, "Partial thromboplastin time" text, "Bleeding time" text, "Platelet count" text )
What kind of bleeding does aspirin cause?
SELECT "Bleeding time" FROM table_17570 WHERE "Condition" = 'Aspirin'
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_DIRE_CD text, MED_DIRE_NM text,...
统计一下医疗记录中患者年龄不高于17岁的平均治病费总额一共是多少?
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE <= 17)
css
CREATE TABLE table_31319 ( "Year" text, "Conductor" text, "Opera House or Orchestra" text, "Label" text, "Countess" text, "Count" text, "Flamand" text, "Olivier" text, "La Roche" text, "Clairon" text )
When dietrich fischer-dieskau is the olivier who is the conductor?
SELECT "Conductor" FROM table_31319 WHERE "Olivier" = 'Dietrich Fischer-Dieskau'
wikisql
CREATE TABLE table_17583 ( "Season" text, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text )
Who won the womens singles in the 1958/1959 season?
SELECT "Womens singles" FROM table_17583 WHERE "Season" = '1958/1959'
wikisql
CREATE TABLE table_851 ( "Rnd" real, "Circuit" text, "GTO Winning Team" text, "GTU Winning Team" text, "TO Winning Team" text, "TU Winning Team" text, "Results" text )
Who was the GTO winning team in round 5 when the GTU winning team was #59 Brumos Porsche - Audi?
SELECT "GTO Winning Team" FROM table_851 WHERE "Rnd" = '5' AND "GTU Winning Team" = '#59 Brumos Porsche - Audi'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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, ...
what is the number of patients whose days of hospital stay is greater than 4 and item id is 51347?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "4" AND lab.itemid = "51347"
mimicsql_data
CREATE TABLE has_amenity ( amenid VARCHAR, dormid VARCHAR ) CREATE TABLE dorm_amenity ( amenity_name VARCHAR, amenid VARCHAR ) CREATE TABLE dorm ( dormid VARCHAR, dorm_name VARCHAR )
List name of all amenities which Anonymous Donor Hall has, and sort the results in alphabetic order.
SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T2.amenid = T1.amenid JOIN dorm AS T3 ON T2.dormid = T3.dormid WHERE T3.dorm_name = 'Anonymous Donor Hall' ORDER BY T1.amenity_name
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_I...
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize the relationship between commission_pct and department_id .
SELECT COMMISSION_PCT, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_18363 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What republican candidate was first elected most recently?
SELECT MAX("First elected") FROM table_18363 WHERE "Party" = 'Republican'
wikisql
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number...
total # of post history.
SELECT COUNT(*) FROM PostHistory
sede
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
how many patients aged below 79 years had the procedure short title suture of artery?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "79" AND procedures.short_title = "Suture of artery"
mimicsql_data
CREATE TABLE table_67846 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
What loss has october 1 as the date?
SELECT "Loss" FROM table_67846 WHERE "Date" = 'october 1'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE proced...
when is the first procedure time of patient 12797 in 2102?
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12797) AND STRFTIME('%y', procedures_icd.charttime) = '2102' ORDER BY procedures_icd.charttime LIMIT 1
mimic_iii
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Show me about the correlation between School_ID and All_Games_Percent , and group by attribute Team_Name in a scatter chart.
SELECT School_ID, All_Games_Percent FROM basketball_match GROUP BY Team_Name
nvbench
CREATE TABLE table_56266 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the Time/Retired with over 56 laps and a grid of 5?
SELECT "Time/Retired" FROM table_56266 WHERE "Laps" > '56' AND "Grid" = '5'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
How many patients with diagnoses icd9 code 3572 are still unmarried?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.icd9_code = "3572"
mimicsql_data
CREATE TABLE table_77071 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
What is the highest Pick, when Round is greater than 15, and when College is 'Tennessee'?
SELECT MAX("Pick") FROM table_77071 WHERE "Round" > '15' AND "College" = 'tennessee'
wikisql
CREATE TABLE table_name_2 ( rank VARCHAR, bronze VARCHAR, gold VARCHAR )
What is the rank of the team with 1 bronze and 0 gold medals?
SELECT rank FROM table_name_2 WHERE bronze = 1 AND gold = 0
sql_create_context
CREATE TABLE table_204_589 ( id number, "season" text, "tier" number, "division" text, "pos." text, "notes" text )
what was the only year the team was relegated ?
SELECT "season" FROM table_204_589 WHERE "notes" = 'relegated'
squall
CREATE TABLE table_name_4 ( region VARCHAR, date VARCHAR )
What region is on 11 August 2008?
SELECT region FROM table_name_4 WHERE date = "11 august 2008"
sql_create_context
CREATE TABLE table_name_3 ( opponent_in_the_final VARCHAR, date VARCHAR )
Who is the opponent in the final on August 14, 2006?
SELECT opponent_in_the_final FROM table_name_3 WHERE date = "august 14, 2006"
sql_create_context
CREATE TABLE table_65171 ( "Eliminated" text, "Tag Team" text, "Entered" real, "Eliminated by" text, "Time" text )
Which Eliminated has an Entered smaller than 2?
SELECT "Eliminated by" FROM table_65171 WHERE "Entered" < '2'
wikisql
CREATE TABLE table_77227 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text )
What is Call Sign, when City of License is Brownfield, Texas?
SELECT "Call sign" FROM table_77227 WHERE "City of license" = 'brownfield, texas'
wikisql
CREATE TABLE pilot ( pilot_id number, name text, age number ) CREATE TABLE airport ( airport_id number, airport_name text, total_passengers number, %_change_2007 text, international_passengers number, domestic_passengers number, transit_passengers number, aircraft_movements ...
Show the names of aircrafts that are associated with both an airport named 'London Heathrow' and an airport named 'London Gatwick
SELECT T1.aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.aircraft_id = T2.aircraft_id JOIN airport AS T3 ON T2.airport_id = T3.airport_id WHERE T3.airport_name = "London Heathrow" INTERSECT SELECT T1.aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.aircraft_id = T2.aircraft_id JOIN airport...
spider
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 prescription...
what is drug code and drug route of drug name cefpodoxime proxetil?
SELECT prescriptions.formulary_drug_cd, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Cefpodoxime Proxetil"
mimicsql_data
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
患者苏晓莉检验下肢的各项指标结果如何?
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM...
css
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
0497811这家医院全部就诊记录中大病支付的额度比上总医疗费的值里的最小值按照不一样的科室编码和入院诊断疾病编码算算看
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '0497811' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD
css
CREATE TABLE table_name_73 ( competition VARCHAR, goal VARCHAR )
What was the competition for goal 8?
SELECT competition FROM table_name_73 WHERE goal = 8
sql_create_context
CREATE TABLE table_name_45 ( year VARCHAR, group VARCHAR )
What is the total number of Years that has the Group, Method Fest Independent Film Festival?
SELECT COUNT(year) FROM table_name_45 WHERE group = "method fest independent film festival"
sql_create_context
CREATE TABLE table_name_80 ( country VARCHAR, internetlists VARCHAR, onisecurityfiltering VARCHAR )
What is the name of the country that has internetlists of , and ONIsecurityfiltering of ?
SELECT country FROM table_name_80 WHERE internetlists = "—" AND onisecurityfiltering = "—"
sql_create_context
CREATE TABLE table_name_6 ( frequency VARCHAR, owner VARCHAR, call_sign VARCHAR )
What is the frequency for the radio owned by bell media with a call sign of chsu-fm?
SELECT frequency FROM table_name_6 WHERE owner = "bell media" AND call_sign = "chsu-fm"
sql_create_context
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar...
Which classes are handled by Dr. Tanya Logan ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = cour...
advising
CREATE TABLE table_name_10 ( copa_libertadores_1996 VARCHAR, team VARCHAR )
Which Copa Libertadores 1996 has a Team of estudiantes?
SELECT copa_libertadores_1996 FROM table_name_10 WHERE team = "estudiantes"
sql_create_context
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, ...
calculate the maximum age of unmarried patients who have st-elevation myocardial infarction primary disease.
SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "STEMI"
mimicsql_data
CREATE TABLE table_8852 ( "Pick" real, "Player" text, "Position" text, "Nationality" text, "Former Team" text )
Which Player has a Pick larger than 20?
SELECT "Player" FROM table_8852 WHERE "Pick" > '20'
wikisql
CREATE TABLE table_18195 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Name the first elected for new york 1
SELECT COUNT("First elected") FROM table_18195 WHERE "District" = 'New York 1'
wikisql
CREATE TABLE table_204_381 ( id number, "sum" number, "mongolian" number, "population\n(2005)" number, "population\n(2008)" number, "population\n(2009)" number, "area\nkm2" number, "density\n/km2" number, "sum centre\npopulation" number )
in 2005 , what city had the most population recorded ?
SELECT "sum" FROM table_204_381 ORDER BY "population\n(2005)" DESC LIMIT 1
squall
CREATE TABLE trip ( id number, duration number, start_date text, start_station_name text, start_station_id number, end_date text, end_station_name text, end_station_id number, bike_id number, subscription_type text, zip_code number ) CREATE TABLE weather ( date text, ...
What are the ids and names of all start stations that were the beginning of at least 200 trips?
SELECT start_station_id, start_station_name FROM trip GROUP BY start_station_name HAVING COUNT(*) >= 200
spider
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversa...
Get quarterly breakdown of answered/unanswered questions for a tag.
SELECT DATEADD(quarter, DATEDIFF(quarter, 0, CreationDate), 0) AS quart, COUNT(p.Id) AS total_posts, SUM(CASE WHEN p.PostTypeId = 1 THEN 1 ELSE 0 END) AS questions, SUM(CASE WHEN p.PostTypeId = 2 THEN 1 ELSE 0 END) AS answers, SUM(CASE WHEN p.PostTypeId = 1 AND NOT p.AcceptedAnswerId IS NULL THEN 1 ELSE 0 END) AS answe...
sede
CREATE TABLE table_65828 ( "Internet Explorer" text, "Firefox , Other Mozilla" text, "Chrome" text, "Safari" text, "Opera" text )
What percentage of browsers were using Internet Explorer during the period in which 24.91% were using Chrome?
SELECT "Internet Explorer" FROM table_65828 WHERE "Chrome" = '24.91%'
wikisql
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...
医院8511727的住院医疗记录的数量有多少,在2002-07-15到2008-05-02这六年里?
SELECT COUNT(*) FROM zyb WHERE zyb.MED_TYPE = '8511727' AND zyb.IN_HOSP_DAYS BETWEEN '2002-07-15' AND '2008-05-02'
css
CREATE TABLE appellations ( no number, appelation text, county text, state text, area text, isava text ) CREATE TABLE wine ( no number, grape text, winery text, appelation text, state text, name text, year number, price number, score number, cases number,...
What are the grapes, appelations, and wines with scores above 93, sorted by Name?
SELECT grape, appelation, name FROM wine WHERE score > 93 ORDER BY name
spider
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service...
what are flights from BOSTON to ST. PETERSBURG
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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST. PET...
atis
CREATE TABLE train_station ( Train_ID int, Station_ID int ) CREATE TABLE train ( Train_ID int, Name text, Time text, Service text ) CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, ...
Bar chart x axis location y axis sum total passengers, show from low to high by the x axis.
SELECT Location, SUM(Total_Passengers) FROM station GROUP BY Location ORDER BY Location
nvbench
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, ...
where did i put that comment.
SELECT * FROM Comments WHERE UserId = '3604745' AND Text LIKE '%example%'
sede
CREATE TABLE table_name_33 ( coach VARCHAR, losses VARCHAR )
Who was the coach who had 215 losses?
SELECT coach FROM table_name_33 WHERE losses = 215
sql_create_context
CREATE TABLE table_19517621_4 ( title VARCHAR, written_by VARCHAR )
What is the title of the episode written by Vanessa Bates?
SELECT title FROM table_19517621_4 WHERE written_by = "Vanessa Bates"
sql_create_context