context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_20 ( current_club VARCHAR, rank VARCHAR )
Which Current Club has a Rank of 4?
SELECT current_club FROM table_name_20 WHERE rank = 4
sql_create_context
CREATE TABLE table_30414 ( "No. in Series" real, "No. in Season" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (millions)" text, "Original air date" text )
What is the title(s) of episodes written by aron eli coleite?
SELECT "Title" FROM table_30414 WHERE "Written by" = 'Aron Eli Coleite'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varch...
For those employees who did not have any job in the past, visualize the relationship between employee_id and salary .
SELECT EMPLOYEE_ID, SALARY FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) 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, X...
编号为9692570的这个医疗机构开了多少检验报告单,时间为二零零二年二月二十七日到二零一六年十月八日
SELECT COUNT(*) FROM jybgb WHERE jybgb.YLJGDM = '9692570' AND jybgb.BGRQ BETWEEN '2002-02-27' AND '2016-10-08'
css
CREATE TABLE Candidates ( candidate_id INTEGER, candidate_details VARCHAR(255) ) CREATE TABLE Student_Course_Attendance ( student_id INTEGER, course_id INTEGER, date_of_attendance DATETIME ) CREATE TABLE People ( person_id INTEGER, first_name VARCHAR(255), middle_name VARCHAR(255), ...
List the id of students who registered some courses and the number of their registered courses. Show the correlation.
SELECT T1.student_id, COUNT(*) FROM Students AS T1 JOIN Student_Course_Registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id
nvbench
CREATE TABLE table_name_68 ( outcome VARCHAR, opponent VARCHAR )
WHICH Outcome has aN Opponent of pascale paradis-mangon?
SELECT outcome FROM table_name_68 WHERE opponent = "pascale paradis-mangon"
sql_create_context
CREATE TABLE table_name_31 ( feb_2013 INTEGER, feb_2010 VARCHAR, nov_2012 VARCHAR )
What is the average Feb 2013 with a Feb 2010 with 37, and a Nov 2012 less than 32?
SELECT AVG(feb_2013) FROM table_name_31 WHERE feb_2010 = "37" AND nov_2012 < 32
sql_create_context
CREATE TABLE table_name_48 ( lost VARCHAR, drawn VARCHAR, position VARCHAR, name VARCHAR )
Which Lost has a Position larger than 2, a Name of sg m nchen (n), and a Drawn larger than 0?
SELECT COUNT(lost) FROM table_name_48 WHERE position > 2 AND name = "sg münchen (n)" AND drawn > 0
sql_create_context
CREATE TABLE table_43457 ( "School Year" text, "Class A" text, "Class AA" text, "Class AAA" text, "Class AAAA" text, "Class AAAAA" text )
Where Class AAA is Atlanta and Class AA is Weimar, what is Class AAAAA?
SELECT "Class AAAAA" FROM table_43457 WHERE "Class AAA" = 'atlanta' AND "Class AA" = 'weimar'
wikisql
CREATE TABLE table_name_51 ( score INTEGER, place VARCHAR, player VARCHAR )
What was the highest score of t5 place finisher brandt jobe?
SELECT MAX(score) FROM table_name_51 WHERE place = "t5" AND player = "brandt jobe"
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...
how many patients diagnosed with unspecified intestinal obstruction were admitted before the year 2125?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2125" AND diagnoses.long_title = "Unspecified intestinal obstruction"
mimicsql_data
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 demographic ...
how many patients whose year of birth is less than 2058 and lab test fluid is ascites?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2058" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE table_4914 ( "Date" text, "Round" text, "Circuit" text, "Winning driver" text, "Winning team" text, "Winning car" text )
What circuit saw Cabin Racing as the winning team?
SELECT "Circuit" FROM table_4914 WHERE "Winning team" = 'cabin racing'
wikisql
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE fare ( fa...
i would like to find out what flights there are on friday 6 eleventh from ST. PETERSBURG to MILWAUKEE and then from MILWAUKEE to TACOMA thank you
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, date_day, days, flight WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MILWAUKEE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1...
atis
CREATE TABLE table_60104 ( "Week 1" text, "Week 2" text, "Week 3" text, "Week 4" text, "Week 5" text )
Who was the girl of the week 3 weeks after brianne bailey in the same month?
SELECT "Week 5" FROM table_60104 WHERE "Week 2" = 'brianne bailey'
wikisql
CREATE TABLE table_49068 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text )
What was the Bronco's record when they played the Detroit Lions at Mile High Stadium?
SELECT "Record" FROM table_49068 WHERE "Game site" = 'mile high stadium' AND "Opponent" = 'detroit lions'
wikisql
CREATE TABLE table_name_7 ( model VARCHAR, digital VARCHAR, tuner VARCHAR )
I want the model for digital of dvb-t (cx22702) and tuner of thomson dtt75105
SELECT model FROM table_name_7 WHERE digital = "dvb-t (cx22702)" AND tuner = "thomson dtt75105"
sql_create_context
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment tex...
View Deadweight (Phase 2) questions. View latest questions older than 3 months that have score < 1 and all answers have score < 0
SELECT Id AS "post_link", Title, Body FROM Posts AS q WHERE PostTypeId = 1 AND Score < 1 AND CreationDate < DATEADD(MONTH, -3, GETDATE()) AND ClosedDate IS NULL AND AcceptedAnswerId IS NULL AND AnswerCount > 0 AND NOT EXISTS(SELECT * FROM Posts AS a WHERE PostTypeId = 2 AND ParentId = q.Id AND Score >= 0) ORDER BY Crea...
sede
CREATE TABLE table_43307 ( "Year" real, "Class" text, "Team" text, "Points" real, "Rank" text, "Wins" real )
What is the lowest points for 36th rank?
SELECT MIN("Points") FROM table_43307 WHERE "Rank" = '36th'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patient...
what is the drug that patient 006-71495 was prescribed two or more times until 46 months ago?
SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006...
eicu
CREATE TABLE table_name_35 ( command_set VARCHAR, _number_fdd VARCHAR, fdd_capacity__each_ VARCHAR, sides VARCHAR )
Tell me the command set with FDD capacity of 270kb and sides of ds with #FDD more than 1
SELECT command_set FROM table_name_35 WHERE fdd_capacity__each_ = "270kb" AND sides = "ds" AND _number_fdd > 1
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, ...
tell me the total number of patients who were discharged from the hospital?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL
mimic_iii
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...
病号冯文轩做的颅部检查各项指标结果怎么样?
SELECT * FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy...
css
CREATE TABLE table_78480 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text )
What date were there more than 19,600 people in attendance?
SELECT "Date" FROM table_78480 WHERE "Attendance" > '19,600'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, ...
on the last hospital visit, how many times had patient 010-26737 received a ferrous iron compound?
SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-26737' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospit...
eicu
CREATE TABLE table_name_23 ( round VARCHAR, player VARCHAR )
Which Round has a Player of anna chakvetadze?
SELECT round FROM table_name_23 WHERE player = "anna chakvetadze"
sql_create_context
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, ...
自07年8月26至14年9月1日患者36587624买西药的次数
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '36587624' AND t_kc22.STA_DATE BETWEEN '2007-08-26' AND '2014-09-01' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE f...
css
CREATE TABLE table_name_9 ( result VARCHAR, attendance VARCHAR )
What is the result of the match with an attendance of 73,855?
SELECT result FROM table_name_9 WHERE attendance = "73,855"
sql_create_context
CREATE TABLE table_name_92 ( release_date VARCHAR, l3_cache VARCHAR, part_number_s_ VARCHAR )
What is the release date of the 6 mb L3 cache with the part number by80607005259aabx80607i7740qm?
SELECT release_date FROM table_name_92 WHERE l3_cache = "6 mb" AND part_number_s_ = "by80607005259aabx80607i7740qm"
sql_create_context
CREATE TABLE table_55438 ( "Congress" text, "Short title" text, "Bill number(s)" text, "Date introduced" text, "Sponsor(s)" text, "# of cosponsors" real )
Who was the sponsor for the bill introduced February 28, 2005 with cosponsors less than 200?
SELECT "Sponsor(s)" FROM table_55438 WHERE "# of cosponsors" < '200' AND "Date introduced" = 'february 28, 2005'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
名为李红旭的病人有哪些检验报告单的报告日期在零六年三月二十日以后?这些报告单所对应的住院就诊的流水号是什么
SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '李红旭' AND NOT zyjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ <= '2006-03-20' UNI...
css
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...
what is diagnoses long title of diagnoses icd9 code 76403?
SELECT diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "76403"
mimicsql_data
CREATE TABLE table_name_26 ( total__kg_ INTEGER, snatch VARCHAR, clean_ VARCHAR, _jerk VARCHAR )
What is the sum Total (kg) associated with a Snatch less than 110, and a Clean & jerk larger than 120?
SELECT SUM(total__kg_) FROM table_name_26 WHERE snatch < 110 AND clean_ & _jerk > 120
sql_create_context
CREATE TABLE table_203_504 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text )
which other time was their the same score as the score in benin ?
SELECT "date" FROM table_203_504 WHERE "opponent" <> 'benin' AND "score" = (SELECT "score" FROM table_203_504 WHERE "opponent" = 'benin')
squall
CREATE TABLE table_60564 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
What tournament was played 16 September 2012?
SELECT "Tournament" FROM table_60564 WHERE "Date" = '16 september 2012'
wikisql
CREATE TABLE department ( dept_name text, building text, budget number ) CREATE TABLE course ( course_id text, title text, dept_name text, credits number ) CREATE TABLE time_slot ( time_slot_id text, day text, start_hr number, start_min number, end_hr number, end_mi...
What are the room numbers and corresponding buildings for classrooms which can seat between 50 to 100 students?
SELECT building, room_number FROM classroom WHERE capacity BETWEEN 50 AND 100
spider
CREATE TABLE table_name_94 ( location VARCHAR, game VARCHAR, score VARCHAR )
Where was the game that was larger than 30 and scored 106-111
SELECT location FROM table_name_94 WHERE game > 30 AND score = "106-111"
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostLinks ( Id number, CreationDate time, Post...
Sites by relative meta activity (compared to the main). Compares the SE sites to their metas - shows the percentage of the users having a post on the meta site, compared to the percentage of the users having a post on the main. Counts only the users over the RepLimit. You can set this RepLimit to 1.
COMMIT
sede
CREATE TABLE table_12906 ( "Date" text, "Label" text, "Format" text, "Country" text, "Catalog" text )
What is the date for CBS label?
SELECT "Date" FROM table_12906 WHERE "Label" = 'cbs'
wikisql
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...
count the number of patients whose admission location is trsf within this facility and diagnoses short title is convulsions nec?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND diagnoses.short_title = "Convulsions NEC"
mimicsql_data
CREATE TABLE table_17356106_1 ( series__number INTEGER, directed_by VARCHAR, season__number VARCHAR )
What is the maximum series number what is smaller than season 7.0 and directed by Laura Innes?
SELECT MAX(series__number) FROM table_17356106_1 WHERE directed_by = "Laura Innes" AND season__number < 7.0
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
See the CreationDate of the most recent Vote record per VoteTypeId..
WITH summary AS (SELECT VoteTypeId, CreationDate, ROW_NUMBER() OVER (PARTITION BY VoteTypeId ORDER BY CreationDate DESC) AS r FROM Votes) SELECT VoteTypeId, CreationDate FROM summary WHERE r = 1 ORDER BY VoteTypeId
sede
CREATE TABLE table_71701 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
Name the authority for morrinsville college
SELECT "Authority" FROM table_71701 WHERE "Name" = 'morrinsville college'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9cod...
what are the three most frequent drugs prescribed to valve replacement < 7days female patients of the 50s within the same month after they have been diagnosed since 4 years ago with valve replacement < 7days?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'valve replacement < 7days' AND DATETIME(diagnosis....
eicu
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text,...
until 3 years ago, what were the five most commonly taken lab tests for patients of age 60 or above?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) AND DATETIME(labevents.charttime) <= DATET...
mimic_iii
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
38758660的患者之前会有哪些不良反应
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE 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...
Specify the death status of the patient named Charles Nilsson
SELECT demographic.expire_flag FROM demographic WHERE demographic.name = "Charles Nilsson"
mimicsql_data
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) 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, X...
患者15176126为精神分裂症,门诊诊断的补体C4的结果定量及其单位都是什么?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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...
css
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...
give the birthdate and gender of subject id 990.
SELECT demographic.dob, demographic.gender FROM demographic WHERE demographic.subject_id = "990"
mimicsql_data
CREATE TABLE table_38555 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
Which Drawn is the highest one that has a Played smaller than 18?
SELECT MAX("Drawn") FROM table_38555 WHERE "Played" < '18'
wikisql
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 ...
编码为08550534166检验报告单对应的患者住院就诊中是谁啊?
SELECT person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN zyjybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = zyjybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = zyjybgb.JZLSH_ZYJZJLB WHERE zyjybgb.BGDH = '08550...
css
CREATE TABLE table_2883 ( "Rank" real, "Rider" text, "Mon 24 Aug" text, "Tues 25 Aug" text, "Wed 26 Aug" text, "Thurs 27 Aug" text, "Fri 28 Aug" text, "Sat 29 Aug" text )
When 22' 37.06 100.090mph is the time for Monday August 24th how many times are there for Friday August 28th?
SELECT COUNT("Fri 28 Aug") FROM table_2883 WHERE "Mon 24 Aug" = '22'' 37.06 100.090mph'
wikisql
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 ...
列举陈振海患者从2003年9月30日开始2005年3月3日结束被开出的所有检验报告单的科室编码以及名称都是什么呢?
SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND 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_MZJZJL...
css
CREATE TABLE railway_manage ( Railway_ID int, Manager_ID int, From_Year text ) CREATE TABLE train ( Train_ID int, Train_Num text, Name text, From text, Arrival text, Railway_ID int ) CREATE TABLE manager ( Manager_ID int, Name text, Country text, Working_year_starts...
Show id and location of railways that are associated with more than one train Visualize by bar chart, and could you display by the x-axis in ascending?
SELECT T1.Location, T1.Railway_ID FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID ORDER BY T1.Location
nvbench
CREATE TABLE table_name_59 ( catalog VARCHAR, date VARCHAR )
What is the catalog of the release from January 23, 2002?
SELECT catalog FROM table_name_59 WHERE date = "january 23, 2002"
sql_create_context
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, C...
select * from users where Location like 'pune'.
SELECT * FROM Users WHERE Location LIKE '%Oklahoma%' ORDER BY Reputation DESC
sede
CREATE TABLE table_64508 ( "Year" real, "Title" text, "Hangul / Japanese" text, "Role" text, "Network" text, "Genre" text )
What's the Hangul/Japanese of Boys Over Flowers that's drama?
SELECT "Hangul / Japanese" FROM table_64508 WHERE "Genre" = 'drama' AND "Title" = 'boys over flowers'
wikisql
CREATE TABLE table_24453847_2 ( date VARCHAR, game_site VARCHAR )
What game date was the game at AOL Arena?
SELECT date FROM table_24453847_2 WHERE game_site = "AOL Arena"
sql_create_context
CREATE TABLE table_58528 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the away team's score when the home team scored 15.16 (106)?
SELECT "Away team score" FROM table_58528 WHERE "Home team score" = '15.16 (106)'
wikisql
CREATE TABLE table_name_27 ( game_site VARCHAR, result VARCHAR )
What game site had a result at l 21 13?
SELECT game_site FROM table_name_27 WHERE result = "l 21–13"
sql_create_context
CREATE TABLE table_name_78 ( name VARCHAR, position VARCHAR, lost VARCHAR )
Which name was in a position less than 4 with 2 losses?
SELECT name FROM table_name_78 WHERE position < 4 AND lost = 2
sql_create_context
CREATE TABLE table_18328569_1 ( clubs_remaining INTEGER, round VARCHAR )
How many clubs remain in the fourth round?
SELECT MIN(clubs_remaining) FROM table_18328569_1 WHERE round = "Fourth round"
sql_create_context
CREATE TABLE table_name_69 ( week INTEGER, opponent VARCHAR )
What is the lowest attendance when the Atlanta Falcons were the opponent?
SELECT MIN(week) FROM table_name_69 WHERE opponent = "atlanta falcons"
sql_create_context
CREATE TABLE table_11075747_4 ( directed_by VARCHAR, episode__number VARCHAR )
Who directed Episode 8?
SELECT directed_by FROM table_11075747_4 WHERE episode__number = 8
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...
show me the number of male patients who were born before 2101.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.dob_year < "2101"
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
what is the maximum age of female patients who died of death status 0?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.expire_flag = "0"
mimicsql_data
CREATE TABLE table_10848177_1 ( song VARCHAR, length VARCHAR )
What song has a length of 3:05?
SELECT song FROM table_10848177_1 WHERE length = "3:05"
sql_create_context
CREATE TABLE table_name_78 ( vmax VARCHAR, type VARCHAR )
What was the maximum speed for the P4-1 (24/36 ps)?
SELECT vmax FROM table_name_78 WHERE type = "p4-1 (24/36 ps)"
sql_create_context
CREATE TABLE team ( Team_id int, Name text ) CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL text, Team int ) CREATE TABLE match_season ( Season real, Player text, Position text, Country int, Team i...
Show the position of players and the corresponding number of players with a bar chart, and show the total number in asc order.
SELECT Position, COUNT(*) FROM match_season GROUP BY Position ORDER BY COUNT(*)
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, find name and the average of manufacturer , and group by attribute name, and visualize them by a bar chart, and I want to order in desc by the y axis please.
SELECT T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Manufacturer DESC
nvbench
CREATE TABLE table_name_12 ( team VARCHAR, driver VARCHAR )
Which team does Colin Moore drive for?
SELECT team FROM table_name_12 WHERE driver = "colin moore"
sql_create_context
CREATE TABLE table_33576 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the away team that played at Windy Hill?
SELECT "Away team" FROM table_33576 WHERE "Venue" = 'windy hill'
wikisql
CREATE TABLE table_70264 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
Which years have a Decile smaller than 2, and an Area of mohaka?
SELECT "Years" FROM table_70264 WHERE "Decile" < '2' AND "Area" = 'mohaka'
wikisql
CREATE TABLE table_name_74 ( year_of_disaffiliation INTEGER, city_of_license_market VARCHAR )
What is the earliest year of disaffiliation of a CHCH-TV station, licensed in Hamilton, Ontario?
SELECT MIN(year_of_disaffiliation) FROM table_name_74 WHERE city_of_license_market = "hamilton, ontario"
sql_create_context
CREATE TABLE table_name_56 ( share INTEGER, rank__week_ VARCHAR, viewers__millions_ VARCHAR, rank__timeslot_ VARCHAR )
What is the average share for episodes with over 7.82 viewers, ranks of 3 and a weekly rank of 54?
SELECT AVG(share) FROM table_name_56 WHERE viewers__millions_ > 7.82 AND rank__timeslot_ = "3" AND rank__week_ = "54"
sql_create_context
CREATE TABLE table_name_51 ( player VARCHAR, pl_gp INTEGER )
What player has a number of playoff games played greater than 0?
SELECT player FROM table_name_51 WHERE pl_gp > 0
sql_create_context
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, Crea...
Find users eligible for moderator nomination.
SELECT Id, DisplayName, Reputation FROM Users WHERE Reputation >= 3000 AND EXISTS(SELECT Id FROM Badges AS b WHERE b.UserId = Users.Id AND b.Name = 'Civic Duty') AND EXISTS(SELECT Id FROM Badges AS b WHERE b.UserId = Users.Id AND b.Name = 'Strunk & White') AND EXISTS(SELECT Id FROM Badges AS b WHERE b.UserId = Users.Id...
sede
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 ...
find the number of days of hospital stay and death status of elizabeth bateman.
SELECT demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.name = "Elizabeth Bateman"
mimicsql_data
CREATE TABLE table_47733 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text )
Which player made the highest number of assists during the game played at the FleetCenter, with end score of W 120-87?
SELECT "High assists" FROM table_47733 WHERE "Location Attendance" = 'fleetcenter' AND "Score" = 'w 120-87'
wikisql
CREATE TABLE table_40344 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What is the Score for the 1999 fifa confederations cup?
SELECT "Score" FROM table_40344 WHERE "Competition" = '1999 fifa confederations cup'
wikisql
CREATE TABLE table_22616 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text )
What was the date of appointment for the manager of the 23rd team?
SELECT "Date of appointment" FROM table_22616 WHERE "Position in table" = '23rd'
wikisql
CREATE TABLE table_40494 ( "Name" text, "Built by HM Dockyard" text, "Ordered" text, "Laid down" text, "Launched" text )
What was launched and laid down in February 1819?
SELECT "Launched" FROM table_40494 WHERE "Laid down" = 'february 1819'
wikisql
CREATE TABLE table_13836 ( "Rank" real, "Peak" text, "Country" text, "Island" text, "Elevation (m)" real, "Prominence (m)" real, "Col (m)" real )
Which Rank has a Col (m) of 0, and a Peak of aoraki/mount cook, and a Prominence (m) larger than 3,755?
SELECT SUM("Rank") FROM table_13836 WHERE "Col (m)" = '0' AND "Peak" = 'aoraki/mount cook' AND "Prominence (m)" > '3,755'
wikisql
CREATE TABLE table_45034 ( "Heat" real, "Lane" real, "Name" text, "Country" text, "Mark" text )
What's the total number of Heat recorded for the british virgin islands?
SELECT COUNT("Heat") FROM table_45034 WHERE "Country" = 'british virgin islands'
wikisql
CREATE TABLE table_77513 ( "Name" text, "Position" text, "Height" text, "Weight" real, "Year" text, "Home Town" text, "High School" text )
What is the Position with a Year with freshman, and a Weight larger than 210?
SELECT "Position" FROM table_77513 WHERE "Year" = 'freshman' AND "Weight" > '210'
wikisql
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_prerequisite ( pre_course_id ...
Is there an afternoon 421 class in Spring-Summer 2014 ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time >= '12:00:00' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 421 AND semester.semester = 'Spring-Summer' AND semester.semester_id = course_offering.semester AND semester.year ...
advising
CREATE TABLE table_name_59 ( english_country_name VARCHAR, english_capital_name VARCHAR )
What is the English name of the country that has Ramallah as its capital?
SELECT english_country_name FROM table_name_59 WHERE english_capital_name = "ramallah"
sql_create_context
CREATE TABLE table_14603212_1 ( school_year VARCHAR, class_aAA VARCHAR, Wimberley VARCHAR, class_a VARCHAR )
If class a is canadian and class aaa is wimberley, which possible school years could this fall on?
SELECT school_year FROM table_14603212_1 WHERE class_aAA = Wimberley AND class_a = "Canadian"
sql_create_context
CREATE TABLE table_name_88 ( attendance VARCHAR, date VARCHAR )
What was the Attendance on 11/09/1946?
SELECT attendance FROM table_name_88 WHERE date = "11/09/1946"
sql_create_context
CREATE TABLE table_name_58 ( wrestlers VARCHAR, days_held VARCHAR )
Name the wrestlers for days held of 69
SELECT wrestlers FROM table_name_58 WHERE days_held = "69"
sql_create_context
CREATE TABLE table_name_71 ( grid VARCHAR, rider VARCHAR )
The rider mike di meglio had a total of how many grids?
SELECT COUNT(grid) FROM table_name_71 WHERE rider = "mike di meglio"
sql_create_context
CREATE TABLE table_name_88 ( type VARCHAR, quantity VARCHAR, number_s_ VARCHAR )
What is the type with a quantity of fewer than 6 and number(s) 5201?
SELECT type FROM table_name_88 WHERE quantity < 6 AND number_s_ = "5201"
sql_create_context
CREATE TABLE table_name_59 ( rider VARCHAR, speed VARCHAR )
Which rider had a speed of 90.57mph?
SELECT rider FROM table_name_59 WHERE speed = "90.57mph"
sql_create_context
CREATE TABLE table_name_70 ( points_against VARCHAR, points_diff VARCHAR )
What is points sgsinst when points diff is +96?
SELECT points_against FROM table_name_70 WHERE points_diff = "+96"
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 diagnosis ( diagn...
during the first hospital encounter, what was the daily maximum dose of enteral 2 cal hn of patient 017-55081?
SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-55081' AND NOT patient.hospitaldischargetime...
eicu
CREATE TABLE table_37402 ( "Year" text, "Winner" text, "Runner-Up" text, "Semi-Finalists" text, "Quarter-Finalists" text, "Last 16" text, "Last 32" text, "Last 64" text, "Total" text )
Which Winner has Semi-Finalists of 2,000?
SELECT "Winner" FROM table_37402 WHERE "Semi-Finalists" = '£2,000'
wikisql
CREATE TABLE table_name_22 ( date VARCHAR, week VARCHAR )
Which date has 1 as the week?
SELECT date FROM table_name_22 WHERE week = 1
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...
provide the number of patients whose gender is m and diagnoses icd9 code is 51889?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.icd9_code = "51889"
mimicsql_data
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 whose year of birth is less than 1882 and drug route is tp?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "1882" AND prescriptions.route = "TP"
mimicsql_data
CREATE TABLE table_203_358 ( id number, "pos." number, "athlete" text, "run 1" number, "run 2" number, "total" text )
which athlete had the fastest run ?
SELECT "athlete" FROM table_203_358 ORDER BY "total" LIMIT 1
squall