context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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...
参保人27789150整数金额住院次数是多少?
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.PERSON_ID = '27789150' AND gwyjzb.CLINIC_TYPE = '住院' AND MOD(gwyjzb.MED_AMOUT, 1) = 0 UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '27789150' AND fgwyjzb.CLINIC_TYPE = '住院' AND MOD(fgwyjzb.MED_AMOUT, 1) = 0
css
CREATE TABLE table_29483673_1 ( location___city VARCHAR, institution VARCHAR )
What city is Tiffin University located in?
SELECT location___city FROM table_29483673_1 WHERE institution = "Tiffin University"
sql_create_context
CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, stud...
Visualize a bar chart about the distribution of middle_name and author_tutor_ATB .
SELECT middle_name, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
CREATE TABLE table_76860 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text )
What is the highest Game, when High Assists is 'Hedo T rko lu (7)'?
SELECT MAX("Game") FROM table_76860 WHERE "High assists" = 'hedo türkoğlu (7)'
wikisql
CREATE TABLE table_name_4 ( year_opened VARCHAR, mall_name VARCHAR )
Which year did the Short Pump Town Center Mall open?
SELECT year_opened FROM table_name_4 WHERE mall_name = "short pump town center"
sql_create_context
CREATE TABLE table_16527640_2 ( vfl_club_s_ VARCHAR, vfl_games VARCHAR )
What vfl club(s) did players who played 23 cfl games play for?
SELECT vfl_club_s_ FROM table_16527640_2 WHERE vfl_games = 23
sql_create_context
CREATE TABLE table_27731 ( "Number" real, "Name" text, "Vertices" text, "Hypotenuse 0 c" text, "Vertical 0 b" text, "Horizontal 0 a" text )
Name the vertical for ys
SELECT "Vertical 0 b" FROM table_27731 WHERE "Horizontal 0 a" = '明勾(YS月南)'
wikisql
CREATE TABLE table_2446333_2 ( date VARCHAR, round VARCHAR )
Name the total number of date for 10
SELECT COUNT(date) FROM table_2446333_2 WHERE round = 10
sql_create_context
CREATE TABLE table_45392 ( "Year" real, "Champion" text, "Runner-Up" text, "Result" text, "Date" text, "Venue" text, "Attendance" text )
Who was the champion when the attendance was 70,000?
SELECT "Champion" FROM table_45392 WHERE "Attendance" = '70,000'
wikisql
CREATE TABLE table_name_61 ( silver VARCHAR, bronze VARCHAR )
How many silver medals did the nation who received 32 bronze medals receive?
SELECT silver FROM table_name_61 WHERE bronze = 32
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
how much is patient 28447's changing heart rate last measured on the current icu visit compared to the value first measured on the current icu visit?
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28447) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i...
mimic_iii
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...
从二零零六年九月十四日到二零二零年十月七日,患者51005151在胃泌素释放肽前体上的检测记录详情
SELECT * 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 jybgb.BGDH ...
css
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...
二零一二年三月二十七日到二零一五年九月七日,在2158734医院中涉及医疗费总额多于1025.62元的科室有多少
SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '2158734' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2012-03-27' AND '2015-09-07' GROUP B...
css
CREATE TABLE table_name_34 ( duration VARCHAR, start VARCHAR, stage VARCHAR, difficulty VARCHAR )
How long does the one that stars with son bou of middle difficulty, and on a stage number larger than 13 last?
SELECT duration FROM table_name_34 WHERE stage > 13 AND difficulty = "middle" AND start = "son bou"
sql_create_context
CREATE TABLE table_name_48 ( score VARCHAR, player VARCHAR )
What is the score of player jay haas?
SELECT score FROM table_name_48 WHERE player = "jay haas"
sql_create_context
CREATE TABLE table_name_90 ( entrants INTEGER, winner VARCHAR )
What was the fewest entrants in an event won by Grant Hinkle?
SELECT MIN(entrants) FROM table_name_90 WHERE winner = "grant hinkle"
sql_create_context
CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number INTEGER, product_id INTEGER, product_title VARCHAR(80), product_quantity VARCHAR(50), product_price DECIMAL(19,4), derived_product_cost DECIMAL(19,4), derived_vat_payable DECIMAL(19,4), derived_total_cost DECIMAL...
How many accounts are opened in each day? Bin the account open day by weekday and group by other account details in a stacked bar chart, and could you sort by the Y-axis in desc?
SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts GROUP BY other_account_details ORDER BY COUNT(date_account_opened) DESC
nvbench
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...
A pie chart shows the proportion of All_Games and School_ID.
SELECT All_Games, School_ID FROM basketball_match
nvbench
CREATE TABLE Performers ( Performer_ID INTEGER, Address_ID INTEGER, Customer_Name VARCHAR(255), Customer_Phone VARCHAR(255), Customer_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Customers ( Customer_ID VARCHAR(100), Address_ID INTEGER, Customer_Name VARCHAR...
Give me a bar chart for the total number of each payment method code, show by the X in ascending.
SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code ORDER BY payment_method_code
nvbench
CREATE TABLE table_name_30 ( award VARCHAR, result VARCHAR, category VARCHAR )
Name the award won in the hall of fame
SELECT award FROM table_name_30 WHERE result = "won" AND category = "hall of fame"
sql_create_context
CREATE TABLE table_15928 ( "County" text, "English name" text, "Irish name" text, "Population" real, "Irish speakers" text )
What is the Irish name listed with 62% Irish speakers?
SELECT "Irish name" FROM table_15928 WHERE "Irish speakers" = '62%'
wikisql
CREATE TABLE table_204_245 ( id number, "#" number, "wrestlers" text, "reign" number, "date" text, "days\nheld" number, "location" text, "event" text, "notes" text )
what location saw the most matches ?
SELECT "location" FROM table_204_245 GROUP BY "location" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_name_62 ( catalog VARCHAR, format VARCHAR, label VARCHAR )
What is the catalog with an LP Format and under the Simply Vinyl label?
SELECT catalog FROM table_name_62 WHERE format = "lp" AND label = "simply vinyl"
sql_create_context
CREATE TABLE table_77468 ( "Team" text, "Athletes" text, "Run 1" text, "Run 2" text, "Run 3" text, "Run 4" text, "Final" text )
Which Final has a Team of liechtenstein (lie) liechtenstein i?
SELECT "Final" FROM table_77468 WHERE "Team" = 'liechtenstein (lie) liechtenstein i'
wikisql
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) C...
what are the nonstop flights between HOUSTON and MEMPHIS
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 = 'HOUSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MEMPH...
atis
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAd...
Inactive beginners who asked questions.
SELECT COUNT(Posts.Id) FROM Posts WHERE OwnerUserId IN (SELECT Id FROM Users WHERE Reputation < '##reputation1##' AND Reputation >= '##reputation2##' AND Users.CreationDate < DATEADD(month, -6, GETDATE())) AND PostTypeId = 1
sede
CREATE TABLE table_name_77 ( colors VARCHAR, host VARCHAR )
What are the colors of the team hosted by Christopher?
SELECT colors FROM table_name_77 WHERE host = "christopher"
sql_create_context
CREATE TABLE table_64757 ( "Game" text, "Date" text, "Opponent" text, "Score" text, "Location Attendance" text, "Record" text )
What date was the record 21-11?
SELECT "Date" FROM table_64757 WHERE "Record" = '21-11'
wikisql
CREATE TABLE table_name_86 ( points INTEGER, match VARCHAR, draw VARCHAR, lost VARCHAR )
What is the sum of points for teams with more than 10 matches, more than 0 draws, and 7 losses?
SELECT SUM(points) FROM table_name_86 WHERE draw > 0 AND lost = 7 AND match > 10
sql_create_context
CREATE TABLE table_name_12 ( Id VARCHAR )
What 2001 has a ATP World Tour Masters 1000 2007?
SELECT 2011 FROM table_name_12 WHERE 2007 = "atp world tour masters 1000"
sql_create_context
CREATE TABLE table_60948 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" text )
What is the to par of the player with a 73-70-70-65=278 score?
SELECT "To par" FROM table_60948 WHERE "Score" = '73-70-70-65=278'
wikisql
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semes...
What courses offered in the Spring or Summer semester allow me to satisfy my PreMajor requirement ?
SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, program_course AS PROGRAM_COURSEalias0...
advising
CREATE TABLE table_name_36 ( issn VARCHAR, publication_range VARCHAR )
What is the ISSN number of a publication range of 1984-?
SELECT issn FROM table_name_36 WHERE publication_range = "1984-"
sql_create_context
CREATE TABLE table_14567 ( "Week" real, "Date" text, "Visiting team" text, "Final score" text, "Host team" text, "Stadium" text )
Who was the host team when the Miami Dolphins were the visiting team?
SELECT "Host team" FROM table_14567 WHERE "Visiting team" = 'miami dolphins'
wikisql
CREATE TABLE table_44127 ( "Continent" text, "Structure" text, "Height" text, "Year" real, "Country" text )
The year 1974 has what listed as the Height?
SELECT "Height" FROM table_44127 WHERE "Year" = '1974'
wikisql
CREATE TABLE table_29154676_1 ( season_no VARCHAR, written_by VARCHAR )
How many episodes were written by Warren Leight?
SELECT COUNT(season_no) FROM table_29154676_1 WHERE written_by = "Warren Leight"
sql_create_context
CREATE TABLE table_name_5 ( date_made VARCHAR, quantity_made VARCHAR )
What is listed as the Date made with a Quantity made of 13?
SELECT date_made FROM table_name_5 WHERE quantity_made = 13
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
how many hours has time elapsed since patient 022-199074 was prescribed with valium for the first time in this hospital encounter?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 = '022-19...
eicu
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...
what is the number of patients whose days of hospital stay is greater than 27 and procedure icd9 code is 3607?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "27" AND procedures.icd9_code = "3607"
mimicsql_data
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE p...
what was the top four most frequent lab tests in this year?
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE cour...
Can I take NERS 673 any semester ?
SELECT COUNT(*) > 0 FROM semester WHERE NOT semester IN (SELECT DISTINCT SEMESTERalias1.semester FROM course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias1 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND COURSEalias0.department = 'NERS' AND COURSEalias0.number =...
advising
CREATE TABLE table_62704 ( "Season" real, "Winners" text, "Runners-up" text, "Third-place" text, "fourth-placed" text, "Number of clubs" real )
What is the number of clubs when Dalian Shide won and Sichuan Quanxing won 4th?
SELECT AVG("Number of clubs") FROM table_62704 WHERE "Winners" = 'dalian shide' AND "fourth-placed" = 'sichuan quanxing'
wikisql
CREATE TABLE table_15314901_1 ( condition_parameter VARCHAR, velocity_angle_η_in_i_radians VARCHAR )
If the velocity angle is ln[(1 + 5)/2] 0.481, what is the condition/parameter?
SELECT condition_parameter FROM table_15314901_1 WHERE velocity_angle_η_in_i_radians = "ln[(1 + √5)/2] ≅ 0.481"
sql_create_context
CREATE TABLE table_18862490_2 ( to_par VARCHAR, year VARCHAR )
What score to par won in 1998?
SELECT to_par FROM table_18862490_2 WHERE year = 1998
sql_create_context
CREATE TABLE table_25655781_17 ( mountains_classification VARCHAR, winner VARCHAR )
Who had the mountains classification when borut bo i was the winner?
SELECT mountains_classification FROM table_25655781_17 WHERE winner = "Borut Božič"
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
二零零七年五月三日到二零一七年八月二十二日的这十年里,查一下医院9214530给异地患者看病的次数
SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '9214530' AND IN_HOSP_DATE BETWEEN '2007-05-03' AND '2017-08-22' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2')
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...
列出所有药品名称中不包含酮的药和对应的价格,主要针对26338630421这个医疗就诊开出的药
SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM, AMOUNT FROM t_kc22 WHERE MED_CLINIC_ID = '26338630421' AND NOT SOC_SRT_DIRE_NM LIKE '%酮%'
css
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 real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
What is the relationship between People_ID and Height , and group by attribute Sex?
SELECT People_ID, Height FROM people GROUP BY Sex
nvbench
CREATE TABLE table_13937 ( "Pick" real, "Player" text, "Team" text, "Position" text, "School" text )
What is the total number pick for seattle mariners team?
SELECT COUNT("Pick") FROM table_13937 WHERE "Team" = 'seattle mariners'
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 demographic (...
what is the gender of patient name paul edwards?
SELECT demographic.gender FROM demographic WHERE demographic.name = "Paul Edwards"
mimicsql_data
CREATE TABLE table_203_247 ( id number, "district" text, "counties represented" text, "delegate" text, "party" text, "first elected" number, "committee" text )
in what year was galen r. clagett first elected into the western maryland delegation ?
SELECT "first elected" FROM table_203_247 WHERE "delegate" = 'galen r. clagett'
squall
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, ...
what's the name of the procedure that patient 5866 was given two or more times until 16 months ago?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 586...
mimic_iii
CREATE TABLE table_1139087_2 ( fastest_lap VARCHAR, rd VARCHAR )
Who drove the fastest lap for round 8?
SELECT fastest_lap FROM table_1139087_2 WHERE rd = 8
sql_create_context
CREATE TABLE table_38029 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text )
What is under segment C when s cuckoo clock is under segment B?
SELECT "Segment C" FROM table_38029 WHERE "Segment B" = 's cuckoo clock'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
count the number of people that died after being diagnosed with hypovolemic shock - hemorrhagic within the same month since 2105.
SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypovolemic shock - hemorrhagic') AS t1 GROUP BY t1.uniquepid HA...
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, ...
what is the name of the organism found in patient 031-16123's first microbiological nasopharynx test since 09/2104?
SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-16123')) AND microlab.culturesite = 'nasopharynx' AND STRFTIME('%y-%m...
eicu
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 are the five most commonly ordered procedures for patients who have been diagnosed with stroke - hemorrhagic stroke previously within 2 months a year before?
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'stroke - hemorrhagic stroke' AND DATETIM...
eicu
CREATE TABLE table_40969 ( "Player" text, "Nationality" text, "Position" text, "Years in Orlando" text, "School/Club Team" text )
Which Player plays Guard-Forward Position for School/Club Team Pepperdine?
SELECT "Player" FROM table_40969 WHERE "Position" = 'guard-forward' AND "School/Club Team" = 'pepperdine'
wikisql
CREATE TABLE church ( Church_ID int, Name text, Organized_by text, Open_Date int, Continuation_of text ) CREATE TABLE people ( People_ID int, Name text, Country text, Is_Male text, Age int ) CREATE TABLE wedding ( Church_ID int, Male_ID int, Female_ID int, Year ...
Please show the trend of the number of the church by open date (bin into the year) using a line chart, and I want to rank x axis from low to high order.
SELECT Open_Date, COUNT(Open_Date) FROM church ORDER BY Open_Date
nvbench
CREATE TABLE table_20050 ( "2000 :" text, "January" text, "February" text, "March" text, "April" text, "May" text, "June" text, "July" text, "August" text, "September" text, "October" text, "November" text, "December" text )
Name the february
SELECT "February" FROM table_20050
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
how many patient are with widowed marital status and lab test fluid ascites?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc21 ( 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...
苗湛英患者的医保个人账户去里有多少钱是在2001年7月5日到2010年6月12日内支出的?
SELECT SUM(t_kc24.PER_ACC_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.PERSON_NM = '苗湛英' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-07-05' AND '2010-06-12'
css
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTas...
WHERE filtering with dates and not times.
SELECT * FROM dbo.Users WHERE CreationDate = '2016/04/01'
sede
CREATE TABLE table_25983027_1 ( rainfall_by_volume__km_3__year_ VARCHAR, rainfall_by_depth__mm_year_ VARCHAR )
What was the rainfall by volume in Huetar Atlantico where the rainfall depth (mm/year) was 3527?
SELECT rainfall_by_volume__km_3__year_ FROM table_25983027_1 WHERE rainfall_by_depth__mm_year_ = 3527
sql_create_context
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CRE...
How the question ratio of the lower and higher-rep users changed with the years.
WITH Raw AS (SELECT FLOOR(LN(Users.Reputation) / LN('##LogBase:float?5##')) AS LogRep, TIME_TO_STR(Posts.CreationDate, '%Y') AS "year", Posts.PostTypeId FROM Posts, Users WHERE Posts.OwnerUserId = Users.Id AND Posts.PostTypeId IN (1, 2) AND Users.Id >= 1) SELECT DATEFROMPARTS('year', 1, 1) AS "year", 'Rep between ' + C...
sede
CREATE TABLE table_14656147_2 ( attendance INTEGER )
Find the least value of attendance?
SELECT MIN(attendance) FROM table_14656147_2
sql_create_context
CREATE TABLE table_31211 ( "Episode" text, "Theme / Date" text, "Song title" text, "Original performer" text, "Result (Placement)" text )
What the title of the song when the result is to the live shows?
SELECT "Song title" FROM table_31211 WHERE "Result (Placement)" = 'to the Live Shows'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE icustays ( row_id number, subj...
what is the maximum daily number of patients who suffer from obs chr bronc w(ac) exac until 3 years ago?
SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'obs chr bronc w(ac) exac') AND DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-3 year'...
mimic_iii
CREATE TABLE table_4680 ( "Team" text, "Constructor" text, "Motorcycle" text, "Rider" text, "Rounds" text )
Who is riding the Ducati 999 RS in Round 7?
SELECT "Rider" FROM table_4680 WHERE "Rounds" = '7' AND "Motorcycle" = 'ducati 999 rs'
wikisql
CREATE TABLE table_name_65 ( date VARCHAR, catalog VARCHAR )
What is the Date for Catalog of lp 5060?
SELECT date FROM table_name_65 WHERE catalog = "lp 5060"
sql_create_context
CREATE TABLE Financial_transactions ( transaction_type VARCHAR, transaction_amount INTEGER )
What is the transaction type that has processed the greatest total amount in transactions?
SELECT transaction_type FROM Financial_transactions GROUP BY transaction_type ORDER BY SUM(transaction_amount) DESC LIMIT 1
sql_create_context
CREATE TABLE table_62314 ( "Pick" real, "Player" text, "Team" text, "Position" text, "Hometown/School" text )
What Hometown/School had a pick above 30, position of OF and team of Cleveland Indians?
SELECT "Hometown/School" FROM table_62314 WHERE "Pick" > '30' AND "Position" = 'of' AND "Team" = 'cleveland indians'
wikisql
CREATE TABLE table_name_87 ( bronze INTEGER, total INTEGER )
What is the lowest number of bronze medals for a nation with fewer than 1 total medal?
SELECT MIN(bronze) FROM table_name_87 WHERE total < 1
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientuni...
what was patient 017-24595's weight the last time in 07/this year?
SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-24595') AND NOT patient.admissionweight IS NULL AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-...
eicu
CREATE TABLE phone_market ( Market_ID VARCHAR, Phone_ID VARCHAR ) CREATE TABLE market ( Market_ID VARCHAR, Num_of_shops INTEGER ) CREATE TABLE phone ( Name VARCHAR, Phone_ID VARCHAR )
Show the names of phones that are on market with number of shops greater than 50.
SELECT T3.Name FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID WHERE T2.Num_of_shops > 50
sql_create_context
CREATE TABLE table_36509 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What was the record after the bout lasting 4:15?
SELECT "Record" FROM table_36509 WHERE "Time" = '4:15'
wikisql
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 tagged excel or vba.
SELECT COUNT(Id) AS num FROM Posts WHERE Tags LIKE '%vba%' OR Tags LIKE '%excel%'
sede
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
provide the number of patients whose diagnoses long title is hyperacusis and lab test category is blood gas?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Hyperacusis" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE table_name_70 ( swing_to_gain INTEGER, winning_party_2007 VARCHAR, rank VARCHAR )
What's the sum of swing to gain with a winning party 2007 of Conservative with a rank smaller than 5?
SELECT SUM(swing_to_gain) FROM table_name_70 WHERE winning_party_2007 = "conservative" AND rank < 5
sql_create_context
CREATE TABLE table_7074 ( "Name" text, "GP-GS" text, "Yards" real, "Long" real, "Avg/G" real )
What is the total number of avg/g with a long of 50, a gp-gs of 3-0, and 926 yards?
SELECT COUNT("Avg/G") FROM table_7074 WHERE "Long" = '50' AND "GP-GS" = '3-0' AND "Yards" > '926'
wikisql
CREATE TABLE table_55165 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the name of the venue that they away team Collingwood played at?
SELECT "Venue" FROM table_55165 WHERE "Away team" = 'collingwood'
wikisql
CREATE TABLE table_30402 ( "# (season #)" text, "No. (episode #)" text, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" text )
What numbered episode was directed by greg colton and written by patrick meighan?
SELECT "No. (episode #)" FROM table_30402 WHERE "Directed by" = 'Greg Colton' AND "Written by" = 'Patrick Meighan'
wikisql
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
哪个人申请的检验报告单51684992743其工号以及姓名都是什么?
SELECT SQRGH, SQRXM FROM jybgb WHERE BGDH = '51684992743'
css
CREATE TABLE table_60357 ( "Tournament" text, "1988" text, "1990" text, "1991" text, "1992" text, "1993" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "Career SR" text, "Career Win-Loss" text )
What is the 1991 for 2R 1999?
SELECT "1991" FROM table_60357 WHERE "1999" = '2r'
wikisql
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId...
How many users provide all accepted answers in the last year in the given tag.
SELECT COUNT(DISTINCT a.OwnerUserId) AS "distinct_users", COUNT(DISTINCT a.OwnerUserId) * 1.0 / COUNT(DISTINCT a.Id) AS "ratio", COUNT(a.Id) AS "accepted_answers", t.TagName, CURRENT_TIMESTAMP() - 366 AS "year_ago" FROM Posts AS q INNER JOIN Posts AS a ON q.AcceptedAnswerId = a.Id JOIN PostTags AS pt ON pt.PostId = q.I...
sede
CREATE TABLE bdmzjzjlb ( 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...
之前,患者22973171有哪些异常情况?
SELECT * FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime t...
what is the first care unit of patient 73713 during this year?
SELECT transfers.careunit FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73713) AND NOT transfers.careunit IS NULL AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY transfers.intime LIMIT 1
mimic_iii
CREATE TABLE procedures ( code number, name text, cost number ) CREATE TABLE stay ( stayid number, patient number, room number, staystart time, stayend time ) CREATE TABLE physician ( employeeid number, name text, position text, ssn number ) CREATE TABLE appointment ( ...
List the physicians' employee ids together with their primary affiliation departments' ids.
SELECT physician, department FROM affiliated_with WHERE primaryaffiliation = 1
spider
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, ...
医院9671663中根据出院诊断疾病的名称不同疾病的平均患者年龄分别是多大啊?
SELECT gwyjzb.OUT_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '9671663' GROUP BY gwyjzb.OUT_DIAG_DIS_NM UNION SELECT fgwyjzb.OUT_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '9671663' GROUP BY fgwyjzb.OUT_DIAG_DIS_NM
css
CREATE TABLE table_203_105 ( id number, "name" text, "street address" text, "years as tallest" text, "height\nft (m)" text, "floors" number )
how long did the lumber exchange building stand as the tallest building ?
SELECT "years as tallest" - "years as tallest" FROM table_203_105 WHERE "name" = 'lumber exchange building'
squall
CREATE TABLE table_44415 ( "Overall ranking" text, "Lat. Am. ranking" text, "Countries surveyed" real, "% rank." text, "Date" text )
Date for less than 122 countries and a 47% rank?
SELECT "Date" FROM table_44415 WHERE "Countries surveyed" < '122' AND "% rank." = '47'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 te...
在一六年十二月二十七日到二零年九月十九日这段时间内,找医生06844302看病的门诊病人有多少
SELECT COUNT(hz_info.RYBH) 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_in...
css
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) ...
since 2105, what are the top five most frequently ordered laboratory tests for patients within 2 months after they have been diagnosed with cholangiocarcinoma?
SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'cholangiocarcinoma' AND STRFTIME('%y', diagnosis.dia...
eicu
CREATE TABLE table_name_15 ( points INTEGER, equipment VARCHAR, position VARCHAR )
What were highest points received from someone using a zabel-wsp with a position greater than 7?
SELECT MAX(points) FROM table_name_15 WHERE equipment = "zabel-wsp" AND position > 7
sql_create_context
CREATE TABLE table_46386 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Series" text )
Which Decision has a Visitor of vancouver, and a Score of 5 4?
SELECT "Decision" FROM table_46386 WHERE "Visitor" = 'vancouver' AND "Score" = '5 – 4'
wikisql
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) 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, ...
Visualize a bar chart about the distribution of meter_300 and meter_100 , list total number in ascending order.
SELECT meter_300, meter_100 FROM swimmer ORDER BY meter_100
nvbench
CREATE TABLE table_name_69 ( finish INTEGER, year VARCHAR, manufacturer VARCHAR )
What is the smallest finish time for a race after 1972 with a car manufactured by pontiac?
SELECT MIN(finish) FROM table_name_69 WHERE year > 1972 AND manufacturer = "pontiac"
sql_create_context
CREATE TABLE table_name_11 ( topinka__r_ VARCHAR, date VARCHAR )
Which Topinka happened on january 22, 2006?
SELECT topinka__r_ FROM table_name_11 WHERE date = "january 22, 2006"
sql_create_context
CREATE TABLE table_21346 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real, "Competition" text, "Man of the Match" text )
Name the opponent for 4th
SELECT "Opponent" FROM table_21346 WHERE "Date" = '4th'
wikisql
CREATE TABLE table_7564 ( "Player" text, "Country" text, "Year(s) won" text, "Total" text, "To par" text )
Which player had a total of 152?
SELECT "Player" FROM table_7564 WHERE "Total" = '152'
wikisql