context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_62179 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What was the competition when the score was 3-0?
SELECT "Competition" FROM table_62179 WHERE "Score" = '3-0'
wikisql
CREATE TABLE table_name_64 ( perpetrator VARCHAR, location VARCHAR )
Who is the perpetrator in Bait Al-Aqari?
SELECT perpetrator FROM table_name_64 WHERE location = "bait al-aqari"
sql_create_context
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...
门诊诊断01248413这个病人患有精神抑郁症,611743检测指标的结果定量是什么?对应的单位呢
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 jyb...
css
CREATE TABLE table_44422 ( "q > 1" real, "q > 1.05" real, "q > 1.1" real, "q > 1.2" real, "q > 1.3" real, "q > 1.4" real )
What is the total of q > 1.4 when q > 1.3 is 455, and q >1.2 is less than 3,028?
SELECT SUM("q > 1.4") FROM table_44422 WHERE "q > 1.3" = '455' AND "q > 1.2" < '3,028'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
give me the number of patients diagnosed with alzheimer's disease who were admitted for more than 7 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "7" AND diagnoses.short_title = "Alzheimer's disease"
mimicsql_data
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...
患者61785002检查过哪些项目
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '61785002' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
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 ...
Karma By User By Post. how long before I get tag badges?
SELECT OwnerUserId, Users.DisplayName, Users.UpVotes, Posts.Id, Posts.CreationDate, COUNT(*) AS AnswerUpvotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 INNER JOIN Users ON Users.Id = Owner...
sede
CREATE TABLE table_56491 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
Who constructed juan manuel fangio's car with over 76 laps and a grid under 10?
SELECT "Constructor" FROM table_56491 WHERE "Grid" < '10' AND "Laps" > '76' AND "Driver" = 'juan manuel fangio'
wikisql
CREATE TABLE table_204_725 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
how many countries earned no bronze medals ?
SELECT COUNT("nation") FROM table_204_725 WHERE "bronze" = 0
squall
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 prescriptions ( subject_id text, hadm_id...
what is the number of patients whose admission year is less than 2184 and procedure short title is left heart cardiac cath?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2184" AND procedures.short_title = "Left heart cardiac cath"
mimicsql_data
CREATE TABLE table_24565004_17 ( goals¹ VARCHAR, name VARCHAR )
Name the goals for mauricio pochettino
SELECT goals¹ FROM table_24565004_17 WHERE name = "Mauricio Pochettino"
sql_create_context
CREATE TABLE table_name_52 ( place VARCHAR, player VARCHAR )
What is the Place when Steve Pate was the player?
SELECT place FROM table_name_52 WHERE player = "steve pate"
sql_create_context
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 text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
因疾病O27.911在科室514住院的人在2000年2月3日到2005年12月31间的平均费用?
SELECT AVG(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.MED_ORG_DEPT_CD = '514' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-02-03' AND '2005-12-31' AND t_kc21.IN_DIAG_DIS_CD = 'O27.911' AND t_kc21.CLINIC_TYPE = '住院'
css
CREATE TABLE table_27005 ( "Artist/Band" text, "Song" text, "Disney affiliated" text, "Released" real, "US exclusive" text, "EU exclusive" text )
Name the most released for the in crowd
SELECT MAX("Released") FROM table_27005 WHERE "Song" = 'The In Crowd'
wikisql
CREATE TABLE table_72937 ( "Season" text, "Date Released" text, "# Of Episodes" real, "# Of Discs" real, "Special Features" text )
How many discs for the complete 4th series?
SELECT MAX("# Of Discs") FROM table_72937 WHERE "Season" = 'The Complete 4th Series'
wikisql
CREATE TABLE table_31205 ( "Skip (Club)" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real )
Which skip (club) had 31 PA and 9 blank ends?
SELECT "Skip (Club)" FROM table_31205 WHERE "PA" = '31' AND "Blank Ends" = '9'
wikisql
CREATE TABLE table_name_19 ( psip_short_name VARCHAR, video VARCHAR, programming VARCHAR )
What is the short name having video of 720p and programming of Main KSTC-TV programming?
SELECT psip_short_name FROM table_name_19 WHERE video = "720p" AND programming = "main kstc-tv programming"
sql_create_context
CREATE TABLE member ( Member_ID text, Name text, Nationality text, Role text ) CREATE TABLE performance ( Performance_ID real, Date text, Host text, Location text, Attendance int ) CREATE TABLE member_attendance ( Member_ID int, Performance_ID int, Num_of_Pieces int )
Compare the total number of locations in each location using a bar graph, and display x axis from high to low order please.
SELECT Location, COUNT(Location) FROM performance GROUP BY Location ORDER BY Location DESC
nvbench
CREATE TABLE table_24945 ( "Rank" real, "Athlete" text, "Nation" text, "Olympics" text, "Gold" real, "Silver" real, "Bronze" real, "Total(min. 2 medals)" real )
What is the maximum number of golds?
SELECT MAX("Gold") FROM table_24945
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
查询编号为84760350这个病人在医院9310059中,出院诊断疾病名称不包含睡眠的医疗就诊记录编号
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '84760350' AND qtb.MED_SER_ORG_NO = '9310059' AND NOT qtb.OUT_DIAG_DIS_NM LIKE '%睡眠%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '84760350' AND gyb.MED_SER_ORG_NO = '9310059' AND NOT gyb.OUT_DIAG_DIS_NM LIKE '%睡眠%' UNION SELECT zyb.MED_CLINIC_ID...
css
CREATE TABLE table_10312 ( "Round" real, "Grand Prix" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Winning Constructor" text, "Report" text )
When the winning driver was jacques villeneuve what was the fastest lap driven?
SELECT "Fastest Lap" FROM table_10312 WHERE "Winning Driver" = 'jacques villeneuve'
wikisql
CREATE TABLE table_204_249 ( id number, "km" number, "municipality" text, "location" text, "interescting highway" text, "notes" text )
how many notes are there ?
SELECT COUNT("notes") FROM table_204_249
squall
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimme...
Show me about the distribution of meter_400 and ID in a bar chart, and order by the y axis in asc.
SELECT meter_400, ID FROM swimmer ORDER BY ID
nvbench
CREATE TABLE table_train_163 ( "id" int, "pulse_oximetry" int, "hemoglobin_a1c_hba1c" float, "body_weight" float, "allergy_to_adhesive" bool, "creatinine_clearance_cl" float, "NOUSE" float )
allergy to adhesives
SELECT * FROM table_train_163 WHERE allergy_to_adhesive = 1
criteria2sql
CREATE TABLE table_12434380_1 ( school_colors VARCHAR, main_campus_location VARCHAR )
How many school colors is there for the main campus location of highland?
SELECT COUNT(school_colors) FROM table_12434380_1 WHERE main_campus_location = "Highland"
sql_create_context
CREATE TABLE table_55911 ( "Date" text, "Name" text, "Flag" text, "Tonnage (GRT)" real, "Sunk by" text )
What is the date for Zouave?
SELECT "Date" FROM table_55911 WHERE "Name" = 'zouave'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
经过到门诊进行诊断被确定为疾病I58.073的人他们的籍贯名称、代码以及相应人数分别是多少?
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND ...
css
CREATE TABLE table_33750 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is melbourne's home team score?
SELECT "Home team score" FROM table_33750 WHERE "Home team" = 'melbourne'
wikisql
CREATE TABLE table_name_25 ( smoke_point VARCHAR, monounsaturated_fat VARCHAR )
Name the smoke point for monosaturated fat of 30g
SELECT smoke_point FROM table_name_25 WHERE monounsaturated_fat = "30g"
sql_create_context
CREATE TABLE table_name_47 ( affiliation VARCHAR, nickname VARCHAR )
Which Affiliation has a Nickname of cougars?
SELECT affiliation FROM table_name_47 WHERE nickname = "cougars"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, ...
when did patient 17944 get discharged from the hospital for the first time in this year?
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 17944 AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY admissions.dischtime LIMIT 1
mimic_iii
CREATE TABLE table_29646 ( "Rnd" real, "Circuit" text, "Sports +2.0 Winning Team" text, "Sports 2.0 Winning Team" text, "GT +2.0 Winning Team" text, "GT 2.0 Winning Team" text, "Results" text )
Name results for herb wetanson
SELECT "Results" FROM table_29646 WHERE "GT 2.0 Winning Team" = 'Herb Wetanson'
wikisql
CREATE TABLE table_29770377_1 ( train_number VARCHAR, train_name VARCHAR, destination VARCHAR )
What is the train number for the train name island express with a destination of kanniyakumari?
SELECT train_number FROM table_29770377_1 WHERE train_name = "Island Express" AND destination = "Kanniyakumari"
sql_create_context
CREATE TABLE table_name_27 ( opponent VARCHAR, attendance INTEGER )
who was the opponent when the attendance was larger than 54,766?
SELECT opponent FROM table_name_27 WHERE attendance > 54 OFFSET 766
sql_create_context
CREATE TABLE table_61001 ( "Date" text, "Opponent" text, "Home/Away" text, "Field" text, "Result" text )
What field is an opponent of cannons and resulted with w 16-11?
SELECT "Field" FROM table_61001 WHERE "Opponent" = 'cannons' AND "Result" = 'w 16-11'
wikisql
CREATE TABLE table_name_43 ( margin_of_victory VARCHAR, date VARCHAR )
What is the Margin of victory on 27 feb 2011?
SELECT margin_of_victory FROM table_name_43 WHERE date = "27 feb 2011"
sql_create_context
CREATE TABLE table_203_563 ( id number, "#" number, "judge" text, "state" text, "born/died" text, "active" text, "chief" text, "senior" text, "appointed by" text, "reason for\ntermination" text )
who was the only judge appointed by mckinley ?
SELECT "judge" FROM table_203_563 WHERE "appointed by" = 'mckinley'
squall
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, ...
how many patients whose procedure icd9 code is 8960 and drug type is main?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "8960" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_48157 ( "Year" real, "Championship" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner-up" text, "Winner's share ( $ )" real )
What Championship had a winning score of 69-71-67-68=275?
SELECT "Championship" FROM table_48157 WHERE "Winning score" = '69-71-67-68=275'
wikisql
CREATE TABLE table_64689 ( "Team #1" text, "Agg." text, "Team #2" text, "1st leg" text, "2nd leg" text )
What is team 1 when the 1st leg is 92-82?
SELECT "Team #1" FROM table_64689 WHERE "1st leg" = '92-82'
wikisql
CREATE TABLE table_14102379_4 ( opponent VARCHAR, stadium VARCHAR )
what's the opponent with stadium being jeppesen stadium
SELECT opponent FROM table_14102379_4 WHERE stadium = "Jeppesen stadium"
sql_create_context
CREATE TABLE table_49835 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who had the highest rebounds on game 5?
SELECT "High rebounds" FROM table_49835 WHERE "Game" = '5'
wikisql
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 jyjgzbb ( BGDH text, BGRQ tim...
患者37544109在2015年2月26日到2020年8月30日内所做的检测丙戊酸的检查是哪个医务人员工号及姓名都是什么?
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH ...
css
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number,...
what was the name of the drug, which patient 009-16880 had been prescribed two times?
SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009...
eicu
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text...
作为检验报告单66750698552的检验技师的工号以及姓名是啥?
SELECT JYJSGH, JYJSQM FROM jybgb WHERE BGDH = '66750698552'
css
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, U...
Top 20 users from Sri Lanka.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%Sri Lanka%' OR UPPER(Location) LIKE '%SRI LANKA' ORDER BY Reputation DESC LIMIT 20
sede
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal bool...
Look for all questions where two users have contributed with any of question, answer or comment. Look for all questions where two users have contributed with any of question, answer or comment
SELECT COALESCE(ParentId, Id) FROM Posts WHERE OwnerUserId = '##UserA##' INTERSECT SELECT COALESCE(ParentId, Id) FROM Posts WHERE OwnerUserId = '##UserB##' ORDER BY COALESCE(ParentId, Id) DESC
sede
CREATE TABLE table_2866514_1 ( written_by VARCHAR, us_viewers__million_ VARCHAR )
Who wrote the episode with 3.96 million US viewers?
SELECT written_by FROM table_2866514_1 WHERE us_viewers__million_ = "3.96"
sql_create_context
CREATE TABLE table_67207 ( "Year" real, "Denomination" text, "Reverse" text, "Weight" text, "Diameter" text, "Fineness" text, "Series" text )
What was the fineness prior to 2007?
SELECT "Fineness" FROM table_67207 WHERE "Year" < '2007'
wikisql
CREATE TABLE Student_Addresses ( student_id INTEGER, address_id INTEGER, date_address_from DATETIME, date_address_to DATETIME, monthly_rental DECIMAL(19,4), other_details VARCHAR(255) ) CREATE TABLE Students ( student_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middl...
Find date_address_to and the average of monthly_rental , and group by attribute other_details and bin date_address_to by weekday, and visualize them by a bar chart.
SELECT date_address_to, AVG(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_name_24 ( date VARCHAR, surface VARCHAR )
What is Date, when Surface is 'Carpet'?
SELECT date FROM table_name_24 WHERE surface = "carpet"
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
How many patients stayed in hospital for more than 2 days and tested with joint fluid in lab?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "2" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE area ( course_id int, area varchar...
In reference to upper-level classes , who would be teaching ?
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 program_...
advising
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
what is the maximum age of patients who were admitted to the hospital urgently in or after the year 2177?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.admityear >= "2177"
mimicsql_data
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 prescriptions ( subject_id text, hadm_id...
what is the number of patients whose religion is protestant quaker and lab test name is ferritin?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "PROTESTANT QUAKER" AND lab.label = "Ferritin"
mimicsql_data
CREATE TABLE table_name_93 ( score VARCHAR, date VARCHAR )
What was the Score on January 30?
SELECT score FROM table_name_93 WHERE date = "january 30"
sql_create_context
CREATE TABLE table_78748 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text )
What's the status on 16/12/1995?
SELECT "Status" FROM table_78748 WHERE "Date" = '16/12/1995'
wikisql
CREATE TABLE table_38820 ( "Game" text, "Date" text, "Result" text, "Site" text, "Series" text )
Name the series with game of game 6
SELECT "Series" FROM table_38820 WHERE "Game" = 'game 6'
wikisql
CREATE TABLE table_9250 ( "Rank" text, "Runs" text, "Opponent" text, "Venue" text, "Season" text )
Which venue is rank 3?
SELECT "Venue" FROM table_9250 WHERE "Rank" = '3'
wikisql
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...
查查医疗机构6085358收费top12的项目都是哪些项目
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '6085358' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 12 UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.ME...
css
CREATE TABLE table_171236_2 ( area_km_2 VARCHAR, official_name VARCHAR )
What is the Area KM 2 of Rothesay?
SELECT COUNT(area_km_2) FROM table_171236_2 WHERE official_name = "Rothesay"
sql_create_context
CREATE TABLE table_2669287_1 ( season VARCHAR, viewers__in_millions_ VARCHAR )
When did the season finale reached an audience of 10.02 million viewers?
SELECT season AS finale FROM table_2669287_1 WHERE viewers__in_millions_ = "10.02"
sql_create_context
CREATE TABLE table_name_41 ( round VARCHAR, date VARCHAR )
What is the round played on 13 October 1984?
SELECT round FROM table_name_41 WHERE date = "13 october 1984"
sql_create_context
CREATE TABLE election ( election_id number, counties_represented text, district number, delegate text, party number, first_elected number, committee text ) CREATE TABLE county ( county_id number, county_name text, population number, zip_code text ) CREATE TABLE party ( ...
How many distinct governors are there?
SELECT COUNT(DISTINCT governor) FROM party
spider
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, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
What is the Spring-Summer schedule for upper-level MO offerings ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MO' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spring-S...
advising
CREATE TABLE table_69822 ( "Cyclist" text, "Nation" text, "Team" text, "Time" text, "UCI Points" real )
Who is the cyclist from the GCE team and had UCI points under 20?
SELECT "Cyclist" FROM table_69822 WHERE "Team" = 'gce' AND "UCI Points" < '20'
wikisql
CREATE TABLE table_23512864_4 ( election_year INTEGER, assembly VARCHAR )
If the assembly is the sixth assembly, what is the maximum election year?
SELECT MAX(election_year) FROM table_23512864_4 WHERE assembly = "Sixth assembly"
sql_create_context
CREATE TABLE club ( club_id number, name text, region text, start_year text ) CREATE TABLE player ( player_id number, name text, position text, club_id number, apps number, tries number, goals text, points number ) CREATE TABLE competition ( competition_id number, ...
List the most common type of competition.
SELECT competition_type FROM competition GROUP BY competition_type ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_name_90 ( time VARCHAR, heat_rank VARCHAR )
Tell me the total number of time for heat rank of 1
SELECT COUNT(time) FROM table_name_90 WHERE heat_rank = 1
sql_create_context
CREATE TABLE table_name_70 ( city_location VARCHAR, pole_position VARCHAR, winning_driver VARCHAR )
Where did Rick Mears win, after starting in Pole Position?
SELECT city_location FROM table_name_70 WHERE pole_position = "rick mears" AND winning_driver = "rick mears"
sql_create_context
CREATE TABLE manufacturer ( Manufacturer_ID int, Open_Year real, Name text, Num_of_Factories int, Num_of_Shops int ) CREATE TABLE furniture_manufacte ( Manufacturer_ID int, Furniture_ID int, Price_in_Dollar real ) CREATE TABLE furniture ( Furniture_ID int, Name text, Num_of...
Find the number of funiture types produced by each manufacturer as well as the company names Show bar chart, and sort in descending by the Y-axis.
SELECT Name, COUNT(*) FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.Manufacturer_ID = t2.Manufacturer_ID GROUP BY t1.Manufacturer_ID ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varc...
what kind of airplane goes from PHILADELPHIA to SAN FRANCISCO monday stopping in DALLAS in the afternoon FIRST class flight
SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, date_day, days, equipment_sequence, fare, fare_basis, flight, flight_fare, flight_stop WHERE ((((date_da...
atis
CREATE TABLE table_name_18 ( team VARCHAR, home_run VARCHAR )
Which team has a Home Run of 27?
SELECT team FROM table_name_18 WHERE home_run = 27
sql_create_context
CREATE TABLE table_27383390_4 ( outgoing_head_coach VARCHAR, incoming_head_coach VARCHAR )
Who is the outgoing head coach when the incoming head coach is abdollah veysi?
SELECT outgoing_head_coach FROM table_27383390_4 WHERE incoming_head_coach = "Abdollah Veysi"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( ...
the systemicmean of patient 005-87465 last measured on the current intensive care unit visit was less than first measured on the current intensive care unit visit?
SELECT (SELECT vitalperiodic.systemicmean FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-87465') AND patient.unitdischargetime IS N...
eicu
CREATE TABLE table_name_99 ( silver INTEGER, bronze VARCHAR )
Bronze of 22 has what average silver?
SELECT AVG(silver) FROM table_name_99 WHERE bronze = 22
sql_create_context
CREATE TABLE table_name_60 ( muzzle_velocity VARCHAR, muzzle_energy VARCHAR )
What is the muzzle velocity for the muzzle energy 351ft lbf (476 j)?
SELECT muzzle_velocity FROM table_name_60 WHERE muzzle_energy = "351ft•lbf (476 j)"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text, person_info_CSD text, person_info_CSRQ time, person_info_GJDM text, person_info_GJMC text, person_info_JGDM text, person_info_JGMC text, person_info_MZDM text, person_info_MZMC text, person_info_XBDM ...
报一下身高和体重,患者褚永福的
SELECT mzjzjlb.SG, mzjzjlb.TZ FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '褚永福'
css
CREATE TABLE table_30424 ( "Institution" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Team Nickname" text, "Primary conference" text )
What was the highest number of students in attendance for the university of north texas?
SELECT MAX("Enrollment") FROM table_30424 WHERE "Institution" = 'University of North Texas'
wikisql
CREATE TABLE table_74196 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
In how many different games did Luke Ridnour (5) did the most high assists?
SELECT COUNT("Game") FROM table_74196 WHERE "High assists" = 'Luke Ridnour (5)'
wikisql
CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGER ) CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Settlements ( Settlement_ID INTEGER, Clai...
Bar chart of sum amount payment from each payment method code
SELECT Payment_Method_Code, SUM(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code
nvbench
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( ...
how many patients were staying in tsicu careunits in 2102?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'tsicu' AND STRFTIME('%y', transfers.intime) = '2102')
mimic_iii
CREATE TABLE table_204_562 ( id number, "no." number, "date" text, "location" text, "surface" text, "opponent in final" text, "score" text )
how many matches were played on a hard surface ?
SELECT COUNT(*) FROM table_204_562 WHERE "surface" = 'hard'
squall
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, a bar chart shows the distribution of name and the average of code , and group by attribute name, and display by the names from high to low.
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC
nvbench
CREATE TABLE table_5425 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real )
What was the record of the game after Week 6 with an attendance larger than 52,560?
SELECT "Record" FROM table_5425 WHERE "Week" > '6' AND "Attendance" > '52,560'
wikisql
CREATE TABLE table_5308 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
Which College has a Pick # larger than 25, and a Round of 7, and a Name of chris white?
SELECT "College" FROM table_5308 WHERE "Pick #" > '25' AND "Round" = '7' AND "Name" = 'chris white'
wikisql
CREATE TABLE table_name_70 ( control VARCHAR, conservative_party VARCHAR )
What was the control for the year with a Conservative Party result of 10 (+5)?
SELECT control FROM table_name_70 WHERE conservative_party = "10 (+5)"
sql_create_context
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE month ( ...
please show me flights available from PITTSBURGH to ATLANTA on a weekday
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, days AS DAYS_0, days AS DAYS_1, days AS DAYS_2, days AS DAYS_3, days AS DAYS_4, flight WHERE (((((DAYS_3.day_name = 'THURSDAY' AND DAYS_4.day_name = 'FRIDAY' AND flight.fligh...
atis
CREATE TABLE table_name_36 ( audience VARCHAR, episode VARCHAR )
What was the audience for Episode 21?
SELECT audience FROM table_name_36 WHERE episode = "21"
sql_create_context
CREATE TABLE table_55645 ( "Round" real, "Grand Prix" text, "Date" text, "Location" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Winning Constructor" text, "Report" text )
What was the date for the canadian grand prix?
SELECT "Date" FROM table_55645 WHERE "Grand Prix" = 'canadian grand prix'
wikisql
CREATE TABLE table_name_6 ( score VARCHAR, date VARCHAR )
What is the Score that has a Date of 2005-10-29?
SELECT score FROM table_name_6 WHERE date = "2005-10-29"
sql_create_context
CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE participates_in ( stuid number, actid number ) CREATE TABLE faculty ( facid number, lname text, fname text, rank text, sex text, phone number, room text, building text ) CREATE TABLE stude...
Which faculty members advise two ore more students? Give me their faculty ids.
SELECT T1.facid FROM faculty AS T1 JOIN student AS T2 ON T1.facid = T2.advisor GROUP BY T1.facid HAVING COUNT(*) >= 2
spider
CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int ) CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text ) CREATE TABLE editor ( Editor_ID int, Name text, Age real )
Give me a bar chart to show the theme and their sales of the journal which did not have any of the listed editors serving on the committee.
SELECT T1.Theme, T1.Sales FROM journal EXCEPT SELECT T1.Date, T1.Theme, T1.Sales FROM journal AS T1 JOIN journal_committee AS T2 ON T1.Journal_ID = T2.Journal_ID
nvbench
CREATE TABLE table_3624 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
What party represents the district with incumbent matthew clay?
SELECT "Party" FROM table_3624 WHERE "Incumbent" = 'Matthew Clay'
wikisql
CREATE TABLE table_7000 ( "Category" text, "Frequency" text, "White" real, "Brown" real, "Black" real, "Amerindian" real, "Yellow" real, "Total" real )
What is the average Black, when White is less than 6,02, and when Total is greater than 100,00?
SELECT AVG("Black") FROM table_7000 WHERE "White" < '6,02' AND "Total" > '100,00'
wikisql
CREATE TABLE table_11064 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the home team's score for the game at Junction Oval?
SELECT "Home team score" FROM table_11064 WHERE "Venue" = 'junction oval'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
give me the number of widow patients who have other preterm infants, 750-999 grams diagnoses.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "WIDOWED" AND diagnoses.long_title = "Other preterm infants, 750-999 grams"
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, ...
医院8988339从两千年五月十六日到一一年八月六日的门诊就诊中,有多少科室开出的检验报告单没超过1张
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM zzmzjzjlb JOIN jybgb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE zzmzjzjlb.YLJGDM = '8988339' AND jybgb.BGRQ BETWEEN '2000-05-16' AND '2011-08-06' GROUP BY jybgb.KSBM HAVING COUNT(*) <= 1 UNION SELECT jybgb.KSBM FROM fzzmzjzjlb ...
css
CREATE TABLE table_13630 ( "Rank" real, "Player" text, "County" text, "Tally" text, "Total" real, "Opposition" text )
Which Player has an Opposition of clare?
SELECT "Player" FROM table_13630 WHERE "Opposition" = 'clare'
wikisql
CREATE TABLE table_13036251_1 ( the_mole VARCHAR, prize_money VARCHAR )
what's the mole with prize money being 24,475
SELECT the_mole FROM table_13036251_1 WHERE prize_money = "€24,475"
sql_create_context