context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
how many patients whose age is less than 41 and lab test category is chemistry?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "41" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
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 demographic (...
specify the age of patient paul edwards
SELECT demographic.age FROM demographic WHERE demographic.name = "Paul Edwards"
mimicsql_data
CREATE TABLE table_25693 ( "Player" text, "Games Played" real, "Minutes" real, "Field Goals" real, "Three Pointers" real, "Free Throws" real, "Rebounds" real, "Assists" real, "Blocks" real, "Steals" real, "Points" real )
Name the least field goals for chantel hilliard
SELECT MIN("Field Goals") FROM table_25693 WHERE "Player" = 'Chantel Hilliard'
wikisql
CREATE TABLE table_name_53 ( points INTEGER, year VARCHAR, entrant VARCHAR )
For the Entrant of Sasol Jordan, add up all the points with a Year larger than 1993.
SELECT SUM(points) FROM table_name_53 WHERE year > 1993 AND entrant = "sasol jordan"
sql_create_context
CREATE TABLE table_50402 ( "Pick" real, "Player" text, "Nationality" text, "New WNBA Team" text, "Former WNBA Team" text, "College/Country/Team" text )
Who is the player who played for the Miami Sol and went to school at North Carolina State?
SELECT "Player" FROM table_50402 WHERE "New WNBA Team" = 'miami sol' AND "College/Country/Team" = 'north carolina state'
wikisql
CREATE TABLE table_name_94 ( date VARCHAR, week VARCHAR, result VARCHAR )
What is the date where the result was L 27-10 in a week before week 9?
SELECT date FROM table_name_94 WHERE week < 9 AND result = "l 27-10"
sql_create_context
CREATE TABLE table_22348 ( "State (class)" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date of successors formal installation" text )
Who vacated his post when his successor was formally installed on May 11, 1966?
SELECT "Vacator" FROM table_22348 WHERE "Date of successors formal installation" = 'May 11, 1966'
wikisql
CREATE TABLE table_42349 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What is the lowest cuts made that had a Top-25 less than 6 and wins greater than 0?
SELECT MIN("Cuts made") FROM table_42349 WHERE "Top-25" < '6' AND "Wins" < '0'
wikisql
CREATE TABLE table_66454 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
what is the least silver for germany when gold is more than 4?
SELECT MIN("Silver") FROM table_66454 WHERE "Nation" = 'germany' AND "Gold" > '4'
wikisql
CREATE TABLE table_1233026_4 ( competition VARCHAR, aggregate VARCHAR )
What is the competition when aggregate is 1 4?
SELECT competition FROM table_1233026_4 WHERE aggregate = "1–4"
sql_create_context
CREATE TABLE table_name_42 ( points INTEGER, chassis VARCHAR, stage_wins VARCHAR )
what is the highest points when the chassis is focus rs wrc 08 and 09 and the stage wins is more than 91?
SELECT MAX(points) FROM table_name_42 WHERE chassis = "focus rs wrc 08 and 09" AND stage_wins > 91
sql_create_context
CREATE TABLE table_name_59 ( score VARCHAR, player VARCHAR )
What was Eduardo Romero's score?
SELECT score FROM table_name_59 WHERE player = "eduardo romero"
sql_create_context
CREATE TABLE table_65664 ( "School" text, "City" text, "Mascot" text, "County" text, "Year joined" real, "Previous Conference" text, "Year Left" real, "Conference Joined" text )
What is the mascot of Hammond Tech?
SELECT "Mascot" FROM table_65664 WHERE "City" = 'hammond' AND "School" = 'hammond tech'
wikisql
CREATE TABLE table_name_80 ( wins INTEGER, points VARCHAR, rank VARCHAR )
What is the lowest number of wins with more than 113 points in 4th rank?
SELECT MIN(wins) FROM table_name_80 WHERE points > 113 AND rank = "4th"
sql_create_context
CREATE TABLE table_204_360 ( id number, "year" number, "host" text, "gold" text, "silver" text, "bronze" text )
how many gold 's has brazil won ?
SELECT COUNT(*) FROM table_204_360 WHERE "gold" = 'brazil'
squall
CREATE TABLE table_3277 ( "Edition" real, "Zone" text, "Round" text, "Against" text, "Surface" text, "Opponent" text, "Outcome" text, "Result" text )
What kind of round was played when Hanne Skak Jensen faced Austria?
SELECT "Round" FROM table_3277 WHERE "Against" = 'Austria'
wikisql
CREATE TABLE table_357 ( "L&CR No." real, "Type" text, "Manufacturer" text, "Delivered" text, "Name" text, "Jt. Cttee No." real, "1845 disposal" text )
What was the type of sussex?
SELECT "Type" FROM table_357 WHERE "Name" = 'Sussex'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code...
when was patient 20066's arterial bp [diastolic] first measured less than 43.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 = 20066) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (...
mimic_iii
CREATE TABLE claims ( claim_id number, policy_id number, date_claim_made time, date_claim_settled time, amount_claimed number, amount_settled number ) CREATE TABLE customers ( customer_id number, customer_details text ) CREATE TABLE customer_policies ( policy_id number, custome...
What is the total amount of settlement made for all the settlements?
SELECT SUM(amount_settled) FROM settlements
spider
CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE author ( authorid int, authorname varchar...
What is the highest cited paper by jeff dean ?
SELECT DISTINCT cite.citedpaperid, COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname = 'jeff dean' AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY cite.citedpaperid ORDER BY COUNT(cite.citedpaperid) DESC
scholar
CREATE TABLE table_name_37 ( rank INTEGER, silver VARCHAR, total VARCHAR, nation VARCHAR )
What is the lowest rank of Hungary where there was a total of 8 medals, including 2 silver?
SELECT MIN(rank) FROM table_name_37 WHERE total = 8 AND nation = "hungary" AND silver > 2
sql_create_context
CREATE TABLE table_name_24 ( week INTEGER, result VARCHAR )
How many weeks had a Result of w 20 6?
SELECT SUM(week) FROM table_name_24 WHERE result = "w 20–6"
sql_create_context
CREATE TABLE table_78334 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What is the combined attendance of all games that had a result of w 35-14?
SELECT SUM("Attendance") FROM table_78334 WHERE "Result" = 'w 35-14'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
how many patients whose admission year is less than 2111 and item id is 51446?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2111" AND lab.itemid = "51446"
mimicsql_data
CREATE TABLE table_204_828 ( id number, "whitworth size (in)" number, "core diameter (in)" number, "threads per inch" number, "pitch (in)" number, "tapping drill size" text )
what is the next whitworth size -lrb- in -rrb- below 1/8 ?
SELECT "whitworth size (in)" FROM table_204_828 WHERE id = (SELECT id FROM table_204_828 WHERE "whitworth size (in)" = '1/8') + 1
squall
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,...
在医院0981491入院诊断疾病结果与出院诊断疾病在2018年10月16日至2020年4月15日以内结果不同的次数有多少?
SELECT (SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '0981491' AND IN_HOSP_DATE BETWEEN '2018-10-16' AND '2020-04-15') - (SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '0981491' AND IN_HOSP_DATE BETWEEN '2018-10-16' AND '2020-04-15' AND IN_DIAG_DIS_CD = OUT_DIAG_DIS_CD)
css
CREATE TABLE table_26375386_28 ( rank_by_average VARCHAR, couple VARCHAR )
How many ranks by average for the couple Tana and Stuart?
SELECT COUNT(rank_by_average) FROM table_26375386_28 WHERE couple = "Tana and Stuart"
sql_create_context
CREATE TABLE table_9551 ( "Election" real, "Number of NDC votes" text, "Share of votes" text, "Seats" real, "Outcome of election" text )
What is the share of votes with 3,567,021 NDC votes?
SELECT "Share of votes" FROM table_9551 WHERE "Number of NDC votes" = '3,567,021'
wikisql
CREATE TABLE table_name_89 ( overall INTEGER, name VARCHAR, round VARCHAR )
Which highest overall figure had Robert Alford as a name and a round of more than 2?
SELECT MAX(overall) FROM table_name_89 WHERE name = "robert alford" AND round > 2
sql_create_context
CREATE TABLE table_17968282_1 ( points VARCHAR, team VARCHAR )
Name the total number of points for newell's old boys
SELECT COUNT(points) FROM table_17968282_1 WHERE team = "Newell's Old Boys"
sql_create_context
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...
May I sign up for 100 -level classes in Spring or Summer term ?
SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURS...
advising
CREATE TABLE table_76347 ( "Draw" real, "Language" text, "Artist" text, "Song" text, "English translation" text, "Place" real, "Points" real )
What song was in french?
SELECT "Song" FROM table_76347 WHERE "Language" = 'french'
wikisql
CREATE TABLE table_28767 ( "Season #" real, "Series #" real, "Episode title" text, "Original air date" text, "Nick prod. #" real )
What's the name of the episode associated with Nick production number 342?
SELECT "Episode title" FROM table_28767 WHERE "Nick prod. #" = '342'
wikisql
CREATE TABLE table_name_98 ( leading_scorer VARCHAR, score VARCHAR )
What Leading scorer had a Score of 80 112?
SELECT leading_scorer FROM table_name_98 WHERE score = "80–112"
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 intakeoutput ( in...
was the value of patient 016-38131's bun last measured on the current hospital visit less than they were first measured on the current hospital visit?
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-38131' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'bun' ...
eicu
CREATE TABLE table_61209 ( "7:00 am" text, "7:30 am" text, "8:00 am" text, "9:00 am" text, "10:00 am" text, "11:00 am" text, "noon" text, "12:30 pm" text, "1:00 pm" text, "1:30 pm" text, "2:00 pm" text, "3:00 pm" text, "3:30 pm" text, "5:00 pm" text, "6:30 pm"...
What is on at 5pm on the channel where As the World Turns is on at 2pm?
SELECT "5:00 pm" FROM table_61209 WHERE "2:00 pm" = 'as the world turns'
wikisql
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 ...
Are there any sections of EECS 767 offered after 07:30 P.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 > '07:30' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 767 AND semester.semester = 'WN' AND ...
advising
CREATE TABLE table_57084 ( "State" text, "Interview" real, "Swimsuit" real, "Evening gown" real, "Average" real )
Name the most interview for minnesota and average more than 7.901
SELECT MAX("Interview") FROM table_57084 WHERE "State" = 'minnesota' AND "Average" > '7.901'
wikisql
CREATE TABLE table_56666 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text )
In the game where the Hornets were the home team and Clippers the visiting team, what is the score?
SELECT "Score" FROM table_56666 WHERE "Home" = 'hornets' AND "Visitor" = 'clippers'
wikisql
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
Tag Usage - Presentation Frameworks.
SELECT t.TagName, COUNT(p.Id) AS Posts, SUM(CASE WHEN p.AnswerCount > 0 THEN 1 ELSE 0 END) AS Answered FROM Tags AS t INNER JOIN PostTags AS pta ON t.Id = pta.TagId INNER JOIN Posts AS p ON p.Id = pta.PostId AND p.PostTypeId = 1 WHERE t.TagName IN ('angular', 'ember.js', 'reactjs', 'vuejs2') GROUP BY t.TagName
sede
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...
在11年7月15日到2014年12月18日之间病患17045983经过了哪些仪器的检查,在检验结果指标记录中仪器的编号是什么?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb_jyjgzbb.YLJGDM AN...
css
CREATE TABLE table_62549 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
What was the highest money when the score was 69-68-67-69=273?
SELECT MAX("Money ( $ )") FROM table_62549 WHERE "Score" = '69-68-67-69=273'
wikisql
CREATE TABLE table_name_53 ( opponent VARCHAR, week VARCHAR )
Who were the opponents during week 14?
SELECT opponent FROM table_name_53 WHERE week = 14
sql_create_context
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABL...
tell me patient 10624's minimum bands value this month?
SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10624) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bands') AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURR...
mimic_iii
CREATE TABLE table_name_64 ( entrant VARCHAR, points VARCHAR, year VARCHAR, engine VARCHAR )
After 1961, who as the Entrant when the engine was a Ferrari v8, and when the points were lower than 23?
SELECT entrant FROM table_name_64 WHERE year > 1961 AND engine = "ferrari v8" AND points < 23
sql_create_context
CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working...
What are the nationalities and the taotal ages of journalists. Visualize by a bar chart.
SELECT Nationality, SUM(Age) FROM journalist GROUP BY Nationality
nvbench
CREATE TABLE table_43430 ( "Year" text, "Award" text, "Production" text, "Role" text, "Result" text )
Which award was given for the role of Elphaba in 2009?
SELECT "Award" FROM table_43430 WHERE "Role" = 'elphaba' AND "Year" = '2009'
wikisql
CREATE TABLE table_1342198_36 ( result VARCHAR, incumbent VARCHAR )
What was the result when incumbent Tom Steed was elected?
SELECT result FROM table_1342198_36 WHERE incumbent = "Tom Steed"
sql_create_context
CREATE TABLE table_5255 ( "Name" text, "Nationality" text, "Position" text, "Tenure Began" real, "Term Ending" real )
Term Ending smaller than 2018, and a Nationality of new zealand what is the name?
SELECT "Name" FROM table_5255 WHERE "Term Ending" < '2018' AND "Nationality" = 'new zealand'
wikisql
CREATE TABLE table_15187735_11 ( segment_c VARCHAR, series_ep VARCHAR )
What is the name of series episode 11-02's segment c?
SELECT segment_c FROM table_15187735_11 WHERE series_ep = "11-02"
sql_create_context
CREATE TABLE table_name_16 ( high_rebounds VARCHAR, date VARCHAR )
Can you tell me the High rebounds that has the Date of november 5?
SELECT high_rebounds FROM table_name_16 WHERE date = "november 5"
sql_create_context
CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area...
A bar chart shows the number of appellations whose score is higher than 93, and ordered by Name.
SELECT Appelation, COUNT(Appelation) FROM wine WHERE Score > 93 GROUP BY Appelation ORDER BY Name
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
what is minimum age of patients whose days of hospital stay is 29 and admission year is greater than or equal to 2107?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.days_stay = "29" AND demographic.admityear >= "2107"
mimicsql_data
CREATE TABLE table_8542 ( "Tournament" text, "Surface" text, "Week" text, "Winner and score" text, "Finalist" text, "Semifinalists" text )
Which Surface has a Week of march 1?
SELECT "Surface" FROM table_8542 WHERE "Week" = 'march 1'
wikisql
CREATE TABLE CHARACTERISTICS ( characteristic_name VARCHAR )
Find the names of all the product characteristics.
SELECT DISTINCT characteristic_name FROM CHARACTERISTICS
sql_create_context
CREATE TABLE table_204_207 ( id number, "week" number, "date" text, "opponent" text, "result" text, "attendance" number, "bye" text )
on what date did the bears win by a difference of 27 points ?
SELECT "date" FROM table_204_207 WHERE "result" = 'w' AND "result" - "result" = 27
squall
CREATE TABLE table_14219514_1 ( home__1st_leg_ VARCHAR )
Who was in 2nd leg when Boca Juniors was in home (1st leg)?
SELECT 2 AS nd_leg FROM table_14219514_1 WHERE home__1st_leg_ = "Boca Juniors"
sql_create_context
CREATE TABLE table_19722233_5 ( blocks VARCHAR, player VARCHAR )
how many times did debbie black block
SELECT blocks FROM table_19722233_5 WHERE player = "Debbie Black"
sql_create_context
CREATE TABLE table_name_83 ( decision VARCHAR, record VARCHAR )
Who had the decision goal when the record was 7-7-2?
SELECT decision FROM table_name_83 WHERE record = "7-7-2"
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE admissions ( ro...
what were the top four most common drugs that followed during the same hospital visit for the patients who were given lt heart angiocardiogram during the previous year?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
mimic_iii
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 ...
how many patients are admitted urgently and lab tested for bilirubin,direct?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.label = "Bilirubin, Direct"
mimicsql_data
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 prescription...
what is the number of patients whose marital status is married and procedure long title is percutaneous [endoscopic] gastrostomy [peg]?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.long_title = "Percutaneous [endoscopic] gastrostomy [PEG]"
mimicsql_data
CREATE TABLE table_name_70 ( rd_1 INTEGER, province VARCHAR, rd_4 VARCHAR )
Which is the highest Rd 1 has a Province of utrecht and a Rd 4 larger than 0?
SELECT MAX(rd_1) FROM table_name_70 WHERE province = "utrecht" AND rd_4 > 0
sql_create_context
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER )
how old is the youngest person for each job?, and could you order x-axis from low to high order?
SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY job
nvbench
CREATE TABLE table_204_123 ( id number, "week" number, "date" text, "kickoff" text, "opponent" text, "results\nfinal score" text, "results\nteam record" text, "game site" text, "attendance" number )
what was the teams final record
SELECT "results\nteam record" FROM table_204_123 ORDER BY "week" DESC LIMIT 1
squall
CREATE TABLE table_name_23 ( attendance INTEGER, date VARCHAR )
What is the average number in attendance on September 16?
SELECT AVG(attendance) FROM table_name_23 WHERE date = "september 16"
sql_create_context
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, ...
What classes are required to declare a major in CLARCH ?
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%CLARCH%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_23937219_3 ( original_air_date VARCHAR, prod_code VARCHAR )
How many original air dates were there for the episode with production code 212?
SELECT COUNT(original_air_date) FROM table_23937219_3 WHERE prod_code = 212
sql_create_context
CREATE TABLE table_name_39 ( capacity VARCHAR, acceleration_0_100km_h VARCHAR )
what is the capacity when the acceleration 1-100km/h is 11.1 s?
SELECT capacity FROM table_name_39 WHERE acceleration_0_100km_h = "11.1 s"
sql_create_context
CREATE TABLE table_name_4 ( to_par VARCHAR, player VARCHAR )
Name the To par of payne stewart?
SELECT to_par FROM table_name_4 WHERE player = "payne stewart"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
what is minimum age of patients whose primary disease is aortic insufficiency\re-do sternotomy; aortic valve replacement and days of hospital stay is 20?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " AND demographic.days_stay = "20"
mimicsql_data
CREATE TABLE table_203_83 ( id number, "ranking" number, "company" text, "industry" text, "revenue (usd billions)" text, "fy" text, "capitalization (usd billions)" text, "employees" number, "listing" text, "headquarters" text, "ceo" text )
how many employees does vitol have ?
SELECT "employees" FROM table_203_83 WHERE "company" = 'vitol'
squall
CREATE TABLE table_70516 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" text )
What was E.J. 'Dutch' Harrison's lowest To Par?
SELECT MIN("To par") FROM table_70516 WHERE "Player" = 'e.j. "dutch" harrison'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
count the number of private health insurance patients who had transplant from cadaver.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.short_title = "Transplant cadaver donor"
mimicsql_data
CREATE TABLE table_20448 ( "Information" text, "Akimel A-al The name is Tohono Oodham for children of the river" text, "Altade\u00f1a" text, "Aprende" text, "Centennial" text, "Kyrene MS" text, "del Pueblo" text )
Name the centennial for location
SELECT "Centennial" FROM table_20448 WHERE "Information" = 'Location'
wikisql
CREATE TABLE financial_transactions ( transaction_id number, account_id number, invoice_number number, transaction_type text, transaction_date time, transaction_amount number, transaction_comment text, other_transaction_details text ) CREATE TABLE invoices ( invoice_number number, ...
What are the invoice dates, order ids, and order details for all invoices?
SELECT T1.invoice_date, T1.order_id, T2.order_details FROM invoices AS T1 JOIN orders AS T2 ON T1.order_id = T2.order_id
spider
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
give me the number of patients whose primary disease is newborn and lab test abnormal status is abnormal?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "NEWBORN" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_44912 ( "Team" text, "Manager" text, "Home city" text, "Stadium" text, "Capacity" real )
what is the home city for the stadion src mladost?
SELECT "Home city" FROM table_44912 WHERE "Stadium" = 'stadion src mladost'
wikisql
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE FlagTypes ( Id ...
How close am I to the sportsmanship badge?.
WITH CandidatePosts AS (SELECT ParentId AS postId FROM Posts AS p WHERE p.OwnerUserId = '##UserId##' AND p.PostTypeId = 2 AND p.Score > 0) SELECT p1.Id AS "post_link", p1.OwnerUserId AS "user_link", Body FROM Posts AS p1 JOIN CandidatePosts AS cp ON cp.postId = p1.ParentId WHERE p1.OwnerUserId != '##UserId##' ORDER BY ...
sede
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varcha...
list ground transportation in BALTIMORE
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'BALTIMORE' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_20094 ( "Name" text, "Position" text, "Number" real, "School/Club Team" text, "Season" text, "Acquisition via" text )
How many players are listed for the school/club team Washington?
SELECT COUNT("Name") FROM table_20094 WHERE "School/Club Team" = 'Washington'
wikisql
CREATE TABLE table_name_97 ( chipset VARCHAR, graphics VARCHAR, model VARCHAR )
What type of chipset is in the Precision t3400 model with the PCI Express graphics?
SELECT chipset FROM table_name_97 WHERE graphics = "pci express" AND model = "precision t3400"
sql_create_context
CREATE TABLE dorm ( dormid number, dorm_name text, student_capacity number, gender text ) CREATE TABLE lives_in ( stuid number, dormid number, room_number number ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, a...
Find the name and gender type of the dorms whose capacity is greater than 300 or less than 100.
SELECT dorm_name, gender FROM dorm WHERE student_capacity > 300 OR student_capacity < 100
spider
CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGER ) CREATE TABLE Settlements ( Settlement_ID INTEGER, Clai...
For those payments processed with Visa, bin the payment day into the Day of Week interval and compute the total amount payment as the Y-axis.
SELECT Date_Payment_Made, SUM(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa'
nvbench
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...
入院时诊断的疾病编号和名称,在医疗就诊95082544208里分别是什么?
SELECT gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '95082544208' UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '95082544208'
css
CREATE TABLE table_name_99 ( total INTEGER, horse VARCHAR )
Tell me the highest total when the horse is spender s
SELECT MAX(total) FROM table_name_99 WHERE horse = "spender s"
sql_create_context
CREATE TABLE table_19608 ( "Series #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production Code" real, "U.S. viewers (millions)" text )
What is the air date for 'there goes the bride'?
SELECT "Original air date" FROM table_19608 WHERE "Title" = 'There Goes the Bride'
wikisql
CREATE TABLE mzb ( 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...
在医院5387444全部诊疗记录中按照不一样的科室和不同的出院诊断列出来患者就诊的平均岁数是多少,保留其中平均岁数大于24岁的记录
SELECT qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '5387444' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_NM HAVING AVG(qtb.PERSON_AGE) > 24 UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.OUT_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '5387444' GR...
css
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, applica...
list the flights from ST. PAUL to SAN JOSE and from ST. PAUL to HOUSTON
SELECT DISTINCT flight.flight_id FROM 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, flight WHERE ((flight.to_airport = AIRPORT_SERVICE_1.airport_code AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND...
atis
CREATE TABLE train ( Train_ID int, Name text, Time text, Service text ) CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE t...
Give me a bar chart about the number of platforms in different locations, and I want to list from high to low by the total number please.
SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY SUM(Number_of_Platforms) DESC
nvbench
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 zyjzjlb ( CYBQDM text, CYBQMC...
查一下患者53607326踝部检验的各项指标结果
SELECT * FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '53607326' AND jyjgzbb.jybgb_BBCJBW = '踝部' UNION SELECT * FR...
css
CREATE TABLE table_44077 ( "Season" text, "Series" text, "Team" text, "Races" text, "Wins" text, "Poles" text, "F/Laps" text, "Podiums" text, "Points" text, "Pos." text )
what is the wins when the f/laps is test driver and team is lotus racing?
SELECT "Wins" FROM table_44077 WHERE "F/Laps" = 'test driver' AND "Team" = 'lotus racing'
wikisql
CREATE TABLE table_21474 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What was the final record for the game in which Dirk Nowitzki (19) had the high points?
SELECT "Record" FROM table_21474 WHERE "High points" = 'Dirk Nowitzki (19)'
wikisql
CREATE TABLE table_17290 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is the record where high assists is pierce (6)?
SELECT "Record" FROM table_17290 WHERE "High assists" = 'Pierce (6)'
wikisql
CREATE TABLE table_45211 ( "English" text, "Pali" text, "Sanskrit" text, "Chinese" text, "Tibetan" text )
Which Chinese has a Pali of atappa?
SELECT "Chinese" FROM table_45211 WHERE "Pali" = 'atappa'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
what are the four most frequently ordered microbiology tests for patients who received glucose - d5ns earlier within 2 months since 2 years ago?
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'glucose - d5ns' AND DATETIME(treatment.treat...
eicu
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
what was the number of aneurysm resection / repair procedures that were performed a year before?
SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'aneurysm resection / repair' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
eicu
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
count the number of patients whose ethnicity is asian and diagnoses long title is suicide and self-inflicted injury by hanging?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "ASIAN" AND diagnoses.long_title = "Suicide and self-inflicted injury by hanging"
mimicsql_data
CREATE TABLE table_11770 ( "Team" text, "Games Played" real, "Wins" real, "Losses" real, "Ties" real, "Goals For" real, "Goals Against" real )
What is the total number of losses for the Team of Montreal with Goals For larger than 29?
SELECT COUNT("Losses") FROM table_11770 WHERE "Goals For" > '29' AND "Team" = 'montreal'
wikisql
CREATE TABLE table_55835 ( "Amino Acid" text, "3-Letter" text, "1-Letter" text, "Side-chain polarity" text, "Side-chain charge (pH 7.4)" text, "Hydropathy index" text )
what is the side-chain polarity for the amino acid with the 1-letter v?
SELECT "Side-chain polarity" FROM table_55835 WHERE "1-Letter" = 'v'
wikisql