context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
among the patients of the 50s , what was the top four most frequent diagnoses?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN...
mimic_iii
CREATE TABLE table_55159 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
How many people attended the game with a record of 86-56
SELECT COUNT("Attendance") FROM table_55159 WHERE "Record" = '86-56'
wikisql
CREATE TABLE table_28529 ( "Stage" real, "Winner" text, "General classification" text, "Points Classification" text, "Mountains Classification" text, "Sprints Classification" text, "Team Classification" text )
Who led team classification during the stage whose winner was Chris Horner?
SELECT "Team Classification" FROM table_28529 WHERE "Winner" = 'Chris Horner'
wikisql
CREATE TABLE table_48682 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What is the event where the opponent was Chris Barden?
SELECT "Event" FROM table_48682 WHERE "Opponent" = 'chris barden'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, give me the comparison about the sum of price over the headquarter , and group by attribute headquarter by a bar chart, sort by the bars in asc.
SELECT Headquarter, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter
nvbench
CREATE TABLE table_7795 ( "Year" real, "Track" text, "50 cc" text, "125 cc" text, "Report" text )
What's the track for 1982?
SELECT "Track" FROM table_7795 WHERE "Year" = '1982'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
在03年3月23日到15年11月12日之间病患55566777的洋地黄情况是怎么样的?
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE diagnoses_icd ( ...
what procedure did patient 162 receive the last time.
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 162) ORDER BY procedures_icd.charttime DESC LIMIT 1)
mimic_iii
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, ...
what is discharge time and procedure icd9 code of subject id 91588?
SELECT demographic.dischtime, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "91588"
mimicsql_data
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,...
讲一下名为孙欣艳的病人在哪几次医疗记录中被开过金额高于532.62元的药,把医疗就诊编号列出来
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '孙欣艳' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 532.62)
css
CREATE TABLE table_name_13 ( state VARCHAR, owner VARCHAR )
What state is Wesson in?
SELECT state FROM table_name_13 WHERE owner = "wesson"
sql_create_context
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PendingFlags ( Id nu...
Find amount of downvotes of a post.
SELECT UpVotes, DownVotes, COUNT(*) AS AnswersCount FROM (SELECT SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS UpVotes, SUM(CASE WHEN VoteTypeId = 3 THEN -1 ELSE 0 END) AS DownVotes FROM Posts INNER JOIN Votes ON Votes.PostId = Posts.Id AND (VoteTypeId = 2 OR VoteTypeId = 3) WHERE Posts.Id = @UserId GROUP BY Posts...
sede
CREATE TABLE table_45964 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" text )
What was the money value that went along with the score of 68-67-69-76=280?
SELECT "Money ( $ )" FROM table_45964 WHERE "Score" = '68-67-69-76=280'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedb...
How many users with 0 questions?.
SELECT COUNT(a.uid) FROM (SELECT OwnerUserId AS uid FROM Posts WHERE PostTypeId = 1 GROUP BY OwnerUserId HAVING COUNT(Id) = 0) AS a
sede
CREATE TABLE order_items ( order_item_id number, order_id number, product_id number ) CREATE TABLE department_stores ( dept_store_id number, dept_store_chain_id number, store_name text, store_address text, store_phone text, store_email text ) CREATE TABLE products ( product_id ...
How many customers use each payment method?
SELECT payment_method_code, COUNT(*) FROM customers GROUP BY payment_method_code
spider
CREATE TABLE table_name_5 ( heat INTEGER, time VARCHAR )
What is the lowest heat number for a swimmer with a time of 2:34.94?
SELECT MIN(heat) FROM table_name_5 WHERE time = "2:34.94"
sql_create_context
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) 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 TAB...
hi i want a round trip ticket to DALLAS
SELECT DISTINCT flight.flight_id FROM airport_service, city, fare, flight, flight_fare WHERE city.city_code = airport_service.city_code AND city.city_name = 'DALLAS' AND NOT fare.round_trip_cost IS NULL AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id AND flight.to_airport = airport_s...
atis
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE FlagTypes ( Id number, Name text, Des...
Top iOS Users in Moscow by Reputation.
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", u.Id AS "user_link", u.Reputation FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id = p.Own...
sede
CREATE TABLE employee ( employeeid number, lastname text, firstname text, title text, reportsto number, birthdate time, hiredate time, address text, city text, state text, country text, postalcode text, phone text, fax text, email text ) CREATE TABLE playlist...
What are the durations of the longest and the shortest tracks in milliseconds?
SELECT MAX(milliseconds), MIN(milliseconds) FROM track
spider
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate tim...
Questions hidden due to ultra specific tags.
SELECT DATE(Posts.CreationDate), Posts.Tags, Posts.Id AS "post_link" FROM Posts WHERE Posts.PostTypeId = @question AND Posts.Tags LIKE ('%<' + @tagToSearch + '>%') AND NOT Posts.Tags LIKE ('%<' + @mainTag + '>%') GROUP BY Posts.Tags, Posts.Id, DATE(Posts.CreationDate) ORDER BY DATE(Posts.CreationDate) DESC
sede
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId ...
Users by Location and Reputation.
SELECT Id AS "user_link", DisplayName, Reputation, Age, UpVotes, DownVotes, Location, WebsiteUrl AS "site_link" FROM Users WHERE Reputation >= @MinRep AND Location LIKE '%' + @Location + '%' ORDER BY Reputation DESC
sede
CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_n...
where can we find some restaurants in alameda ?
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'alameda' AND restaurant.id = location.restaurant_id
restaurants
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate n...
what is the daily maximum drain 1 output ml output that patient 002-34744 has had on the current intensive care unit visit?
SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-34744') AND patient.unitdischargetime IS NUL...
eicu
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...
How many of the patients aged below 62 were admitted in hospital for more than 27 days?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "62" AND demographic.days_stay > "27"
mimicsql_data
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 transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype tex...
what is the maximum cost of a hospital bill that includes a drug called dorzolamide 2%/timolol 0.5% ophth. since 2105?
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'dorzolamide 2%/timolol 0.5% ophth.') AND STRFTIME('%y', cost.chargetime) >= '2105' GROUP BY cost.hadm_id) AS t1
mimic_iii
CREATE TABLE table_204_928 ( id number, "year" number, "album" text, "territory" text, "label" text, "notes" text )
which album came after hammer and tongs for this group ?
SELECT "album" FROM table_204_928 WHERE id = (SELECT id FROM table_204_928 WHERE "album" = 'hammer and tongs') + 1
squall
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
what is the total amount of input patient 027-144847 has received on last month/30?
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-144847')) AND intakeoutput.cellpath LIKE '%i...
eicu
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...
按照科室的不同名字和入院诊断的不同编码算算看医院5532316所有记载里患者的平均年纪
SELECT qtb.MED_ORG_DEPT_NM, qtb.IN_DIAG_DIS_CD, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '5532316' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.IN_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.IN_DIAG_DIS_CD, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '5532316' GROUP BY gyb.MED_ORG_DEPT_NM, gyb.IN_...
css
CREATE TABLE table_58903 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in Final" text, "Score in Final" text )
What is Date, when Opponent in Final is 'Guy Forget'?
SELECT "Date" FROM table_58903 WHERE "Opponent in Final" = 'guy forget'
wikisql
CREATE TABLE table_69579 ( "Year" real, "Team" text, "Chassis" text, "Engine" text, "Rank" text, "Points" real )
Which team is from earlier than 1994?
SELECT "Team" FROM table_69579 WHERE "Year" < '1994'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, C...
医疗就诊56971731612的怎么描述病情?
SELECT t_kc21.MAIN_COND_DES FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '56971731612'
css
CREATE TABLE table_name_67 ( points VARCHAR, points_for VARCHAR )
Name the point with points for of 255
SELECT points FROM table_name_67 WHERE points_for = "255"
sql_create_context
CREATE TABLE table_name_13 ( wk_9 INTEGER, wk_11 VARCHAR, wk_7 VARCHAR, wk_6 VARCHAR, wk_10 VARCHAR )
What is the highest week 9 that had a week 6 of 7, a week 10 of greater than 2, a week 7 of 5, and a week 11 less than 2?
SELECT MAX(wk_9) FROM table_name_13 WHERE wk_6 = "7" AND wk_10 > 2 AND wk_7 = "5" AND wk_11 < 2
sql_create_context
CREATE TABLE table_2506 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text )
What was the best top five result when the average start is 28.5?
SELECT MAX("Top 5") FROM table_2506 WHERE "Avg. Start" = '28.5'
wikisql
CREATE TABLE table_40006 ( "Name" text, "Date of Birth" text, "Height" real, "Weight" real, "Spike" real, "Block" real )
What is Name, when Block is 320, when Spike is more than 336, and when Date of Birth is 12.10.1978?
SELECT "Name" FROM table_40006 WHERE "Block" = '320' AND "Spike" > '336' AND "Date of Birth" = '12.10.1978'
wikisql
CREATE TABLE table_name_71 ( opponent VARCHAR, player VARCHAR )
Who was ashley sampi's opponent?
SELECT opponent FROM table_name_71 WHERE player = "ashley sampi"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
when patient 006-105495 had intake for the first time on this month/28?
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-105495')) AND intakeoutput.cellpath LIKE '%intake...
eicu
CREATE TABLE table_15117 ( "Title" text, "Length" text, "Writer" text, "Director" text, "Airdate" text )
When did the length of 60 minutes air?
SELECT "Airdate" FROM table_15117 WHERE "Length" = '60 minutes'
wikisql
CREATE TABLE table_204_506 ( id number, "seasons" number, "team" text, "ch.wins" number, "promotions" number, "relegations" number )
which three teams have been playing for the most seasons ?
SELECT "team" FROM table_204_506 WHERE "seasons" = (SELECT MAX("seasons") FROM table_204_506)
squall
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, ...
what was the name of procedure, that patient 51698 was first received during this year?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51698) AND DATETIME(procedures_icd.charttime, 'start of year') = DAT...
mimic_iii
CREATE TABLE table_74346 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
What player came from Cornell University (NCAA)?
SELECT "Player" FROM table_74346 WHERE "College/junior/club team" = 'Cornell University (NCAA)'
wikisql
CREATE TABLE table_name_84 ( record VARCHAR, date VARCHAR )
What was the record for the date of June 14?
SELECT record FROM table_name_84 WHERE date = "june 14"
sql_create_context
CREATE TABLE ROLES ( role_code VARCHAR )
What are all role codes?
SELECT role_code FROM ROLES
sql_create_context
CREATE TABLE table_26277 ( "Name" text, "Starting chip count" real, "WSOP bracelets" real, "WSOP cashes" real, "WSOP earnings" text, "Final place" text, "Prize" text )
The person who had $126,796 WSOP earnings had how many WSOP cashes?
SELECT "WSOP cashes" FROM table_26277 WHERE "WSOP earnings" = '$126,796'
wikisql
CREATE TABLE table_21178 ( "Cycle no." text, "Air dates" text, "Reward" text, "Immunity" text, "Eliminated" text, "Vote" text, "Finish" text )
Name the finish for patani
SELECT "Finish" FROM table_21178 WHERE "Eliminated" = 'Patani'
wikisql
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...
看看医疗机构科室的编码及名称,就是负责医疗就诊91661477964的那个科室
SELECT MED_ORG_DEPT_CD, MED_ORG_DEPT_NM FROM t_kc21 WHERE MED_CLINIC_ID = '91661477964'
css
CREATE TABLE table_62622 ( "Year" real, "Team" text, "Co-Drivers" text, "Class" text, "Laps" real, "Pos." text, "Class Pos." text )
Who were the co-drivers of the vehicle that had both a Class position and position of 7th?
SELECT "Co-Drivers" FROM table_62622 WHERE "Class Pos." = '7th' AND "Pos." = '7th'
wikisql
CREATE TABLE table_name_66 ( score VARCHAR, tournament VARCHAR )
What is the score in the touranament of Antalya-Belek?
SELECT score FROM table_name_66 WHERE tournament = "antalya-belek"
sql_create_context
CREATE TABLE table_name_1 ( ground VARCHAR, home_team VARCHAR )
The Home team of Sydney had which ground?
SELECT ground FROM table_name_1 WHERE home_team = "sydney"
sql_create_context
CREATE TABLE useracct ( u_id number, name text ) CREATE TABLE trust ( source_u_id number, target_u_id number, trust number ) CREATE TABLE item ( i_id number, title text ) CREATE TABLE review ( a_id number, u_id number, i_id number, rating number, rank number )
Find the number of reviews.
SELECT COUNT(*) FROM review
spider
CREATE TABLE table_name_5 ( score VARCHAR, opponents_in_the_final VARCHAR )
What is the score for the match where the opponent in the final was james cerretani todd perry?
SELECT score FROM table_name_5 WHERE opponents_in_the_final = "james cerretani todd perry"
sql_create_context
CREATE TABLE gyb ( 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...
在06年4月6日至18年5月21日内10元期间里,参保人李勇锐10元以内为小金额结算总共是多少次?
SELECT COUNT(*) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.PERSON_NM = '李勇锐' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-04-06' AND '2018-05-21' AND t_kc24.MED_AMOUT <= 10 UNION SELECT COUNT(*) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.PERSON_NM = '李勇锐' AND ...
css
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...
among patients who have been prescribed buffered lidocaine 1%, what are the four most commonly prescribed drugs at the same time during this year?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'buffered lidocaine 1%' AND DATETIME(medication.drug...
eicu
CREATE TABLE table_name_91 ( event VARCHAR, runner_up_skip VARCHAR, location VARCHAR )
What's the event that happened in Gander, Newfoundland and Labrador with Randy Ferbey runner-up?
SELECT event FROM table_name_91 WHERE runner_up_skip = "randy ferbey" AND location = "gander, newfoundland and labrador"
sql_create_context
CREATE TABLE table_1153898_1 ( semi_ddm_class VARCHAR, comparisons VARCHAR )
Is drawing tablet support part of the semi-DDM class?
SELECT semi_ddm_class FROM table_1153898_1 WHERE comparisons = "Drawing Tablet Support"
sql_create_context
CREATE TABLE table_name_20 ( producer_s_ VARCHAR, film VARCHAR )
Who was the producer for the film 'Strange Little Girls'?
SELECT producer_s_ FROM table_name_20 WHERE film = "strange little girls"
sql_create_context
CREATE TABLE table_64151 ( "Date" text, "Label" text, "Format" text, "Country" text, "Catalog" text )
What Catalog came out on August 20, 1965?
SELECT "Catalog" FROM table_64151 WHERE "Date" = 'august 20, 1965'
wikisql
CREATE TABLE table_27750 ( "Year" real, "Division" real, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text )
Name the year for open cup did not qualify and national final
SELECT COUNT("Year") FROM table_27750 WHERE "Open Cup" = 'Did not qualify' AND "Playoffs" = 'National Final'
wikisql
CREATE TABLE table_18946749_4 ( col__m_ INTEGER, prominence__m_ VARCHAR )
What is the highest value for col(m) when prominence(m) is 3755?
SELECT MAX(col__m_) FROM table_18946749_4 WHERE prominence__m_ = 3755
sql_create_context
CREATE TABLE table_203_368 ( id number, "date" text, "opponent" text, "venue" text, "result" text )
which month were the most games played in ?
SELECT "date" FROM table_203_368 GROUP BY "date" ORDER BY COUNT("opponent") DESC LIMIT 1
squall
CREATE TABLE table_73243 ( "Player" text, "Australian Open" real, "French Open" real, "Wimbledon" real, "US Open" real )
What year did Martina Navratilova win Wimbledon?
SELECT "Wimbledon" FROM table_73243 WHERE "Player" = 'Martina Navratilova'
wikisql
CREATE TABLE table_name_28 ( agg VARCHAR, team_1 VARCHAR )
What was the aggregate for the match with Sierra Leone as team 1?
SELECT agg FROM table_name_28 WHERE team_1 = "sierra leone"
sql_create_context
CREATE TABLE table_name_24 ( round VARCHAR, method VARCHAR )
What round did the match go to when tko (cut) was the method?
SELECT round FROM table_name_24 WHERE method = "tko (cut)"
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...
在2007年12月20日到2016年9月1日间15522613这个患者买了几次西药?
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '15522613' AND t_kc22.STA_DATE BETWEEN '2007-12-20' AND '2016-09-01' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID = '1...
css
CREATE TABLE table_43820 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text )
What's the record of the UCS 2 - Battle at the Barn when the round was n/a?
SELECT "Record" FROM table_43820 WHERE "Round" = 'n/a' AND "Event" = 'ucs 2 - battle at the barn'
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...
Number of answers by top 10 authors.
SELECT u.DisplayName, COUNT(p.Id) AS Answers FROM Posts AS p JOIN Users AS u ON u.Id = p.OwnerUserId WHERE p.OwnerUserId IN (SELECT Id FROM Users ORDER BY Reputation DESC LIMIT 10) AND p.PostTypeId = 2 GROUP BY u.DisplayName ORDER BY Answers DESC
sede
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE chartevents ( ...
when did patient 21302 get admitted via transfer from hosp/extram to the hospital for the first time this year?
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 21302 AND admissions.admission_location = 'transfer from hosp/extram' AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
能知道患者16019866之前看病的医院吗
SELECT zzmzjzjlb.YLJGDM FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '16019866' UNION SELECT fzzmzjzjlb.YLJGDM FROM hz_info JOIN fzzmzjzjlb ON hz_info.YLJGDM = fzzmzjzjlb.YLJGDM AND hz_info.KH = fzzmzjzjlb.KH AND hz_i...
css
CREATE TABLE table_name_52 ( facility_id INTEGER, city_of_license VARCHAR, erp_kw VARCHAR )
What is the Facility ID that has a City of license of wheeling, and a ERP kW less than 4.5?
SELECT MAX(facility_id) FROM table_name_52 WHERE city_of_license = "wheeling" AND erp_kw < 4.5
sql_create_context
CREATE TABLE table_name_33 ( player VARCHAR, round INTEGER )
Which player was selected in rounds under 3?
SELECT player FROM table_name_33 WHERE round < 3
sql_create_context
CREATE TABLE table_name_14 ( song_sung VARCHAR, status VARCHAR )
Which Song Sung has a Status of Eliminated?
SELECT song_sung FROM table_name_14 WHERE status = "eliminated"
sql_create_context
CREATE TABLE table_1341568_14 ( party VARCHAR, incumbent VARCHAR )
What party was Lane Evans?
SELECT party FROM table_1341568_14 WHERE incumbent = "Lane Evans"
sql_create_context
CREATE TABLE table_74966 ( "Condition" text, "Prothrombin time" text, "Partial thromboplastin time" text, "Bleeding time" text, "Platelet count" text )
Which Bleeding time has a Condition of factor x deficiency as seen in amyloid purpura?
SELECT "Bleeding time" FROM table_74966 WHERE "Condition" = 'factor x deficiency as seen in amyloid purpura'
wikisql
CREATE TABLE table_203_244 ( id number, "pos" text, "rider" text, "manufacturer" text, "time/retired" text, "points" number )
what is the number of riders listed ?
SELECT COUNT("rider") FROM table_203_244
squall
CREATE TABLE table_69940 ( "Date" text, "Visitor" text, "Result" text, "Score" text, "Home" text, "Record" text, "Attendance" real )
Name the date with attendance more than 19,204 and result of l and visitor of san francisco 49ers and record of 2-8-0
SELECT "Date" FROM table_69940 WHERE "Attendance" > '19,204' AND "Result" = 'l' AND "Visitor" = 'san francisco 49ers' AND "Record" = '2-8-0'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
did patient 006-40255 since 2103 receive the diagnosis of hepatic dysfunction - moderate?
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-40255')) AND diagnosis.diagnosisname = 'hepatic dysfunction - moderate' ...
eicu
CREATE TABLE table_63604 ( "Medal count" real, "Date" text, "Athlete" text, "Nation" text, "Sport" text, "Record medal event" text )
What record medal event has athletics as the sport, with robert garrett as the athlete, and a medal count less than 3?
SELECT "Record medal event" FROM table_63604 WHERE "Sport" = 'athletics' AND "Athlete" = 'robert garrett' AND "Medal count" < '3'
wikisql
CREATE TABLE table_name_43 ( player VARCHAR, height VARCHAR, current_club VARCHAR )
Who is 1.92 m tall and a current club member of Montepaschi Siena
SELECT player FROM table_name_43 WHERE height = 1.92 AND current_club = "montepaschi siena"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
what is maximum age of patients whose gender is f and discharge location is disc-tran cancer/chldrn h?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H"
mimicsql_data
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, ...
What is CJS 592 really called ?
SELECT DISTINCT name FROM course WHERE department = 'CJS' AND number = 592
advising
CREATE TABLE table_35444 ( "School" text, "Mascot" text, "Location" text, "Enrollment" real, "IHSAA Class" text, "IHSAA Football Class" text, "County" text )
What is the mascot for the school with a student body larger than 2,191 in Noblesville?
SELECT "Mascot" FROM table_35444 WHERE "Enrollment" > '2,191' AND "School" = 'noblesville'
wikisql
CREATE TABLE table_12095 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the place of the player with a 70-66-67=203 score?
SELECT "Place" FROM table_12095 WHERE "Score" = '70-66-67=203'
wikisql
CREATE TABLE table_39733 ( "Code" text, "Years" text, "Displacement (bore x stroke)/Type" text, "Power@rpm" text, "torque@rpm" text, "Compression (:1)" text )
torque@rpm of n m (lb ft)@4050 has what code?
SELECT "Code" FROM table_39733 WHERE "torque@rpm" = 'n·m (lb·ft)@4050'
wikisql
CREATE TABLE table_name_18 ( home_team VARCHAR, away_team VARCHAR )
What is the home team that played Derby County as the away team?
SELECT home_team FROM table_name_18 WHERE away_team = "derby county"
sql_create_context
CREATE TABLE table_77805 ( "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text )
What circuit did Innes Ireland win at for the I lombank trophy?
SELECT "Circuit" FROM table_77805 WHERE "Winning driver" = 'innes ireland' AND "Race Name" = 'i lombank trophy'
wikisql
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_prerequisite ( pre_cour...
MICRBIOL 642 has been taught by whom in the past ?
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN semester...
advising
CREATE TABLE table_56162 ( "Date" text, "Competition" text, "Venue" text, "Result" text, "Score" text, "Goals" text )
Which date has a Goal of deacon 4/4, withers 1 dg?
SELECT "Date" FROM table_56162 WHERE "Goals" = 'deacon 4/4, withers 1 dg'
wikisql
CREATE TABLE table_60121 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real )
What year was the 146 total?
SELECT "Year(s) won" FROM table_60121 WHERE "Total" = '146'
wikisql
CREATE TABLE table_38142 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Events" real, "Wins" real )
Events of 22, and a Rank smaller than 4 involved which of the lowest earnings ($)?
SELECT MIN("Earnings ( $ )") FROM table_38142 WHERE "Events" = '22' AND "Rank" < '4'
wikisql
CREATE TABLE table_42086 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text )
Who were the winners of the Women's Doubles in the years after 2009?
SELECT "Women's doubles" FROM table_42086 WHERE "Year" > '2009'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the sum of revenue , and group by attribute name, could you show in desc by the X-axis?
SELECT T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC
nvbench
CREATE TABLE table_54319 ( "Name" text, "Service" text, "Rank" text, "Place of action" text, "Unit" text )
Name the place of action for the marine corps and corporal rank
SELECT "Place of action" FROM table_54319 WHERE "Service" = 'marine corps' AND "Rank" = 'corporal'
wikisql
CREATE TABLE table_name_21 ( result VARCHAR, week VARCHAR, opponent VARCHAR )
What was the result in a week lower than 10 with an opponent of Chicago Bears?
SELECT result FROM table_name_21 WHERE week < 10 AND opponent = "chicago bears"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugsto...
how many times has patient 006-181433 been prescribed dextrose 50% inj in this month.
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-181433')) AND medication.drugname = 'dextrose 50% inj' AND DATETIME(medica...
eicu
CREATE TABLE table_name_84 ( number_range VARCHAR, builder VARCHAR, introduced VARCHAR )
What is the number range for the Gloucester RCW builder introduced in 1937?
SELECT number_range FROM table_name_84 WHERE builder = "gloucester rcw" AND introduced = "1937"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
Tell me the time of admission for patient Dona Cole.
SELECT demographic.admittime FROM demographic WHERE demographic.name = "Dona Cole"
mimicsql_data
CREATE TABLE table_28271 ( "No." real, "#" real, "Title" text, "Director" text, "Writer(s)" text, "Original air date" text, "Prod. code" real, "U.S. viewers (million)" text )
Who wrote the movie positioned at 8 on the list?
SELECT "Writer(s)" FROM table_28271 WHERE "#" = '8'
wikisql
CREATE TABLE table_13570 ( "Model number" text, "sSpec number" text, "Cores" text, "Frequency" text, "Turbo" text, "L2 cache" text, "L3 cache" text, "GPU model" text, "GPU frequency" text, "Socket" text, "I/O bus" text, "Release date" text, "Part number(s)" text, ...
What's the GPU model that has sSpec number SR16Z(c0)?
SELECT "GPU model" FROM table_13570 WHERE "sSpec number" = 'sr16z(c0)'
wikisql
CREATE TABLE table_1772 ( "Parish (Prestegjeld)" text, "Sub-Parish (Sogn)" text, "Church Name" text, "Year Built" real, "Location of the Church" text )
What is the total number of churches built in 1916?
SELECT COUNT("Location of the Church") FROM table_1772 WHERE "Year Built" = '1916'
wikisql
CREATE TABLE table_name_9 ( overall VARCHAR, combined VARCHAR, downhill VARCHAR )
How many overalls has 1 combined and 24 downhills?
SELECT overall FROM table_name_9 WHERE combined = "1" AND downhill = "24"
sql_create_context