context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_78 ( runner_s__up VARCHAR, margin_of_victory VARCHAR, winning_score VARCHAR )
Which runner(s)-up had a Winning score of 13 (68-70-66-71=275) and a Margin of victory of 3 strokes?
SELECT runner_s__up FROM table_name_78 WHERE margin_of_victory = "3 strokes" AND winning_score = –13(68 - 70 - 66 - 71 = 275)
sql_create_context
CREATE TABLE table_name_40 ( away_team VARCHAR, home_team VARCHAR )
What was home team North Melbourne's opponents score?
SELECT away_team AS score FROM table_name_40 WHERE home_team = "north melbourne"
sql_create_context
CREATE TABLE table_name_60 ( status VARCHAR, notes VARCHAR )
What is the status where the notes are possible jr synonym of sapeornis?
SELECT status FROM table_name_60 WHERE notes = "possible jr synonym of sapeornis"
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABL...
what was the number of endo polpectomy lrge int procedures that were performed since 1 year ago?
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'endo polpectomy lrge int') AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-1 year')
mimic_iii
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...
how many patients since 2 years ago were prescribed vancomycin 1 gm in ns 250 ml ivpb after parenteral feeds - tpn within 2 months?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'parenteral feeds - tpn' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-2 year')) AS t1 ...
eicu
CREATE TABLE Customer_Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Code CHAR(15), Start_Date DATE, End_Date DATE ) CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGE...
What about the average amounts of payments by each method code? You can give me a bar chart, sort from high to low by the y-axis.
SELECT Payment_Method_Code, AVG(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code ORDER BY AVG(Amount_Payment) DESC
nvbench
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...
有哪些名称相同的检测指标出现在检验报告单76308065306与53442751434中?这些检测指标名称是啥?
SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.BGDH = '76308065306' INTERSECT SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.BGDH = '53442751434'
css
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...
03652738号患者在02年3月6日到04月10月25日期间其所有检验结果指标记录中的检测方法是啥呢?
SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH...
css
CREATE TABLE table_name_16 ( label VARCHAR, year INTEGER )
What is the label of the Year before 1979?
SELECT label FROM table_name_16 WHERE year < 1979
sql_create_context
CREATE TABLE table_204_490 ( id number, "position" text, "name" text, "height" text, "weight" text, "birthdate" text, "birthplace" text, "2009-10 team" text )
who is the tallest player born in july ?
SELECT "name" FROM table_204_490 WHERE "birthdate" = 7 ORDER BY "height" DESC LIMIT 1
squall
CREATE TABLE Complaints ( complaint_id INTEGER, product_id INTEGER, customer_id INTEGER, complaint_outcome_code VARCHAR(20), complaint_status_code VARCHAR(20), complaint_type_code VARCHAR(20), date_complaint_raised DATETIME, date_complaint_closed DATETIME, staff_id INTEGER ) CREATE ...
Draw a bar chart for what are all the different product names, and how many complains has each received?, sort in desc by the bars.
SELECT product_name, COUNT(*) FROM Products AS t1 JOIN Complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name ORDER BY product_name DESC
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
how many patients whose discharge location is disch-tran to psych hosp and primary disease is ruq pain?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND demographic.diagnosis = "RUQ PAIN"
mimicsql_data
CREATE TABLE table_71009 ( "Institution" text, "Main Campus Location" text, "Founded" real, "Mascot" text, "School Colors" text )
What college was founded in 1967?
SELECT "Main Campus Location" FROM table_71009 WHERE "Founded" = '1967'
wikisql
CREATE TABLE table_name_99 ( nationality VARCHAR, name VARCHAR, lane VARCHAR, rank VARCHAR, time VARCHAR )
Which Nationality has a Rank larger than 1, and a Time smaller than 22.12, and a Lane smaller than 4, and a Name of ashley callus?
SELECT nationality FROM table_name_99 WHERE rank > 1 AND time < 22.12 AND lane < 4 AND name = "ashley callus"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
what is date of birth and gender of subject name bessie giordano?
SELECT demographic.dob, demographic.gender FROM demographic WHERE demographic.name = "Bessie Giordano"
mimicsql_data
CREATE TABLE table_name_18 ( season VARCHAR, points VARCHAR, finish VARCHAR )
What season has a 6th north finish and more than 21 points?
SELECT season FROM table_name_18 WHERE points > 21 AND finish = "6th north"
sql_create_context
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
The next 6 semesters , what classes will be offered ?
SELECT DISTINCT course.name, course.number, semester.semester, semester.year FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'FA' AND semester.year = 2017) OR (semester.semester = 'FA' AND semester.year = 2018) OR (semester.semester = 'WN' AND se...
advising
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number...
Find the distinct last names of the students who have class president votes.
SELECT DISTINCT T1.lname FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = T2.class_president_vote
spider
CREATE TABLE table_29659 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" real, "U.S. viewers (millions)" text )
How many episodes titled 'Blue in the face' were directed by Sean McNamara?
SELECT COUNT("Series #") FROM table_29659 WHERE "Directed by" = 'Sean McNamara' AND "Title" = 'Blue in the Face'
wikisql
CREATE TABLE table_12020 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the away team at lake oval?
SELECT "Away team" FROM table_12020 WHERE "Venue" = 'lake oval'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
查查患者魏倚云的既往病史
SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '魏倚云'
css
CREATE TABLE table_2066296_5 ( red__e8_ VARCHAR, interior_roof VARCHAR )
How many different results for red (e8) does the model with parchment/saddle interior/roof have?
SELECT COUNT(red__e8_) FROM table_2066296_5 WHERE interior_roof = "Parchment/saddle"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
患者秦承平的门诊诊断之前是什么样的?
SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND 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_mz...
css
CREATE TABLE table_1844 ( "Date(s)" text, "Venue" text, "City, state" text, "Ticket price(s)" text, "Ticket sold / available" text, "Ticket grossing" text )
What venue is in Wantagh, New York?
SELECT "Venue" FROM table_1844 WHERE "City, state" = 'Wantagh, New York'
wikisql
CREATE TABLE table_174151_5 ( power_provided VARCHAR, transfer_speed__mb_s_ VARCHAR )
Name the power provided for transfer speed mb/s is 1250
SELECT power_provided FROM table_174151_5 WHERE transfer_speed__mb_s_ = "1250"
sql_create_context
CREATE TABLE table_name_10 ( position INTEGER, team VARCHAR, played VARCHAR )
What is the highest position for Nelson, with a played entry of more than 24?
SELECT MAX(position) FROM table_name_10 WHERE team = "nelson" AND played > 24
sql_create_context
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE medication ( medi...
when is patient 032-754 receiving an intake for the first time on 05/30/last year?
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 = '032-754')) AND intakeoutput.cellpath LIKE '%intake%' ...
eicu
CREATE TABLE diagnoses_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, d...
how many days have passed since patient 12775 first stayed in their current hospital encounter in the ward 23?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12775 AND admissions.dischtime IS NULL)) AND transfers....
mimic_iii
CREATE TABLE table_name_52 ( indicia VARCHAR, end_month VARCHAR )
Which Indicia has anEnd month in feb-75?
SELECT indicia FROM table_name_52 WHERE end_month = "feb-75"
sql_create_context
CREATE TABLE table_56899 ( "Week" real, "EASTERN #1" text, "Eastern #2" text, "WESTERN #1" text, "Western #2" text )
Tell me the wekk for eastern #2 of houston
SELECT "Week" FROM table_56899 WHERE "Eastern #2" = 'houston'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
provide the procedure short title and drug code of subject id 24425.
SELECT procedures.short_title, prescriptions.formulary_drug_cd FROM procedures INNER JOIN prescriptions ON procedures.hadm_id = prescriptions.hadm_id WHERE procedures.subject_id = "24425"
mimicsql_data
CREATE TABLE table_28506 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text )
The order # is what for the week # Top 10?
SELECT "Order #" FROM table_28506 WHERE "Week #" = 'Top 10'
wikisql
CREATE TABLE table_23812 ( "Date of opinion poll" text, "Conductor" text, "Sample size" real, "For" text, "Against" text, "Undecided" text )
Who conducted the poll with sample size of 2000 that shows 18% undecided?
SELECT "Conductor" FROM table_23812 WHERE "Undecided" = '18%' AND "Sample size" = '2000'
wikisql
CREATE TABLE table_27755 ( "Series" real, "Season" text, "Played in" text, "First Match" text, "Tests played (sched)" text, "Tests won by Australia" real, "Tests won by England" real, "Tests drawn" real, "Series result" text, "Holder at series end" text )
Name the total number of tests won by australia for series 10
SELECT COUNT("Tests won by Australia") FROM table_27755 WHERE "Series" = '10'
wikisql
CREATE TABLE table_name_68 ( date VARCHAR, stage VARCHAR )
Which date has a Stage of 12?
SELECT date FROM table_name_68 WHERE stage = "12"
sql_create_context
CREATE TABLE table_1028356_3 ( opponents VARCHAR, partner VARCHAR )
How many matches where played with Jim Pugh?
SELECT COUNT(opponents) FROM table_1028356_3 WHERE partner = "Jim Pugh"
sql_create_context
CREATE TABLE table_3305 ( "Season" real, "Champion" text, "Second" text, "Third" text, "Team Champion" text, "National Trophy/Rookie" text )
If the national trophy/rookie is Gerrard Barrabeig, what is the name of the second?
SELECT "Second" FROM table_3305 WHERE "National Trophy/Rookie" = 'Gerrard Barrabeig'
wikisql
CREATE TABLE table_name_40 ( qual_2 VARCHAR, name VARCHAR )
Name the Qual 2 which has the name of katherine legge
SELECT qual_2 FROM table_name_40 WHERE name = "katherine legge"
sql_create_context
CREATE TABLE table_33328 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What date did South Melbourne play as the Away team?
SELECT "Date" FROM table_33328 WHERE "Away team" = 'south melbourne'
wikisql
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
what number of patients with private insurance have been diagnosed with pressure ulcer, unstageable?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Private" AND diagnoses.long_title = "Pressure ulcer, unstageable"
mimicsql_data
CREATE TABLE table_26606 ( "Week" real, "Date" text, "Opponent" text, "Location" text, "Final Score" text, "Attendance" real, "Record" text )
Name the final score for week 5
SELECT "Final Score" FROM table_26606 WHERE "Week" = '5'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many of the patients with adverse effects of corticosteroids remained admitted in hospital for more than 1 day?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "1" AND diagnoses.short_title = "Adv eff corticosteroids"
mimicsql_data
CREATE TABLE table_1341423_40 ( party VARCHAR, district VARCHAR )
what is the party for the district south carolina 4?
SELECT party FROM table_1341423_40 WHERE district = "South Carolina 4"
sql_create_context
CREATE TABLE table_name_77 ( loss VARCHAR, record VARCHAR )
What was the loss of the game when the record was 20-16?
SELECT loss FROM table_name_77 WHERE record = "20-16"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
provide the maximum age of female patients who had sternal wound infection.
SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "STERNAL WOUND INFECTION"
mimicsql_data
CREATE TABLE table_name_88 ( league INTEGER, play_offs VARCHAR, total VARCHAR )
Name the lowest league for play-offs more than 0 and total of 25
SELECT MIN(league) FROM table_name_88 WHERE play_offs > 0 AND total = 25
sql_create_context
CREATE TABLE table_59858 ( "Team" text, "Average" real, "Points" real, "Played" real, "1991-92" text, "1992-93" text, "1993-94" real )
Which 1991-92 has a 1993-94 smaller than 34, and a Team of argentinos juniors?
SELECT "1991-92" FROM table_59858 WHERE "1993-94" < '34' AND "Team" = 'argentinos juniors'
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, ...
provide the number of patients whose death status is 1 and diagnoses long title is diabetes with ketoacidosis, type i [juvenile type], not stated as uncontrolled?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.long_title = "Diabetes with ketoacidosis, type I [juvenile type], not stated as uncontrolled"
mimicsql_data
CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
Labs are in what number of upper level courses ?
SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_lab = 'Y' AND program_course.category LIKE '%ULCS%'
advising
CREATE TABLE table_48107 ( "Rank" real, "Title" text, "Studio" text, "Director" text, "Worldwide Gross" text )
What was the average rank for the film directed by roland emmerich under the studio of 20th century fox?
SELECT AVG("Rank") FROM table_48107 WHERE "Studio" = '20th century fox' AND "Director" = 'roland emmerich'
wikisql
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Badges ( Id number, UserId number, Name...
most popular python questions for Julia :).
SELECT P.Title, P.Id AS "post_link", P.Score AS Score, P.FavoriteCount AS Favorites, P.ViewCount AS "views" FROM Posts AS P WHERE P.Tags LIKE '%<##tag?julia##>%' AND NOT P.CommunityOwnedDate IS NULL AND NOT P.Title IS NULL ORDER BY Score DESC LIMIT 100
sede
CREATE TABLE table_386 ( "Component" text, "Integrated" text, "Allied-Related" text, "Allied-Unrelated" text, "Holding" text )
How many integrated allied-related are there?
SELECT "Integrated" FROM table_386 WHERE "Allied-Related" = 'Many'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
what is the number of patients whose age is less than 71 and item id is 50818?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "71" AND lab.itemid = "50818"
mimicsql_data
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
查询7475007医疗机构从09年3月6日到18年12月10日有多少住院时长超过9天的就诊记录
SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '7475007' AND wdmzjzjlb.RYDJSJ BETWEEN '2009-03-06' AND '2018-12-10' AND DATEDIFF(wdmzjzjlb.CYSJ, wdmzjzjlb.RYSJ) > 9 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '7475007' AND bdmzjzjlb.RYDJSJ BETWEEN '2009-03-06' AND '2018-12-10' AND DATEDIFF(bd...
css
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, ...
list the patient ids of the patients that were diagnosed with fever in 2103.
SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'fever' AND STRFTIME('%y', diagnosis.diagnosistime) = '2103')
eicu
CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Subjects ( subject_id INTEGER, subje...
What are the enrollment dates of all the tests that have result 'Pass', and count them by a line chart, show x-axis from low to high order.
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" GROUP BY date_of_enrolment ORDER BY date_of_enrolment
nvbench
CREATE TABLE table_76638 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
What year did player steve jones, who had a t60 finish, win?
SELECT "Year(s) won" FROM table_76638 WHERE "Finish" = 't60' AND "Player" = 'steve jones'
wikisql
CREATE TABLE table_80331 ( "Member" text, "Party" text, "Electorate" text, "State" text, "Term in office" text )
Which party had a member from the state of Vic and an Electorate called Wannon?
SELECT "Party" FROM table_80331 WHERE "State" = 'vic' AND "Electorate" = 'wannon'
wikisql
CREATE TABLE table_20217 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text, "Pictorials" text )
Who was the interview subject when the centerfold model was Sherry Arnett?
SELECT COUNT("Interview subject") FROM table_20217 WHERE "Centerfold model" = 'Sherry Arnett'
wikisql
CREATE TABLE table_name_59 ( d__max_ VARCHAR, morse_taper_number VARCHAR, c__max_ VARCHAR )
With a Morse Taper number less than 3 and a C (max) of 59.5 what is the total of D (max)?
SELECT COUNT(d__max_) FROM table_name_59 WHERE morse_taper_number < 3 AND c__max_ = 59.5
sql_create_context
CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paper ( paperid int, title varchar, venueid ...
What conference does daniela witten publish in ?
SELECT DISTINCT paper.venueid FROM author, paper, writes WHERE author.authorname = 'daniela witten' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom t...
how many times did patient 3663 produce chest tubes cticu ct 1 until 10/2105?
SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3663)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'chest tubes cticu c...
mimic_iii
CREATE TABLE table_204_525 ( id number, "rank" number, "player" text, "county" text, "tally" text, "total" number, "opposition" text )
in the 197172 national hurling league , how many players from cork county were ranked at least rank 15 or better ?
SELECT COUNT("player") FROM table_204_525 WHERE "county" = 'cork' AND "rank" <= 15
squall
CREATE TABLE table_79275 ( "Class" text, "Wheel arrangement" text, "Fleet number(s)" text, "Manufacturer" text, "Year made" text, "Quantity made" text, "Quantity preserved" text, "Year(s) retired" text )
What is the locomotive class that has a wheel arrangement of 2-8-2 and a quantity made of 25?
SELECT "Class" FROM table_79275 WHERE "Wheel arrangement" = '2-8-2' AND "Quantity made" = '25'
wikisql
CREATE TABLE table_name_5 ( venue VARCHAR, date VARCHAR )
What venue is on the date of 8/6/03
SELECT venue FROM table_name_5 WHERE date = "8/6/03"
sql_create_context
CREATE TABLE table_43508 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text )
What is the attendance date of the game home team Shrewsbury Town played?
SELECT "Attendance" FROM table_43508 WHERE "Home team" = 'shrewsbury town'
wikisql
CREATE TABLE table_name_83 ( to_par INTEGER, player VARCHAR, place VARCHAR, score VARCHAR )
What is the highest to par of player len mattiace, who has a t7 place and a score of 73-74=147?
SELECT MAX(to_par) FROM table_name_83 WHERE place = "t7" AND score = 73 - 74 = 147 AND player = "len mattiace"
sql_create_context
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...
Most popular comments for a user. Exactly what it says on the tin. Shows the most popular comments for a given user
SELECT C.PostId AS "post_link", C.Score, C.Text FROM Comments AS C WHERE C.UserId = '##UserId##' ORDER BY C.Score DESC LIMIT 20
sede
CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Staff ( staff_id INTEGER, staff_gender VARCHAR(1), staff_name VARCHAR(80) ) CREATE TABLE Suppliers ( supplier_id INTEGER, supplier_name VARCHAR(80), su...
Bar chart x axis product type code y axis maximal product price
SELECT product_type_code, MAX(product_price) FROM Products GROUP BY product_type_code
nvbench
CREATE TABLE table_6133 ( "Year" real, "Winner" text, "Jockey" text, "Trainer" text, "Owner" text, "Time" text, "Purse" text )
What is the purse when Aidan O'brien was the trainer?
SELECT "Purse" FROM table_6133 WHERE "Trainer" = 'aidan o''brien'
wikisql
CREATE TABLE table_23273 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Who are the candidates in Florida 13 district?
SELECT "Candidates" FROM table_23273 WHERE "District" = 'Florida 13'
wikisql
CREATE TABLE Stay ( StayID INTEGER, Patient INTEGER, Room INTEGER, StayStart DATETIME, StayEnd DATETIME ) CREATE TABLE Patient ( SSN INTEGER, Name VARCHAR(30), Address VARCHAR(30), Phone VARCHAR(30), InsuranceID INTEGER, PCP INTEGER ) CREATE TABLE Physician ( EmployeeID...
Return the name of each physician and the number of patients he or she treats in a bar chart.
SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID
nvbench
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
医院4523226所有的记录里,根据科室名与出院的时候诊断编码的区别看一下自费额度与总医疗费用相比的最小值并按升序来排列显示
SELECT gwyjzb.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_CD, MIN(t_kc24.PER_EXP) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '4523226' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_CD ORDER BY MIN(t_kc24.PER_EXP / t_kc24.MED_AMOUT) UNION SELECT fgwyjzb.MED_ORG_D...
css
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, meter_700 text, Time text ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE...
Bar chart x axis meter 500 y axis meter_100, order in descending by the X-axis.
SELECT meter_500, meter_100 FROM swimmer ORDER BY meter_500 DESC
nvbench
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 manufacturer over the name , and group by attribute name by a bar chart, and sort from low to high by the bar please.
SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE table_11854 ( "Client" text, "Windows" text, "GNU/Linux" text, "Mac OS X" text, "Haiku" text )
Which Mac OSX's GNU/Linux was yes when Windows was no?
SELECT "Mac OS X" FROM table_11854 WHERE "GNU/Linux" = 'yes' AND "Windows" = 'no'
wikisql
CREATE TABLE table_1706942_1 ( q1_order VARCHAR, driver VARCHAR )
How many Q1 figures are given for Alexander Wurz?
SELECT COUNT(q1_order) FROM table_1706942_1 WHERE driver = "Alexander Wurz"
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...
Count the number of office admitted patients who had a prescription for vecuronium bromide medication.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND prescriptions.drug = "Vecuronium Bromide"
mimicsql_data
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufac...
i'd like to go from BOSTON to SAN FRANCISCO
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRA...
atis
CREATE TABLE table_name_51 ( total_rebounds VARCHAR, player VARCHAR )
How many rebounds have a Player of herb estes?
SELECT COUNT(total_rebounds) FROM table_name_51 WHERE player = "herb estes"
sql_create_context
CREATE TABLE table_15102 ( "Model" text, "Seats" text, "Period" text, "Built" text, "Country" text )
In what time period were 354 built?
SELECT "Period" FROM table_15102 WHERE "Built" = '354'
wikisql
CREATE TABLE table_43020 ( "Country" text, "Area (km\u00b2)" text, "Population (2011 est.)" text, "Population density (per km\u00b2)" text, "GDP (PPP) $M USD" text )
Which country has a population of 3,221,216?
SELECT "Country" FROM table_43020 WHERE "Population (2011 est.)" = '3,221,216'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
how many patients had v6284 as their diagnosis icd9 code along with a base drug type?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "V6284" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE outputevents ( row_id number, subject_id number, ...
how many hours does it have been since the first time patient 51858 stayed in careunit micu on the current hospital encounter?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51858 AND admissions.dischtime IS NULL) AND transfers.careunit = 'micu' ORDER BY transfers.intime LIMIT 1
mimic_iii
CREATE TABLE table_name_57 ( gold VARCHAR, rank VARCHAR, total VARCHAR )
How many Gold medals for the country with a Rank of 1 and less than 2 Total medals?
SELECT COUNT(gold) FROM table_name_57 WHERE rank = "1" AND total < 2
sql_create_context
CREATE TABLE table_19139 ( "EDO Flight" real, "Shuttle" text, "Mission" text, "Launch Date" text, "Duration" text, "Primary Payload(s)" text )
what's the edo flight with duration being 17 days, 15 hours, 53 minutes, 18 seconds
SELECT "EDO Flight" FROM table_19139 WHERE "Duration" = '17 days, 15 hours, 53 minutes, 18 seconds'
wikisql
CREATE TABLE Supplier_Addresses ( supplier_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Addresses ( address_id INTEGER, address_details VARCHAR(255) ) CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER ) CR...
For each payment method, return how many customers use it.
SELECT payment_method_code, COUNT(*) FROM Customers GROUP BY payment_method_code
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
how many male patients were admitted to emergency?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.admission_type = "EMERGENCY"
mimicsql_data
CREATE TABLE table_79578 ( "Pick" real, "Team" text, "Player" text, "Position" text, "College" text )
The New York Jets picked someone from what college?
SELECT "College" FROM table_79578 WHERE "Team" = 'new york jets'
wikisql
CREATE TABLE table_26075 ( "Round" text, "Clubs remaining" real, "Clubs involved" real, "Winners from previous round" text, "New entries this round" text, "Leagues entering at this round" text )
Which leagues entered an extra preliminary round?
SELECT "Leagues entering at this round" FROM table_26075 WHERE "Round" = 'Extra Preliminary Round'
wikisql
CREATE TABLE table_359 ( "Launch Vehicle" text, "Launch date" text, "Mission" text, "Institutional authority" text, "Launch site" text, "Results" text )
Which missions were scheduled to launch on November 16, 2006?
SELECT "Mission" FROM table_359 WHERE "Launch date" = 'November 16, 2006'
wikisql
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For those employees who did not have any job in the past, visualize a bar chart about the distribution of job_id and the amount of job_id , and group by attribute job_id, list from low to high by the JOB_ID please.
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_41514 ( "Nation" text, "Skip" text, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot Pct." text )
What is the Blank Ends when there are less than 39 ends won and, more than 35 ends lost, and 4 stolen ends.
SELECT "Blank Ends" FROM table_41514 WHERE "Ends Won" < '39' AND "Ends Lost" > '35' AND "Stolen Ends" = '4'
wikisql
CREATE TABLE table_2668243_17 ( candidates VARCHAR, incumbent VARCHAR )
Name the candidates for selah r. hobbie
SELECT candidates FROM table_2668243_17 WHERE incumbent = "Selah R. Hobbie"
sql_create_context
CREATE TABLE table_79210 ( "Rank" real, "Rowers" text, "Country" text, "Time" text, "Notes" text )
What country has a rank smaller than 6, a time of 6:32.32 and notes of FB?
SELECT "Country" FROM table_79210 WHERE "Rank" < '6' AND "Notes" = 'fb' AND "Time" = '6:32.32'
wikisql
CREATE TABLE table_33438 ( "Country Name" text, "1961-65" text, "1966-70" text, "1971-75" text, "1976-80" text, "1981-85" text, "1986-90" text, "1991-95" text, "1996\u20132000" text, "2001-05" text, "2006-10" text )
What was the 2001-05 rate for the country that had 1981-85 rate of -3.48%?
SELECT "2001-05" FROM table_33438 WHERE "1981-85" = '-3.48%'
wikisql
CREATE TABLE table_name_11 ( winner VARCHAR, year VARCHAR )
What is Winner, when Year is 2013?
SELECT winner FROM table_name_11 WHERE year = 2013
sql_create_context
CREATE TABLE table_204_609 ( id number, "year" number, "car" number, "start" number, "qual" number, "rank" number, "finish" number, "laps" number, "led" number, "retired" text )
what was the last year that it finished the race ?
SELECT "year" FROM table_204_609 ORDER BY "year" DESC LIMIT 1
squall
CREATE TABLE table_2071644_1 ( moment_of_inertia_in_torsion__j___cm_4__ VARCHAR, beam_height__mm_ VARCHAR )
What is the moment of intertia in torsion (j) Cm4) for the beam height (mm) 120??=
SELECT COUNT(moment_of_inertia_in_torsion__j___cm_4__) FROM table_2071644_1 WHERE beam_height__mm_ = 120
sql_create_context
CREATE TABLE table_name_81 ( year VARCHAR, points VARCHAR, chassis VARCHAR )
Which year had 0 points and an AGS JH23B chassis?
SELECT year FROM table_name_81 WHERE points = 0 AND chassis = "ags jh23b"
sql_create_context