context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
what is the number of patients whose age is less than 31 and diagnoses icd9 code is 2809?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "31" AND diagnoses.icd9_code = "2809"
mimicsql_data
CREATE TABLE table_name_29 ( Vice VARCHAR, president VARCHAR, treasurer VARCHAR )
Which Vice President has a President of daniel masny, and a Treasurer of rebecca t. altmann?
SELECT Vice AS president FROM table_name_29 WHERE president = "daniel masny" AND treasurer = "rebecca t. altmann"
sql_create_context
CREATE TABLE table_name_78 ( score VARCHAR, home VARCHAR, date VARCHAR )
What score has detroit as the home, and December 9 as the date?
SELECT score FROM table_name_78 WHERE home = "detroit" AND date = "december 9"
sql_create_context
CREATE TABLE table_name_22 ( place VARCHAR, score VARCHAR )
What was the place when the score was 71-69-71=211?
SELECT place FROM table_name_22 WHERE score = 71 - 69 - 71 = 211
sql_create_context
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, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb ( YLJGDM text, YLJGDM_M...
查一下门诊就诊18195078262有哪些患者?需要他们的卡号以及卡类型
SELECT KH, KLX FROM mzjzjlb WHERE JZLSH = '18195078262'
css
CREATE TABLE table_55963 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the Home team score when the crowd was larger than 12,240 and Carlton was the away team?
SELECT "Home team score" FROM table_55963 WHERE "Crowd" > '12,240' AND "Away team" = 'carlton'
wikisql
CREATE TABLE table_69120 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
What is the highest roll number of the school with a state authority and a decile smaller than 8?
SELECT MAX("Roll") FROM table_69120 WHERE "Authority" = 'state' AND "Decile" < '8'
wikisql
CREATE TABLE table_name_40 ( score VARCHAR, high_assists VARCHAR )
Which Score has a High assists of whalen (5)?
SELECT score FROM table_name_40 WHERE high_assists = "whalen (5)"
sql_create_context
CREATE TABLE table_74400 ( "Date" text, "Time" text, "ACC Team" text, "Big Ten Team" text, "Location" text, "Television" text, "Attendance" real, "Winner" text, "Challenge Leader" text )
Who were the challenge leaders of the games won by boston college (88-76)?
SELECT "Challenge Leader" FROM table_74400 WHERE "Winner" = 'Boston College (88-76)'
wikisql
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, ...
542 is what size ?
SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 542
advising
CREATE TABLE table_26178 ( "Neighbourhood" text, "% 0-19" text, "% 20-39" text, "% 40-59" text, "% 60-74" text, "% 75 +" text )
What is every value for % 75 + if % 0-19 is 19,75%?
SELECT "% 75 +" FROM table_26178 WHERE "% 0-19" = '19,75%'
wikisql
CREATE TABLE procedures ( 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, ...
Find the number of patients who had biopsy of bone marrow that stayed in the hospital for more than 6 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "6" AND procedures.long_title = "Biopsy of bone marrow"
mimicsql_data
CREATE TABLE table_50916 ( "Governor" text, "State" text, "Past" text, "Party" text, "Elected/assumed office" real, "Seat up" real )
What state had an elected/assumed office in 2013?
SELECT "State" FROM table_50916 WHERE "Elected/assumed office" = '2013'
wikisql
CREATE TABLE table_name_27 ( goals_for INTEGER, team VARCHAR, lost VARCHAR )
Which Goals For has a Team of congleton town, and a Lost larger than 11?
SELECT MAX(goals_for) FROM table_name_27 WHERE team = "congleton town" AND lost > 11
sql_create_context
CREATE TABLE table_5565 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text )
Name the series ep for darts
SELECT "Series Ep." FROM table_5565 WHERE "Segment D" = 'darts'
wikisql
CREATE TABLE table_name_19 ( hometown VARCHAR, player VARCHAR )
Which hometown has a player of Ray Drew?
SELECT hometown FROM table_name_19 WHERE player = "ray drew"
sql_create_context
CREATE TABLE table_name_42 ( year INTEGER, venue VARCHAR )
What is the lowest Year, when Venue is Rio De Janeiro, Brazil?
SELECT MIN(year) FROM table_name_42 WHERE venue = "rio de janeiro, brazil"
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
has there been any blood culture microbiology test done for patient 56490 in 09/last year?
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 56490) AND microbiologyevents.spec_type_desc = 'blood culture' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', ...
mimic_iii
CREATE TABLE table_47775 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Record" text )
What was the Maple Leafs' record on game 52?
SELECT "Record" FROM table_47775 WHERE "Game" = '52'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
在05年4月7日开始20年6月11日结束医院4702340医疗异地患者的次数是多少?
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '4702340' AND gwyjzb.IN_HOSP_DATE BETWEEN '2005-04-07' AND '2020-06-11' AND gwyjzb.REMOTE_SETTLE_FLG = '异地1' OR gwyjzb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '4702340' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2005-04...
css
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 tags related to JavaScript.
SELECT p.Tags FROM Posts AS p, PostTags AS pt, Tags AS t WHERE pt.PostId = p.Id AND pt.TagId = t.Id AND t.TagName = 'scan' GROUP BY p.Tags
sede
CREATE TABLE gsi ( course_offering_id int, student_id int ) 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, ...
On the LACS 400 -level , what 6 -credit courses are there ?
SELECT DISTINCT department, name, number FROM course WHERE credits = 6 AND department = 'LACS' AND number < 400 + 100 AND number >= 400
advising
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...
在患者陶歌韵的诊疗记录里,从02年8月1日到10年6月21日这期间,为其检测游离甲状腺素(三代)的医务人员有哪几位,报一下工号及姓名
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZ...
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC t...
检验报告单24571107359是哪个患者门诊就诊中开出的
SELECT person_info.XM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZ...
css
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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), ...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about the average of department_id over the hire_date bin hire_date by weekday, and could you list in descending by the y-axis please?
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE table_24380 ( "No." real, "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text )
Name the to par for 20 feb 2005
SELECT "To par" FROM table_24380 WHERE "Date" = '20 Feb 2005'
wikisql
CREATE TABLE table_30457 ( "Series #" real, "Title" text, "Written by" text, "Directed by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text )
How many million u.s. viewers watched the episode with a production code of 2t7004?
SELECT "U.S. viewers (millions)" FROM table_30457 WHERE "Production code" = '2T7004'
wikisql
CREATE TABLE table_52735 ( "Number" real, "Name" text, "Builder" text, "Type" text, "Date" real )
What is the name of the train numbered less than 6 before 1993?
SELECT "Name" FROM table_52735 WHERE "Number" < '6' AND "Date" < '1993'
wikisql
CREATE TABLE table_45223 ( "Official Name" text, "Status" text, "Area km 2" real, "Population" real, "Census Ranking" text )
What is the Official Name of the Community with an Area km 2 of 16.13?
SELECT "Official Name" FROM table_45223 WHERE "Area km 2" = '16.13'
wikisql
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE time_interval ( period text, begin_time in...
what airline is AC
SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'AC'
atis
CREATE TABLE table_73927 ( "Episode" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text )
The theme Auditioner's Choice has what song choice?
SELECT "Song choice" FROM table_73927 WHERE "Theme" = 'Auditioner''s Choice'
wikisql
CREATE TABLE table_name_4 ( date VARCHAR, score_in_the_final VARCHAR )
What Date has a Score in the final of 3 6, 2 6, 4 6?
SELECT date FROM table_name_4 WHERE score_in_the_final = "3–6, 2–6, 4–6"
sql_create_context
CREATE TABLE table_19993 ( "Condition/Parameter" text, "Coordinate velocity v dx/dt in units of c" text, "Velocity angle \u03b7 in i-radians" text, "Proper velocity w dx/d\u03c4 in units of c" text, "Lorentz factor \u03b3 dt/d\u03c4 = E/mc 2" text )
If the condition/parameter is rapidity of 1 hyperbolic radian, what is the proper velocity w dx/d in units of c?
SELECT "Proper velocity w dx/d\u03c4 in units of c" FROM table_19993 WHERE "Condition/Parameter" = 'Rapidity of 1 hyperbolic radian'
wikisql
CREATE TABLE table_name_98 ( high_assists VARCHAR, high_points VARCHAR )
What was the high assists from a high points of dorell wright (20)?
SELECT high_assists FROM table_name_98 WHERE high_points = "dorell wright (20)"
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, ...
之前,患者28448699在哪里就诊的?
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 = '28448699' 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 locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_I...
Show the average salary by each hire date of employees, and please bin the hire date into the day of week interval for showing a bar chart, could you order by the Y from high to low?
SELECT HIRE_DATE, AVG(SALARY) FROM employees ORDER BY AVG(SALARY) DESC
nvbench
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 black/cape verdean patients who have base type drug prescription.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
when was the first time patient 14990 respiratory rate was measured less than 25.0 on the first icu visit.
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14990) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (...
mimic_iii
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, d...
when was the last time patient 030-52327 was having less than 80.0 sao2 yesterday?
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-52327')) AND vitalperiodic.sao2 < 80.0 AND NOT ...
eicu
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
how many black/african american patients had the item id 51363?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND lab.itemid = "51363"
mimicsql_data
CREATE TABLE table_name_61 ( format VARCHAR, catalog VARCHAR )
What shows as the format for catalog 11 135?
SELECT format FROM table_name_61 WHERE catalog = "11 135"
sql_create_context
CREATE TABLE table_30071 ( "Week" real, "Date" text, "Kickoff" text, "Opponent" text, "Final score" text, "Team record" text, "Game site" text, "Attendance" real )
what was the opposition where the field is waldstadion during time 6
SELECT "Opponent" FROM table_30071 WHERE "Game site" = 'Waldstadion' AND "Week" = '6'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicatio...
what is five year survival rate of patients diagnosed with upper gi bleeding?
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI...
eicu
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...
provide the number of patients with a diagnoses of personal history of other malignant neoplasm of rectum, rectosigmoid junction and anus and are still alive.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.short_title = "Hx-rectal & anal malign"
mimicsql_data
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, a bar chart shows the distribution of hire_date and the average of employee_id bin hire_date by weekday.
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE table_79795 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the maximum number of silvers for a country with fewer than 12 golds and a total less than 8?
SELECT MAX("Silver") FROM table_79795 WHERE "Gold" < '12' AND "Total" < '8'
wikisql
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 diagnosis ( diagnosisid num...
on the first icu visit what was the minimum value of sao2 of patient 009-15?
SELECT MIN(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-15') AND NOT patient.unitdischargetime IS NULL ORDER ...
eicu
CREATE TABLE table_20246201_9 ( office VARCHAR, candidate VARCHAR )
What office is Jon Huntsman a candidate for?
SELECT office FROM table_20246201_9 WHERE candidate = "Jon Huntsman"
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE diagn...
how many hours have passed since patient 40059 was admitted to the hospital.
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 40059 AND admissions.dischtime IS NULL
mimic_iii
CREATE TABLE basketball_match ( team_id number, school_id number, team_name text, acc_regular_season text, acc_percent text, acc_home text, acc_road text, all_games text, all_games_percent number, all_home text, all_road text, all_neutral text ) CREATE TABLE university (...
What are the schools that were either founded before 1850 or are public?
SELECT school FROM university WHERE founded > 1850 OR affiliation = 'Public'
spider
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostHistoryTypes ( Id number, Name te...
Top Comments of a user.
SELECT PostId AS "post_link", Score, Text FROM Comments WHERE UserId = '##UserId##' ORDER BY Score DESC LIMIT 250
sede
CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHA...
What is the project id and detail for the project with at least two documents Plot them as bar chart, and list x-axis in descending order.
SELECT T1.Project_Details, T1.Project_ID FROM Projects AS T1 JOIN Documents AS T2 ON T1.Project_ID = T2.Project_ID ORDER BY T1.Project_Details DESC
nvbench
CREATE TABLE table_name_43 ( report VARCHAR, venue VARCHAR )
What was the report at State Sports Centre?
SELECT report FROM table_name_43 WHERE venue = "state sports centre"
sql_create_context
CREATE TABLE table_54314 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
In which of North Melbourne's away games was there the lowest crowd?
SELECT MIN("Crowd") FROM table_54314 WHERE "Away team" = 'north melbourne'
wikisql
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE cine...
Show each location and the number of cinemas there Show bar chart, I want to display in ascending by the X-axis.
SELECT Location, COUNT(*) FROM cinema GROUP BY Location ORDER BY Location
nvbench
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requi...
In HISTORY 497 which section is after 17:15 A.M. ?
SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '17:15' AND course.course_id = course_offering.course_id AND course.department = 'HISTORY' AND course.number = 497 AND semester.semester = 'WN' A...
advising
CREATE TABLE table_74251 ( "Date/Location" text, "Mens singles" text, "Womens Singles" text, "U21 Mens" text, "U21 Womens" text, "Mixed Restricted" text, "Mixed Veteran" text )
When Naomi Owen won the Womens Singles and Ricardo Walther won the Mens Singles, who won the mixed veteran?
SELECT "Mixed Veteran" FROM table_74251 WHERE "Womens Singles" = 'Naomi Owen' AND "Mens singles" = 'Ricardo Walther'
wikisql
CREATE TABLE table_name_11 ( after_debt VARCHAR, cash_on_hand VARCHAR )
How much is after debt when cash on hand is $651,300?
SELECT after_debt FROM table_name_11 WHERE cash_on_hand = "$651,300"
sql_create_context
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE area ( course_id int, area varchar ) ...
What is the least difficult ULCS course with the largest class size ?
SELECT DISTINCT department, name, number FROM course WHERE course_id IN (SELECT PROGRAM_COURSE_ID FROM program_course AS PROGRAM_COURSE WHERE PROGRAM_WORKLOAD = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 WHERE PROGRAM_COURSEalias1.category LIKE '%ULCS%')) AND num_enrolled = (...
advising
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
among patients who remained admitted in hospital for more than 20 days, calculate the number of those on po therapy.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "20" AND prescriptions.route = "ORAL"
mimicsql_data
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
患者93292938的自付比例低于0.34的药品量在2005年2月13日到2020年12月30日之间有多少?
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '93292938' AND t_kc22.STA_DATE BETWEEN '2005-02-13' AND '2020-12-30' AND t_kc22.SELF_PAY_PRO < 0.34 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb...
css
CREATE TABLE table_49256 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Box Score" text, "Report" text )
What venue had a Score of 120-108?
SELECT "Venue" FROM table_49256 WHERE "Score" = '120-108'
wikisql
CREATE TABLE table_76217 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" real )
What is the Johnny Palmer with a To larger than 6 Money sum?
SELECT SUM("Money ( $ )") FROM table_76217 WHERE "To par" > '6' AND "Player" = 'johnny palmer'
wikisql
CREATE TABLE happy_hour ( hh_id number, shop_id number, month text, num_of_shaff_in_charge number ) CREATE TABLE member ( member_id number, name text, membership_card text, age number, time_of_purchase number, level_of_membership number, address text ) CREATE TABLE shop ( ...
Which month has the most happy hours?
SELECT month FROM happy_hour GROUP BY month ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_48341 ( "Year" real, "MLB Club" text, "Record" text, "Finish" text, "Manager" text )
who is the manager when the year is before 1994 and finish is 5th?
SELECT "Manager" FROM table_48341 WHERE "Year" < '1994' AND "Finish" = '5th'
wikisql
CREATE TABLE table_name_7 ( date VARCHAR, home_team VARCHAR )
When did the north melbourne team play?
SELECT date FROM table_name_7 WHERE home_team = "north melbourne"
sql_create_context
CREATE TABLE table_11884814_3 ( interview VARCHAR, country VARCHAR )
What was the interview score for Hawaii?
SELECT interview FROM table_11884814_3 WHERE country = "Hawaii"
sql_create_context
CREATE TABLE table_20649850_1 ( college VARCHAR, position VARCHAR )
Where did the ol go to college?
SELECT college FROM table_20649850_1 WHERE position = "OL"
sql_create_context
CREATE TABLE table_name_71 ( type VARCHAR, name__wade_giles_ VARCHAR )
What is the type of Kuang-Hsing?
SELECT type FROM table_name_71 WHERE name__wade_giles_ = "kuang-hsing"
sql_create_context
CREATE TABLE table_23947 ( "City (Utility)" text, "Residential Monthly usage: 1000 kWh" text, "Small power Power demand: 40 kW; Consumption 10,000 kWh, load factor: 35%." text, "Medium power Power demand: 1,000 kW; Consumption: 400,000 kWh, load factor: 56 %." text, "Large power Power demand: 50,000...
What is every residential monthly usage if large power demand is 6.86?
SELECT "Residential Monthly usage: 1000 kWh" FROM table_23947 WHERE "Large power Power demand: 50,000 kW; Consumption: 30,600,000 kWh, load factor: 85%." = '6.86'
wikisql
CREATE TABLE table_203_353 ( id number, "#" number, "title" text, "producer(s)" text, "featured guest(s)" text, "time" text )
how many tracks have their producer as mike punch harper ?
SELECT COUNT("title") FROM table_203_353 WHERE "producer(s)" = 'mike "punch" harper'
squall
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40)...
For employees without the letter M in their first name, give me a line chart to show the salary change over their hire date using a line chart, order from low to high by the X.
SELECT HIRE_DATE, SALARY FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY HIRE_DATE
nvbench
CREATE TABLE table_name_56 ( total INTEGER, player VARCHAR )
What is the Total of Player Craig Stadler?
SELECT AVG(total) FROM table_name_56 WHERE player = "craig stadler"
sql_create_context
CREATE TABLE table_13018091_1 ( won INTEGER, club VARCHAR )
How many games did whitehaven win?
SELECT MIN(won) FROM table_13018091_1 WHERE club = "Whitehaven"
sql_create_context
CREATE TABLE table_19753079_13 ( result VARCHAR, district VARCHAR )
What was the result of the Georgia 8 district?
SELECT result FROM table_19753079_13 WHERE district = "Georgia 8"
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 = jy...
css
CREATE TABLE table_name_25 ( lead VARCHAR, left_bloc VARCHAR )
Name the lead with left bloc of 8.4%
SELECT lead FROM table_name_25 WHERE left_bloc = "8.4%"
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 demographic (...
what is admission time of subject id 6983?
SELECT demographic.admittime FROM demographic WHERE demographic.subject_id = "6983"
mimicsql_data
CREATE TABLE table_name_48 ( date VARCHAR, leading_scorer VARCHAR )
When has a Leading scorer of ricky davis (20)?
SELECT date FROM table_name_48 WHERE leading_scorer = "ricky davis (20)"
sql_create_context
CREATE TABLE table_58996 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( \u00a3 )" text )
What is the lowest to par of a player from australia with a score of 76-70-75-72=293?
SELECT MIN("To par") FROM table_58996 WHERE "Country" = 'australia' AND "Score" = '76-70-75-72=293'
wikisql
CREATE TABLE table_name_2 ( rules VARCHAR, location VARCHAR, event VARCHAR, result VARCHAR )
Which rule has The Event of n/a, The Result of loss, and The Location of winsford england?
SELECT rules FROM table_name_2 WHERE event = "n/a" AND result = "loss" AND location = "winsford england"
sql_create_context
CREATE TABLE table_64833 ( "Japanese Title" text, "English Title" text, "Year" real, "First publisher" text, "ISBN" text )
What is the First Publisher prior to 1999?
SELECT "First publisher" FROM table_64833 WHERE "Year" < '1999'
wikisql
CREATE TABLE table_23718905_6 ( bowl_game VARCHAR, matchup_results VARCHAR )
In what bowl game was the result Oklahoma 31, Stanford 27?
SELECT bowl_game FROM table_23718905_6 WHERE matchup_results = "Oklahoma 31, Stanford 27"
sql_create_context
CREATE TABLE table_name_98 ( loss VARCHAR, date VARCHAR )
Who recorded the loss on august 7?
SELECT loss FROM table_name_98 WHERE date = "august 7"
sql_create_context
CREATE TABLE song ( song_name text, artist_name text, country text, f_id number, genre_is text, rating number, languages text, releasedate time, resolution number ) CREATE TABLE artist ( artist_name text, country text, gender text, preferred_genre text ) CREATE TABL...
What is the id of the files that are available in the format of mp4 and a resolution smaller than 1000?
SELECT f_id FROM files WHERE formats = "mp4" INTERSECT SELECT f_id FROM song WHERE resolution < 1000
spider
CREATE TABLE table_31729 ( "Hangul" text, "Hanja" text, "Revised" text, "McCune-Reischauer" text, "Estimated distribution (2000)*" real )
Tell me the revised of mccune reischauer of y n (s) ry n (n)
SELECT "Revised" FROM table_31729 WHERE "McCune-Reischauer" = 'yŏn (s) ryŏn (n)'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
what was the top four most frequent diagnosis in a year before?
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE table_291768_1 ( launched VARCHAR, commissioned VARCHAR )
when was the first start date that actually began on august 6, 1969
SELECT launched FROM table_291768_1 WHERE commissioned = "August 6, 1969"
sql_create_context
CREATE TABLE table_7922 ( "Season in Tamil" text, "English Transliteration" text, "English Translation" text, "Season in Sanskrit" text, "Season in English" text, "Tamil Months" text, "Gregorian Months" text )
What are the gregorian months for the season in Tamil?
SELECT "Gregorian Months" FROM table_7922 WHERE "Season in Tamil" = 'குளிர்'
wikisql
CREATE TABLE procedures ( 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, ...
Specify the number of elective admissions before the year 2148
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.admityear < "2148"
mimicsql_data
CREATE TABLE table_13564702_4 ( tries_against VARCHAR, tries_for VARCHAR )
How many tries against got the club with 62 tries for?
SELECT tries_against FROM table_13564702_4 WHERE tries_for = "62"
sql_create_context
CREATE TABLE table_11545282_7 ( no VARCHAR, years_for_jazz VARCHAR )
How many players only played for the Jazz in only 2010?
SELECT COUNT(no) FROM table_11545282_7 WHERE years_for_jazz = "2010"
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...
count the number of patients whose procedure icd9 code is 3799 and drug type is additive?
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 = "3799" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_co...
what are the four most frequent drugs that were prescribed in the same hospital encounter to patients aged 60 or above after they had been diagnosed with ac posthemorrhag anemia, until 2104?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
mimic_iii
CREATE TABLE table_1341522_38 ( opponent VARCHAR, district VARCHAR )
who is the the opponent with district being ohio12
SELECT opponent FROM table_1341522_38 WHERE district = "Ohio12"
sql_create_context
CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid number(9,0) ) CREATE TABLE employee ( eid number(9,0), name varchar2(30), salary number(10,2) ) CREATE...
How many flights in each destination city? Return a bar chart, and list in descending by the y axis please.
SELECT destination, COUNT(destination) FROM flight GROUP BY destination ORDER BY COUNT(destination) DESC
nvbench
CREATE TABLE table_58531 ( "Pick" real, "Round" real, "Player" text, "Position" text, "School" text )
What player is picked 302 in round 11?
SELECT "Player" FROM table_58531 WHERE "Round" = '11' AND "Pick" = '302'
wikisql
CREATE TABLE table_204_155 ( id number, "rank" number, "heat" number, "athlete" text, "nationality" text, "time" number, "notes" text )
which athlete from poland had the lowest time ?
SELECT "athlete" FROM table_204_155 WHERE "nationality" = 'poland' ORDER BY "time" LIMIT 1
squall
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepi...
among patients of age 50s during the previous year, what were the top four most frequent lab tests?
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')...
eicu
CREATE TABLE table_name_41 ( compression_ratio VARCHAR, engine VARCHAR )
What is the compression ratio for the 302-2v Windsor v8 engine?
SELECT compression_ratio FROM table_name_41 WHERE engine = "302-2v windsor v8"
sql_create_context