instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_68099 ( "Year" real, "Group" text, "Award" text, "Film/Show" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Film/Show, when the Year is 2010?
SELECT "Film/Show" FROM table_68099 WHERE "Year" = '2010'
wikisql
CREATE TABLE table_38244 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partnering" text, "Opponents in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the score for opponents of nathan healey igor kunitsyn
SELECT "Score" FROM table_38244 WHERE "Opponents in the final" = 'nathan healey igor kunitsyn'
wikisql
CREATE TABLE table_42825 ( "Season" real, "Series" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Season, when F/Laps is 1, and when Poles is less than 0?
SELECT AVG("Season") FROM table_42825 WHERE "F/Laps" = '1' AND "Poles" < '0'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) 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 text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- let me know the birth date and death date of patient caren obrien.
SELECT demographic.dob, demographic.dod FROM demographic WHERE demographic.name = "Caren Obrien"
mimicsql_data
CREATE TABLE party ( Party_ID int, Minister text, Took_office text, Left_office text, Region_ID int, Party_name text ) CREATE TABLE member ( Member_ID int, Member_Name text, Party_ID text, In_office text ) CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) CREATE TABLE region ( Region_ID int, Region_name text, Date text, Label text, Format text, Catalogue text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show party names and the number of events for each party. Visualize by pie chart.
SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID
nvbench
CREATE TABLE table_26930 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Wildcats points" real, "Opponents" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all results from the 3-3 scoring game.
SELECT "Result" FROM table_26930 WHERE "Record" = '3-3'
wikisql
CREATE TABLE table_name_33 ( laps VARCHAR, constructor VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps did BRM have with a grid of 11?
SELECT COUNT(laps) FROM table_name_33 WHERE constructor = "brm" AND grid = 11
sql_create_context
CREATE TABLE table_name_64 ( draw VARCHAR, performer VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of draws for songs performed by Miranda with fewer than 48 points?
SELECT COUNT(draw) FROM table_name_64 WHERE performer = "miranda" AND points < 48
sql_create_context
CREATE TABLE table_name_49 ( date VARCHAR, games VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what day was the record set at the 2002 Salt Lake City games with a time of 3:57.70?
SELECT date FROM table_name_49 WHERE games = "2002 salt lake city" AND time = "3:57.70"
sql_create_context
CREATE TABLE table_204_211 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many countries received silver medals ?
SELECT COUNT("nation") FROM table_204_211 WHERE "silver" > 0
squall
CREATE TABLE table_name_43 ( opponent VARCHAR, venue VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who played against in venue a on 17 february 1900?
SELECT opponent FROM table_name_43 WHERE venue = "a" AND date = "17 february 1900"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY number, ILL_PAY number, CIVIL_SUBSIDY number, PER_SOL number, PER_EXP number, DATA_ID text, SYNC_TIME time, OUT_HOSP_DATE time, CLINIC_ID text, MED_TYPE number, INSURED_STS text, INSURED_IDENTITY number, TRADE_TYPE number, RECIPE_BILL_ID text, ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, REIMBURS_FLG number, SENDER_DEAL_ID text, RECEIVER_DEAL_ID text, SENDER_REVOKE_ID text, RECEIVER_REVOKE_ID text, SENDER_OFFSET_ID text, RECEIVER_OFFSET_ID text, LAS_OVE_PAY number, OVE_ADD_PAY number, SUP_ADD_PAY number, CKC102 number, CASH_PAY number, COM_ACC_PAY number, ENT_ACC_PAY number, ENT_PAY number, COM_PAY number, OLDC_FUND_PAY number, SPE_FUND_PAY number ) CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG number, FLX_MED_ORG_ID text, MED_SER_ORG_NO text, CLINIC_TYPE text, MED_TYPE number, CLINIC_ID text, IN_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, INPT_AREA_BED text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, MAIN_COND_DES text, INSU_TYPE text, IN_HOSP_DAYS number, MED_AMOUT number, FERTILITY_STS number, DATA_ID text, SYNC_TIME time, REIMBURSEMENT_FLG number, HOSP_LEV number, HOSP_STS number, INSURED_IDENTITY number, SERVANT_FLG text, TRADE_TYPE number, INSURED_STS text, REMOTE_SETTLE_FLG text ) 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, VAL_UNIT text, DOSE_UNIT text, DOSE_FORM text, SPEC text, USE_FRE text, EACH_DOSAGE text, QTY number, UNIVALENT number, AMOUNT number, SELF_PAY_PRO number, RER_SOL number, SELF_PAY_AMO number, UP_LIMIT_AMO number, OVE_SELF_AMO number, EXP_OCC_DATE time, RECIPE_BILL_ID text, FLX_MED_ORG_ID text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, HOSP_DOC_CD text, HOSP_DOC_NM text, REF_STA_FLG number, DATA_ID text, SYNC_TIME time, PRESCRIPTION_CODE text, PRESCRIPTION_ID text, TRADE_TYPE number, STA_FLG number, STA_DATE time, REIMBURS_TYPE number, FXBZ number, REMOTE_SETTLE_FLG text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 从2010年5月27日到2021年2月21日,医疗机构3892472有多少公务员有医疗就诊记录?
SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '3892472' AND IN_HOSP_DATE BETWEEN '2010-05-27' AND '2021-02-21' AND SERVANT_FLG = '公务员'
css
CREATE TABLE table_203_364 ( id number, "year" number, "driver" text, "nation of citizenship" text, "racing series" text, "type of vehicle" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- does the united states have more nation of citzenship then united kingdom ?
SELECT (SELECT COUNT(*) FROM table_203_364 WHERE "nation of citizenship" = 'united states') > (SELECT COUNT(*) FROM table_203_364 WHERE "nation of citizenship" = 'united kingdom')
squall
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, FLX_MED_ORG_ID text, ILL_PAY number, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, LAS_OVE_PAY number, MED_AMOUT number, MED_CLINIC_ID text, MED_SAFE_PAY_ID text, MED_TYPE number, OLDC_FUND_PAY number, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_ADD_PAY number, OVE_PAY number, PERSON_ID text, PER_ACC_PAY number, PER_EXP number, PER_SOL number, RECEIVER_DEAL_ID text, RECEIVER_OFFSET_ID text, RECEIVER_REVOKE_ID text, RECIPE_BILL_ID text, REF_SLT_FLG number, REIMBURS_FLG number, SENDER_DEAL_ID text, SENDER_OFFSET_ID text, SENDER_REVOKE_ID text, SPE_FUND_PAY number, SUP_ADD_PAY number, SYNC_TIME time, TRADE_TYPE number ) CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, IN_HOSP_DATE time, IN_HOSP_DAYS number, MAIN_COND_DES text, MED_AMOUT number, MED_CLINIC_ID text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, MED_SER_ORG_NO text, MED_TYPE number, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, PERSON_AGE number, PERSON_ID text, PERSON_NM text, PERSON_SEX number, REIMBURSEMENT_FLG number, REMOTE_SETTLE_FLG text, SERVANT_FLG text, SOC_SRT_CARD text, SYNC_TIME time, TRADE_TYPE number ) 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_DIRE_CD text, MED_DIRE_NM text, MED_EXP_BILL_ID text, MED_EXP_DET_ID text, MED_INV_ITEM_TYPE text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_SELF_AMO number, PRESCRIPTION_CODE text, PRESCRIPTION_ID text, QTY number, RECIPE_BILL_ID text, REF_STA_FLG number, REIMBURS_TYPE number, REMOTE_SETTLE_FLG text, RER_SOL number, SELF_PAY_AMO number, SELF_PAY_PRO number, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, SPEC text, STA_DATE time, STA_FLG number, SYNC_TIME time, TRADE_TYPE number, UNIVALENT number, UP_LIMIT_AMO number, USE_FRE text, VAL_UNIT text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 医疗记录中对于潘莹玉患者医疗费总额高于2220.31元的所以出院诊断疾病编码和名称都分别是什么呢?
SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '潘莹玉' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 2220.31)
css
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 text, NLS number, NLY number, QTJZYSGH text, SG number, SSY number, SZY number, TW number, TXBZ number, TZ number, WDBZ number, XL number, YLJGDM text, ZSEBZ number, ZZBZ number, ZZYSGH 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, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, SBBM text, SHRGH text, SHRXM text, YQBH text, YQMC text, jyjgzbb_id number ) CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 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, JYKSBM text, JYKSMC text, JYLX number, JYRQ time, JYSQJGMC text, JYXMDM text, JYXMMC text, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SHRGH text, SHRXM text, SHSJ time, SQKS text, SQKSMC text, SQRGH text, SQRQ time, SQRXM text, YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text ) 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 text, RYCWH text, RYDJSJ time, RYSJ time, RYTJDM number, RYTJMC text, RZBQDM text, RZBQMC text, WDBZ number, YLJGDM text, ZYBMLX number, ZYZDBM text, ZYZDMC text, ZYZYZDZZBM text, ZYZYZDZZMC text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 从2007年10月16日到2020年3月16日,列出病人沈智勇这期间所有检验报告单的审核日期时间
SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '沈智勇' AND jybgb.BGRQ BETWEEN '2007-10-16' AND '2020-03-16' UNION SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb 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 = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE person_info.XM = '沈智勇' AND jybgb.BGRQ BETWEEN '2007-10-16' AND '2020-03-16'
css
CREATE TABLE table_203_89 ( id number, "#" number, "name\n(birth-death)" text, "took office" text, "left office" text, "monarch" text, "prime minister" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which governor served for the least number of years ?
SELECT "name\n(birth-death)" FROM table_203_89 ORDER BY "left office" - "took office" LIMIT 1
squall
CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) 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 Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many documents for each document type description? Visualize by a pie chart.
SELECT Document_Type_Description, COUNT(Document_Type_Description) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Description
nvbench
CREATE TABLE table_4886 ( "Year" text, "Player" text, "Nationality" text, "Position" text, "Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the nationality of five-eighth player Darren Lockyer?
SELECT "Nationality" FROM table_4886 WHERE "Player" = 'darren lockyer' AND "Position" = 'five-eighth'
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, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostsWithDeleted ( 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, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) 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 PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) 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 text, Text text, ContentLicense text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE VoteTypes ( Id number, Name text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- full PostHistory for a post.
SELECT ph.*, pht.Name FROM PostHistory AS ph LEFT JOIN PostHistoryTypes AS pht ON ph.PostHistoryTypeId = pht.Id WHERE PostId = '##post:int##' ORDER BY ph.Id
sede
CREATE TABLE table_61731 ( "Result" text, "Record" text, "Opponent" text, "Method" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which location has a method of decision and Nikos Tsoukalas for an opponent?
SELECT "Location" FROM table_61731 WHERE "Method" = 'decision' AND "Opponent" = 'nikos tsoukalas'
wikisql
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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- A bar chart about what is average age for different job title?, and rank y axis in ascending order.
SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY AVG(age)
nvbench
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 ) 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, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- count the number of patients whose language is engl and diagnoses long title is unspecified protein-calorie malnutrition?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.language = "ENGL" AND diagnoses.long_title = "Unspecified protein-calorie malnutrition"
mimicsql_data
CREATE TABLE table_1108394_47 ( party VARCHAR, manhattan VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many parties received 29.9% of the vote in Manhattan?
SELECT COUNT(party) FROM table_1108394_47 WHERE manhattan = "29.9_percentage"
sql_create_context
CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Information Extraction publications
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Information Extraction' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
scholar
CREATE TABLE table_43502 ( "Tournament" text, "1978" text, "1979" text, "1980" text, "1982" text, "1983" text, "1984" text, "1985" text, "1986" text, "1987" text, "1988" text, "1989" text, "1990" text, "1991" text, "1992" text, "Career SR" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is 1987, when 1986 is '1R'?
SELECT "1987" FROM table_43502 WHERE "1986" = '1r'
wikisql
CREATE TABLE table_67971 ( "Event" text, "Time" text, "Nationality" text, "Date" text, "Meet" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Event's Time is 4:01.00?
SELECT "Event" FROM table_67971 WHERE "Time" = '4:01.00'
wikisql
CREATE TABLE table_name_98 ( venue VARCHAR, sport VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which venue held a basketball team?
SELECT venue FROM table_name_98 WHERE sport = "basketball"
sql_create_context
CREATE TABLE Roles ( role_code VARCHAR(15), role_description VARCHAR(80) ) CREATE TABLE Document_Sections ( section_id INTEGER, document_code VARCHAR(15), section_sequence INTEGER, section_code VARCHAR(20), section_title VARCHAR(80) ) CREATE TABLE Document_Sections_Images ( section_id INTEGER, image_id INTEGER ) CREATE TABLE Documents ( document_code VARCHAR(15), document_structure_code VARCHAR(15), document_type_code VARCHAR(15), access_count INTEGER, document_name VARCHAR(80) ) CREATE TABLE Functional_Areas ( functional_area_code VARCHAR(15), parent_functional_area_code VARCHAR(15), functional_area_description VARCHAR(80) ) CREATE TABLE Document_Functional_Areas ( document_code VARCHAR(15), functional_area_code VARCHAR(15) ) CREATE TABLE Images ( image_id INTEGER, image_alt_text VARCHAR(80), image_name VARCHAR(40), image_url VARCHAR(255) ) CREATE TABLE Users ( user_id INTEGER, role_code VARCHAR(15), user_name VARCHAR(40), user_login VARCHAR(40), password VARCHAR(40) ) CREATE TABLE Document_Structures ( document_structure_code VARCHAR(15), parent_document_structure_code VARCHAR(15), document_structure_description VARCHAR(80) ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the number of users in each role. Plot them as bar chart.
SELECT role_code, COUNT(*) FROM Users GROUP BY role_code
nvbench
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_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, IN_HOSP_DATE time, IN_HOSP_DAYS number, MAIN_COND_DES text, MED_AMOUT number, MED_CLINIC_ID number, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, MED_SER_ORG_NO text, MED_TYPE number, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, PERSON_AGE number, PERSON_ID text, PERSON_NM text, PERSON_SEX number, REIMBURSEMENT_FLG number, REMOTE_SETTLE_FLG text, SERVANT_FLG text, SOC_SRT_CARD text, SYNC_TIME time, TRADE_TYPE number ) CREATE TABLE zyb ( 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_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, IN_HOSP_DATE time, IN_HOSP_DAYS number, MAIN_COND_DES text, MED_AMOUT number, MED_CLINIC_ID number, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, MED_SER_ORG_NO text, MED_TYPE number, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, PERSON_AGE number, PERSON_ID text, PERSON_NM text, PERSON_SEX number, REIMBURSEMENT_FLG number, REMOTE_SETTLE_FLG text, SERVANT_FLG text, SOC_SRT_CARD text, SYNC_TIME time, TRADE_TYPE number ) 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 text, MED_DIRE_NM text, MED_EXP_BILL_ID text, MED_EXP_DET_ID text, MED_INV_ITEM_TYPE text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_SELF_AMO number, PRESCRIPTION_CODE text, PRESCRIPTION_ID text, QTY number, RECIPE_BILL_ID text, REF_STA_FLG number, REIMBURS_TYPE number, REMOTE_SETTLE_FLG text, RER_SOL number, SELF_PAY_AMO number, SELF_PAY_PRO number, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, SPEC text, STA_DATE time, STA_FLG number, SYNC_TIME time, TRADE_TYPE number, UNIVALENT number, UP_LIMIT_AMO number, USE_FRE text, VAL_UNIT text ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, FLX_MED_ORG_ID text, ILL_PAY number, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, LAS_OVE_PAY number, MED_AMOUT number, MED_CLINIC_ID text, MED_SAFE_PAY_ID text, MED_TYPE number, OLDC_FUND_PAY number, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_ADD_PAY number, OVE_PAY number, PERSON_ID text, PER_ACC_PAY number, PER_EXP number, PER_SOL number, RECEIVER_DEAL_ID text, RECEIVER_OFFSET_ID text, RECEIVER_REVOKE_ID text, RECIPE_BILL_ID text, REF_SLT_FLG number, REIMBURS_FLG number, SENDER_DEAL_ID text, SENDER_OFFSET_ID text, SENDER_REVOKE_ID text, SPE_FUND_PAY number, SUP_ADD_PAY number, SYNC_TIME time, TRADE_TYPE number ) CREATE TABLE gyb ( 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_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, IN_HOSP_DATE time, IN_HOSP_DAYS number, MAIN_COND_DES text, MED_AMOUT number, MED_CLINIC_ID number, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, MED_SER_ORG_NO text, MED_TYPE number, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, PERSON_AGE number, PERSON_ID text, PERSON_NM text, PERSON_SEX number, REIMBURSEMENT_FLG number, REMOTE_SETTLE_FLG text, SERVANT_FLG text, SOC_SRT_CARD text, SYNC_TIME time, TRADE_TYPE number ) CREATE TABLE qtb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, IN_HOSP_DATE time, IN_HOSP_DAYS number, MAIN_COND_DES text, MED_AMOUT number, MED_CLINIC_ID number, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, MED_SER_ORG_NO text, MED_TYPE number, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, PERSON_AGE number, PERSON_ID text, PERSON_NM text, PERSON_SEX number, REIMBURSEMENT_FLG number, REMOTE_SETTLE_FLG text, SERVANT_FLG text, SOC_SRT_CARD text, SYNC_TIME time, TRADE_TYPE number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 从2010年12月18日起2020年6月3日结束的这段时间医院0444106的住院医疗记录的具体的数量是多些?
SELECT COUNT(*) FROM zyb WHERE zyb.MED_TYPE = '0444106' AND zyb.IN_HOSP_DAYS BETWEEN '2010-12-18' AND '2020-06-03'
css
CREATE TABLE table_name_59 ( location VARCHAR, unit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country is the Jiufotang Formation located in?
SELECT location FROM table_name_59 WHERE unit = "jiufotang formation"
sql_create_context
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, JYKSBM text, JYKSMC text, JYLX number, JYRQ time, JYSQJGMC text, JYXMDM text, JYXMMC text, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SHRGH text, SHRXM text, SHSJ time, SQKS text, SQKSMC text, SQRGH text, SQRQ time, SQRXM text, YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text ) 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, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, SBBM text, SHRGH text, SHRXM text, YLJGDM text, YQBH text, YQMC text ) 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 text, RYCWH text, RYDJSJ time, RYSJ time, RYTJDM number, RYTJMC text, RZBQDM text, RZBQMC text, WDBZ number, YLJGDM text, ZYBMLX number, ZYZDBM text, ZYZDMC text, ZYZYZDZZBM text, ZYZYZDZZMC text ) 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 bdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC text, NLS number, NLY number, QTJZYSGH text, SG number, SSY number, SZY number, TW number, TXBZ number, TZ number, XL number, YLJGDM number, ZSEBZ number, ZZBZ number, ZZYSGH text ) CREATE TABLE wdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC text, NLS number, NLY number, QTJZYSGH text, SG number, SSY number, SZY number, TW number, TXBZ number, TZ number, XL number, YLJGDM number, ZSEBZ number, ZZBZ number, ZZYSGH text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 沈雅懿患者的检验报告单对应的检验结果指标均异常都是哪些?列出对应的检验报告单号都是啥?
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '沈雅懿' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WHERE jyjgzbb.JCZBJGDL >= jyjgzbb.CKZFWXX AND jyjgzbb.JCZBJGDL <= jyjgzbb.CKZFWSX) UNION SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN bdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND hz_info.KH = bdmzjzjlb.KH AND hz_info.KLX = bdmzjzjlb.KLX AND bdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND bdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '沈雅懿' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WHERE jyjgzbb.JCZBJGDL >= jyjgzbb.CKZFWXX AND jyjgzbb.JCZBJGDL <= jyjgzbb.CKZFWSX) UNION SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb 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 = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE person_info.XM = '沈雅懿' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WHERE jyjgzbb.JCZBJGDL >= jyjgzbb.CKZFWXX AND jyjgzbb.JCZBJGDL <= jyjgzbb.CKZFWSX)
css
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) 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, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) 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 ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense 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, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostsWithDeleted ( 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, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) -- Using valid SQLite, answer the following questions for the tables provided above. -- id-requests to be deleted (q.score<4 and not a single answer scored >=3).
SELECT CONCAT('http://anime.stackexchange.com/questions/', p.Id) FROM Posts AS p JOIN PostTags AS pt ON p.Id = pt.PostId JOIN Tags AS t ON pt.TagId = t.Id WHERE p.PostTypeId = 1 AND t.TagName = 'identification-request' AND p.DeletionDate IS NULL AND p.Score < 4 AND NOT EXISTS(SELECT 1 FROM Posts AS a WHERE a.ParentId = p.Id AND a.DeletionDate IS NULL AND a.Score >= 3)
sede
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, FLX_MED_ORG_ID text, ILL_PAY number, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, LAS_OVE_PAY number, MED_AMOUT number, MED_CLINIC_ID text, MED_SAFE_PAY_ID text, MED_TYPE number, OLDC_FUND_PAY number, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_ADD_PAY number, OVE_PAY number, PERSON_ID text, PER_ACC_PAY number, PER_EXP number, PER_SOL number, RECEIVER_DEAL_ID text, RECEIVER_OFFSET_ID text, RECEIVER_REVOKE_ID text, RECIPE_BILL_ID text, REF_SLT_FLG number, REIMBURS_FLG number, SENDER_DEAL_ID text, SENDER_OFFSET_ID text, SENDER_REVOKE_ID text, SPE_FUND_PAY number, SUP_ADD_PAY number, SYNC_TIME time, TRADE_TYPE number, t_kc21_CLINIC_ID text, t_kc21_CLINIC_TYPE text, t_kc21_COMP_ID text, t_kc21_DATA_ID text, t_kc21_DIFF_PLACE_FLG number, t_kc21_FERTILITY_STS number, t_kc21_FLX_MED_ORG_ID text, t_kc21_HOSP_LEV number, t_kc21_HOSP_STS number, t_kc21_IDENTITY_CARD text, t_kc21_INPT_AREA_BED text, t_kc21_INSURED_IDENTITY number, t_kc21_INSURED_STS text, t_kc21_INSU_TYPE text, t_kc21_IN_DIAG_DIS_CD text, t_kc21_IN_DIAG_DIS_NM text, t_kc21_IN_HOSP_DATE time, t_kc21_IN_HOSP_DAYS number, t_kc21_MAIN_COND_DES text, t_kc21_MED_AMOUT number, t_kc21_MED_ORG_DEPT_CD text, t_kc21_MED_ORG_DEPT_NM text, t_kc21_MED_SER_ORG_NO text, t_kc21_MED_TYPE number, t_kc21_OUT_DIAG_DIS_CD text, t_kc21_OUT_DIAG_DIS_NM text, t_kc21_OUT_DIAG_DOC_CD text, t_kc21_OUT_DIAG_DOC_NM text, t_kc21_OUT_HOSP_DATE time, t_kc21_OVERALL_CD_ORG text, t_kc21_OVERALL_CD_PERSON text, t_kc21_PERSON_AGE number, t_kc21_PERSON_ID text, t_kc21_PERSON_NM text, t_kc21_PERSON_SEX number, t_kc21_REIMBURSEMENT_FLG number, t_kc21_REMOTE_SETTLE_FLG text, t_kc21_SERVANT_FLG text, t_kc21_SOC_SRT_CARD text, t_kc21_SYNC_TIME time, t_kc21_TRADE_TYPE number ) 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 text, MED_DIRE_NM text, MED_EXP_BILL_ID text, MED_EXP_DET_ID text, MED_INV_ITEM_TYPE text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_SELF_AMO number, PRESCRIPTION_CODE text, PRESCRIPTION_ID text, QTY number, RECIPE_BILL_ID text, REF_STA_FLG number, REIMBURS_TYPE number, REMOTE_SETTLE_FLG text, RER_SOL number, SELF_PAY_AMO number, SELF_PAY_PRO number, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, SPEC text, STA_DATE time, STA_FLG number, SYNC_TIME time, TRADE_TYPE number, UNIVALENT number, UP_LIMIT_AMO number, USE_FRE text, VAL_UNIT text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 统计医疗记录中医院编码是4503605的入院诊断为P01.300的最低和最高医疗费总额分别是多少啊?
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '4503605' AND t_kc24.t_kc21_IN_DIAG_DIS_CD = 'P01.300')
css
CREATE TABLE table_59553 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Grid, when Time is '+16.687'?
SELECT SUM("Grid") FROM table_59553 WHERE "Time" = '+16.687'
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_DIRE_CD text, MED_DIRE_NM text, MED_EXP_BILL_ID text, MED_EXP_DET_ID text, MED_INV_ITEM_TYPE text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_SELF_AMO number, PRESCRIPTION_CODE text, PRESCRIPTION_ID text, QTY number, RECIPE_BILL_ID text, REF_STA_FLG number, REIMBURS_TYPE number, REMOTE_SETTLE_FLG text, RER_SOL number, SELF_PAY_AMO number, SELF_PAY_PRO number, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, SPEC text, STA_DATE time, STA_FLG number, SYNC_TIME time, TRADE_TYPE number, UNIVALENT number, UP_LIMIT_AMO number, USE_FRE text, VAL_UNIT text ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, IN_HOSP_DATE time, IN_HOSP_DAYS number, MAIN_COND_DES text, MED_AMOUT number, MED_CLINIC_ID text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, MED_SER_ORG_NO text, MED_TYPE number, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, PERSON_AGE number, PERSON_ID text, PERSON_NM text, PERSON_SEX number, REIMBURSEMENT_FLG number, REMOTE_SETTLE_FLG text, SERVANT_FLG text, SOC_SRT_CARD text, SYNC_TIME time, TRADE_TYPE number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, FLX_MED_ORG_ID text, ILL_PAY number, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, LAS_OVE_PAY number, MED_AMOUT number, MED_CLINIC_ID text, MED_SAFE_PAY_ID text, MED_TYPE number, OLDC_FUND_PAY number, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_ADD_PAY number, OVE_PAY number, PERSON_ID text, PER_ACC_PAY number, PER_EXP number, PER_SOL number, RECEIVER_DEAL_ID text, RECEIVER_OFFSET_ID text, RECEIVER_REVOKE_ID text, RECIPE_BILL_ID text, REF_SLT_FLG number, REIMBURS_FLG number, SENDER_DEAL_ID text, SENDER_OFFSET_ID text, SENDER_REVOKE_ID text, SPE_FUND_PAY number, SUP_ADD_PAY number, SYNC_TIME time, TRADE_TYPE number ) CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 自二零一三年七月八日开始,截止到二零一三年十月十二日,患者郑妙晴的在医治时做过几次检查
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '郑妙晴' AND t_kc22.STA_DATE BETWEEN '2013-07-08' AND '2013-10-12' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_66006 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of bronze medals of west germany, which has more than 0 golds?
SELECT MAX("Bronze") FROM table_66006 WHERE "Nation" = 'west germany' AND "Gold" > '0'
wikisql
CREATE TABLE table_204_349 ( id number, "year" number, "conservative\ncouncillors" number, "labour\ncouncillors" number, "independent\ncouncillors" number, "liberal\ncouncillors" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- why years have no liberal councillors serving ?
SELECT "year" FROM table_204_349 WHERE "liberal\ncouncillors" = 0
squall
CREATE TABLE table_67629 ( "Club" text, "Sport" text, "League" text, "Venue" text, "Championships (Years)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which club has a League of american basketball association, and a Venue of tba?
SELECT "Club" FROM table_67629 WHERE "League" = 'american basketball association' AND "Venue" = 'tba'
wikisql
CREATE TABLE table_72369 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Status" text, "Opponent" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was incumbent jim mcdermott first elected?
SELECT MIN("First elected") FROM table_72369 WHERE "Incumbent" = 'Jim McDermott'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY number, ILL_PAY number, CIVIL_SUBSIDY number, PER_SOL number, PER_EXP number, DATA_ID text, SYNC_TIME time, OUT_HOSP_DATE time, CLINIC_ID text, MED_TYPE number, INSURED_STS text, INSURED_IDENTITY number, TRADE_TYPE number, RECIPE_BILL_ID text, ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, REIMBURS_FLG number, SENDER_DEAL_ID text, RECEIVER_DEAL_ID text, SENDER_REVOKE_ID text, RECEIVER_REVOKE_ID text, SENDER_OFFSET_ID text, RECEIVER_OFFSET_ID text, LAS_OVE_PAY number, OVE_ADD_PAY number, SUP_ADD_PAY number, CKC102 number, CASH_PAY number, COM_ACC_PAY number, ENT_ACC_PAY number, ENT_PAY number, COM_PAY number, OLDC_FUND_PAY number, SPE_FUND_PAY number ) CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG number, FLX_MED_ORG_ID text, MED_SER_ORG_NO text, CLINIC_TYPE text, MED_TYPE number, CLINIC_ID text, IN_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, INPT_AREA_BED text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, MAIN_COND_DES text, INSU_TYPE text, IN_HOSP_DAYS number, MED_AMOUT number, FERTILITY_STS number, DATA_ID text, SYNC_TIME time, REIMBURSEMENT_FLG number, HOSP_LEV number, HOSP_STS number, INSURED_IDENTITY number, SERVANT_FLG text, TRADE_TYPE number, INSURED_STS text, REMOTE_SETTLE_FLG text ) 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, VAL_UNIT text, DOSE_UNIT text, DOSE_FORM text, SPEC text, USE_FRE text, EACH_DOSAGE text, QTY number, UNIVALENT number, AMOUNT number, SELF_PAY_PRO number, RER_SOL number, SELF_PAY_AMO number, UP_LIMIT_AMO number, OVE_SELF_AMO number, EXP_OCC_DATE time, RECIPE_BILL_ID text, FLX_MED_ORG_ID text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, HOSP_DOC_CD text, HOSP_DOC_NM text, REF_STA_FLG number, DATA_ID text, SYNC_TIME time, PRESCRIPTION_CODE text, PRESCRIPTION_ID text, TRADE_TYPE number, STA_FLG number, STA_DATE time, REIMBURS_TYPE number, FXBZ number, REMOTE_SETTLE_FLG text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 在医院2045056中的病人75810879出院时确诊疾病名字包含皮炎的医疗就诊记录编号是几号?
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '75810879' AND MED_SER_ORG_NO = '2045056' AND OUT_DIAG_DIS_NM LIKE '%皮炎%'
css
CREATE TABLE table_23817012_6 ( gp_gs VARCHAR, ft_pct VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in the ft pct .667 what is the number of gp-gs
SELECT COUNT(gp_gs) FROM table_23817012_6 WHERE ft_pct = ".667"
sql_create_context
CREATE TABLE table_47699 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Weeks is the game against the Tampa Bay Buccaneers with less than 44,506 in Attendance?
SELECT SUM("Week") FROM table_47699 WHERE "Opponent" = 'tampa bay buccaneers' AND "Attendance" < '44,506'
wikisql
CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5) ) CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show each gender code and the corresponding count of guests sorted by the count in descending order by a pie chart.
SELECT gender_code, COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_15 ( laps INTEGER, grid VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps did Ricardo Zonta drive with a grid less than 14?
SELECT SUM(laps) FROM table_name_15 WHERE grid < 14 AND driver = "ricardo zonta"
sql_create_context
CREATE TABLE table_66547 ( "Manufacturer" text, "Transmission" text, "Engine Capacity" real, "Fuel Type" text, "L/100km Urban (Cold)" real, "L/100km Extra-Urban" real, "L/100km Combined" real, "mpg-UK Urban (Cold)" real, "mpg-UK Extra-Urban" real, "mpg-UK Combined" real, "mpg-US Urban" real, "mpg-US Extra-Urban" real, "mpg-US Combined" real, "CO 2 g/km" real, "Green Rating" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the average L/km combines when the L/100km Urban is 13.9, the mpg-UK combined is more than 28.5 and the mpg-UK extra urban is less than 38.7?
SELECT AVG("L/100km Combined") FROM table_66547 WHERE "L/100km Urban (Cold)" = '13.9' AND "mpg-UK Combined" > '28.5' AND "mpg-UK Extra-Urban" < '38.7'
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 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 text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear 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 ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- provide the number of patients whose marital status is widowed and procedure long title is percutaneous (endoscopic) jejunostomy [pej]?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.long_title = "Percutaneous (endoscopic) jejunostomy [PEJ]"
mimicsql_data
CREATE TABLE table_14038363_1 ( height VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How tall is Maksim Botin?
SELECT height FROM table_14038363_1 WHERE player = "Maksim Botin"
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 text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear 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 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 ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many patients are diagnosed with polyneuropathy in diabetes and treated with base drug?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Polyneuropathy in diabetes" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE table_name_62 ( shoots VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What shows for shoots for craig peacock a?
SELECT shoots FROM table_name_62 WHERE player = "craig peacock a"
sql_create_context
CREATE TABLE table_32178 ( "Date" text, "Result" text, "Score" text, "Stadium" text, "City" text, "Crowd" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of game with a score of 42-6?
SELECT "Date" FROM table_32178 WHERE "Score" = '42-6'
wikisql
CREATE TABLE table_name_62 ( social_sec_leeds VARCHAR, media_officer VARCHAR, treasurer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What kind of Social Sec Leeds has a Media Officer of jason james and a Treasurer of james davidson?
SELECT social_sec_leeds FROM table_name_62 WHERE media_officer = "jason james" AND treasurer = "james davidson"
sql_create_context
CREATE TABLE table_28803803_1 ( date VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the dates that Falling Angel aired?
SELECT date FROM table_28803803_1 WHERE name = "Falling Angel"
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 text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear 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 ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- give me the number of patients whose year of birth is less than 2182 and procedure short title is coronar arteriogr-1 cath?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2182" AND procedures.short_title = "Coronar arteriogr-1 cath"
mimicsql_data
CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80), gender_mf VARCHAR(1), address_line_1 VARCHAR(80) ) CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many completion students in each day? Return a line chart grouping by date of completion, and order by the X-axis in descending please.
SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment GROUP BY date_of_completion ORDER BY date_of_completion DESC
nvbench
CREATE TABLE claims ( Effective_Date VARCHAR, claim_id VARCHAR ) CREATE TABLE settlements ( claim_id VARCHAR, settlement_amount INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the effective date of the claim that has the largest amount of total settlement?
SELECT t1.Effective_Date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id = t2.claim_id GROUP BY t1.claim_id ORDER BY SUM(t2.settlement_amount) DESC LIMIT 1
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) 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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) 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, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) 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_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- retrieve the patient ids who are diagnosed with nonrupt cerebral aneurym since 2105.
SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'nonrupt cerebral aneurym') AND STRFTIME('%y', diagnoses_icd.charttime) >= '2105')
mimic_iii
CREATE TABLE table_13089 ( "Municipality" text, "Inhabitants" real, "Mayor" text, "Party" text, "Election" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which inhabitants have 2009 as the election, with cremona as the municipality?
SELECT "Inhabitants" FROM table_13089 WHERE "Election" = '2009' AND "Municipality" = 'cremona'
wikisql
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) 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 int, respected int, participation int, heavy_reading int, tough_grader int, hilarious int, would_take_again int, good_lecture int, no_skip int ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_projects varchar, has_exams varchar, num_reviews int, clarity_score int, easiness_score int, helpfulness_score int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) 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 varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you identify the GSIs from last semester for DENTED 605 ?
SELECT DISTINCT student.firstname, student.lastname FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN gsi ON gsi.course_offering_id = course_offering.offering_id INNER JOIN student ON student.student_id = gsi.student_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'DENTED' AND course.number = 605 AND semester.semester = 'FA' AND semester.year = 2015
advising
CREATE TABLE table_name_94 ( round VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What round did Matt Clark play?
SELECT round FROM table_name_94 WHERE player = "matt clark"
sql_create_context
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) 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 varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_projects varchar, has_exams varchar, num_reviews int, clarity_score int, easiness_score int, helpfulness_score int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) 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 int, respected int, participation int, heavy_reading int, tough_grader int, hilarious int, would_take_again int, good_lecture int, no_skip int ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Is MATH 185 available as a Summer class in 2004 ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MATH' AND course.number = 185 AND semester.semester = 'Summer' AND semester.semester_id = course_offering.semester AND semester.year = 2004
advising
CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5) ) CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the facility codes of apartments with more than 4 bedrooms, and count them by a bar chart, display by the Y-axis from high to low.
SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY COUNT(facility_code) DESC
nvbench
CREATE TABLE table_19808 ( "#" real, "Episode" text, "Writer" text, "Director" text, "Original air date" text, "Viewing figure" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which numerical entry corresponds to 'Episode 9'?
SELECT COUNT("#") FROM table_19808 WHERE "Episode" = 'Episode 9'
wikisql
CREATE TABLE party_events ( event_id number, event_name text, party_id number, member_in_charge_id number ) CREATE TABLE party ( party_id number, minister text, took_office text, left_office text, region_id number, party_name text ) CREATE TABLE region ( region_id number, region_name text, date text, label text, format text, catalogue text ) CREATE TABLE member ( member_id number, member_name text, party_id text, in_office text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the minister who took office after 1961 or before 1959.
SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959
spider
CREATE TABLE table_204_334 ( id number, "opposition" text, "matches" number, "won" number, "drawn" number, "lost" number, "for" number, "against" number, "win%" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many teams did the comets win 2 matches against ?
SELECT COUNT("opposition") FROM table_204_334 WHERE "won" = 2
squall
CREATE TABLE table_name_62 ( city___state VARCHAR, series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what City/State did the ATCC Round 4 series take place?
SELECT city___state FROM table_name_62 WHERE series = "atcc round 4"
sql_create_context
CREATE TABLE Customer_Address_History ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER, order_quantity VARCHAR(80) ) CREATE TABLE Contacts ( contact_id INTEGER, customer_id INTEGER, gender VARCHAR(1), first_name VARCHAR(80), last_name VARCHAR(50), contact_phone VARCHAR(80) ) CREATE TABLE Addresses ( address_id INTEGER, line_1_number_building VARCHAR(80), city VARCHAR(50), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50) ) CREATE TABLE Customers ( customer_id INTEGER, payment_method_code VARCHAR(15), customer_number VARCHAR(20), customer_name VARCHAR(80), customer_address VARCHAR(255), customer_phone VARCHAR(80), customer_email VARCHAR(80) ) CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_date DATETIME, order_status_code VARCHAR(15) ) CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(15), product_name VARCHAR(80), product_price DOUBLE ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the product name and total order quantity for each product. Show bar chart.
SELECT T1.product_name, AVG(SUM(T2.order_quantity)) FROM Products AS T1 JOIN Order_Items AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name
nvbench
CREATE TABLE table_60828 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Played has a Position of 7, and a Drawn smaller than 7?
SELECT SUM("Played") FROM table_60828 WHERE "Position" = '7' AND "Drawn" < '7'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) 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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) 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_code text, short_title text, long_title text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are the ways to consume guaifenesin?
SELECT DISTINCT prescriptions.route FROM prescriptions WHERE prescriptions.drug = 'guaifenesin'
mimic_iii
CREATE TABLE table_name_67 ( gran_hamada VARCHAR, block_a VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Gran Hamada has a Block A of tatsuhito takaiwa?
SELECT gran_hamada FROM table_name_67 WHERE block_a = "tatsuhito takaiwa"
sql_create_context
CREATE TABLE domain_conference ( cid int, did int ) CREATE TABLE cite ( cited int, citing int ) CREATE TABLE domain_keyword ( did int, kid int ) CREATE TABLE domain_publication ( did int, pid int ) CREATE TABLE domain_author ( aid int, did int ) CREATE TABLE domain ( did int, name varchar ) CREATE TABLE author ( aid int, homepage varchar, name varchar, oid int ) CREATE TABLE organization ( continent varchar, homepage varchar, name varchar, oid int ) CREATE TABLE domain_journal ( did int, jid int ) CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE writes ( aid int, pid int ) CREATE TABLE conference ( cid int, homepage varchar, name varchar ) CREATE TABLE publication_keyword ( kid int, pid int ) CREATE TABLE journal ( homepage varchar, jid int, name varchar ) CREATE TABLE keyword ( keyword varchar, kid int ) -- Using valid SQLite, answer the following questions for the tables provided above. -- return me the number of papers in VLDB conference in ' University of Michigan ' .
SELECT COUNT(DISTINCT (publication.title)) FROM author, conference, organization, publication, writes WHERE conference.name = 'VLDB' AND organization.name = 'University of Michigan' AND organization.oid = author.oid AND publication.cid = conference.cid AND writes.aid = author.aid AND writes.pid = publication.pid
academic
CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, wind_speed_mph int ) CREATE TABLE station ( id int, network_name text, services text, local_authority text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- A bar graph listing the local authorities and how many local authorities provided by all stations, could you display X from high to low order?
SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority ORDER BY local_authority DESC
nvbench
CREATE TABLE table_61462 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did the player who won in 1991 finish?
SELECT "Finish" FROM table_61462 WHERE "Year(s) won" = '1991'
wikisql
CREATE TABLE table_name_31 ( weight VARCHAR, number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much does number 26 weigh?
SELECT weight FROM table_name_31 WHERE number = "26"
sql_create_context
CREATE TABLE table_41853 ( "Team" text, "Match" real, "Points" real, "Draw" real, "Lost" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team has 10 losses?
SELECT "Team" FROM table_41853 WHERE "Lost" = '10'
wikisql
CREATE TABLE table_48303 ( "Rank" real, "Company" text, "Headquarters" text, "Industry" text, "Sales (billion $)" real, "Profits (billion $)" real, "Assets (billion $)" real, "Market Value (billion $)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest market value in billions of the company with profits of 20.96 billions and 166.99 billions in assets?
SELECT MAX("Market Value (billion $)") FROM table_48303 WHERE "Profits (billion $)" = '20.96' AND "Assets (billion $)" > '166.99'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when was the last time patient 027-165214 had the minimum systemicdiastolic on the current intensive care unit visit.
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 = '027-165214') AND patient.unitdischargetime IS NULL) AND NOT vitalperiodic.systemicdiastolic IS NULL ORDER BY vitalperiodic.systemicdiastolic, vitalperiodic.observationtime DESC LIMIT 1
eicu
CREATE TABLE table_25595209_1 ( loa__metres_ VARCHAR, yacht VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the LOA of Brindabella?
SELECT loa__metres_ FROM table_25595209_1 WHERE yacht = "Brindabella"
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, SBBM text, SHRGH text, SHRXM text, YLJGDM text, YQBH text, YQMC text ) 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 text, RYCWH text, RYDJSJ time, RYSJ time, RYTJDM number, RYTJMC text, RZBQDM text, RZBQMC text, WDBZ number, YLJGDM text, ZYBMLX number, ZYZDBM text, ZYZDMC text, ZYZYZDZZBM text, ZYZYZDZZMC text ) 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, JYKSBM text, JYKSMC text, JYLX number, JYRQ time, JYSQJGMC text, JYXMDM text, JYXMMC text, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SHRGH text, SHRXM text, SHSJ time, SQKS text, SQKSMC text, SQRGH text, SQRQ time, SQRXM text, YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text, person_info_CSD text, person_info_CSRQ time, person_info_GJDM text, person_info_GJMC text, person_info_JGDM text, person_info_JGMC text, person_info_MZDM text, person_info_MZMC text, person_info_XBDM number, person_info_XBMC text, person_info_XLDM text, person_info_XLMC text, person_info_XM text, person_info_ZYLBDM text, person_info_ZYMC text ) 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 text, NLS number, NLY number, QTJZYSGH text, SG number, SSY number, SZY number, TW number, TXBZ number, TZ number, WDBZ number, XL number, YLJGDM text, ZSEBZ number, ZZBZ number, ZZYSGH text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 沈雅懿患者的检验报告单对应的检验结果指标均异常都是哪些?列出对应的检验报告单号都是啥?
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.person_info_XM = '沈雅懿' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WHERE jyjgzbb.JCZBJGDL >= jyjgzbb.CKZFWXX AND jyjgzbb.JCZBJGDL <= jyjgzbb.CKZFWSX) UNION SELECT jybgb.BGDH FROM hz_info JOIN zyjzjlb JOIN jybgb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE hz_info.person_info_XM = '沈雅懿' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WHERE jyjgzbb.JCZBJGDL >= jyjgzbb.CKZFWXX AND jyjgzbb.JCZBJGDL <= jyjgzbb.CKZFWSX)
css
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE diagnoses_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 TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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 prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are the top three most common specimen tests performed since 2 years ago?
SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 3
mimic_iii
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) 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_diagnoses ( 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 labevents ( row_id number, subject_id number, hadm_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 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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) -- Using valid SQLite, answer the following questions for the tables provided above. -- had patient 3273 excreted urine out ureteral stent #1 when they came to the hospital last time?
SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3273 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urine out ureteral stent #1' AND d_items.linksto = 'outputevents')
mimic_iii
CREATE TABLE table_29292 ( "Season" text, "Coach" text, "Conf. Record" text, "Overall" text, "Standings" text, "Postseason" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what season was the conference record for the Pandas 15-1-1?
SELECT "Season" FROM table_29292 WHERE "Conf. Record" = '15-1-1'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text, VAL_UNIT text, DOSE_UNIT text, DOSE_FORM text, SPEC text, USE_FRE text, EACH_DOSAGE text, QTY number, UNIVALENT number, AMOUNT number, SELF_PAY_PRO number, RER_SOL number, SELF_PAY_AMO number, UP_LIMIT_AMO number, OVE_SELF_AMO number, EXP_OCC_DATE time, RECIPE_BILL_ID text, FLX_MED_ORG_ID text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, HOSP_DOC_CD text, HOSP_DOC_NM text, REF_STA_FLG number, DATA_ID text, SYNC_TIME time, PRESCRIPTION_CODE text, PRESCRIPTION_ID text, TRADE_TYPE number, STA_FLG number, STA_DATE time, REIMBURS_TYPE number, FXBZ number, REMOTE_SETTLE_FLG text ) CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG number, FLX_MED_ORG_ID text, MED_SER_ORG_NO text, CLINIC_TYPE text, MED_TYPE number, CLINIC_ID text, IN_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, INPT_AREA_BED text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, MAIN_COND_DES text, INSU_TYPE text, IN_HOSP_DAYS number, MED_AMOUT number, FERTILITY_STS number, DATA_ID text, SYNC_TIME time, REIMBURSEMENT_FLG number, HOSP_LEV number, HOSP_STS number, INSURED_IDENTITY number, SERVANT_FLG text, TRADE_TYPE number, INSURED_STS text, REMOTE_SETTLE_FLG text ) CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY number, ILL_PAY number, CIVIL_SUBSIDY number, PER_SOL number, PER_EXP number, DATA_ID text, SYNC_TIME time, OUT_HOSP_DATE time, CLINIC_ID text, MED_TYPE number, INSURED_STS text, INSURED_IDENTITY number, TRADE_TYPE number, RECIPE_BILL_ID text, ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, REIMBURS_FLG number, SENDER_DEAL_ID text, RECEIVER_DEAL_ID text, SENDER_REVOKE_ID text, RECEIVER_REVOKE_ID text, SENDER_OFFSET_ID text, RECEIVER_OFFSET_ID text, LAS_OVE_PAY number, OVE_ADD_PAY number, SUP_ADD_PAY number, CKC102 number, CASH_PAY number, COM_ACC_PAY number, ENT_ACC_PAY number, ENT_PAY number, COM_PAY number, OLDC_FUND_PAY number, SPE_FUND_PAY number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 因疾病I35.324住院在乳腺肿瘤这个科室记录有多少平均费用,时间在二零零七年五月十一日至二零一二年六月一日
SELECT AVG(MED_AMOUT) FROM t_kc21 WHERE MED_ORG_DEPT_NM = '乳腺肿瘤科' AND IN_HOSP_DATE BETWEEN '2007-05-11' AND '2012-06-01' AND IN_DIAG_DIS_CD = 'I35.324' AND CLINIC_TYPE = '住院'
css
CREATE TABLE table_60842 ( "Constituency number" real, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Electorates (2011)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What district has abhayapuri south as the name?
SELECT "District" FROM table_60842 WHERE "Name" = 'abhayapuri south'
wikisql
CREATE TABLE table_7771 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Tom Kite's to par?
SELECT "To par" FROM table_7771 WHERE "Player" = 'tom kite'
wikisql
CREATE TABLE table_name_94 ( rank INTEGER, country VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Rank is the Country of soviet union with a Total smaller than 19?
SELECT MIN(rank) FROM table_name_94 WHERE country = "soviet union" AND total < 19
sql_create_context
CREATE TABLE table_25277262_2 ( directed_by VARCHAR, no_in_season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people directed episode 3 in the season?
SELECT COUNT(directed_by) FROM table_25277262_2 WHERE no_in_season = 3
sql_create_context
CREATE TABLE table_dev_20 ( "id" int, "anemia" bool, "gender" string, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "platelets" int, "dyslipidemia" bool, "renal_disease" bool, "creatinine_clearance_cl" float, "neutropenia" int, "estimated_glomerular_filtration_rate_egfr" int, "thrombocytopenia" float, "diastolic_blood_pressure_dbp" int, "lymphopenia" int, "ldl" int, "serum_creatinine" float, "kidney_disease" bool, "triglyceride_tg" float, "uncontrolled_blood_pressure" bool, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- baseline hgb below the lower limits of normal at the local laboratory; lymphopenia ( < 1000 / l ) , neutropenia ( < 1500 / l ) , or thrombocytopenia ( platelets < 100000 / l ) .
SELECT * FROM table_dev_20 WHERE lymphopenia < 1000 AND neutropenia < 1500 OR thrombocytopenia = 1 OR platelets < 100000
criteria2sql
CREATE TABLE table_203_408 ( id number, "rd." number, "grand prix" text, "date" text, "location" text, "pole position" text, "fastest lap" text, "winning driver" text, "constructor" text, "report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the winning driver after nigel mansell ?
SELECT "winning driver" FROM table_203_408 WHERE "rd." > (SELECT "rd." FROM table_203_408 WHERE "winning driver" = 'nigel mansell') ORDER BY "rd." LIMIT 1
squall
CREATE TABLE table_name_11 ( type VARCHAR, model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type of car has the model 6cm?
SELECT type FROM table_name_11 WHERE model = "6cm"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) 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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) 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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the last ward identification for patient 49036 since 4 years ago?
SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49036) AND NOT transfers.wardid IS NULL AND DATETIME(transfers.intime) >= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY transfers.intime DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_98 ( score VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the player from England's score?
SELECT score FROM table_name_98 WHERE country = "england"
sql_create_context
CREATE TABLE table_2140071_8 ( episode INTEGER, premier_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Maximum episode premiered March 8, 2008?
SELECT MAX(episode) FROM table_2140071_8 WHERE premier_date = "March 8, 2008"
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 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, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many patients are born before 2197 and with procedure icd9 code 309?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2197" AND procedures.icd9_code = "309"
mimicsql_data
CREATE TABLE table_name_32 ( acceleration_0_100km_h VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the acceleration 1-100km/h when the name is 1.5 dci?
SELECT acceleration_0_100km_h FROM table_name_32 WHERE name = "1.5 dci"
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 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 text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear 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 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 ) -- Using valid SQLite, answer the following questions for the tables provided above. -- give me the number of patients whose primary disease is transient ischemic attack and days of hospital stay is greater than 4?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "TRANSIENT ISCHEMIC ATTACK" AND demographic.days_stay > "4"
mimicsql_data
CREATE TABLE table_name_5 ( away VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which away game was played on 2008-07-18?
SELECT away FROM table_name_5 WHERE date = "2008-07-18"
sql_create_context
CREATE TABLE table_17319931_1 ( team VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the team whose driver Jeff Simmons?
SELECT team FROM table_17319931_1 WHERE driver = "Jeff Simmons"
sql_create_context
CREATE TABLE table_20986710_1 ( score_in_final VARCHAR, runner_up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the final score when tracy austin was runner up?
SELECT score_in_final FROM table_20986710_1 WHERE runner_up = "Tracy Austin"
sql_create_context
CREATE TABLE table_name_61 ( nba_draft VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which NBA Draft had Labradford Smith?
SELECT nba_draft FROM table_name_61 WHERE player = "labradford smith"
sql_create_context
CREATE TABLE table_24015 ( "Player" text, "Played" real, "Legs Won" real, "Legs Lost" real, "LWAT" real, "100+" real, "140+" real, "180s" real, "High Checkout" real, "3-dart Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player has a 92.58 3-dart average?
SELECT "Player" FROM table_24015 WHERE "3-dart Average" = '92.58'
wikisql